summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-08-21 05:23:24 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-08-21 05:23:24 +0000
commita3ec215973c3653ebdeb81dcdd1274519c376a3d (patch)
treedc0edc2133786db0565f19d51c4a9957dd69e2ac
downloaddiffutils-tarball-a3ec215973c3653ebdeb81dcdd1274519c376a3d.tar.gz
-rw-r--r--.tarball-version1
-rw-r--r--ABOUT-NLS1282
-rw-r--r--AUTHORS51
-rw-r--r--COPYING674
-rw-r--r--ChangeLog1902
-rw-r--r--ChangeLog-20084273
-rw-r--r--GNUmakefile127
-rw-r--r--INSTALL368
-rw-r--r--Makefile.am58
-rw-r--r--Makefile.in1737
-rw-r--r--NEWS396
-rw-r--r--README64
-rw-r--r--README-release100
-rw-r--r--THANKS23
-rw-r--r--TODO9
-rw-r--r--aclocal.m41358
-rwxr-xr-xbootstrap1026
-rwxr-xr-xbuild-aux/announce-gen557
-rwxr-xr-xbuild-aux/ar-lib270
-rwxr-xr-xbuild-aux/compile348
-rwxr-xr-xbuild-aux/config.guess1456
-rwxr-xr-xbuild-aux/config.rpath684
-rwxr-xr-xbuild-aux/config.sub1823
-rwxr-xr-xbuild-aux/depcomp756
-rwxr-xr-xbuild-aux/do-release-commit-and-tag179
-rwxr-xr-xbuild-aux/gendocs.sh504
-rwxr-xr-xbuild-aux/git-version-gen226
-rwxr-xr-xbuild-aux/gitlog-to-changelog499
-rwxr-xr-xbuild-aux/gnu-web-doc-update210
-rwxr-xr-xbuild-aux/gnupload440
-rwxr-xr-xbuild-aux/install-sh501
-rwxr-xr-xbuild-aux/mdate-sh224
-rwxr-xr-xbuild-aux/missing215
-rw-r--r--build-aux/snippet/_Noreturn.h10
-rw-r--r--build-aux/snippet/arg-nonnull.h26
-rw-r--r--build-aux/snippet/c++defs.h271
-rw-r--r--build-aux/snippet/unused-parameter.h36
-rw-r--r--build-aux/snippet/warn-on-use.h109
-rwxr-xr-xbuild-aux/test-driver148
-rw-r--r--build-aux/texinfo.tex11724
-rwxr-xr-xbuild-aux/update-copyright274
-rwxr-xr-xbuild-aux/useless-if-before-free210
-rwxr-xr-xbuild-aux/vc-list-files113
-rw-r--r--cfg.mk73
-rwxr-xr-xconfigure41975
-rw-r--r--configure.ac180
-rw-r--r--dist-check.mk171
-rw-r--r--doc/Makefile.am23
-rw-r--r--doc/Makefile.in1667
-rw-r--r--doc/diagmeet.note62
-rw-r--r--doc/diffutils.info5313
-rw-r--r--doc/diffutils.texi4759
-rw-r--r--doc/fdl.texi505
-rw-r--r--doc/stamp-vti4
-rw-r--r--doc/version.texi4
-rwxr-xr-xexgettext114
-rw-r--r--gnulib-tests/Makefile.am1
-rw-r--r--gnulib-tests/Makefile.in5645
-rw-r--r--gnulib-tests/accept.c52
-rw-r--r--gnulib-tests/arpa_inet.in.h140
-rw-r--r--gnulib-tests/bind.c49
-rw-r--r--gnulib-tests/connect.c56
-rw-r--r--gnulib-tests/dtotimespec.c59
-rw-r--r--gnulib-tests/fdopen.c69
-rw-r--r--gnulib-tests/fpucw.h108
-rw-r--r--gnulib-tests/ftruncate.c188
-rw-r--r--gnulib-tests/getcwd-lgpl.c126
-rw-r--r--gnulib-tests/getpagesize.c39
-rw-r--r--gnulib-tests/gnulib.mk1841
-rw-r--r--gnulib-tests/hash-pjw.c40
-rw-r--r--gnulib-tests/hash-pjw.h23
-rw-r--r--gnulib-tests/inet_pton.c268
-rw-r--r--gnulib-tests/init.sh624
-rw-r--r--gnulib-tests/ioctl.c88
-rw-r--r--gnulib-tests/listen.c49
-rw-r--r--gnulib-tests/macros.h73
-rw-r--r--gnulib-tests/nanosleep.c276
-rw-r--r--gnulib-tests/nap.h128
-rw-r--r--gnulib-tests/netinet_in.in.h47
-rw-r--r--gnulib-tests/perror.c49
-rw-r--r--gnulib-tests/pipe.c50
-rw-r--r--gnulib-tests/putenv.c194
-rw-r--r--gnulib-tests/same-inode.h33
-rw-r--r--gnulib-tests/select.c575
-rw-r--r--gnulib-tests/setlocale.c939
-rw-r--r--gnulib-tests/setsockopt.c65
-rw-r--r--gnulib-tests/signature.h48
-rw-r--r--gnulib-tests/sleep.c76
-rw-r--r--gnulib-tests/snprintf.c71
-rw-r--r--gnulib-tests/socket.c49
-rw-r--r--gnulib-tests/sockets.c157
-rw-r--r--gnulib-tests/sockets.h62
-rw-r--r--gnulib-tests/stdalign.in.h121
-rw-r--r--gnulib-tests/strerror_r.c338
-rw-r--r--gnulib-tests/symlink.c57
-rw-r--r--gnulib-tests/sys_ioctl.in.h78
-rw-r--r--gnulib-tests/sys_select.in.h319
-rw-r--r--gnulib-tests/sys_socket.c4
-rw-r--r--gnulib-tests/sys_socket.in.h692
-rw-r--r--gnulib-tests/sys_uio.in.h63
-rw-r--r--gnulib-tests/test-accept.c56
-rw-r--r--gnulib-tests/test-alloca-opt.c62
-rw-r--r--gnulib-tests/test-areadlink.c53
-rw-r--r--gnulib-tests/test-areadlink.h83
-rw-r--r--gnulib-tests/test-argmatch.c101
-rw-r--r--gnulib-tests/test-arpa_inet.c27
-rw-r--r--gnulib-tests/test-binary-io.c69
-rwxr-xr-xgnulib-tests/test-binary-io.sh14
-rw-r--r--gnulib-tests/test-bind.c58
-rw-r--r--gnulib-tests/test-bitrotate.c279
-rw-r--r--gnulib-tests/test-btowc.c63
-rwxr-xr-xgnulib-tests/test-btowc1.sh15
-rwxr-xr-xgnulib-tests/test-btowc2.sh15
-rw-r--r--gnulib-tests/test-c-ctype.c228
-rw-r--r--gnulib-tests/test-c-stack.c76
-rwxr-xr-xgnulib-tests/test-c-stack.sh21
-rwxr-xr-xgnulib-tests/test-c-stack2.sh36
-rwxr-xr-xgnulib-tests/test-c-strcase.sh21
-rw-r--r--gnulib-tests/test-c-strcasecmp.c65
-rw-r--r--gnulib-tests/test-c-strncasecmp.c79
-rw-r--r--gnulib-tests/test-close.c45
-rw-r--r--gnulib-tests/test-connect.c60
-rw-r--r--gnulib-tests/test-ctype.c27
-rw-r--r--gnulib-tests/test-dirname.c193
-rw-r--r--gnulib-tests/test-dup2.c218
-rw-r--r--gnulib-tests/test-environ.c44
-rw-r--r--gnulib-tests/test-errno.c119
-rw-r--r--gnulib-tests/test-exclude.c129
-rwxr-xr-xgnulib-tests/test-exclude1.sh50
-rwxr-xr-xgnulib-tests/test-exclude2.sh50
-rwxr-xr-xgnulib-tests/test-exclude3.sh50
-rwxr-xr-xgnulib-tests/test-exclude4.sh45
-rwxr-xr-xgnulib-tests/test-exclude5.sh48
-rwxr-xr-xgnulib-tests/test-exclude6.sh46
-rwxr-xr-xgnulib-tests/test-exclude7.sh47
-rwxr-xr-xgnulib-tests/test-exclude8.sh46
-rw-r--r--gnulib-tests/test-fcntl-h.c130
-rw-r--r--gnulib-tests/test-fcntl.c409
-rw-r--r--gnulib-tests/test-fdopen.c49
-rw-r--r--gnulib-tests/test-fgetc.c97
-rw-r--r--gnulib-tests/test-filenamecat.c66
-rw-r--r--gnulib-tests/test-float.c384
-rw-r--r--gnulib-tests/test-fnmatch.c56
-rw-r--r--gnulib-tests/test-fputc.c91
-rw-r--r--gnulib-tests/test-fread.c100
-rw-r--r--gnulib-tests/test-freopen-safer.c97
-rw-r--r--gnulib-tests/test-freopen.c82
-rw-r--r--gnulib-tests/test-fstat.c50
-rw-r--r--gnulib-tests/test-ftruncate.c60
-rwxr-xr-xgnulib-tests/test-ftruncate.sh3
-rw-r--r--gnulib-tests/test-fwrite.c94
-rw-r--r--gnulib-tests/test-getcwd-lgpl.c102
-rw-r--r--gnulib-tests/test-getdtablesize.c36
-rw-r--r--gnulib-tests/test-getopt.c99
-rw-r--r--gnulib-tests/test-getopt.h1391
-rw-r--r--gnulib-tests/test-getopt_long.h2144
-rw-r--r--gnulib-tests/test-gettimeofday.c47
-rw-r--r--gnulib-tests/test-hash.c263
-rw-r--r--gnulib-tests/test-iconv-h.c27
-rw-r--r--gnulib-tests/test-iconv.c148
-rw-r--r--gnulib-tests/test-ignore-value.c84
-rw-r--r--gnulib-tests/test-inet_pton.c58
-rwxr-xr-xgnulib-tests/test-init.sh73
-rw-r--r--gnulib-tests/test-intprops.c370
-rw-r--r--gnulib-tests/test-inttostr.c94
-rw-r--r--gnulib-tests/test-inttypes.c118
-rw-r--r--gnulib-tests/test-ioctl.c51
-rw-r--r--gnulib-tests/test-isblank.c50
-rw-r--r--gnulib-tests/test-iswblank.c35
-rw-r--r--gnulib-tests/test-langinfo.c92
-rw-r--r--gnulib-tests/test-listen.c49
-rw-r--r--gnulib-tests/test-locale.c80
-rw-r--r--gnulib-tests/test-localeconv.c72
-rw-r--r--gnulib-tests/test-lstat.c60
-rw-r--r--gnulib-tests/test-lstat.h116
-rw-r--r--gnulib-tests/test-malloca.c62
-rwxr-xr-xgnulib-tests/test-mbrtowc-w32-1.sh4
-rwxr-xr-xgnulib-tests/test-mbrtowc-w32-2.sh4
-rwxr-xr-xgnulib-tests/test-mbrtowc-w32-3.sh4
-rwxr-xr-xgnulib-tests/test-mbrtowc-w32-4.sh4
-rwxr-xr-xgnulib-tests/test-mbrtowc-w32-5.sh4
-rw-r--r--gnulib-tests/test-mbrtowc-w32.c735
-rw-r--r--gnulib-tests/test-mbrtowc.c349
-rwxr-xr-xgnulib-tests/test-mbrtowc1.sh15
-rwxr-xr-xgnulib-tests/test-mbrtowc2.sh15
-rwxr-xr-xgnulib-tests/test-mbrtowc3.sh15
-rwxr-xr-xgnulib-tests/test-mbrtowc4.sh15
-rwxr-xr-xgnulib-tests/test-mbrtowc5.sh6
-rw-r--r--gnulib-tests/test-mbscasecmp.c55
-rwxr-xr-xgnulib-tests/test-mbscasecmp.sh15
-rw-r--r--gnulib-tests/test-mbsinit.c55
-rwxr-xr-xgnulib-tests/test-mbsinit.sh15
-rw-r--r--gnulib-tests/test-mbsrtowcs.c293
-rwxr-xr-xgnulib-tests/test-mbsrtowcs1.sh15
-rwxr-xr-xgnulib-tests/test-mbsrtowcs2.sh15
-rwxr-xr-xgnulib-tests/test-mbsrtowcs3.sh15
-rwxr-xr-xgnulib-tests/test-mbsrtowcs4.sh15
-rw-r--r--gnulib-tests/test-mbsstr1.c128
-rw-r--r--gnulib-tests/test-mbsstr2.c141
-rwxr-xr-xgnulib-tests/test-mbsstr2.sh15
-rw-r--r--gnulib-tests/test-mbsstr3.c81
-rwxr-xr-xgnulib-tests/test-mbsstr3.sh15
-rw-r--r--gnulib-tests/test-memchr.c132
-rw-r--r--gnulib-tests/test-nanosleep.c83
-rw-r--r--gnulib-tests/test-netinet_in.c27
-rw-r--r--gnulib-tests/test-nl_langinfo.c126
-rwxr-xr-xgnulib-tests/test-nl_langinfo.sh17
-rw-r--r--gnulib-tests/test-open.c41
-rw-r--r--gnulib-tests/test-open.h104
-rw-r--r--gnulib-tests/test-pathmax.c32
-rw-r--r--gnulib-tests/test-perror.c36
-rwxr-xr-xgnulib-tests/test-perror.sh24
-rw-r--r--gnulib-tests/test-perror2.c136
-rw-r--r--gnulib-tests/test-pipe.c104
-rw-r--r--gnulib-tests/test-quotearg-simple.c359
-rw-r--r--gnulib-tests/test-quotearg.h132
-rw-r--r--gnulib-tests/test-raise.c50
-rw-r--r--gnulib-tests/test-rawmemchr.c92
-rw-r--r--gnulib-tests/test-readlink.c48
-rw-r--r--gnulib-tests/test-readlink.h119
-rw-r--r--gnulib-tests/test-regex.c253
-rw-r--r--gnulib-tests/test-select-fd.c72
-rwxr-xr-xgnulib-tests/test-select-in.sh38
-rwxr-xr-xgnulib-tests/test-select-out.sh35
-rw-r--r--gnulib-tests/test-select-stdin.c83
-rw-r--r--gnulib-tests/test-select.c34
-rw-r--r--gnulib-tests/test-select.h462
-rw-r--r--gnulib-tests/test-setenv.c56
-rw-r--r--gnulib-tests/test-setlocale1.c61
-rwxr-xr-xgnulib-tests/test-setlocale1.sh34
-rw-r--r--gnulib-tests/test-setlocale2.c55
-rwxr-xr-xgnulib-tests/test-setlocale2.sh17
-rw-r--r--gnulib-tests/test-setsockopt.c55
-rw-r--r--gnulib-tests/test-sh-quote.c203
-rw-r--r--gnulib-tests/test-sigaction.c122
-rw-r--r--gnulib-tests/test-signal-h.c129
-rw-r--r--gnulib-tests/test-sigprocmask.c102
-rw-r--r--gnulib-tests/test-sleep.c58
-rw-r--r--gnulib-tests/test-snprintf.c72
-rw-r--r--gnulib-tests/test-sockets.c46
-rw-r--r--gnulib-tests/test-stat-time.c224
-rw-r--r--gnulib-tests/test-stat.c56
-rw-r--r--gnulib-tests/test-stat.h101
-rw-r--r--gnulib-tests/test-stdalign.c116
-rw-r--r--gnulib-tests/test-stdbool.c118
-rw-r--r--gnulib-tests/test-stddef.c73
-rw-r--r--gnulib-tests/test-stdint.c359
-rw-r--r--gnulib-tests/test-stdio.c43
-rw-r--r--gnulib-tests/test-stdlib.c54
-rw-r--r--gnulib-tests/test-strerror.c75
-rw-r--r--gnulib-tests/test-strerror_r.c181
-rw-r--r--gnulib-tests/test-strftime.c216
-rw-r--r--gnulib-tests/test-striconv.c180
-rw-r--r--gnulib-tests/test-string.c33
-rw-r--r--gnulib-tests/test-strings.c27
-rw-r--r--gnulib-tests/test-strnlen.c68
-rw-r--r--gnulib-tests/test-strtoull.c180
-rw-r--r--gnulib-tests/test-strtoumax.c180
-rw-r--r--gnulib-tests/test-symlink.c47
-rw-r--r--gnulib-tests/test-symlink.h95
-rw-r--r--gnulib-tests/test-sys_ioctl.c27
-rw-r--r--gnulib-tests/test-sys_select.c59
-rw-r--r--gnulib-tests/test-sys_socket.c68
-rw-r--r--gnulib-tests/test-sys_stat.c340
-rw-r--r--gnulib-tests/test-sys_time.c34
-rw-r--r--gnulib-tests/test-sys_types.c34
-rw-r--r--gnulib-tests/test-sys_uio.c32
-rw-r--r--gnulib-tests/test-sys_wait.c47
-rw-r--r--gnulib-tests/test-sys_wait.h53
-rw-r--r--gnulib-tests/test-time.c41
-rw-r--r--gnulib-tests/test-timespec.c167
-rw-r--r--gnulib-tests/test-unistd.c56
-rw-r--r--gnulib-tests/test-unsetenv.c61
-rwxr-xr-xgnulib-tests/test-update-copyright.sh547
-rw-r--r--gnulib-tests/test-vasnprintf.c94
-rw-r--r--gnulib-tests/test-vasprintf.c103
-rwxr-xr-xgnulib-tests/test-vc-list-files-cvs.sh53
-rwxr-xr-xgnulib-tests/test-vc-list-files-git.sh42
-rw-r--r--gnulib-tests/test-verify.c69
-rwxr-xr-xgnulib-tests/test-verify.sh24
-rw-r--r--gnulib-tests/test-version-etc.c33
-rwxr-xr-xgnulib-tests/test-version-etc.sh43
-rw-r--r--gnulib-tests/test-wchar.c37
-rwxr-xr-xgnulib-tests/test-wcrtomb-w32-1.sh4
-rwxr-xr-xgnulib-tests/test-wcrtomb-w32-2.sh4
-rwxr-xr-xgnulib-tests/test-wcrtomb-w32-3.sh4
-rwxr-xr-xgnulib-tests/test-wcrtomb-w32-4.sh4
-rwxr-xr-xgnulib-tests/test-wcrtomb-w32-5.sh4
-rw-r--r--gnulib-tests/test-wcrtomb-w32.c332
-rw-r--r--gnulib-tests/test-wcrtomb.c162
-rwxr-xr-xgnulib-tests/test-wcrtomb.sh35
-rw-r--r--gnulib-tests/test-wctype-h.c74
-rw-r--r--gnulib-tests/test-wcwidth.c81
-rw-r--r--gnulib-tests/test-xalloc-die.c30
-rwxr-xr-xgnulib-tests/test-xalloc-die.sh36
-rw-r--r--gnulib-tests/test-xstrtol.c65
-rwxr-xr-xgnulib-tests/test-xstrtol.sh71
-rw-r--r--gnulib-tests/test-xstrtoul.c4
-rw-r--r--gnulib-tests/test-xstrtoumax.c4
-rwxr-xr-xgnulib-tests/test-xstrtoumax.sh46
-rw-r--r--gnulib-tests/test-xvasprintf.c138
-rw-r--r--gnulib-tests/timespec-add.c71
-rw-r--r--gnulib-tests/timespec-sub.c71
-rw-r--r--gnulib-tests/unistr/test-u8-mbtoucr.c187
-rw-r--r--gnulib-tests/unistr/test-u8-uctomb.c157
-rw-r--r--gnulib-tests/uniwidth/test-uc_width.c56
-rw-r--r--gnulib-tests/uniwidth/test-uc_width2.c86
-rwxr-xr-xgnulib-tests/uniwidth/test-uc_width2.sh597
-rw-r--r--gnulib-tests/w32sock.h136
-rw-r--r--gnulib-tests/wctob.c38
-rw-r--r--gnulib-tests/wctomb-impl.h34
-rw-r--r--gnulib-tests/wctomb.c25
-rw-r--r--gnulib-tests/zerosize-ptr.h68
-rw-r--r--lib/Makefile.am35
-rw-r--r--lib/Makefile.in3607
-rw-r--r--lib/alloca.c478
-rw-r--r--lib/alloca.in.h63
-rw-r--r--lib/allocator.c5
-rw-r--r--lib/allocator.h58
-rw-r--r--lib/anytostr.c57
-rw-r--r--lib/areadlink.c56
-rw-r--r--lib/areadlink.h33
-rw-r--r--lib/argmatch.c277
-rw-r--r--lib/argmatch.h111
-rw-r--r--lib/asnprintf.c34
-rw-r--r--lib/asprintf.c39
-rw-r--r--lib/assure.h37
-rw-r--r--lib/basename-lgpl.c75
-rw-r--r--lib/basename.c58
-rw-r--r--lib/binary-io.c4
-rw-r--r--lib/binary-io.h75
-rw-r--r--lib/bitrotate.c3
-rw-r--r--lib/bitrotate.h136
-rw-r--r--lib/btowc.c39
-rw-r--r--lib/c-ctype.c3
-rw-r--r--lib/c-ctype.h366
-rw-r--r--lib/c-stack.c330
-rw-r--r--lib/c-stack.h44
-rw-r--r--lib/c-strcase.h56
-rw-r--r--lib/c-strcasecmp.c56
-rw-r--r--lib/c-strcaseeq.h181
-rw-r--r--lib/c-strncasecmp.c56
-rw-r--r--lib/careadlinkat.c160
-rw-r--r--lib/careadlinkat.h67
-rw-r--r--lib/close.c69
-rw-r--r--lib/cmpbuf.c109
-rw-r--r--lib/cmpbuf.h19
-rw-r--r--lib/config.charset682
-rw-r--r--lib/config.hin2257
-rw-r--r--lib/ctype.in.h57
-rw-r--r--lib/diffseq.h425
-rw-r--r--lib/dirname-lgpl.c86
-rw-r--r--lib/dirname.c38
-rw-r--r--lib/dirname.h54
-rw-r--r--lib/dosname.h53
-rw-r--r--lib/dup2.c215
-rw-r--r--lib/errno.in.h279
-rw-r--r--lib/error.c406
-rw-r--r--lib/error.h75
-rw-r--r--lib/exclude.c695
-rw-r--r--lib/exclude.h62
-rw-r--r--lib/exitfail.c24
-rw-r--r--lib/exitfail.h18
-rw-r--r--lib/fcntl.c414
-rw-r--r--lib/fcntl.in.h363
-rw-r--r--lib/fd-hook.c116
-rw-r--r--lib/fd-hook.h119
-rw-r--r--lib/file-type.c111
-rw-r--r--lib/file-type.h29
-rw-r--r--lib/filename.h54
-rw-r--r--lib/filenamecat-lgpl.c88
-rw-r--r--lib/filenamecat.c41
-rw-r--r--lib/filenamecat.h27
-rw-r--r--lib/float+.h147
-rw-r--r--lib/float.c33
-rw-r--r--lib/float.in.h188
-rw-r--r--lib/fnmatch.c350
-rw-r--r--lib/fnmatch.in.h67
-rw-r--r--lib/fnmatch_loop.c1219
-rw-r--r--lib/freopen-safer.c103
-rw-r--r--lib/freopen.c67
-rw-r--r--lib/fstat.c88
-rw-r--r--lib/getdtablesize.c121
-rw-r--r--lib/getopt.c1275
-rw-r--r--lib/getopt.in.h255
-rw-r--r--lib/getopt1.c170
-rw-r--r--lib/getopt_int.h135
-rw-r--r--lib/gettext.h292
-rw-r--r--lib/gettime.c48
-rw-r--r--lib/gettimeofday.c154
-rw-r--r--lib/gnulib.mk2863
-rw-r--r--lib/hard-locale.c72
-rw-r--r--lib/hard-locale.h25
-rw-r--r--lib/hash.c1225
-rw-r--r--lib/hash.h103
-rw-r--r--lib/iconv.c449
-rw-r--r--lib/iconv.in.h110
-rw-r--r--lib/iconv_close.c46
-rw-r--r--lib/iconv_open-aix.gperf44
-rw-r--r--lib/iconv_open-aix.h256
-rw-r--r--lib/iconv_open-hpux.gperf56
-rw-r--r--lib/iconv_open-hpux.h299
-rw-r--r--lib/iconv_open-irix.gperf31
-rw-r--r--lib/iconv_open-irix.h199
-rw-r--r--lib/iconv_open-osf.gperf50
-rw-r--r--lib/iconv_open-osf.h278
-rw-r--r--lib/iconv_open-solaris.gperf30
-rw-r--r--lib/iconv_open-solaris.h190
-rw-r--r--lib/iconv_open.c172
-rw-r--r--lib/ignore-value.h50
-rw-r--r--lib/imaxtostr.c3
-rw-r--r--lib/intprops.h445
-rw-r--r--lib/inttostr.c3
-rw-r--r--lib/inttostr.h46
-rw-r--r--lib/inttypes.in.h1144
-rw-r--r--lib/isblank.c33
-rw-r--r--lib/iswblank.c26
-rw-r--r--lib/itold.c28
-rw-r--r--lib/langinfo.in.h194
-rw-r--r--lib/localcharset.c613
-rw-r--r--lib/localcharset.h40
-rw-r--r--lib/locale.in.h216
-rw-r--r--lib/localeconv.c103
-rw-r--r--lib/lstat.c97
-rw-r--r--lib/malloc.c56
-rw-r--r--lib/malloca.c149
-rw-r--r--lib/malloca.h133
-rw-r--r--lib/malloca.valgrind7
-rw-r--r--lib/mbchar.c37
-rw-r--r--lib/mbchar.h360
-rw-r--r--lib/mbiter.c3
-rw-r--r--lib/mbiter.h225
-rw-r--r--lib/mbrtowc.c407
-rw-r--r--lib/mbscasecmp.c98
-rw-r--r--lib/mbsinit.c61
-rw-r--r--lib/mbslen.c44
-rw-r--r--lib/mbsrtowcs-impl.h122
-rw-r--r--lib/mbsrtowcs-state.c37
-rw-r--r--lib/mbsrtowcs.c32
-rw-r--r--lib/mbsstr.c384
-rw-r--r--lib/mbtowc-impl.h44
-rw-r--r--lib/mbtowc.c26
-rw-r--r--lib/mbuiter.c3
-rw-r--r--lib/mbuiter.h232
-rw-r--r--lib/memchr.c172
-rw-r--r--lib/memchr.valgrind14
-rw-r--r--lib/mkstemp.c50
-rw-r--r--lib/mktime-internal.h37
-rw-r--r--lib/mktime.c630
-rw-r--r--lib/msvc-inval.c129
-rw-r--r--lib/msvc-inval.h222
-rw-r--r--lib/msvc-nothrow.c49
-rw-r--r--lib/msvc-nothrow.h43
-rw-r--r--lib/nl_langinfo.c322
-rw-r--r--lib/offtostr.c3
-rw-r--r--lib/open.c181
-rw-r--r--lib/pathmax.h83
-rw-r--r--lib/prepargs.c91
-rw-r--r--lib/prepargs.h3
-rw-r--r--lib/printf-args.c187
-rw-r--r--lib/printf-args.h158
-rw-r--r--lib/printf-parse.c638
-rw-r--r--lib/printf-parse.h193
-rw-r--r--lib/progname.c92
-rw-r--r--lib/progname.h62
-rw-r--r--lib/propername.c318
-rw-r--r--lib/propername.h106
-rw-r--r--lib/quote.h46
-rw-r--r--lib/quotearg.c1031
-rw-r--r--lib/quotearg.h425
-rw-r--r--lib/raise.c79
-rw-r--r--lib/rawmemchr.c136
-rw-r--r--lib/rawmemchr.valgrind12
-rw-r--r--lib/readlink.c74
-rw-r--r--lib/ref-add.sin29
-rw-r--r--lib/ref-del.sin24
-rw-r--r--lib/regcomp.c3937
-rw-r--r--lib/regex.c81
-rw-r--r--lib/regex.h659
-rw-r--r--lib/regex_internal.c1741
-rw-r--r--lib/regex_internal.h903
-rw-r--r--lib/regexec.c4391
-rw-r--r--lib/secure_getenv.c54
-rw-r--r--lib/setenv.c390
-rw-r--r--lib/sh-quote.c107
-rw-r--r--lib/sh-quote.h49
-rw-r--r--lib/sig-handler.c3
-rw-r--r--lib/sig-handler.h54
-rw-r--r--lib/sigaction.c204
-rw-r--r--lib/signal.in.h463
-rw-r--r--lib/sigprocmask.c349
-rw-r--r--lib/size_max.h30
-rw-r--r--lib/stat-macros.h3
-rw-r--r--lib/stat-time.c3
-rw-r--r--lib/stat-time.h199
-rw-r--r--lib/stat.c138
-rw-r--r--lib/stdarg.in.h35
-rw-r--r--lib/stdbool.in.h132
-rw-r--r--lib/stddef.in.h110
-rw-r--r--lib/stdint.in.h635
-rw-r--r--lib/stdio--.h41
-rw-r--r--lib/stdio-safer.h36
-rw-r--r--lib/stdio.in.h1357
-rw-r--r--lib/stdlib.in.h977
-rw-r--r--lib/str-kmp.h153
-rw-r--r--lib/strcasecmp.c62
-rw-r--r--lib/streq.h176
-rw-r--r--lib/strerror-override.c302
-rw-r--r--lib/strerror-override.h56
-rw-r--r--lib/strerror.c70
-rw-r--r--lib/strftime.c1465
-rw-r--r--lib/strftime.h33
-rw-r--r--lib/striconv.c463
-rw-r--r--lib/striconv.h75
-rw-r--r--lib/string.in.h1046
-rw-r--r--lib/strings.in.h122
-rw-r--r--lib/stripslash.c45
-rw-r--r--lib/strncasecmp.c62
-rw-r--r--lib/strndup.c36
-rw-r--r--lib/strnlen.c30
-rw-r--r--lib/strnlen1.c35
-rw-r--r--lib/strnlen1.h40
-rw-r--r--lib/strptime.c1143
-rw-r--r--lib/strtoimax.c82
-rw-r--r--lib/strtol.c422
-rw-r--r--lib/strtoul.c19
-rw-r--r--lib/strtoull.c26
-rw-r--r--lib/strtoumax.c2
-rw-r--r--lib/sys_stat.in.h732
-rw-r--r--lib/sys_time.in.h213
-rw-r--r--lib/sys_types.in.h53
-rw-r--r--lib/sys_wait.in.h129
-rw-r--r--lib/system-quote.c311
-rw-r--r--lib/system-quote.h99
-rw-r--r--lib/tempname.c324
-rw-r--r--lib/tempname.h65
-rw-r--r--lib/time-internal.h49
-rw-r--r--lib/time.in.h297
-rw-r--r--lib/time_r.c44
-rw-r--r--lib/time_rz.c321
-rw-r--r--lib/timegm.c40
-rw-r--r--lib/timespec.c3
-rw-r--r--lib/timespec.h112
-rw-r--r--lib/trim.c129
-rw-r--r--lib/trim.h33
-rw-r--r--lib/uinttostr.c3
-rw-r--r--lib/umaxtostr.c3
-rw-r--r--lib/unistd.c4
-rw-r--r--lib/unistd.in.h1586
-rw-r--r--lib/unistr.in.h750
-rw-r--r--lib/unistr/u8-mbtoucr.c285
-rw-r--r--lib/unistr/u8-uctomb-aux.c69
-rw-r--r--lib/unistr/u8-uctomb.c88
-rw-r--r--lib/unitypes.in.h46
-rw-r--r--lib/uniwidth.in.h72
-rw-r--r--lib/uniwidth/cjk.h37
-rw-r--r--lib/uniwidth/width.c450
-rw-r--r--lib/unlocked-io.h136
-rw-r--r--lib/unsetenv.c127
-rw-r--r--lib/vasnprintf.c5598
-rw-r--r--lib/vasnprintf.h79
-rw-r--r--lib/vasprintf.c50
-rw-r--r--lib/verify.h279
-rw-r--r--lib/version-etc-fsf.c30
-rw-r--r--lib/version-etc.c258
-rw-r--r--lib/version-etc.h78
-rw-r--r--lib/wchar.in.h1038
-rw-r--r--lib/wcrtomb.c53
-rw-r--r--lib/wctype-h.c4
-rw-r--r--lib/wctype.in.h514
-rw-r--r--lib/wcwidth.c50
-rw-r--r--lib/xalloc-die.c41
-rw-r--r--lib/xalloc-oversized.h71
-rw-r--r--lib/xalloc.h264
-rw-r--r--lib/xasprintf.c34
-rw-r--r--lib/xfreopen.c42
-rw-r--r--lib/xfreopen.h2
-rw-r--r--lib/xmalloc.c122
-rw-r--r--lib/xreadlink.c44
-rw-r--r--lib/xreadlink.h25
-rw-r--r--lib/xsize.c3
-rw-r--r--lib/xsize.h117
-rw-r--r--lib/xstriconv.c62
-rw-r--r--lib/xstriconv.h78
-rw-r--r--lib/xstrndup.c36
-rw-r--r--lib/xstrndup.h23
-rw-r--r--lib/xstrtol-error.c98
-rw-r--r--lib/xstrtol.c249
-rw-r--r--lib/xstrtol.h73
-rw-r--r--lib/xstrtoul.c6
-rw-r--r--lib/xstrtoumax.c6
-rw-r--r--lib/xvasprintf.c110
-rw-r--r--lib/xvasprintf.h55
-rw-r--r--m4/00gnulib.m446
-rw-r--r--m4/absolute-header.m4102
-rw-r--r--m4/alloca.m4121
-rw-r--r--m4/arpa_inet_h.m457
-rw-r--r--m4/btowc.m4116
-rw-r--r--m4/c-stack.m4359
-rw-r--r--m4/clock_time.m431
-rw-r--r--m4/close.m433
-rw-r--r--m4/codeset.m424
-rw-r--r--m4/config-h.m413
-rw-r--r--m4/configmake.m455
-rw-r--r--m4/ctype.m432
-rw-r--r--m4/dirname.m419
-rw-r--r--m4/double-slash-root.m438
-rw-r--r--m4/dup2.m4117
-rw-r--r--m4/eealloc.m431
-rw-r--r--m4/environ.m447
-rw-r--r--m4/errno_h.m4137
-rw-r--r--m4/error.m427
-rw-r--r--m4/exponentd.m4116
-rw-r--r--m4/extensions.m4143
-rw-r--r--m4/extern-inline.m4102
-rw-r--r--m4/fcntl-o.m4134
-rw-r--r--m4/fcntl.m4126
-rw-r--r--m4/fcntl_h.m450
-rw-r--r--m4/fdopen.m447
-rw-r--r--m4/filenamecat.m416
-rw-r--r--m4/flexmember.m441
-rw-r--r--m4/float_h.m498
-rw-r--r--m4/fnmatch.m4156
-rw-r--r--m4/fpieee.m454
-rw-r--r--m4/freopen.m419
-rw-r--r--m4/fstat.m436
-rw-r--r--m4/ftruncate.m440
-rw-r--r--m4/getcwd.m4162
-rw-r--r--m4/getdtablesize.m446
-rw-r--r--m4/getopt.m4368
-rw-r--r--m4/getpagesize.m432
-rw-r--r--m4/gettext.m4401
-rw-r--r--m4/gettime.m413
-rw-r--r--m4/gettimeofday.m4138
-rw-r--r--m4/glibc21.m434
-rw-r--r--m4/gnu-make.m419
-rw-r--r--m4/gnulib-common.m4462
-rw-r--r--m4/gnulib-comp.m41985
-rw-r--r--m4/hard-locale.m411
-rw-r--r--m4/iconv.m4271
-rw-r--r--m4/iconv_h.m441
-rw-r--r--m4/iconv_open.m456
-rw-r--r--m4/include_next.m4223
-rw-r--r--m4/inet_pton.m468
-rw-r--r--m4/inline.m440
-rw-r--r--m4/intlmacosx.m456
-rw-r--r--m4/intmax_t.m467
-rw-r--r--m4/inttostr.m432
-rw-r--r--m4/inttypes-pri.m442
-rw-r--r--m4/inttypes.m4158
-rw-r--r--m4/inttypes_h.m429
-rw-r--r--m4/ioctl.m441
-rw-r--r--m4/isblank.m417
-rw-r--r--m4/iswblank.m441
-rw-r--r--m4/langinfo_h.m4105
-rw-r--r--m4/largefile.m4146
-rw-r--r--m4/lib-ld.m4119
-rw-r--r--m4/lib-link.m4777
-rw-r--r--m4/lib-prefix.m4224
-rw-r--r--m4/libsigsegv.m416
-rw-r--r--m4/libunistring-base.m4141
-rw-r--r--m4/localcharset.m417
-rw-r--r--m4/locale-fr.m4250
-rw-r--r--m4/locale-ja.m4136
-rw-r--r--m4/locale-tr.m4127
-rw-r--r--m4/locale-zh.m4130
-rw-r--r--m4/locale_h.m4122
-rw-r--r--m4/localeconv.m422
-rw-r--r--m4/longlong.m4113
-rw-r--r--m4/lstat.m471
-rw-r--r--m4/malloc.m4101
-rw-r--r--m4/malloca.m415
-rw-r--r--m4/manywarnings.m4274
-rw-r--r--m4/mbchar.m413
-rw-r--r--m4/mbiter.m414
-rw-r--r--m4/mbrtowc.m4664
-rw-r--r--m4/mbsinit.m451
-rw-r--r--m4/mbslen.m416
-rw-r--r--m4/mbsrtowcs.m4155
-rw-r--r--m4/mbstate_t.m441
-rw-r--r--m4/mbtowc.m419
-rw-r--r--m4/memchr.m488
-rw-r--r--m4/mkstemp.m482
-rw-r--r--m4/mktime.m4268
-rw-r--r--m4/mmap-anon.m455
-rw-r--r--m4/mode_t.m426
-rw-r--r--m4/msvc-inval.m419
-rw-r--r--m4/msvc-nothrow.m410
-rw-r--r--m4/multiarch.m462
-rw-r--r--m4/nanosleep.m4148
-rw-r--r--m4/netinet_in_h.m431
-rw-r--r--m4/nl_langinfo.m450
-rw-r--r--m4/nls.m432
-rw-r--r--m4/nocrash.m4131
-rw-r--r--m4/off_t.m418
-rw-r--r--m4/open.m491
-rw-r--r--m4/pathmax.m442
-rw-r--r--m4/perror.m463
-rw-r--r--m4/pipe.m415
-rw-r--r--m4/po.m4453
-rw-r--r--m4/printf.m41555
-rw-r--r--m4/progtest.m491
-rw-r--r--m4/putenv.m456
-rw-r--r--m4/quote.m413
-rw-r--r--m4/quotearg.m410
-rw-r--r--m4/raise.m434
-rw-r--r--m4/rawmemchr.m420
-rw-r--r--m4/readlink.m471
-rw-r--r--m4/regex.m4293
-rw-r--r--m4/secure_getenv.m426
-rw-r--r--m4/select.m4114
-rw-r--r--m4/setenv.m4160
-rw-r--r--m4/setlocale.m429
-rw-r--r--m4/sigaction.m440
-rw-r--r--m4/signal_h.m483
-rw-r--r--m4/signalblocking.m425
-rw-r--r--m4/size_max.m479
-rw-r--r--m4/sleep.m462
-rw-r--r--m4/snprintf.m454
-rw-r--r--m4/socketlib.m486
-rw-r--r--m4/sockets.m417
-rw-r--r--m4/socklen.m477
-rw-r--r--m4/sockpfaf.m487
-rw-r--r--m4/ssize_t.m423
-rw-r--r--m4/stat-time.m483
-rw-r--r--m4/stat.m471
-rw-r--r--m4/stdalign.m457
-rw-r--r--m4/stdarg.m478
-rw-r--r--m4/stdbool.m4104
-rw-r--r--m4/stddef_h.m451
-rw-r--r--m4/stdint.m4511
-rw-r--r--m4/stdint_h.m427
-rw-r--r--m4/stdio_h.m4221
-rw-r--r--m4/stdlib_h.m4119
-rw-r--r--m4/strcase.m445
-rw-r--r--m4/strerror.m496
-rw-r--r--m4/strerror_r.m4173
-rw-r--r--m4/strftime.m428
-rw-r--r--m4/string_h.m4120
-rw-r--r--m4/strings_h.m452
-rw-r--r--m4/strndup.m458
-rw-r--r--m4/strnlen.m430
-rw-r--r--m4/strptime.m422
-rw-r--r--m4/strtoull.m424
-rw-r--r--m4/strtoumax.m428
-rw-r--r--m4/symlink.m453
-rw-r--r--m4/sys_ioctl_h.m464
-rw-r--r--m4/sys_select_h.m495
-rw-r--r--m4/sys_socket_h.m4176
-rw-r--r--m4/sys_stat_h.m496
-rw-r--r--m4/sys_time_h.m4111
-rw-r--r--m4/sys_types_h.m424
-rw-r--r--m4/sys_uio_h.m431
-rw-r--r--m4/sys_wait_h.m436
-rw-r--r--m4/tempname.m419
-rw-r--r--m4/time_h.m4134
-rw-r--r--m4/time_r.m458
-rw-r--r--m4/time_rz.m421
-rw-r--r--m4/timegm.m426
-rw-r--r--m4/timespec.m411
-rw-r--r--m4/tm_gmtoff.m414
-rw-r--r--m4/unistd_h.m4189
-rw-r--r--m4/unlocked-io.m441
-rw-r--r--m4/vararrays.m468
-rw-r--r--m4/vasnprintf.m4291
-rw-r--r--m4/vasprintf.m446
-rw-r--r--m4/version-etc.m433
-rw-r--r--m4/warn-on-use.m447
-rw-r--r--m4/warnings.m479
-rw-r--r--m4/wchar_h.m4225
-rw-r--r--m4/wchar_t.m424
-rw-r--r--m4/wcrtomb.m4112
-rw-r--r--m4/wctob.m4127
-rw-r--r--m4/wctomb.m419
-rw-r--r--m4/wctype_h.m4209
-rw-r--r--m4/wcwidth.m4104
-rw-r--r--m4/wint_t.m432
-rw-r--r--m4/xalloc.m47
-rw-r--r--m4/xsize.m412
-rw-r--r--m4/xstrndup.m415
-rw-r--r--m4/xstrtol.m410
-rw-r--r--m4/xvasprintf.m48
-rw-r--r--maint.mk1679
-rw-r--r--man/Makefile.am39
-rw-r--r--man/Makefile.in1451
-rw-r--r--man/cmp.174
-rw-r--r--man/cmp.x2
-rw-r--r--man/diff.1266
-rw-r--r--man/diff.x2
-rw-r--r--man/diff3.1100
-rw-r--r--man/diff3.x2
-rwxr-xr-xman/help2man671
-rw-r--r--man/sdiff.1102
-rw-r--r--man/sdiff.x2
-rw-r--r--po/LINGUAS32
-rw-r--r--po/Makefile.in.in475
-rw-r--r--po/Makevars83
-rw-r--r--po/POTFILES.in36
-rw-r--r--po/Rules-quot58
-rw-r--r--po/boldquot.sed10
-rw-r--r--po/ca.gmobin0 -> 8017 bytes
-rw-r--r--po/ca.po1666
-rw-r--r--po/cs.gmobin0 -> 33984 bytes
-rw-r--r--po/cs.po1577
-rw-r--r--po/da.gmobin0 -> 32510 bytes
-rw-r--r--po/da.po1602
-rw-r--r--po/de.gmobin0 -> 34205 bytes
-rw-r--r--po/de.po1668
-rw-r--r--po/diffutils.pot1349
-rw-r--r--po/el.gmobin0 -> 40946 bytes
-rw-r--r--po/el.po1531
-rw-r--r--po/en@boldquot.header25
-rw-r--r--po/en@quot.header22
-rw-r--r--po/eo.gmobin0 -> 32270 bytes
-rw-r--r--po/eo.po1523
-rw-r--r--po/es.gmobin0 -> 34684 bytes
-rw-r--r--po/es.po1902
-rw-r--r--po/fi.gmobin0 -> 16465 bytes
-rw-r--r--po/fi.po1666
-rw-r--r--po/fr.gmobin0 -> 34873 bytes
-rw-r--r--po/fr.po1777
-rw-r--r--po/ga.gmobin0 -> 7785 bytes
-rw-r--r--po/ga.po1644
-rw-r--r--po/gl.gmobin0 -> 11774 bytes
-rw-r--r--po/gl.po1705
-rw-r--r--po/he.gmobin0 -> 6157 bytes
-rw-r--r--po/he.po1599
-rw-r--r--po/hr.gmobin0 -> 16253 bytes
-rw-r--r--po/hr.po1410
-rw-r--r--po/hu.gmobin0 -> 35089 bytes
-rw-r--r--po/hu.po1551
-rw-r--r--po/id.gmobin0 -> 31171 bytes
-rw-r--r--po/id.po1585
-rw-r--r--po/insert-header.sin23
-rw-r--r--po/it.gmobin0 -> 33715 bytes
-rw-r--r--po/it.po1617
-rw-r--r--po/ja.gmobin0 -> 32354 bytes
-rw-r--r--po/ja.po1563
-rw-r--r--po/lv.gmobin0 -> 33115 bytes
-rw-r--r--po/lv.po1601
-rw-r--r--po/ms.gmobin0 -> 8981 bytes
-rw-r--r--po/ms.po1596
-rw-r--r--po/nb.gmobin0 -> 32637 bytes
-rw-r--r--po/nb.po1531
-rw-r--r--po/nl.gmobin0 -> 34390 bytes
-rw-r--r--po/nl.po1634
-rw-r--r--po/pl.gmobin0 -> 33448 bytes
-rw-r--r--po/pl.po1521
-rw-r--r--po/pt_BR.gmobin0 -> 34876 bytes
-rw-r--r--po/pt_BR.po1674
-rw-r--r--po/quot.sed6
-rw-r--r--po/remove-potcdate.sin19
-rw-r--r--po/ro.gmobin0 -> 6531 bytes
-rw-r--r--po/ro.po1660
-rw-r--r--po/ru.gmobin0 -> 7897 bytes
-rw-r--r--po/ru.po1654
-rw-r--r--po/sr.gmobin0 -> 39585 bytes
-rw-r--r--po/sr.po1500
-rw-r--r--po/stamp-po1
-rw-r--r--po/sv.gmobin0 -> 32238 bytes
-rw-r--r--po/sv.po1515
-rw-r--r--po/tr.gmobin0 -> 33709 bytes
-rw-r--r--po/tr.po1662
-rw-r--r--po/uk.gmobin0 -> 42512 bytes
-rw-r--r--po/uk.po1569
-rw-r--r--po/vi.gmobin0 -> 36291 bytes
-rw-r--r--po/vi.po1610
-rw-r--r--po/zh_CN.gmobin0 -> 29617 bytes
-rw-r--r--po/zh_CN.po1526
-rw-r--r--po/zh_TW.gmobin0 -> 7702 bytes
-rw-r--r--po/zh_TW.po1639
-rw-r--r--src/Makefile.am77
-rw-r--r--src/Makefile.in1680
-rw-r--r--src/analyze.c707
-rw-r--r--src/cmp.c661
-rw-r--r--src/context.c537
-rw-r--r--src/diff.c1472
-rw-r--r--src/diff.h423
-rw-r--r--src/diff3.c1791
-rw-r--r--src/dir.c385
-rw-r--r--src/ed.c175
-rw-r--r--src/ifdef.c430
-rw-r--r--src/io.c830
-rw-r--r--src/normal.c91
-rw-r--r--src/sdiff.c1173
-rw-r--r--src/side.c335
-rw-r--r--src/system.h214
-rw-r--r--src/util.c1577
-rw-r--r--tests/Makefile.am90
-rw-r--r--tests/Makefile.in1916
-rwxr-xr-xtests/basic42
-rwxr-xr-xtests/bignum14
-rwxr-xr-xtests/binary17
-rwxr-xr-xtests/brief-vs-stat-zero-kernel-lies38
-rwxr-xr-xtests/colliding-file-names19
-rwxr-xr-xtests/colors134
-rw-r--r--tests/diff3108
-rw-r--r--tests/envvar-check65
-rwxr-xr-xtests/excess-slash18
-rwxr-xr-xtests/filename-quoting61
-rwxr-xr-xtests/function-line-vs-leading-space65
-rwxr-xr-xtests/help-version269
-rwxr-xr-xtests/ignore-matching-lines47
-rw-r--r--tests/init.sh616
-rwxr-xr-xtests/label-vs-func31
-rwxr-xr-xtests/new-file38
-rw-r--r--tests/no-dereference169
-rwxr-xr-xtests/no-newline-at-eof59
-rwxr-xr-xtests/stdin24
-rwxr-xr-xtests/strcoll-0-names25
-rw-r--r--tests/t-local.sh0
911 files changed, 297455 insertions, 0 deletions
diff --git a/.tarball-version b/.tarball-version
new file mode 100644
index 0000000..5a95802
--- /dev/null
+++ b/.tarball-version
@@ -0,0 +1 @@
+3.5
diff --git a/ABOUT-NLS b/ABOUT-NLS
new file mode 100644
index 0000000..b1de1b6
--- /dev/null
+++ b/ABOUT-NLS
@@ -0,0 +1,1282 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+1.1 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. Installers may use special
+options at configuration time for changing the default behaviour. The
+command:
+
+ ./configure --disable-nls
+
+will _totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl' library
+and will decide to use it. If not, you may have to to use the
+`--with-libintl-prefix' option to tell `configure' where to look for it.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.2 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. If you happen to have the `LC_ALL' or some other
+`LC_xxx' environment variables set, you should unset them before
+setting `LANG', otherwise the setting of `LANG' will not have the
+desired effect. Here `LL' is an ISO 639 two-letter language code, and
+`CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.3 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://translationproject.org/', in the "Teams" area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `coordinator@translationproject.org' to
+reach the coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skills are praised more than
+programming skills, here.
+
+1.4 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of June
+2010. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca
+ +--------------------------------------------------+
+ a2ps | [] [] |
+ aegis | |
+ ant-phone | |
+ anubis | |
+ aspell | [] [] |
+ bash | |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | |
+ bison-runtime | [] |
+ bluez-pin | [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] |
+ cryptsetup | |
+ dfarc | |
+ dialog | [] [] |
+ dico | |
+ diffutils | [] |
+ dink | |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ exif | |
+ fetchmail | [] |
+ findutils | [] |
+ flex | [] |
+ freedink | |
+ gas | |
+ gawk | [] [] |
+ gcal | [] |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] |
+ gettext-tools | [] [] |
+ gip | [] |
+ gjay | |
+ gliv | [] |
+ glunarclock | [] [] |
+ gnubiff | |
+ gnucash | [] |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | |
+ gold | |
+ gpe-aerial | |
+ gpe-beam | |
+ gpe-bluetooth | |
+ gpe-calendar | |
+ gpe-clock | [] |
+ gpe-conf | |
+ gpe-contacts | |
+ gpe-edit | |
+ gpe-filemanager | |
+ gpe-go | |
+ gpe-login | |
+ gpe-ownerinfo | [] |
+ gpe-package | |
+ gpe-sketchbook | |
+ gpe-su | [] |
+ gpe-taskmanager | [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | [] [] |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] |
+ gst-plugins-ugly | [] |
+ gstreamer | [] [] [] |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] |
+ gutenprint | |
+ hello | [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | [] [] |
+ iso_15924 | |
+ iso_3166 | [] [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | |
+ iso_639 | [] [] [] [] |
+ iso_639_3 | |
+ jwhois | |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | |
+ ld | [] |
+ leafpad | [] [] |
+ libc | [] [] |
+ libexif | () |
+ libextractor | |
+ libgnutls | |
+ libgpewidget | |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | [] |
+ libidn | |
+ lifelines | |
+ liferea | [] [] |
+ lilypond | |
+ linkdr | [] |
+ lordsawar | |
+ lprng | |
+ lynx | [] |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | |
+ man-db | |
+ man-db-manpages | |
+ minicom | |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | |
+ psmisc | |
+ pspp | [] |
+ pwdutils | |
+ radius | [] |
+ recode | [] [] |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] |
+ sharutils | [] [] |
+ shishi | |
+ skencil | |
+ solfege | |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | |
+ tar | [] |
+ texinfo | |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+ +--------------------------------------------------+
+ af am an ar as ast az be be@latin bg bn_IN bs ca
+ 6 0 1 2 3 19 1 10 3 28 3 1 38
+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ +-------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] () |
+ anubis | [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] [] [] |
+ cflow | [] [] |
+ clisp | [] [] [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] [] [] |
+ cryptsetup | [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] |
+ dink | [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ exif | () [] [] |
+ fetchmail | [] [] () [] [] [] |
+ findutils | [] [] [] |
+ flex | [] [] |
+ freedink | [] [] [] |
+ gas | [] |
+ gawk | [] [] [] |
+ gcal | [] |
+ gcc | [] [] |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gip | [] [] [] [] |
+ gjay | [] |
+ gliv | [] [] [] |
+ glunarclock | [] [] |
+ gnubiff | () |
+ gnucash | [] () () () () |
+ gnuedu | [] [] |
+ gnulib | [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] |
+ gpe-aerial | [] [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] [] [] |
+ gpe-contacts | [] [] [] |
+ gpe-edit | [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] () [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] |
+ grub | [] [] |
+ gsasl | [] |
+ gss | |
+ gst-plugins-bad | [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] () [] |
+ gtkam | [] [] () [] [] |
+ gtkorphan | [] [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] |
+ hello | [] [] [] [] |
+ help2man | [] |
+ hylafax | [] [] |
+ idutils | [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] [] [] [] () [] [] [] () |
+ iso_3166_2 | () |
+ iso_4217 | [] [] [] () [] [] |
+ iso_639 | [] [] [] [] () [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | [] [] [] [] [] |
+ keytouch | [] [] |
+ keytouch-editor | [] [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] [] [] [] |
+ latrine | [] () |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] () |
+ libgphoto2_port | [] () [] |
+ libgsasl | |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] [] |
+ lifelines | [] () |
+ liferea | [] [] [] [] [] |
+ lilypond | [] [] [] |
+ linkdr | [] [] [] |
+ lordsawar | [] |
+ lprng | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailfromd | |
+ mailutils | [] |
+ make | [] [] [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] [] [] [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] |
+ pies | |
+ popt | [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] |
+ pwdutils | [] |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rosegarden | () () () |
+ rpm | [] [] [] |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] |
+ sed | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | |
+ skencil | [] () [] |
+ solfege | [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ sysstat | [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] |
+ tin | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] |
+ vice | () () |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] [] |
+ +-------------------------------------------------+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ 5 64 105 117 18 1 8 0 28 89 18 19 0
+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ +----------------------------------------------------+
+ a2ps | [] [] [] [] |
+ aegis | [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] [] |
+ aspell | [] [] [] [] |
+ bash | [] [] [] [] |
+ bfd | [] [] [] |
+ bibshelf | [] [] [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] |
+ bison-runtime | [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] |
+ cflow | [] [] [] |
+ clisp | [] |
+ coreutils | [] [] [] [] [] |
+ cpio | [] [] [] [] |
+ cppi | [] [] |
+ cpplib | [] [] [] |
+ cryptsetup | [] [] [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ dink | [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ exif | [] [] [] [] [] [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] |
+ freedink | [] [] [] |
+ gas | [] [] |
+ gawk | [] [] [] [] () [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] |
+ gip | [] [] [] [] [] [] |
+ gjay | [] |
+ gliv | [] () |
+ glunarclock | [] [] [] [] |
+ gnubiff | () [] () |
+ gnucash | () () () () () [] |
+ gnuedu | [] [] |
+ gnulib | [] [] [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] [] |
+ gpe-aerial | [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] [] [] |
+ gpe-contacts | [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] [] |
+ gpe-go | [] [] [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] [] |
+ grub | [] [] [] [] |
+ gsasl | [] [] [] [] [] |
+ gss | [] [] [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] [] [] |
+ gtkam | [] [] [] [] [] |
+ gtkorphan | [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] [] |
+ hello | [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | () [] [] [] |
+ iso_4217 | [] () [] [] [] [] |
+ iso_639 | [] () [] [] [] [] [] [] [] |
+ iso_639_3 | () [] [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] [] [] [] [] [] |
+ keytouch-editor | [] [] [] [] [] |
+ keytouch-keyboa... | [] [] [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] [] |
+ ld | [] [] [] [] |
+ leafpad | [] [] [] [] [] [] [] () |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] [] |
+ libidn | [] [] [] [] |
+ lifelines | () |
+ liferea | [] [] [] [] |
+ lilypond | [] [] |
+ linkdr | [] [] [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] [] [] |
+ m4 | [] [] [] [] [] [] |
+ mailfromd | |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] [] |
+ man-db | [] [] |
+ man-db-manpages | [] |
+ minicom | [] [] [] [] [] |
+ mkisofs | [] [] [] [] |
+ myserver | |
+ nano | [] [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pies | |
+ popt | [] [] [] [] [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | |
+ pwdutils | [] [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () () () () |
+ rpm | [] [] |
+ rush | |
+ sarg | [] |
+ screem | [] [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ shishi | [] |
+ skencil | [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] |
+ sp | [] () |
+ sysstat | [] [] [] [] [] |
+ tar | [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux-ng | [] [] [] [] [] [] |
+ vice | () () () |
+ vmm | [] |
+ vorbis-tools | [] |
+ wastesedge | () () |
+ wdiff | [] |
+ wget | [] [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] |
+ +----------------------------------------------------+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4
+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ +-----------------------------------------------+
+ a2ps | [] |
+ aegis | |
+ ant-phone | |
+ anubis | [] [] |
+ aspell | [] |
+ bash | |
+ bfd | |
+ bibshelf | [] [] |
+ binutils | |
+ bison | [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] |
+ cpio | |
+ cppi | |
+ cpplib | |
+ cryptsetup | |
+ dfarc | [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] |
+ dink | |
+ doodle | |
+ e2fsprogs | |
+ enscript | |
+ exif | [] |
+ fetchmail | |
+ findutils | |
+ flex | |
+ freedink | [] |
+ gas | |
+ gawk | |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] |
+ gettext-tools | [] |
+ gip | [] [] |
+ gjay | |
+ gliv | |
+ glunarclock | [] |
+ gnubiff | |
+ gnucash | () () () () |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] |
+ gold | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] |
+ gpe-timesheet | [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] |
+ gst-plugins-ugly | [] [] [] [] [] |
+ gstreamer | |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | |
+ hello | [] [] [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | |
+ iso_15924 | [] [] |
+ iso_3166 | [] [] () [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] |
+ iso_639 | [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] [] |
+ libc | [] |
+ libexif | |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | |
+ libidn | |
+ lifelines | |
+ liferea | |
+ lilypond | |
+ linkdr | |
+ lordsawar | |
+ lprng | |
+ lynx | |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | [] [] [] |
+ psmisc | |
+ pspp | |
+ pwdutils | |
+ radius | |
+ recode | |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] |
+ sed | |
+ sharutils | |
+ shishi | |
+ skencil | |
+ solfege | [] |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | [] |
+ tar | [] |
+ texinfo | [] |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] |
+ wyslij-po | |
+ xchat | [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +-----------------------------------------------+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1
+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] |
+ bfd | [] |
+ bibshelf | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] () |
+ buzztard | [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cppi | [] |
+ cpplib | [] |
+ cryptsetup | [] |
+ dfarc | [] |
+ dialog | [] [] [] [] |
+ dico | [] |
+ diffutils | [] [] [] [] [] [] |
+ dink | () |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ exif | [] [] [] () [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ freedink | [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gcal | |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] |
+ gip | [] [] [] [] [] |
+ gjay | |
+ gliv | [] [] [] [] [] [] |
+ glunarclock | [] [] [] [] [] |
+ gnubiff | [] () |
+ gnucash | [] () () () |
+ gnuedu | [] |
+ gnulib | [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] [] |
+ gold | |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] [] |
+ gphoto2 | [] [] [] [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] |
+ grub | [] [] [] |
+ gsasl | [] [] [] [] |
+ gss | [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] |
+ hello | [] [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] [] [] [] |
+ iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
+ iso_3166_2 | [] [] [] |
+ iso_4217 | [] [] [] [] [] [] [] [] |
+ iso_639 | [] [] [] [] [] [] [] [] [] |
+ iso_639_3 | [] [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] [] [] |
+ keytouch-editor | [] [] [] |
+ keytouch-keyboa... | [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] |
+ ld | |
+ leafpad | [] [] [] [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] |
+ lifelines | [] [] |
+ liferea | [] [] [] [] [] () () [] |
+ lilypond | [] |
+ linkdr | [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailfromd | [] |
+ mailutils | [] |
+ make | [] [] [] [] |
+ man-db | [] [] [] |
+ man-db-manpages | [] [] [] |
+ minicom | [] [] [] [] |
+ mkisofs | [] [] [] |
+ myserver | |
+ nano | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] [] [] |
+ pies | [] |
+ popt | [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] [] |
+ pwdutils | [] |
+ radius | [] [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () |
+ rpm | [] [] [] |
+ rush | [] [] |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ skencil | [] [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] [] |
+ soundtracker | [] |
+ sp | |
+ sysstat | [] [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] [] |
+ vice | [] |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +---------------------------------------------------+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37
+
+ sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] | 27
+ aegis | [] | 9
+ ant-phone | [] [] [] [] | 9
+ anubis | [] [] [] [] | 15
+ aspell | [] [] [] | 20
+ bash | [] [] [] | 12
+ bfd | [] | 6
+ bibshelf | [] [] [] | 16
+ binutils | [] [] | 8
+ bison | [] [] | 12
+ bison-runtime | [] [] [] [] [] [] | 29
+ bluez-pin | [] [] [] [] [] [] [] [] | 37
+ bombono-dvd | [] | 4
+ buzztard | [] | 7
+ cflow | [] [] [] | 9
+ clisp | | 10
+ coreutils | [] [] [] [] | 22
+ cpio | [] [] [] [] [] [] | 13
+ cppi | [] [] | 5
+ cpplib | [] [] [] [] [] [] | 14
+ cryptsetup | [] [] | 7
+ dfarc | [] | 9
+ dialog | [] [] [] [] [] [] [] | 30
+ dico | [] | 2
+ diffutils | [] [] [] [] [] [] | 30
+ dink | | 4
+ doodle | [] [] | 7
+ e2fsprogs | [] [] [] | 11
+ enscript | [] [] [] [] | 17
+ exif | [] [] [] | 16
+ fetchmail | [] [] [] | 17
+ findutils | [] [] [] [] [] | 20
+ flex | [] [] [] [] | 15
+ freedink | [] | 10
+ gas | [] | 4
+ gawk | [] [] [] [] | 18
+ gcal | [] [] | 5
+ gcc | [] [] [] | 7
+ gettext-examples | [] [] [] [] [] [] [] | 34
+ gettext-runtime | [] [] [] [] [] [] [] | 29
+ gettext-tools | [] [] [] [] [] [] | 22
+ gip | [] [] [] [] | 22
+ gjay | [] | 3
+ gliv | [] [] [] | 14
+ glunarclock | [] [] [] [] [] | 19
+ gnubiff | [] [] | 4
+ gnucash | () [] () [] () | 10
+ gnuedu | [] [] | 7
+ gnulib | [] [] [] [] | 16
+ gnunet | [] | 1
+ gnunet-gtk | [] [] [] | 5
+ gnutls | [] [] [] | 10
+ gold | [] | 4
+ gpe-aerial | [] [] [] | 18
+ gpe-beam | [] [] [] | 19
+ gpe-bluetooth | [] [] [] | 13
+ gpe-calendar | [] [] [] [] | 12
+ gpe-clock | [] [] [] [] [] | 28
+ gpe-conf | [] [] [] [] | 20
+ gpe-contacts | [] [] [] | 17
+ gpe-edit | [] [] [] | 12
+ gpe-filemanager | [] [] [] [] | 16
+ gpe-go | [] [] [] [] [] | 25
+ gpe-login | [] [] [] | 11
+ gpe-ownerinfo | [] [] [] [] [] | 25
+ gpe-package | [] [] [] | 13
+ gpe-sketchbook | [] [] [] | 20
+ gpe-su | [] [] [] [] [] | 30
+ gpe-taskmanager | [] [] [] [] [] | 29
+ gpe-timesheet | [] [] [] [] [] | 25
+ gpe-today | [] [] [] [] [] [] | 30
+ gpe-todo | [] [] [] [] | 17
+ gphoto2 | [] [] [] [] [] | 24
+ gprof | [] [] [] | 15
+ gpsdrive | [] [] [] | 11
+ gramadoir | [] [] [] | 11
+ grep | [] [] [] | 10
+ grub | [] [] [] | 14
+ gsasl | [] [] [] [] | 14
+ gss | [] [] [] | 11
+ gst-plugins-bad | [] [] [] [] | 26
+ gst-plugins-base | [] [] [] [] [] | 24
+ gst-plugins-good | [] [] [] [] | 24
+ gst-plugins-ugly | [] [] [] [] [] | 29
+ gstreamer | [] [] [] [] | 22
+ gtick | [] [] [] | 13
+ gtkam | [] [] [] | 20
+ gtkorphan | [] [] [] | 14
+ gtkspell | [] [] [] [] [] [] [] [] [] | 45
+ gutenprint | [] | 10
+ hello | [] [] [] [] [] [] | 21
+ help2man | [] [] | 7
+ hylafax | [] | 5
+ idutils | [] [] [] [] | 17
+ indent | [] [] [] [] [] [] | 30
+ iso_15924 | () [] () [] [] | 16
+ iso_3166 | [] [] () [] [] () [] [] [] () | 53
+ iso_3166_2 | () [] () [] | 9
+ iso_4217 | [] () [] [] () [] [] | 26
+ iso_639 | [] [] [] () [] () [] [] [] [] | 38
+ iso_639_3 | [] () | 8
+ jwhois | [] [] [] [] [] | 16
+ kbd | [] [] [] [] [] | 15
+ keytouch | [] [] [] | 16
+ keytouch-editor | [] [] [] | 14
+ keytouch-keyboa... | [] [] [] | 14
+ klavaro | [] | 11
+ latrine | [] [] [] | 10
+ ld | [] [] [] [] | 11
+ leafpad | [] [] [] [] [] [] | 33
+ libc | [] [] [] [] [] | 21
+ libexif | [] () | 7
+ libextractor | [] | 1
+ libgnutls | [] [] [] | 9
+ libgpewidget | [] [] [] | 14
+ libgpg-error | [] [] [] | 9
+ libgphoto2 | [] [] | 8
+ libgphoto2_port | [] [] [] [] | 14
+ libgsasl | [] [] [] | 13
+ libiconv | [] [] [] [] | 21
+ libidn | () [] [] | 11
+ lifelines | [] | 4
+ liferea | [] [] [] | 21
+ lilypond | [] | 7
+ linkdr | [] [] [] [] [] | 17
+ lordsawar | | 1
+ lprng | [] | 3
+ lynx | [] [] [] [] | 17
+ m4 | [] [] [] [] | 19
+ mailfromd | [] [] | 3
+ mailutils | [] | 5
+ make | [] [] [] [] | 21
+ man-db | [] [] [] | 8
+ man-db-manpages | | 4
+ minicom | [] [] | 16
+ mkisofs | [] [] | 9
+ myserver | | 0
+ nano | [] [] [] [] | 21
+ opcodes | [] [] [] | 11
+ parted | [] [] [] [] [] | 15
+ pies | [] [] | 3
+ popt | [] [] [] [] [] [] | 27
+ psmisc | [] [] | 11
+ pspp | | 4
+ pwdutils | [] [] | 6
+ radius | [] [] | 9
+ recode | [] [] [] [] | 28
+ rosegarden | () | 0
+ rpm | [] [] [] | 11
+ rush | [] [] | 4
+ sarg | | 1
+ screem | [] | 3
+ scrollkeeper | [] [] [] [] [] | 27
+ sed | [] [] [] [] [] | 30
+ sharutils | [] [] [] [] [] | 22
+ shishi | [] | 3
+ skencil | [] [] | 7
+ solfege | [] [] [] [] | 16
+ solfege-manual | [] | 8
+ soundtracker | [] [] [] | 9
+ sp | [] | 3
+ sysstat | [] [] | 15
+ tar | [] [] [] [] [] [] | 23
+ texinfo | [] [] [] [] [] | 17
+ tin | | 4
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux-ng | [] [] [] [] | 20
+ vice | () () | 1
+ vmm | [] | 4
+ vorbis-tools | [] | 6
+ wastesedge | | 2
+ wdiff | [] [] | 7
+ wget | [] [] [] [] [] | 26
+ wyslij-po | [] [] | 8
+ xchat | [] [] [] [] [] [] | 36
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63
+ xkeyboard-config | [] [] [] | 22
+ +---------------------------------------------------+
+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If June 2010 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
+`http://translationproject.org/extra/matrix.html'.
+
+1.5 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`coordinator@translationproject.org' to make the `.pot' files available
+to the translation teams.
+
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..58b097a
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,51 @@
+GNU diff was written by Paul Eggert, Mike Haertel, David Hayes,
+Richard Stallman, and Len Tower.
+
+GNU diff3 was written by Randy Smith.
+
+GNU sdiff was written by Thomas Lord.
+
+GNU cmp was written by Torbjorn Granlund and David MacKenzie.
+
+The diffutils manual was written by David MacKenzie, Paul Eggert, and
+Richard Stallman. Parts are adapted by from a manual page written by
+Larry Wall, with his permission.
+
+Many other people have contributed to GNU diffutils, including Wayne
+Davison, Patrick D'Cruze, F. Thomas May, Greg McGary, Chip Rosenthal,
+and Eli Zaretskii.
+
+The following contributions warranted legal paper exchanges with the
+Free Software Foundation. Also see the files ChangeLog and THANKS.
+
+Leonard H. Tower Jr.
+Torbjorn Granlund
+Mike Haertel
+David S. Hayes
+Randall Smith
+Richard Stallman
+F. Thomas May
+Wayne Davison
+Paul R. Eggert
+Chip Rosenthal
+Wayne Davison
+Patrick D'Cruze
+Eli Zaretskii
+
+
+Copyright (C) 2001, 2006, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+This file is part of GNU diffutils.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..8ebf809
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,1902 @@
+2016-08-20 Jim Meyering <meyering@fb.com>
+
+ version 3.5
+ * NEWS: Record release date.
+
+2016-08-16 Jim Meyering <meyering@fb.com>
+
+ build: arrange to build with -fno-common, when possible
+ * configure.ac (WERROR_CFLAGS): Add -fno-common, when possible.
+ This would have prevented the duplicate definition of
+ presume_output_tty that was fixed in v3.4-10-gc2dc91f.
+
+2016-08-16 Hanno Böck <hanno@hboeck.de>
+
+ diff: avoid duplicate definition of presume_output_tty
+ * src/util.c (presume_output_tty): Remove this definition.
+ The other is in diff.h. Reported in https://bugs.gnu.org/24248
+
+2016-08-14 Jim Meyering <meyering@fb.com>
+
+ gnulib: update to latest
+
+ tests: diff3: work around missing seq on some systems
+ * tests/diff3 (seq): Provide a seq replacement function,
+ since at least AIX, SunOS 5.10, OpenBSD-5.8 lack it.
+ Reported by Assaf Gordon in https://bugs.gnu.org/24227#8
+
+2016-08-13 Jim Meyering <meyering@fb.com>
+
+ diff3: fix leaks, for real
+ * src/diff3.c (struct diff_block)[lint]: Add member, n2.
+ (free_diff_block, next_to_n2): New functions.
+ * tests/diff3: Add more test coverage.
+
+ maint: require that commit messages be of a certain form
+ * bootstrap.conf (bootstrap_epilogue): Merge from coreutils, so that
+ a local commit hook will now help enforce consistent commit messages.
+ * Makefile.am (check-git-hook-script-sync): New rule, largely copied
+ from coreutils.
+ * scripts/git-hooks/commit-msg: New file, from coreutils, but
+ with adapted list of program names.
+ * scripts/git-hooks/applypatch-msg: New file, from git.
+ * scripts/git-hooks/pre-applypatch: Likewise.
+ * scripts/git-hooks/pre-commit: Likewise.
+
+2016-08-13 Bastian Beischer <bastian.beischer@rwth-aachen.de>
+
+ diff3: fix heap use-after-free; add minimal diff3 test coverage
+ Commit v3.3-42-g3b74a90, "FIXME: src/diff3: plug a leak" added an
+ invalid use of free, leading to use-after-free in nearly any invocation
+ of diff3. Revert that commit.
+ * NEWS (Bug fixes): Mention it.
+ * tests/diff3: New file, to add minimal test coverage.
+ * tests/Makefile.am (TESTS): Add it.
+ Reported by Bastian Beischer in http://bugs.gnu.org/24210
+
+2016-08-13 Jim Meyering <meyering@fb.com>
+
+ build: ignore texinfo build artifacts
+ * .gitignore: Ignore texinfo artifacts in doc/.
+
+ maint: diff3: remove an unreachable statement
+ * src/diff3.c (main): Remove unreachable "return" after exit from main.
+
+2016-08-08 Jim Meyering <meyering@fb.com>
+
+ diff: disable colorization for TERM=dumb
+ * src/diff.c (main): With --color or --color=auto, when TERM is
+ "dumb", disable colorization. Suggested by Daniel Colascione.
+ * NEWS (Bug fixes): Mention it.
+ * tests/colors: Add a test that would fail without this change,
+ yet passes with it.
+
+ maint: post-release administrivia
+ * NEWS: Add header line for next release.
+ * .prev-version: Record previous version.
+ * cfg.mk (old_NEWS_hash): Auto-update.
+
+ version 3.4
+ * NEWS: Record release date.
+
+2016-08-06 Jim Meyering <meyering@fb.com>
+
+ gnulib: update to latest
+
+ tests: tweak built_programs definition
+ * tests/Makefile.am (built_programs): Adjust to work around what
+ may be a problem due to interaction between Solaris 10's /bin/sh
+ and an old version of GNU make. Reported by Dagobert Michelsen
+ in https https://bugs.gnu.org/24137.
+
+2016-08-02 Jim Meyering <meyering@fb.com>
+
+ gnulib: update to latest
+
+ tests: skip a /proc/self-dependent test on the Hurd
+ * tests/brief-vs-stat-zero-kernel-lies: The Hurd's /proc/self
+ is not useful, so detect that and skip the test that requires it.
+ Reported by Assaf Gordon in https://debbugs.gnu.org/24121#29
+
+2016-08-01 Jim Meyering <meyering@fb.com>
+
+ tests/colors: fix portability problem with touch --date
+ * tests/colors (epoch): Don't use GNU touch's --date=$epoch option.
+ Use the portable -t 197001010000.00.
+ Reported by Assaf Gordon in https://debbugs.gnu.org/24121#8
+
+ build: Solaris 9: avoid link failure due to isblank use
+ * bootstrap.conf (gnulib_modules): Add isblank, to avoid a link
+ error on Solaris 9 Sparc. Reported by Dagobert Michelsen.
+
+ test: improve test infrastructure
+ * tests/envvar-check: New file, copied from grep, with the addition
+ of the EDITOR and GREP_OPTIONS envvar names.
+ * tests/Makefile.am (EXTRA_DIST): Add it.
+ (TESTS_ENVIRONMENT): Revamp, to be more like that of grep.
+
+2016-07-31 Jim Meyering <meyering@fb.com>
+
+ maint: remove gl/lib/reg*.c.diff; no longer needed
+ * gl/lib/regcomp.c.diff: Remove file, now that gnulib's
+ regcomp.c compiles regex.c with -Wno-unused-parameter.
+ * gl/lib/regex_internal.c.diff: This file induced a change to ensure
+ that the "Idx" type was unsigned and to remove a few "VAR < 0"
+ comparisons. These days, it is probably fine to stay in sync with
+ gnulib/glibc's copies
+ of these files, so remove these patches, too.
+ * gl/lib/regexec.c.diff: Likewise.
+ Prompted by a report by Assaf Gordon and a suggestion from Paul Eggert.
+
+ tests: colors: fix a portability problem and work around a shell bug
+ * tests/colors (e): Fix a portability bug: use printf '\033'
+ rather than '\e' to generate the required byte sequence, since
+ for some shells (at least dash 0.5.8), the latter doesn't work.
+ Work around a shell bug whereby "local tab=$(printf '\t')"
+ would result in an empty value for "$tab": hoist each "tab"
+ definition up/out of its function to global scope.
+ Reported by Assaf Gordon in http://debbugs.gnu.org/24116#8
+
+2016-07-23 Jim Meyering <meyering@fb.com>
+
+ gnulib: update to latest; and tests/init.sh
+ * gnulib: Update to latest.
+ * init.sh: Update from gnulib.
+
+2016-05-30 Jim Meyering <meyering@fb.com>
+
+ maint: arrange for "make distcheck" to work with unreleased automake
+ * dist-check.mk (my-distcheck): Remove all .deps directories
+ before performing the recursive comparison.
+
+2016-05-24 Glenn Morris <rgm@gnu.org>
+
+ doc: fix a reference to emacs' emerge node
+ * doc/diffutils.texi (Interactive Merging): Correct a reference to
+ emacs' emerge node: s/emerge/Emerge/.
+ This addresses http://debbugs.gnu.org/23613
+
+2016-04-30 Jim Meyering <meyering@fb.com>
+
+ maint: arrange for better URLs in generated announcement message
+ * cfg.mk (url_dir_list): Define. I had been correcting the generated
+ URLs by hand, just before the announcement. This is better.
+
+2016-03-15 Jim Meyering <meyering@fb.com>
+
+ maint: don't ignore gitlog-to-changelog failure
+ * Makefile.am (gen-ChangeLog): Don't ignore failure of
+ gitlog-to-changelog. This syncs to coreutils' copy of this rule.
+
+2016-03-06 Giuseppe Scrivano <gscrivano@gnu.org>
+
+ diff: --color: fix an infinite recursion bug
+ * src/diff.h (presume_output_tty): New extern variable.
+ * src/diff.c (PRESUME_OUTPUT_TTY_OPTION): New enum.
+ (group_format_option): Add '-presume-output-tty'.
+ (main): Handle PRESUME_OUTPUT_TTY_OPTION.
+ * src/util.c: New variable `presume_output_tty'.
+ (check_color_output): Handle presume_output_tty.
+ (set_color_context): Call process_signals only when color_context is
+ not RESET_CONTEXT.
+ * tests/colors: Check that diff doesn't crash when interrupted
+ in the middle of a color sequence.
+
+ Reported by Gisle Vanem in http://debbugs.gnu.org/22067
+
+2016-01-31 Jim Meyering <meyering@fb.com>
+
+ maint: update prereq version of gettext
+ * configure.ac: Increase designated gettext version to 0.19.2
+ * bootstrap.conf (buildreq): Likewise.
+ Remove now-unnecessary code to remove gettext-provided files.
+
+ gnulib: update to latest
+
+2016-01-01 Jim Meyering <meyering@fb.com>
+
+ FIXME: src/diff3: plug a leak
+
+2016-01-01 Jim Meyering <meyering@fb.com>
+
+ maint: update copyright year, bootstrap, init.sh
+ Run "make update-copyright" and then...
+
+ * gnulib: Update to latest.
+ * tests/init.sh: Update from gnulib.
+ * bootstrap: Likewise.
+
+2015-12-06 Jim Meyering <meyering@fb.com>
+
+ diff --brief no longer mistakenly reports diff. with 0-sized /proc/ files
+ Normally, it is safe to assume two regular files are different when
+ their st_size values are different. However, that assumption may
+ be invalid if either value is zero, as happens with files on Linux
+ /proc and /sys file systems. Since skipping this optimization will
+ usually cost very little (one read syscall, to read zero bytes),
+ it is fine to accommodate those unusual files.
+ * src/analyze.c (diff_2_files): Do not assume regular files differ
+ just because their st_size values differ when one or more is 0.
+ * src/diff.c (compare_files): Likewise.
+ * tests/brief-vs-proc-stat-zero: New test.
+ * tests/Makefile.am: Add it.
+ * NEWS (Bug fixes): Describe it.
+ Reported by Stephan Müller in http://debbugs.gnu.org/21942
+
+ tests: arrange to print any skipped-test explanation to tty, too
+ I noticed that when a test was skipped, the reason was not printed.
+ This fixes it. In coreutils, this variable is set in init.cfg,
+ but there is no point in putting the definition so far from the
+ code that chooses the file descriptor number in tests/Makefile.am.
+ * tests/Makefile.am (TESTS_ENVIRONMENT) [stderr_fileno_]: Define
+ here (to 9), right next to the companion "9>&2".
+
+2015-11-29 Jim Meyering <meyering@fb.com>
+
+ build: add gperf to the list of required programs
+ * bootstrap.conf (buildreq): Add gperf to the list.
+ Reported by Stephan Müller in http://debbugs.gnu.org/21945
+
+2015-11-29 Giuseppe Scrivano <gscrivano@gnu.org>
+
+ tests: Add tests for --color and --palette
+ * tests/colors: New file.
+ * tests/Makefile.am (TESTS): Add colors.
+
+ doc: mention --color and --palette in NEWS
+
+ diff: add --palette
+ * bootstrap (gnulib_modules): Add 'argmatch'.
+ * doc/diffutils.texi: Add documentation for --palette
+ * src/diff.h (set_color_palette): New prototype.
+ * src/diff.c (set_color_palette): New function.
+ (color_palette): New variable.
+ * src/utils.c: Include "argmatch.h".
+ (struct bin_str): New struct.
+ (struct color_ext_type): New struct.
+ (color_indicator): New array.
+ (indicator_name): New array.
+ (indicator_no): New enum.
+ (parse_state): New enum.
+ (put_indicator): New function.
+ (get_funky_string): New function. Copied from coreutils ls.
+ (parse_diff_color): New function. Copied from coreutils ls
+ "parse_ls_color" function.
+ (set_color_context): Use put_indicator instead of directly
+ outputting the sequence.
+ * po/POTFILES.in: Add 'lib/argmatch.c'
+
+ diff: add support for --color
+ * doc/diffutils.texi (diff Options): Add documentation for --color.
+ Copied from coreutils ls --color.
+ * src/context.c (pr_unidiff_hunk): Set the color context.
+ (print_context_header): Likewise.
+ (pr_context_hunk): Likewise.
+ * src/diff.h (enum colors_style): New enum to record when to use colors.
+ (colors_style): New variable to memorize the argument value.
+ (set_color_context): Add function definition.
+ * src/diff.c: : Define COLOR_OPTION.
+ (specify_colors_style): New function.
+ (longopts): Add --color.
+ (main): Handle --color argument.
+ (option_help_msgid): Add usage string for --color.
+ * src/normal.c (print_normal_hunk): Set the color context.
+ * src/side.c (print_1sdiff_line): Likewise.
+ * src/util.c (print_1_line_nl): New function.
+ (print_1_line): Make it a wrapper of 'print_1_line_nl'.
+ (colors_enabled): New boolean variable.
+ (begin_output): Call check_color_output once the output file is
+ configured.
+ (output_1_line): Periodically call `process_signals'.
+ (caught_signals): New sigset_t.
+ (colors_enabled): New boolean variable.
+ (interrupt_signal): New sig_atomic_t.
+ (stop_signal_count): New sig_atomic_t.
+ (check_color_output): New function.
+ (install_signal_handlers): Likewise. Copied from coreutils ls.
+ (process_signals): Likewise. Copied from coreutils ls.
+ (set_color_context): New function.
+ (sighandler): Likewise. Copied from coreutils ls.
+ (stophandler): Likewise. Copied from coreutils ls.
+
+2015-09-24 Andreas Grünbacher <agruen@gnu.org>
+
+ diff: Improve help text of option --label
+ * src/diff.c (option_help_msgid): Improve help text of option --label.
+
+2015-09-01 Jim Meyering <meyering@fb.com>
+
+ build: correct man-page generation rule
+ The PATH was set incorrectly, so that the diff used by
+ help2man was the one from $PATH, rather than the just-built
+ one.
+ * man/Makefile.am (bin_dir): New variable, to...
+ (dist_man1_MANS): ...prepend ../src to PATH, not just "..".
+ Also, add a test to ensure that each $(bin_dir)/$$base is
+ executable, so this doesn't happen again.
+ In http://debbugs.gnu.org/21023, Rodrigo Valiña
+ Gutiérrez reported that diff.1 from the diffutils-3.3 tarball
+ contained no description of the then-new --no-dereference option.
+
+2015-07-10 Jim Meyering <meyering@fb.com>
+
+ doc: --no-dereference: improve wording/description
+ * doc/diffutils.texi (Comparing Directories): Correct grammar.
+ (diff Options) [--no-dereference]: Say a little more.
+
+2015-01-01 Jim Meyering <meyering@fb.com>
+
+ maint: update copyright year ranges to include 2015; update gnulib
+
+2014-12-12 KO Myung-Hun <komh@chollian.net>
+
+ diff: skip test if seek is not possible on OS/2 kLIBC
+ This fixes the problem that 'diff - file' and 'cat file | diff - file'
+ fail due to a seek failure with a message 'diff.exe: -: Invalid seek',
+ because seek does not work on stdin and a pipe on OS/2 kLIBC.
+
+ * src/io.c (sip): Set skip_test to true if seek is not possible on
+ OS/2 kLIBC.
+
+2014-12-09 Jim Meyering <meyering@fb.com>
+
+ gnulib: update to latest
+
+2014-12-09 KO Myung-Hun <komh78@gmail.com>
+
+ build: double-quote use of $PATH
+ * man/Makefile.am (dist_man1_MANS): On OS/2, PATH_SEPARATOR is ';',
+ but unquoted, that is interpreted as the shell's statement
+ terminator. Quote it.
+
+2014-10-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: fix integer overflow problem with --tabsize
+ Reported by Tobias Stoeckmann in: http://bugs.gnu.org/18857
+ * src/diff.c (main): Don't overflow if INTMAX_MAX / 2 < tabsize.
+ * tests/bignum: New file, to test for this bug.
+ * tests/Makefile.am (TESTS): Add it.
+
+2014-09-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ doc: mention diff -B fix in NEWS
+
+ diff: fix bug with diff -B and incomplete lines
+ Reported by Navin Kabra via Eric Blake in:
+ http://bugs.gnu.org/18402
+ * src/util.c (analyze_hunk): Don't mishandle incomplete
+ lines at end of file.
+ * tests/no-newline-at-eof: Test for the bug.
+
+ diff: fix performance bug with prefix computation
+ * src/io.c (find_identical_ends): Fix performance bug:
+ the test for when the prefix was needed messed up by
+ the 2002-02-28 integer-overflow fixes, causing performance to be
+ worse than it needed to be.
+
+2014-08-23 Jim Meyering <meyering@fb.com>
+
+ gnulib: update to latest, as well as bootstrap
+
+ maint: update copyright year range in texinfo documentation
+ * doc/diffutils.texi: Update copyright.
+
+2014-04-15 Jim Meyering <meyering@fb.com>
+
+ maint: update bug-reporting address
+ * README: Change bug-gnu-utils@... to bug-diffutils@gnu.org.
+ * doc/diffutils.texi: Likewise.
+ Reported by Jamie Landeg Jones.
+
+2014-03-26 Paul Eggert <eggert@penguin.cs.ucla.edu>
+
+ diff: fix two "..." typos in --help output
+ * src/diff.c (option_help_msgid): Remove two "..." typos (Bug#17102).
+
+2014-03-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ doc: improve documentation about reading and stdin
+ See Bug#17075.
+ * doc/diffutils.texi (Comparison): Say that files need not be read.
+ (Invoking diff): Remove confusing remark about 'diff - -'.
+ It's not that useful, and it's not portable anyway.
+
+2014-02-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff, sdiff: minor integer overflow fixes
+ * src/context.c (find_hunk):
+ Simplify, now that 2 * context + 1 cannot overflow.
+ * src/diff.c (main):
+ * src/sdiff.c (interact):
+ Don't rely on undefined behavior on signed integer overflow.
+ * src/diff.c (main): Don't let contexts exceed CONTEXT_MAX.
+ * src/system.h (CONTEXT_MAX): New macro.
+
+ diff: fix bug with -I and overlapping hunks
+ Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16864>.
+ * src/context.c (find_hunk): Threshold is CONTEXT only if
+ the second change is ignorable.
+ * tests/ignore-matching-lines: New test.
+ * tests/Makefile.am (TESTS): Add it.
+
+2014-02-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: remove TOO_EXPENSIVE heuristic
+ Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16848>.
+ The simplest solution is to remove the TOO_EXPENSIVE heuristic
+ that I added to GNU diff in 1993. Although appropriate for
+ circa-1993 hardware, these days the heuristic seems to be more
+ trouble than it's worth.
+ * NEWS: Document this.
+ * doc/diffutils.texi (Overview): Modernize citations.
+ Remove mention of TOO_EXPENSIVE heuristic.
+ * src/analyze.c (diff_2_files): Adjust to TOO_EXPENSIVE-related
+ API changes in gnulib's diffseq module.
+
+ build: update gnulib submodule to latest
+
+2014-01-31 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: exit with status 1, not 2, when binary files differ
+ Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16608>.
+ * NEWS:
+ * doc/diffutils.texi (Binary, Invoking diff): Document this.
+ * src/analyze.c (briefly_report): Return void, not int.
+ All uses changed. Do not futz with exit status. Simplify.
+ * tests/binary: Adjust to match new behavior.
+
+2013-09-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ build: omit -Wsuggest-attribute=pure for lib
+ * configure.ac (WARN_CFLAGS): Omit -Wsuggest-attribute=pure
+ when compiling the lib subdirectory. Reported for Fedora 19
+ by Eric Blake in <http://bugs.gnu.org/15463>.
+
+2013-08-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ cmp, diff, sdiff: tune by using rawmemchr
+ On my platform (AMD Phenom II X4 910e, Fedora 17 x86-64), this sped up
+ 'cmp -n 8GiB /dev/full /dev/zero' by a factor of 3.8, and
+ 'cmp -sn 8GiB /dev/full /dev/zero' by a factor of 1.8.
+ * bootstrap.conf (gnulib_modules): Add rawmemchr.
+ * src/cmp.c (cmp): Optimize the common case where buffers are the same,
+ by using count_newlines rather than block_compare_and_count.
+ (block_compare_and_count): Remove.
+ (count_newlines): New function.
+ * src/cmp.c (count_newlines):
+ * src/io.c (prepare_text):
+ * src/sdiff.c (lf_copy, lf_skip, lf_snarf):
+ Use rawmemchr instead of memchr, for speed.
+
+2013-08-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ cmp: tune 'cmp a b' for GCC x86
+ Performance problem reported by David Balažic in:
+ http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00013.html
+ * src/system.h (word): Make it size_t, not uintmax_t.
+ This sped up plain cmp 90% on my tests (GCC 4.8.1, x86).
+
+2013-07-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ build: update gnulib submodule to latest
+
+2013-05-06 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ build: enable 'subdir-objects' automake option
+ The future major Automake version (2.0, ETA at least one year from now)
+ might enable that option unconditionally, so better get prepared in due
+ time.
+
+ * configure.ac (AM_INIT_AUTOMAKE): Adjust.
+ (AM_PROG_CC_C_O): New, required by Automake up to 1.13.x when the
+ 'subdir-objects' is in use.
+
+2013-04-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ build: update gnulib submodule to latest
+
+2013-04-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: fix bug with Asian file names
+ Problem reported by Errembault Philippe in:
+ http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html
+ * NEWS: Document this.
+ * src/dir.c (compare_names): Fall back on file_name_cmp if
+ compare_collated returns 0, unless ignoring file name case.
+ (diff_dirs): Don't bother with the O(N**2) stuff unless ignoring
+ file name case.
+ * tests/Makefile.am (TESTS): Add strcoll-0-names.
+ * tests/strcoll-0-names: New file.
+
+ diff: remove unnecessary decl
+ * src/dir.c (compare_names_for_qsort): Remove declaration.
+ Not needed now that we assume C89.
+
+ diff: tune compare_names_for_qsort
+ * src/dir.c (compare_collated): New function.
+ (compare_names): Use it.
+ (compare_names_for_qsort): Use it. This is a bit more efficient
+ as it can avoid a double invocation of file_name_cmp when
+ file_name_cmp returns zero.
+
+2013-03-30 Jim Meyering <meyering@fb.com>
+
+ doc: mention new option, --no-dereference in 3.3's NEWS
+ * NEWS (New feeatures): Update 3.3's news to mention --no-dereference.
+ Reported by Denis Excoffier.
+ * Makefile.am (old_NEWS_hash): Update, since this modifies old, and
+ normally-immutable NEWS.
+
+2013-03-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ tests: port to Solaris 10 /bin/sh
+ * tests/Makefile.am (TESTS_ENVIRONMENT):
+ Use "FOO=val; export FOO" rather than "export FOO=val",
+ as the latter form doesn't work with Solaris /bin/sh.
+ Problem found when trying to run "make check" on Solaris 10.
+
+2013-03-24 Jim Meyering <meyering@fb.com>
+
+ maint: post-release administrivia
+ * NEWS: Add header line for next release.
+ * .prev-version: Record previous version.
+ * cfg.mk (old_NEWS_hash): Auto-update.
+
+ version 3.3
+ * NEWS: Record release date.
+
+2013-03-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ doc: fix menu typo
+ * doc/diffutils.texi (Comparing Three Files): Fix out-of-order menu.
+ Bug caught by Texinfo 5.0.
+
+ maint: update build procedure to recent gettext etc.
+ * bootstrap.conf (gnulib_modules): Add vararrays.
+ (needed_gnulib_files, unnecessary_gettext_files): New vars.
+ (bootstrap_post_import_hook): New function, to implement these vars.
+ (excluded_files): Remove; 'bootstrap' no longer supports this.
+ Its function is now performed by unnecessary_gettext_files.
+ (buildreq): Update automake to 1.12.2, to avoid CVE-2012-3386.
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Bump from 0.17 to 0.18.2,
+ to lessen the probability that we'll have outlandishly old files
+ during a build.
+ * m4/vararrays.m4: Remove from repository, as we now use the
+ gnulib version.
+
+2013-03-21 Jim Meyering <jim@meyering.net>
+
+ build: update gnulib to latest and adapt; update bootstrap, too
+ Blindly updating to the latest from gnulib, bootstrap would
+ fail due to failure of our local patches to apply. Hence,
+ these first two updates.
+ * gl/lib/regex_internal.c.diff: Update offsets, so this patch
+ applies to the latest from gnulib.
+ * gl/lib/regex_internal.h.diff: Remove file. No longer needed.
+ * bootstrap: Update from gnulib.
+
+2013-01-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ tests: port to hosts lacking fmt, make -C
+ * tests/Makefile.am (built_programs): Don't assume fmt works.
+ Don't rely on 'make -C', either.
+
+ maint: update .gitignore for recent gnulib
+ * .gitignore: Add tests/*.trs and several *.h and *.sed files in lib,
+
+2013-01-04 Jim Meyering <jim@meyering.net>
+
+ build: update gnulib submodule to latest
+
+ maint: update all copyright year number ranges
+ Run "make update-copyright".
+
+2012-10-23 Eric Blake <eblake@redhat.com>
+
+ build: default to --enable-gcc-warnings in a git tree
+ Anyone building from cloned sources can be assumed to have a new
+ enough environment, such that enabling gcc warnings by default will
+ be useful. Tarballs still default to no warnings, and the default
+ can still be overridden with --disable-gcc-warnings.
+ * configure.ac (gl_gcc_warnings): Set default based on environment.
+
+2012-10-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/diffutils.texi (cmp Options): Document -l format better.
+
+2012-09-10 Jim Meyering <meyering@redhat.com>
+
+ maint: use xasprintf in place of xmalloc+sprintf
+ * bootstrap.conf (gnulib_modules): Add gnulib's xvasprintf module.
+ * src/util.c: Include "xvasprintf.h".
+ (begin_output): Use xasprintf in place of xmalloc+sprintf.
+
+2012-09-10 Andreas Gruenbacher <agruen@gnu.org>
+
+ diff: encode file names with special characters
+ * src/util.c (c_escape_char): New function.
+ (c_escape): New function.
+ (begin_output): Escape file names when needed.
+ * src/context.c (print_context_header): New names parameter.
+ (print_context_label): New name parameter.
+ * src/diff.h (print_context_header): Change prototype.
+ * tests/filename-quoting: New file.
+ * NEWS: Document this change.
+
+2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: silence GCC warning instead of slowing down
+ * src/dir.c (find_dir_file_pathname): Use 'IF_LINT (volatile)' to
+ silence the gcc warning, rather than using 'volatile', as the
+ warning appears to be bogus.
+
+2012-08-28 Jim Meyering <meyering@redhat.com>
+
+ diff: avoid possible longjmp-triggered misbehavior
+ * src/dir.c (find_dir_file_pathname): gcc 4.8.0 20120825 reported
+ that a local variable's value might be clobbered. Declare "match"
+ to be volatile.
+
+ build: update gnulib, bootstrap and init.sh to latest
+
+ maint: avoid new syntax-check failure due to @xref use
+ * doc/diffutils.texi: Change several "; @xref{..." to ". @xref{...",
+ since @xref should start a sentence.
+
+2012-05-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ maint: remove ms subdirectory
+ diffutils is now designed to build with Cygwin or MinGW.
+ The old DJGPP stuff probably doesn't work anyway.
+ * Makefile.am (SUBDIRS): Remove ms.
+ * NEWS: Document this.
+ * configure.ac (AC_CONFIG_FILES): Remove ms/Makefile.
+ * ms/Makefile.am, ms/README, ms/config.bat, ms/config.sed:
+ * ms/config.site: Remove.
+
+2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ maint: update bootstrap from gnulib
+ * bootstrap: Update from gnulib.
+
+ main: port subcommands to mingw
+ Problem reported by Eli Zaretskii in
+ <http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00013.html>.
+ Approach suggested by Bruno Haible as option (4) in
+ <http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00036.html>.
+ * bootstrap.conf (gnulib_modules): Add system-quote.
+ * src/diff3.c, src/sdiff.c, src/util.c:
+ Include <system-quote.h>, not <sh-quote.h>.
+ * src/diff3.c (read_diff):
+ * src/sdiff.c (main, edit):
+ * src/util.c (begin_output):
+ Use system_quote_argv, for portability to Mingw.
+ * src/sdiff.c (NUM_SIGS, handler_index_of_SIGINT): Now enum
+ values, not macros; this is cleaner and avoids a GCC warning if
+ !HAVE_WORKING_VFORK.
+ * src/util.c (begin_output) [! HAVE_WORKING_FORK]: Do not use -f,
+ for consistency with the HAVE_WORKING_FORK code.
+
+ maint: update bootstrap from gnulib
+ * bootstrap: Update from gnulib.
+
+ maint: m4/gnulib-cache.m4 is not under version control
+ This is like what coreutils does, and suppresses 'git status' chatter.
+ * .gitignore: Add /m4/gnulib-cache.m4.
+
+ Use binary mode when testing for binary files.
+ This reverts the 2006-01-05 change and modernizes to the current API.
+ Idea suggested by Eli Zaretskii in:
+ http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00066.html
+ * src/cmp.c (main):
+ * src/diff.c (main, compare_files):
+ Use set_binary_mode rather than SET_BINARY.
+ * src/diff.c (compare_files): Omit unnecessary use of O_BINARY.
+ * src/io.c (sip): Sample unknown files in binary mode, to see
+ whether they are binary.
+ (read_files): Read binary files in binary mode.
+
+ build: update gnulib submodule to latest
+
+2012-05-13 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ build: omit obsolete AM_PROG_CC_STDC macro
+ The Automake-provided macro 'AM_PROG_CC_STDC' has been superseded by
+ the Autoconf-provided one 'AC_PROG_CC' since October 2002, and will
+ be removed in the next major automake version.
+ * configure.ac (AM_PROG_CC_STDC): Drop it.
+
+2012-05-05 Jim Meyering <meyering@redhat.com>
+
+ diff: fix a typo that was always disabling the same_special_file macro
+ * src/system.h (same_special_file): Correct cpp guard expression:
+ s/HAVE_ST_RDEV/HAVE_STRUCT_STAT_ST_RDEV/. Reported by Eli Zaretskii.
+
+2012-04-17 Jim Meyering <meyering@redhat.com>
+
+ maint: update bootstrap from gnulib
+ * bootstrap: Update from gnulib.
+
+2012-03-07 Eric Blake <eblake@redhat.com>
+
+ usage: improve wording of --ignore-matching-lines
+ * src/diff.c (option_help_msgid): Tweak wording.
+
+2012-03-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ doc: explain -I RE better in --help output
+ * src/diff.c, src/sdiff.c (option_help_msgid): For -I RE,
+ change "whose lines all match" to "all whose lines match" to avoid
+ unintended interpretation. Reported by Danijel Tasov in
+ <http://bugs.debian.org/648411>.
+
+2012-02-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ sdiff: remove dependency on sigprocmask
+ * bootstrap.conf (gnulib_modules): Remove sigprocmask.
+ * src/sdiff.c (temporary_file): No need to invoke sigprocmask
+ here, since the signal handler merely sets a flag.
+
+2012-02-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: -N, --unidirectional-new-file now compare to "-" too
+ * NEWS: Document this.
+ * doc/diffutils.texi (Comparing Directories): Likewise.
+ Also, document that these options work at the top level.
+ * src/diff.c (compare_files): Treat EBADF like ENOENT, to handle
+ the case where "-" is closed. Allow the other file to be
+ STDIN_FILENO, in case it's "-".
+ * tests/Makefile.am (TESTS): Add new-file.
+ * tests/new-file: New file.
+
+2012-01-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ maint: quote 'like this' or "like this", not `like this'
+ This is in response to a recent change in the GNU coding standards,
+ which now suggest quoting 'like this' or "like this", instead of
+ `like this' or ``like this''.
+ * HACKING, NEWS, README, README-hacking, TODO, doc/diagmeet.note:
+ * doc/diffutils.texi, ms/config.bat, ms/config.site:
+ * src/analyze.c, src/cmp.c, src/context.c, src/diff.c:
+ * src/diff.h, src/diff3.c, src/dir.c, src/ifdef.c, src/io.c:
+ * src/sdiff.c, src/side.c, src/system.h, src/util.c:
+ * tests/help-version:
+ Quote 'like this' or "like this" in commentary.
+ * cfg.mk (old_NEWS_hash): Adjust to reflect new NEWS quoting.
+ * man/help2man: Update to 1.40.4 version, with quoting fixed as above.
+ * po/en.po: Remove translation involving `, as it's no longer needed.
+ * src/cmp.c (try_help, specify_ignore_initial, usage, main):
+ * src/diff.c (main, try_help, option_help_msgid, specify_value)
+ (compare_files):
+ * src/diff3.c (main, try_help, option_help_msgid, usage)
+ (read_diff):
+ * src/dir.c (compare_names):
+ * src/sdiff.c (try_help, usage, check_child_status, main):
+ * src/util.c (finish_output):
+ * tests/help-version:
+ Quote 'like this' in output.
+
+ build: update gnulib submodule to latest
+
+2012-01-12 Jim Meyering <meyering@redhat.com>
+
+ build: accommodate newer bootstrap from gnulib
+ * bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
+ and --makefile-name=gnulib.mk. Also remove now-obsolete $bt/ prefix.
+ * bootstrap: Update from gnulib.
+ * tests/init.sh: Update from gnulib.
+ * lib/Makefile.am: Initialize numerous variables, so that
+ generated code in gnulib.mk may use += to append to them.
+
+ maint: avoid new syntax-check failure
+ * src/diff.c (compare_files): Use STREQ, not strcmp.
+
+2012-01-08 Bruno Haible <bruno@clisp.org>
+
+ New option --no-dereference.
+ * src/diff.h (no_dereference_symlinks): New variable.
+ * src/diff.c: Include xreadlink.h.
+ (longopts): Add --no-dereference option.
+ (main): Accept --no-dereference option.
+ (option_help_msgid): Mention the --no-dereference option.
+ (compare_files): If no_dereference_symlinks is true, use lstat()
+ instead of stat(). Compare symbolic links by comparing their values.
+ * bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink.
+ * doc/diffutils.texi (Comparing Directories, diff Options): Mention the
+ --no-dereference option.
+ * tests/no-dereference: New file.
+ * tests/Makefile.am (TESTS): Add it.
+
+2012-01-01 Jim Meyering <meyering@redhat.com>
+
+ maint: update all copyright year number ranges
+ Run "make update-copyright".
+
+2011-12-14 Jim Meyering <meyering@redhat.com>
+
+ build: update to latest gnulib and adapt
+ * tests/binary: Reverse arguments to compare to avoid failure of
+ new syntax-check rule.
+ * configure.ac: Use -Wno-format-nonliteral.
+ Mark functions as pure of const, per recommendations enabled by
+ new gcc -W options. Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
+ * lib/cmpbuf.h (buffer_lcm, block_compare):
+ Apply pure and/or const attributes.
+ * src/cmp.c (block_compare): Likewise.
+ * src/context.c (find_hunk): Likewise.
+ * src/diff.h (lines_differ): Likewise.
+ * src/diff3.c (skipwhite): Likewise.
+ * src/dir.c (dir_loop): Likewise.
+ * src/util.c (find_change, find_reverse_change): Likewise.
+ (translate_line_number): Likewise.
+
+ build: stop distributing gzip'd releases; xz is enough
+ * configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip.
+
+2011-11-29 Jim Meyering <meyering@redhat.com>
+
+ tests: use "compare exp out", not "compare out exp"
+ Likewise, when an empty file is expected, use "compare /dev/null out",
+ not "compare out /dev/null". I.e., specify the expected/desired contents
+ via the first file name. Prompted by a suggestion from Bruno Haible
+ in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154
+
+ Run these commands:
+
+ git grep -l -E 'compare [^ ]+ exp' \
+ |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
+ git grep -l -E 'compare [^ ]+ /dev/null' \
+ |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'
+
+ But manually convert this one:
+
+ -compare out exp-$(echo $opt|tr ' ' _)
+ +compare exp-$(echo $opt|tr ' ' _) out
+
+ and avoid an inappropriate change to cfg.mk.
+
+2011-10-12 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: use more portable fd redirection in TESTS_ENVIRONMENT
+ * tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2'
+ is not portable to various Korn shells, and to (at least) HP-UX 11
+ /bin/sh. Use a more portable idiom.
+ See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for
+ lots of discussion.
+
+2011-10-11 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: make test runner a script, not a shell function
+ All the test scripts in the diffutils testsuite are shell scripts,
+ so the current definition of TESTS_ENVIRONMENT, which adaptively
+ run tests using either perl or the shell depending on their kind,
+ is an overkill.
+
+ Moreover, this change is required in order for the testsuite to
+ continue to work with the new testsuite harness that is planned
+ to be introduced in Automake 1.12 (which, as of the writing date,
+ is still under development and in late alpha state).
+
+ See also related discussion on bug-coreutils:
+ <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>
+
+ * tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the
+ `shell_or_perl_' shell function, which is not required anymore.
+ (LOG_COMPILER): New, define to `$(SHELL)'.
+ * tests/binary: Make executable.
+ * tests/colliding-file-names: Likewise.
+ * tests/excess-slash: Likewise.
+ * tests/no-newline-at-eof: Likewise.
+
+2011-10-04 Claudio Bley <claudio.bley@gmail.com>
+
+ portability: use SET_BINARY rather than xfreopen (NULL, ...
+ * src/diff.c: Include binary-io.h, not xfreopen.h.
+ (main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...),
+ because the latter doesn't work on MinGW and crashes using MSVC.
+ * src/cmp.c (main): Likewise.
+
+2011-10-04 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+2011-09-02 Jim Meyering <meyering@redhat.com>
+
+ post-release administrivia
+ * NEWS: Add header line for next release.
+ * .prev-version: Record previous version.
+ * cfg.mk (old_NEWS_hash): Auto-update.
+
+ version 3.2
+ * NEWS: Record release date.
+
+ build: update bootstrap and tests/init.sh from gnulib
+ * bootstrap: Update from gnulib.
+ * tests/init.sh: Likewise.
+
+ build: update gnulib submodule to latest
+
+2011-09-01 Jim Meyering <meyering@redhat.com>
+
+ doc: diffutils' texi-derived doc may now be in debian's "main" section
+ * NEWS (Packaging): Mention the "no front/back-cover" change.
+
+2011-08-14 Jim Meyering <meyering@redhat.com>
+
+ maint: avoid new "make sytnax-check" failure.
+ * src/diff.h (find_dir_file_pathname): Mark declaration with "extern"
+ keyword, in order to placate the tight-scope syntax check.
+
+2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/io.c (find_and_hash_each_line): Refactor for brevity.
+
+2011-08-14 Roland McGrath <roland@hack.frob.com>
+
+ diff, sdiff: new option --ignore-trailing-space (-Z)
+ Derived from Roland McGrath's patch (dated June 2004!) in:
+ http://lists.gnu.org/archive/html/bug-gnu-utils/2004-07/msg00000.html
+ * NEWS:
+ * doc/diffutils.texi (White Space, Blank Lines)
+ (sdiff Option Summary, diff Options, sdiff Options): Document -Z.
+ * src/diff.h (IGNORE_TRAILING_SPACE)
+ (IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE): New constants, for -Z.
+ * src/diff.c (shortopts, longopts, main, option_help_msgid):
+ * src/sdiff.c (longopts, option_help_msgid, main):
+ * src/io.c (find_and_hash_each_line):
+ * src/util.c (lines_differ, analyze_hunk): Support -Z.
+
+2011-08-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap.conf (gnulib_modules): Remove timegm.
+ This fixes a problem noted by Andreas Schwab in:
+ http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00035.html
+
+2011-08-13 Tim Waugh <twaugh@redhat.com>
+
+ diff: --ignore-file-name-case now applies at top level too
+ Derived from Tim Waugh's patch in:
+ http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00034.html
+ * NEWS, doc/diffutils.texi (diff Options): Document this.
+ * src/diff.c (compare_files): Implement this, by using
+ find_dir_file_pathname.
+ * src/diff.h (find_dir_file_pathname): New decl.
+ * src/dir.c: Include filenamecat.h.
+ (find_dir_file_pathname): New function.
+
+2011-08-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * .gitignore: Add lib/unistr, lib/unused-parameter.h.
+
+2011-08-10 Jim Meyering <meyering@redhat.com>
+
+ post-release administrivia
+ * NEWS: Add header line for next release.
+ * .prev-version: Record previous version.
+ * cfg.mk (old_NEWS_hash): Auto-update.
+
+ version 3.1
+ * NEWS: Record release date.
+
+ build: use largefile module and update to latest gnulib
+ * configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
+ * bootstrap.conf (gnulib_modules): ...this. Use largefile module.
+ * gnulib: Update to latest.
+
+2011-08-08 Santiago Vila <sanvila@unex.es>
+
+ doc: insert comma in --help line for --ignore-space-change (-b)
+ * src/diff.c (option_help_msgid): Insert omitted comma between
+ "-b" and "--ignore-space-change". (tiny change)
+
+2011-08-04 Jim Meyering <meyering@redhat.com>
+
+ doc: relax restriction on front-cover and back-cover texts
+ * doc/diffutils.texi (copying): Relax restriction on front-cover
+ and back-cover texts (just as m4 did here:
+ http://git.savannah.gnu.org/cgit/m4.git/commit?id=ee1e92ec).
+ Reported by Santiago Vila. Fix suggested by Eric Blake.
+
+2011-08-03 Jim Meyering <meyering@redhat.com>
+
+ tests: update init.sh from gnulib
+ * tests/init.sh: Update from gnulib.
+
+ build: update gnulib submodule to latest
+
+2011-07-03 Jim Meyering <meyering@redhat.com>
+
+ maint: remove inclusion of unused header, for "make syntax-check"
+ * src/diff3.c: Don't include <inttostr.h>. Not used.
+ * src/context.c: Likewise.
+
+2011-06-19 Jim Meyering <meyering@redhat.com>
+
+ build: don't require perl when building from a tarball
+ But do ensure -- in all other circumstances -- that the man/*.1
+ files are rebuilt whenever the version number changes.
+ * configure.ac (SRC_VERSION_C): Define.
+ * man/Makefile.am (dist_man1_MANS): Rename from $(man1_MANS),
+ so that we distribute those pesky man/*.1 files.
+ (EXTRA_DIST): Reflect name change.
+ (MAINTAINERCLEANFILES): Define this, not DISTCLEANFILES,
+ now that these generated files are distributed.
+ ($(dist_man1_MANS)): Depend on $(SRC_VERSION_C), so we get the
+ full dependency when not building from a tarball.
+
+2011-06-13 Jim Meyering <meyering@redhat.com>
+
+ doc: do not distribute generated man/*.1 man files
+ * man/help2man: New file.
+ * man/Makefile.am: Use $(srcdir)/help2man.
+ Convert $(dist_man1_MANS) to $(man1_MANS), to tell automake
+ not to distribute the generated man/*.1 files. Now they're
+ generated at build-from-tarball time.
+ ($(man1_MANS)): Depend on version.c, so that man pages are
+ regenerated whenever the version string changes.
+
+ build: ccache works better without embedded version strings
+ * src/Makefile.am: Generate version.c and version.h and put the
+ new symbol in a tiny library to be used by each program.
+ (LDADD): Add the new library.
+ * src/cmp.c (main): Use Version, not PACKAGE_VERSION, so the .o
+ file does not change with each commit-derived version increment.
+ * src/diff.c (main): Likewise.
+ * src/diff3.c (main): Likewise.
+ * src/sdiff.c (main): Likewise.
+ * src/system.h: Include "version.h".
+ * .gitignore: Add version.[ch]
+
+2011-06-12 Jim Meyering <meyering@redhat.com>
+
+ doc: ensure each program has a man/*.x file: add "SEE ALSO" references
+ * man/cmp.x: New file.
+ * man/diff3.x: New file.
+ * man/sdiff.x: New file.
+ * man/diff.x: Add xrefs to the other three programs, and to patch.
+ * man/Makefile.am (EXTRA_DIST): List new files.
+ (cmp.1, diff3.1, sdiff.1): Depend on each .x file.
+
+ doc: rename diff.texi to diffutils.texi
+ This makes the .texi basename the same as the package name,
+ which is consistent with most other GNU packages.
+ * doc/diffutils.texi: Rename from...
+ * doc/diff.texi: ...removed.
+ * doc/Makefile.am (info_TEXINFOS): Reflect name change.
+ (diffutils_TEXINFOS): Likewise.
+ * cfg.mk (gendocs_options_): Remove this customization. It is no
+ longer needed, now that the .texi name matches that of the package.
+ * man/Makefile.am ($(dist_man1_MANS)): Remove now-unnecessary sed
+ filter.
+ * README: Update references to diffutils.texi etc. here, too.
+ * .gitignore: Update here, too.
+ Suggested by Karl Berry.
+
+2011-06-08 Karl Berry <karl@freefriends.org>
+
+ cmp, diff, diff3, sdiff: edit and align --help text.
+ * cmp.c (option_help_msgid, usage),
+ * diff.c (option_help_msgid, usage),
+ * diff3.c (option_help_msgid, usage),
+ * sdiff.c (option_help_msgid, usage): align descriptions in the --help
+ output and slightly edit content.
+
+2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: don't use locales after local-specific sorting fails
+ * src/dir.c (compare_names): Don't invoke strcasecmp if
+ locale-specific sorting fails, because POSIX.1-2008 says strcasecmp
+ has unspecified behavior outside the POSIX locale. See:
+ http://lists.gnu.org/archive/html/bug-diffutils/2011-05/msg00008.html
+
+ bootstrap: Avoid multithreading.
+ * bootstrap.conf (gnulib_tool_option_extras):
+ Add "--avoid=localename --avoid=lock", because we don't want to
+ bring in the multithreading code that recent gnulib changes would
+ otherwise bring in.
+ (excluded_files): Remove m4/lock.m4; no longer needed, now that
+ we use --avoid=lock.
+
+ build: update gnulib submodule to latest
+
+2011-05-23 Karl Berry <karl@gnu.org>
+
+ maint: update README-hacking
+ * README-hacking: Update a la coreutils for git, etc.
+
+2011-05-23 Jim Meyering <meyering@redhat.com>
+
+ maint: update gnulib to latest with accompanying tight-scope tweaks
+ * cfg.mk: Include $(srcdir)/dist-check.mk using "-include",
+ to accommodate the new sc_tight_scope rule.
+ (_gl_TS_extern): Define, to tell gnulib's tight_scope rule that
+ headers here mark externs with "XTERN".
+ * gnulib: Update to latest.
+
+2011-05-18 Jim Meyering <meyering@redhat.com>
+
+ maint: use gnulib's new readme-release module
+ * bootstrap.conf (gnulib_modules): Add readme-release.
+ (bootstrap_epilogue): Add the recommended perl one-liner.
+ * README-release: Remove file; it is now generated from gnulib.
+ * .gitignore: Add it.
+
+ build: update gnulib submodule to latest
+
+ maint: prepare for the tight-scope check
+ * src/diff.h: Mark function declarations with "extern" in
+ preparation for the tight-scope check.
+ (ignore_white_space): Separate enum decl from declaration
+ of this variable.
+ * src/Makefile.am (diff_SOURCES): Move diff.h from here to ...
+ (noinst_HEADERS): ...here.
+ For convenience, since the tight-scope rule uses $(noinst_HEADERS).
+
+ maint: don't use now-removed gnulib "exit" module
+ * bootstrap.conf (gnulib_modules): Remove "exit" module.
+ It no longer exists.
+
+2011-03-26 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+ * .x-sc_space_tab: Remove file. Instead, ...
+ * cfg.mk (exclude_file_name_regexp--sc_space_tab): ...define this.
+
+ maint: fix typo in unused rule
+ * cfg.mk (config-save): Fix typo: add leading "_" in variable name.
+
+2011-03-18 Jim Meyering <meyering@redhat.com>
+
+ doc: add a reference to wdiff(1) from diff.1
+ * man/diff.x: New file, to add "SEE ALSO" reference to wdiff(1).
+ * man/Makefile.am (diff.1): Depend on diff.x.
+ ($(dist_man1_MANS)): Tell help2man to include diff.x.
+ (EXTRA_DIST): Add diff.x.
+ Suggestion from Dan Jacobson in http://bugs.debian.org/613319
+
+2011-03-18 Eric Blake <eblake@redhat.com>
+
+ docs: info should mention -L
+ * doc/diff.texi (diff Options): Document -L.
+
+ docs: diff --help should mention -L
+ * src/diff.c (option_help_msgid): Document -L.
+
+2011-02-15 Jim Meyering <meyering@redhat.com>
+
+ doc: speak of the --test (-a) option, not "the -a or --test option"
+ Convert using this command:
+ perl -pi -e \
+ 's/(\@option{-.}) or (\@option{--.*?}) option/$2 ($1) option/' \
+ doc/diff.texi
+ Then convert some more with this:
+ perl -pi -e \
+ 's/the (\@option{-.}) or (\@option{--.*?})$/the $2 ($1)/' \
+ doc/diff.texi
+ Then convert more manually.
+
+ Suggested by Dan Jacobson
+
+2011-01-24 Jim Meyering <meyering@redhat.com>
+
+ maint: remove all uses of vfork: use fork instead
+ Our use of vfork now provokes warnings from gcc-4.6.0.
+ Also, vfork is no longer even specified by POSIX.1-2008.
+ * src/diff3.c (read_diff): Change each use of vfork to "fork".
+ Remove #ifdef'd code.
+ * src/util.c (begin_output, finish_output): Likewise.
+ * src/sdiff.c (cleanup, main, edit): Likewise.
+ (handler_index_of_SIGPIPE): Remove now-unused definition.
+ * src/system.h: Don't include <vfork.h>.
+ (vfork): Remove definition.
+ * ms/config.site: Remove reference to vfork cache variable.
+
+ tests: avoid newer but less-portable tail option syntax
+ * tests/function-line-vs-leading-space: Use sed -n '3,$p' rather than
+ tail -n+3. Older versions of tail do not accept that newer syntax.
+ Reported by Sudhakara Peram.
+
+ tests: fix an erroneous test
+ On most systems, like-named files were compared, by luck.
+ However, on others, different-named files would be compared
+ since their names were being treated as equal -- but they had
+ different content, so the test would fail.
+ * tests/colliding-file-names: Use different sets of file names
+ in d1 and d2 so that they cannot accidentally match.
+ Put the same line in each test file. This is required
+ when files named e.g., abc and ABC are compared.
+ This test was failing on a NixOS 86_64-darwin system.
+
+ build: update gnulib submodule to latest
+
+ tests: fix typo that silently disabled all tests
+ * tests/Makefile.am (TESTS): Fix typo: s/jESTS/TESTS/
+
+2011-01-23 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+ maint: avoid new syntax-check failure
+ * src/diff.c (specify_value): Use !STREQ(...), not strcmp(...) != 0.
+ * src/diff3.c (main): Likewise.
+
+2011-01-03 Jim Meyering <meyering@redhat.com>
+
+ maint: update copyright year ranges to include 2011
+ Run "make update-copyright", so "make syntax-check" works in 2011.
+
+ build: update gnulib submodule to latest
+
+2010-12-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ bootstrap: adjust to recent gnulib changes
+ * bootstrap.conf (excluded_files): Do not exclude m4/size_max.m4
+ and m4/xsize.m4 when using an external gettext, since they are
+ now needed by other gnulib modules.
+
+2010-12-16 Jim Meyering <meyering@redhat.com>
+
+ doc: add contributor guidelines: HACKING
+ * HACKING: New file, copied 99% from the one in grep's repository.
+
+2010-10-09 Jim Meyering <meyering@redhat.com>
+
+ maint: describe policy on copyright year number ranges
+ * README: Mention coreutils' long-standing policy on use of M-N
+ ranges in copyright year lists. Requested by Richard Stallman.
+
+2010-09-04 Jim Meyering <meyering@redhat.com>
+
+ maint: adjust init.sh use to conform
+ * tests/help-version: Use one line: "${srcdir=.}/init.sh"; ...
+ * tests/basic: Likewise.
+ * tests/binary: Likewise.
+ * tests/colliding-file-names: Likewise.
+ * tests/excess-slash: Likewise.
+ * tests/function-line-vs-leading-space: Likewise.
+ * tests/help-version: Likewise.
+ * tests/label-vs-func: Likewise.
+ * tests/no-newline-at-eof: Likewise.
+ * tests/stdin: Likewise.
+
+ maint: avoid shadowing warning
+ * src/dir.c (diff_dirs): Rename shadowed local cmp to "c".
+
+2010-09-03 Jim Meyering <meyering@redhat.com>
+
+ build: use gettext-h, not gettext
+ * bootstrap.conf (gnulib_modules): Use gettext-h, not gettext.
+ The latter is overkill for a package that uses
+ AM_GNU_GETTEXT([external]...
+
+ build: update build/test tools from gnulib
+ * bootstrap: Update from gnulib.
+ * tests/init.sh: Likewise.
+
+ build: update gnulib submodule to latest
+
+2010-08-14 Jim Meyering <meyering@redhat.com>
+
+ diff -r: avoid printing excess slashes in concatenated file names
+ * bootstrap.conf (gnulib_modules): Add filenamecat.
+ * src/diff.c: Include "filenamecat.h".
+ (compare_files): Use file_name_concat, rather than dir_file_pathname.
+ * src/util.c (dir_file_pathname): Remove now-unused function.
+ * src/diff.h: Remove its declaration.
+ * tests/excess-slash: New script to test for this.
+ * tests/Makefile.am (TESTS): Add it.
+ Forwarded by Santiago Vila from <bugs.debian.org/586301a>,
+ reported by Jari Aalto.
+
+2010-08-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ diff: avoid spurious diffs when two distinct dir entries compare equal
+ Problem reported by Christoph Anton Mitterer in:
+ http://lists.gnu.org/archive/html/bug-diffutils/2010-08/msg00000.html
+
+ * NEWS: Mention this bug fix.
+ * src/dir.c (compare_names_for_qsort): Fall back on file_name_cmp
+ if two distinct entries in the same directory compare equal.
+ (diff_dirs): Prefer a file_name_cmp match when available.
+ * tests/Makefile.am (TESTS): New test colliding-file-names.
+ * tests/colliding-file-names: New file.
+
+2010-05-09 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+ build: don't define macros that gnulib provides
+ * bootstrap.conf (gnulib_modules): Add signal, stdint.
+ * lib/cmpbuf.c (SA_RESTART, SA_INTERRUPT): Remove definitions.
+ (SIZE_MAX, PTRDIFF_MAX): Likewise.
+ Include <stdint.h>.
+ * src/system.h (WEXITSTATUS, WIFEXITED): Remove definitions.
+ (SA_RESTART, SA_INTERRUPT): Likewise.
+
+ build: rely on gnulib's sigprocmask module
+ * src/sdiff.c: Remove #if-!HAVE_SIGPROCMASK-guarded code.
+ * bootstrap.conf (gnulib_modules): Add sigprocmask.
+
+2010-05-04 Jim Meyering <meyering@redhat.com>
+
+ doc: README-release: don't mention To:, Cc:, etc announcement headers,
+ now that those are supplied automatically via gnulib's maint.mk.
+ * README-release: sync with coreutils.
+
+ maint: teach web-doc-generating code how to do its job
+ * cfg.mk (gendocs_options): Define, so that gendocs.sh knows
+ the name of our texinfo source file.
+ * gnulib: Update to latest, for new gnu-web-doc-update and maint.mk.
+
+2010-05-03 Jim Meyering <meyering@redhat.com>
+
+ doc: update release procedure
+ * README-release: Rearrange slightly: post the announcement to
+ Savannah first, so you can include a link to that post in the email.
+ Sync a few details from coreutils' README-release.
+
+ post-release administrivia
+ * NEWS: Add header line for next release.
+ * .prev-version: Record previous version.
+ * cfg.mk (old_NEWS_hash): Auto-update.
+
+ version 3.0
+ * NEWS: Record release date.
+
+ build: update gnulib submodule to latest
+
+2010-04-30 Jim Meyering <meyering@redhat.com>
+
+ build: use gnulib's sys_wait module
+ * bootstrap.conf (gnulib_modules): Use gnulib's sys_wait module,
+ now that we assume its presence.
+
+ build: update gnulib submodule to latest
+ * bootstrap: Also update from gnulib.
+ * tests/init.sh: Likewise
+
+ maint: remove now-useless #if HAVE_HEADER_H guards
+ * src/system.h: Include <sys/wait.h> unconditionally,
+ now that gnulib guarantees its presence.
+ * lib/cmpbuf.c: Likewise for <unistd.h> and <inttypes.h>.
+
+2010-04-16 Jim Meyering <meyering@redhat.com>
+
+ tests: use original no-newline-at-eof test, but with -U1, not -U2
+ * tests/no-newline-at-eof: Revert to the smaller test, but with
+ -U1 rather than -U2, since that actually triggers the bug.
+
+2010-04-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Followon improvements for the fix for Debian bug 577832.
+ * src/io.c (find_and_hash_each_line): Omit the inserted newline in
+ a simpler way.
+ * tests/no-newline-at-eof: Fix the test case so that it rejects
+ the old, buggy behavior.
+
+2010-04-16 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+ tests: test for the no-newline-at-EOF bug
+ * tests/no-newline-at-eof: New file.
+ * tests/Makefile.am (TESTS): Add it.
+
+2010-04-16 Jim Meyering <meyering@redhat.com>
+
+ diff: fix a regression when at least one input lacks a newline-at-EOF,
+ and the final hunk plus context-length aligns exactly with the end
+ of the newline-lacking file. Diff would fail to output the required
+ "\ No newline at end of file" line, thus rendering the output invalid.
+ This bug appears to have been introduced by 2006-05-07
+ commit 58d0483b, "(find_identical_ends): Fix huge performance bug...",
+ at least to the extent that reverting that change fixes the bug.
+ Considering the stated effect of that change and lack of metrics,
+ reverting it is not an option, so here we take a more direct approach.
+
+ Given these inputs,
+
+ printf '\n1'>a; printf '\n0\n\n1'>b
+
+ and running diff like this:
+
+ ./diff -U1 a b
+
+ for input file "b", the pointer, files[1].linbuf[4][-1], to
+ the last byte on the final line was mistakenly pointing at the
+ sentinel newline at EOF, rather than at the preceding byte.
+
+ (gdb) p files[1].linbuf[4][-1]
+ $3 = 10 '\n'
+
+ Thus, this test in the final print_1_line call:
+
+ if ((!line_flag || line_flag[0]) && limit[-1] != '\n')
+ fprintf (out, "\n\\ %s\n", _("No newline at end of file"));
+
+ would fail, because limit[-1] (which is files[1].linbuf[4][-1])
+ was mistakenly '\n', rather than the desired '1'.
+
+ My first thought was simply to adjust the final linbuf[line] setting,
+ at the end of io.c's find_and_hash_each_line function function:
+
+ if (p == bufend)
+ - break;
+ + {
+ + if (current->missing_newline)
+ + --linbuf[line];
+ + break;
+ + }
+
+ But that would make diff misbehave with this input
+ (same as above, but with a newline appended to "a"),
+
+ printf '\n1\n'>a; printf '\n0\n\n1'>b
+ ./diff -U1 a b
+
+ due to the block (100 lines above) that is triggered in that case
+ (but not in the both-files-missing-newline case):
+
+ if (p == bufend
+ && current->missing_newline
+ && ROBUST_OUTPUT_STYLE (output_style))
+ {
+ /* This line is incomplete. If this is significant,
+ put the line into buckets[-1]. */
+ if (ignore_white_space < IGNORE_SPACE_CHANGE)
+ bucket = &buckets[-1];
+
+ /* Omit the inserted newline when computing linbuf later. */
+ p--;
+ bufend = suffix_begin = p;
+ }
+
+ Note how "p" is decremented and "bufend" adjusted.
+ When that happens, we certainly don't want to decrement
+ "bufend" yet again.
+
+ Since there is no other way to determine at the end whether "bufend"
+ was already decremented, add a new variable to serve as witness.
+
+ * NEWS (Bug fixes): Mention it.
+ Reported by Timo Juhani Lindfors in http://bugs.debian.org/577832.
+ Forwarded by Santiago Vila.
+
+2010-04-16 Jim Meyering <meyering@redhat.com>
+
+ tests: update init.sh from gnulib
+ * tests/init.sh: Update from gnulib.
+
+2010-04-08 Jim Meyering <meyering@redhat.com>
+
+ build: include cfg.mk and dist-check.mk in the distribution tarball
+ * Makefile.am (EXTRA_DIST): Add cfg.mk and dist-check.mk.
+
+ maint: update to latest gnulib
+ * cfg.mk (sc_cross_check_PATH_usage_in_tests): Remove rule,
+ now that it's in gnulib's maint.mk.
+ * gnulib: Update to latest.
+
+2010-04-07 Jim Meyering <meyering@redhat.com>
+
+ tests: make new PATH-crosschecking syntax-check tighter
+ * cfg.mk (sc_cross_check_PATH_usage_in_tests): Use grep's -x (match
+ entire line) option with -F.
+
+ tests: pull latest help-version from gzip
+ * tests/help-version: Update from gzip.
+ * Makefile.am (TESTS_ENVIRONMENT): Export VERSION,
+ as required for this new help-version script.
+
+ tests: add syntax-check rule to verify that tests use proper PATH
+ * cfg.mk (sc_cross_check_PATH_usage_in_tests): New rule, that is
+ useful only in conjunction with the help-version script.
+
+ tests: use path_prepend_ consistently; remove unnecessary VERBOSE check
+ * tests/basic: Likewise.
+ * tests/binary: Likewise.
+ * tests/function-line-vs-leading-space: Likewise.
+ * tests/label-vs-func: Likewise.
+ * tests/stdin: Likewise.
+
+2010-04-06 Eric Blake <eblake@redhat.com>
+
+ maint: ignore generated files
+ * .gitignore: Ignore recent gnulib additions.
+
+ maint: update to latest bootstrap
+ * bootstrap: Copy from gnulib/build-aux.
+
+2010-04-05 Jim Meyering <meyering@redhat.com>
+
+ tests: get latest init.sh from gnulib
+ * tests/init.sh: Update from gnulib.
+
+ build: update gnulib submodule to latest; adapt
+ * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it.
+
+ diff -F/-p: don't depend on locale-specific white-space definition
+ * src/context.c: Include "c-ctype.h".
+ Use c_isspace, not isspace.
+
+2010-03-18 Jim Meyering <meyering@redhat.com>
+
+ tests: exercise new behavior of -F RE
+ * tests/function-line-vs-leading-space: New file.
+ * tests/Makefile.am (TESTS): Add it.
+
+2010-03-18 Yannick Moy <yannick.moy@adacore.com>
+
+ with -F or -p, emit better function lines: no leading white space
+ * src/diff.c (print_context_function): For languages like Ada
+ that allow local functions and procedures, the plain context
+ function line may start with enough blank characters that the
+ function name does not get completely printed in the 40
+ characters limit. This patch solves this problem by removing
+ these useless initial blank characters.
+ * NEWS (Changes in behavior): Mention this change.
+
+2010-03-17 Jim Meyering <meyering@redhat.com>
+
+ build: don't require a specific version of help2man
+ * bootstrap.conf (buildreq): Bootstrap can't deal with it,
+ perhaps because the command name contains a digit.
+
+ build: make bootstrap ensure that help2man is available
+ * bootstrap.conf (buildreq): Add help2man.
+
+2010-02-23 Jim Meyering <meyering@redhat.com>
+
+ tests: test for the "Binary files A and B differ" diagnostic
+ * tests/binary: New script.
+ * tests/Makefile.am (TESTS): Add it.
+
+ revert 2002 change that removed "Binary " from "files A and B differ"
+ With this change, "printf '\0'|diff - /dev/null" now prints
+ "Binary files - and /dev/null differ" once again.
+ This reverts 2002-06-28 commit a352f0980,
+ "(briefly_report): Don't say "Binary files differ", ...".
+ * src/analyze.c (briefly_report): Do include the "Binary " prefix
+ in the diagnostic, when !brief.
+ * NEWS (Changes in behavior): Mention the diagnostic change.
+ Reported by Andreas Hoenen in http://bugs.debian.org/570064.
+
+2010-02-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ avoid compilation failure on systems lacking both fork and vfork
+ * src/sdiff.c [!HAVE_WORKING_FORK && !HAVE_WORKING_VFORK] (main):
+ Pass the right number of arguments to shell_quote_copy.
+ * src/util.c [!HAVE_WORKING_FORK && !HAVE_WORKING_VFORK] (begin_output):
+ Likewise.
+
+2010-02-11 Jim Meyering <meyering@redhat.com>
+
+ post-release administrivia
+ * NEWS: Add header line for next release.
+ * .prev-version: Record previous version.
+ * cfg.mk (old_NEWS_hash): Auto-update.
+
+ version 2.9
+ * NEWS: Record release date.
+
+ doc: document the release procedure
+ * README-release: New file.
+
+2010-02-10 Jim Meyering <meyering@redhat.com>
+
+ maint: change use of "|" to more maintainable "||" (no semantic change)
+ * src/analyze.c (diff_2_files): Using the "||" operator happens to
+ be equivalent to using "|" in this case. It is also clearer and
+ less prone to inadvertent bug introduction, in case the variable,
+ "changes" were ever to take on a value not in {0,1}.
+ Patch by Tim Waugh, via Mike Frysinger.
+
+ portability: avoid "diff - ..." failure at least on *BSD and Solaris
+ The new "stdin" test was failing on many types of systems.
+ * src/diff.c (compare_files): Guard use of xfreopen (NULL, "rb", ...
+ also with O_BINARY, so as to avoid this unnecessary call on
+ systems where it's not needed (on some it fails with "Bad address".
+
+2010-02-09 Jim Meyering <meyering@redhat.com>
+
+ tests: honor VERBOSE
+ * tests/basic: Enable "set -x" if $VERBOSE.
+ * tests/help-version: Likewise.
+ * tests/label-vs-func: Likewise.
+ * tests/stdin: Likewise.
+
+2010-02-04 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+ sync with gnulib
+ * gl/lib/regcomp.c.diff: Adjust to apply to the latest in gnulib.
+ * gnulib: Update submodule to latest.
+
+2010-02-04 Jim Meyering <meyering@redhat.com>
+
+ build: do not override gnulib-provided AM_CFLAGS options
+ Avoid a warning from automake:
+ lib/Makefile.am:23: AM_CFLAGS multiply defined in condition TRUE ...
+ lib/gnulib.mk:30: ... `AM_CFLAGS' previously defined here
+ lib/Makefile.am:18: `lib/gnulib.mk' included from here
+
+ * lib/Makefile.am (AM_CFLAGS): Append $(WARN_CFLAGS) and
+ $(WERROR_CFLAGS), i.e., use "+=", not "=".
+ This was introduced via 2009-12-17 commit e58efa5b
+ "build: enable warnings and -Werror.",
+ but fortunately is not a bug, because the definition
+ it would have overridden was always empty.
+
+2010-01-17 Jim Meyering <meyering@redhat.com>
+
+ maint: add to .gitignore
+ * .gitignore: Ignore more.
+
+2010-01-15 Jim Meyering <meyering@redhat.com>
+
+ doc: add to TODO
+ * TODO: Add an item, suggested by Dan Jacobson.
+
+2010-01-13 Jim Meyering <meyering@redhat.com>
+
+ tests: ensure that an argument of "-" is treated as standard input
+ * tests/stdin: New test.
+ * tests/Makefile.am (TESTS): Add it.
+
+2010-01-10 Jim Meyering <meyering@redhat.com>
+
+ tests: now "make distcheck" runs more tests, incl. syntax-check
+ * cfg.mk: Include dist-check.mk, from coreutils.
+ * Makefile.am (distcheck-hook): Define rule, to hook to...
+ * dist-check.mk: New file.
+
+2010-01-09 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib to latest, for fixed syntax-check rule
+
+ maint: record updated NEWS hash
+ * cfg.mk (old_NEWS_hash): Update to account for GFDL change.
+
+ build: update gnulib submodule to latest
+
+ tests: add a test of basic functionality
+ * tests/basic: Start adding tests.
+ * tests/Makefile.am (TESTS): Add it.
+
+ maint: udpate GFDL license to 1.3
+ * doc/diff.texi: Update to use GFDL version 1.3.
+
+2010-01-04 Eric Blake <ebb9@byu.net>
+
+ build: allow compilation on cygwin
+ * src/Makefile.am (cmp_LDADD): Move LIBICONV...
+ (LDADD): ...into global flags, since all programs need it.
+
+2010-01-03 Jim Meyering <meyering@redhat.com>
+
+ maint: record update-copyright options for this package
+ * cfg.mk: Next time, just run "make update-copyright".
+
+ tests: prepend ../src, not "." to PATH
+ * tests/help-version: Correct PATH.
+
+2010-01-01 Jim Meyering <meyering@redhat.com>
+
+ maint: update all FSF copyright year lists to include 2010
+ Use this command:
+ git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
+ env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
+
+2009-12-31 Jim Meyering <meyering@redhat.com>
+
+ maint: newer gnulib; don't hard-code my GPG key ID
+ * cfg.mk (gpg_key_ID): Remove definition, now that maint.mk automates it.
+ * gnulib: Update to latest.
+
+ tests: exercise diff -p's function-name matching
+ * tests/label-vs-func: New file.
+ * tests/Makefile.am (TESTS): Add label-vs-func.
+ Reported by Simon Arlott <simon@fire.lp0.eu>
+ http://article.gmane.org/gmane.linux.kernel.janitors/14260
+
+ tests: use gnulib's init.sh
+ * tests/Makefile.am (EXTRA_DIST): Add init.sh.
+ Remove test-lib.sh.
+ * tests/init.sh: New file.
+ * tests/test-lib.sh: Remove file.
+ * tests/help-version: Use init.sh, not test-lib.sh.
+
+2009-11-28 Jim Meyering <meyering@redhat.com>
+
+ maint: don't let trailing spaces in diffs perturb make syntax-check
+ * .x-sc_space_tab: New file.
+
+2009-11-22 Jim Meyering <meyering@redhat.com>
+
+ build: enable warnings and -Werror.
+ * src/Makefile.am (AM_CFLAGS): Enable warnings and -Werror.
+ Set to this: $(WARN_CFLAGS) $(WERROR_CFLAGS)
+ * lib/Makefile.am (AM_CFLAGS): Similarly, but use this:
+ $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
+ * configure.ac (GNULIB_WARN_CFLAGS): Don't turn off -Wuninitialized.
+
+ build: avoid a warning from gnulib's sh-quote.c
+ * gl/lib/sh-quote.c.diff: New file, to avoid a warning.
+
+ maint: avoid warnings via patched versions of gnulib's regex functions
+ * gl/lib/regcomp.c.diff: New file.
+ * gl/lib/regex_internal.c.diff: Likewise.
+ * gl/lib/regex_internal.h.diff: Likewise.
+ * gl/lib/regexec.c.diff: Likewise.
+
+ build: update gnulib submodule to latest
+
+2009-11-20 Eric Blake <ebb9@byu.net>
+
+ build: ignore more files
+ * .gitignore: Add config.cache, *.exe.
+
+2009-11-20 Eric Blake <ebb9@byu.net>
+
+ build: fix test run on cygwin
+ This, plus a gnulib update for xalloc-die-tests, are necessary
+ for make check to pass on cygwin.
+
+ * tests/Makefile.am (built_programs): Ignore $(EXEEXT).
+ * src/Makefile.am (paths.h): Add missing dependency.
+
+2009-11-20 Jim Meyering <meyering@redhat.com>
+
+ maint: remove vestiges of nanosleep
+ * src/Makefile.am (LDADD): Remove $(LIB_NANOSLEEP), now
+ that we no longer use the nanosleep module.
+ Spotted by Eric Blake.
+
+ maint: don't pull in gnulib's nanosleep unnecessarily
+ * bootstrap.conf (gnulib_modules): Remove nanosleep. Not needed.
+ Spotted by Eric Blake.
+
+ maint: cfg.mk: remove factored-out ftp host/dir definitions
+ * cfg.mk (gnu_ftp_host-alpha, gnu_ftp_host-beta gnu_ftp_host-stable):
+ (gnu_rel_host, url_dir_list): Remove definitions. The defaults,
+ now provided by maint.mk, are the same.
+ * gnulib: Update for latest, including those maint.mk additions.
+
+ build: link with now-required libraries
+ * src/Makefile.am (LDADD): Add gnulib-required libraries.
+ (cmp_LDADD): Add $(LIBICONV), for cmp's use of proper_name_utf8.
+
+ maint: lib/xfreopen.c contains translatable strings
+ * po/POTFILES.in: Add lib/xfreopen.c.
+
+ maint: remove hard-coded macro definitions provided by intprops.h
+ * lib/cmpbuf.c: Include "intprops.h" rather than open-coding macros
+ like TYPE_SIGNED and TYPE_MINIMUM.
+
+ maint: add gnulib's announce-gen module
+ * bootstrap.conf (gnulib_modules): Add announce-gen
+
+ build: suppress warnings about bindtextdomain and textdomain
+ * src/system.h (bindtextdomain, textdomain) [!ENABLE_NLS]: Define away.
+
+ build: use more gnulib modules
+ * bootstrap.conf (gnulib_modules): Add mktime, nanosleep, strptime
+ and timegm.
+
+ use xfreopen rather than freopen
+ * src/cmp.c: Include "xfreopen.h".
+ Use xfreopen in place of freopen.
+ * src/diff.c Likewise, and...
+ (main): Set exit_failure to EXIT_TROUBLE, rather than to 2.
+ * src/diff3.c: Likewise.
+ * bootstrap.conf (gnulib_modules): Add xfreopen.
+
+ build: enable many warnings
+ * configure.ac: Add support for --enable-gcc-warnings.
+ * bootstrap.conf (gnulib_modules): Add manywarnings.
+ * Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
+ build: update gnulib submodule to latest
+
+ maint: add an assertion to suppress clang-detected warning
+ The clang static analyzer reported that a NULL parent could be
+ dereferenced. However, that cannot happen, because for all callers,
+ the parameter, parent, is always non-NULL at that point.
+ * src/diff.c: Include <assert.h>.
+ Assert that parent is not NULL.
+
+ maint: remove dead assignment from diff3.c
+ * src/diff3.c (make_3way_diff): Remove dead assignment.
+
+2009-11-17 Jim Meyering <meyering@redhat.com>
+
+ build: update gnulib submodule to latest
+
+ maint: hide build commands behind $(AM_V_GEN)
+ * src/Makefile.am (paths.h): Use $(AM_V_GEN), and split a long line.
+ * man/Makefile.am ($(dist_man1_MANS)): Use $(AM_V_GEN) here, too.
+
+2009-11-16 Jim Meyering <meyering@redhat.com>
+
+ build: let automake generate better man-installation rules
+ * man/Makefile.am (dist_man1_MANS): Rename from dist_man_MANS,
+ to enable better automake-generated installation rules.
+
+ admin: ignore all of gnulib-tests
+ * .gitignore: Add gnulib-tests
+
+2009-11-16 Eric Blake <ebb9@byu.net>
+
+ build: avoid link failure when libsigsegv is used
+ * src/Makefile.am (LDADD): Link against LIBSIGSEGV.
+
+2009-11-16 Jim Meyering <meyering@redhat.com>
+
+ maint: define/use PROGRAM_NAME and AUTHORS; use propername module
+ * bootstrap.conf (gnulib_modules): Add propername.
+ * src/cmp.c (PROGRAM_NAME, AUTHORS): Define.
+ (main): Use them in use of version_etc.
+ * src/diff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
+ * src/diff3.c (PROGRAM_NAME, AUTHORS, main): Likewise.
+ * src/sdiff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
+ * src/system.h: Include "propername.h".
+
+ maint: no longer define *_FILENO constants
+ * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
+ Remove definitions. Now guaranteed by gnulib.
+
+ maint: bug-diffutils@gnu.org is the new bug-reporting address
+ * configure.ac (AC_INIT): Use bug-diffutils@..., not bug-gnu-utils
+ as the bug-reporting address.
+ * NEWS (Administrivia): Mention this.
+ * src/cmp.c (usage): Remove hard-coded address.
+ Instead, use gnulib's emit_bug_reporting_address function.
+ * src/diff.c (usage, option_help_msgid): Likewise.
+ * src/diff3.c (usage): Likewise.
+ * src/sdiff.c (usage): Likewise.
+
+ sdiff, diff3: exec diff, not $(bindir)/diff
+ * src/Makefile.am (paths.h): Emit a definition of DEFAULT_DIFF_PROGRAM
+ that is simply "diff" (or whatever $(transform) would convert that to,
+ e.g., "gdiff"). This makes it so that tests can work without first
+ installing diff, and so that the binaries do not hard-code $(prefix).
+ * NEWS (Changes in behavior): Mention this.
+
+2009-11-14 Jim Meyering <meyering@redhat.com>
+
+ tests: add the first script; hook up gnulib-tests
+ * configure.ac (AC_CONFIG_FILES): Add tests/Makefile and
+ gnulib-tests/Makefile.
+ * tests/help-version: New file, from coreutils.
+ * tests/test-lib.sh: Likewise.
+ * tests/Makefile.am: New file, from gzip.
+ * Makefile.am (SUBDIRS): Add tests and gnulib-tests.
+ * tests/t-local.sh: New, empty(for now) file.
+
+2009-11-13 Jim Meyering <meyering@redhat.com>
+
+ build: require gettext-0.17
+ * configure.ac: Require gettext-0.17; it was released two years ago.
+
+ build: correct gettext configure-time support
+ * configure.ac: Use AM_GNU_GETTEXT([external], [need-ngettext]),
+ rather than AM_GNU_GETTEXT([external], [need-formatstring-macros]).
+ Reported by Martin Jacobs in
+ http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3181
+
+2009-11-12 Jim Meyering <meyering@redhat.com>
+
+ build: generalize autoheader check
+ * bootstrap: Look for AC_CONFIG_HEADER as well as AC_CONFIG_HEADERS.
+
+2009-11-11 Jim Meyering <meyering@redhat.com>
+
+ maint: use a git submodule for gnulib
+ * .gitmodules: New file, to track gnulib.
+ * gnulib: New file, created by running this:
+ git submodule add git://git.sv.gnu.org/gnulib.git gnulib
+
+ maint: tell git what it can ignore
+ * .gitignore: Ignore generated files.
diff --git a/ChangeLog-2008 b/ChangeLog-2008
new file mode 100644
index 0000000..7cf442c
--- /dev/null
+++ b/ChangeLog-2008
@@ -0,0 +1,4273 @@
+2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/diff.texi: Update Back-Cover text to reflect new GNU wording.
+
+2008-01-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/side.c [!HAVE_MBRTOWC]: Supply defns for mbstate_t and mbrtowc.
+ Problem reported by Bruno Haible.
+
+2008-01-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/side.c (print_half_line): Don't convert to unsigned char
+ unnecessarily.
+
+ Don't mishandle multibyte characters in side-by-side format.
+ Problem reported by Erik Karlsson in
+ <http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00030.html>.
+ * bootstrap.conf (gnulib_modules): Add wcwidth.
+ * src/side.c: Include <wchar.h>.
+ (print_half_line): Compute number of bytes and print widths of
+ multibyte characters. Inspired by an alternative solution from
+ Bruno Haible in
+ <http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00032.html>.
+
+2007-12-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: New diff option --suppress-blank-empty (no longer -u default).
+ * doc/diff.texi (Detailed Unified): Trailing spaces are no longer
+ omitted.
+ (Trailing Blanks): New section.
+ (diff Options) Mention new option.
+ * src/diff.h (suppress_blank_entry): New decl.
+ * src/context.c (pr_unidiff_hunk): Support --suppress-blank-empty.
+ * src/util.c (print_1_line): Likewise.
+ * src/diff.c (longopts, main, option_help_msgid): Likewise.
+ (SUPPRESS_BLANK_EMPTY_OPTION): New constant.
+
+ * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS after gl_EARLY,
+ since gnulib now requires this order.
+
+ * bootstrap: Import from gnulib.
+
+2007-08-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Break out diffseq.h into a separate file, so that gettext can use
+ this code. Idea and code from Bruno Haible.
+ * bootstrap.conf (gnulib_modules): Add diffseq.
+ * src/analyze.c (xvec, yvec, fdiag, bdiag, too_expensive, SNAKE_LIMIT):
+ (struct partition, diag, compareseq): Remove; now in diffseq.h.
+ (ELEMENT, EQUAL, OFFSET, EXTRA_CONTEXT_FIELDS, NOTE_DELETE, NOTE_INSERT):
+ (USE_HEURISTIC): New macros.
+ Include "diffseq.h".
+ (diff_2_files): Rewrite to use new diffseq.h interface.
+
+ * bootstrap: Import from gnulib.
+
+2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/diff.c (compare_files): Use last_component rather than base_name,
+ adjusting to gnulib API change. This avoids a memory leak.
+ * src/sdiff.c (expand_name): Likewise.
+ * src/util.c (dir_file_pathname): Likewise.
+
+ * doc/diff.texi (Copying This Manual): Adjust to new fdl.texi layout.
+
+2007-07-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/diff.texi (White Space): Note that newline always ends a line,
+ so -w doesn't ignore newline-related changes. Problem reported by
+ David Kastrup.
+
+ * COPYING: New file.
+ * AUTHORS: Update from GPLv2 to GPLv3.
+ * Makefile.am: Likewise.
+ * NEWS: Likewise.
+ * README: Likewise.
+ * README-hacking: Likewise.
+ * bootstrap: Likewise.
+ * bootstrap.conf: Likewise.
+ * configure.ac: Likewise.
+ * exgettext: Likewise.
+ * doc/Makefile.am: Likewise.
+ * lib/Makefile.am: Likewise.
+ * lib/cmpbuf.c: Likewise.
+ * lib/cmpbuf.h: Likewise.
+ * lib/prepargs.c: Likewise.
+ * m4/vararrays.m4: Likewise.
+ * man/Makefile.am: Likewise.
+ * ms/Makefile.am: Likewise.
+ * ms/README: Likewise.
+ * ms/config.bat: Likewise.
+ * ms/config.sed: Likewise.
+ * ms/config.site: Likewise.
+ * po/POTFILES.in: Likewise.
+ * src/Makefile.am: Likewise.
+ * src/analyze.c: Likewise.
+ * src/cmp.c: Likewise.
+ * src/context.c: Likewise.
+ * src/diff.c: Likewise.
+ * src/diff.h: Likewise.
+ * src/diff3.c: Likewise.
+ * src/dir.c: Likewise.
+ * src/ed.c: Likewise.
+ * src/io.c: Likewise.
+ * src/normal.c: Likewise.
+ * src/sdiff.c: Likewise.
+ * src/system.h: Likewise.
+ * src/util.c: Likewise.
+
+ * src/ifdef.c: Fix typo: "GNU DIFF General Public License" should be
+ "GNU General Public License". Reported by Erich Guenther.
+ * src/side.c: Likewise.
+
+2007-06-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap.conf (gnulib_modules): Add inttypes.
+ * src/context.c (print_context_label): Don't assume that time_t
+ fits in long int, since it doesn't in FreeBSD/arm. Problem
+ reported by Xin Li in
+ <http://lists.gnu.org/archive/html/bug-gnu-utils/2007-06/msg00091.html>.
+
+2007-06-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Mention new sdiff aliases 1 and 2 for l and r.
+ * doc/diff.texi (Merge Commands): Likewise.
+ * src/sdiff.c (give_help): Give help for them.
+ (edit): Support them.
+
+2007-04-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/diff.texi (Detailed diff3 Normal): "range is a singleton" ->
+ "there is only one line", for clarity. Suggested by Jerry Peek.
+
+2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * TODO: Mention possible sdiff improvement.
+
+ * bootstrap: Sync from gnulib.
+ * src/cmp.c: Don't include exit.h; no longer needed.
+ * src/diff.c: Likewise.
+ * src/sdiff.c: Likewise.
+ * src/dir.c: Don't include strcase.h; no longer needed.
+ * README-alpha: Remove, replacing with:
+ * README-hacking: New file, taken from coreutils with some changes.
+ The rename is required by the change to 'bootstrap'.
+
+2006-11-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/analyze.c (build_reverse_script): Fix typo in comment.
+ Problem and fix reported by Daniel Hipschman.
+
+2006-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Don't assume SIGPIPE exists, and that sigblock and sigsetmask
+ exist if sigprocmask does not. Problem reported by Paul Edwards
+ for MVS 3.8.
+ * configure.ac (sigblock): Check whether this function is
+ available, if sigprocmask is not.
+ * src/sdiff.c (sigs): Omit SIGPIPE if it's not defined.
+ Put SIGINT last; all uses changed.
+ (handler_index_of_SIGPIPE): Omit if SIGPIPE is not defined.
+ (sigblock, sigsetmask) [!HAVE_SIGBLOCK]: New macros.
+ (sigprocmask): Don't dump core if O is null.
+
+2006-11-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/sdiff.c (sigprocmask) [! HAVE_SIGPROCMASK]: Cast 2nd arg to
+ sigset_t *, since it might be a literal 0. Problem reported by
+ Paul Edwards for MVS 3.8.
+
+2006-09-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: diff -u no longer outputs trailing white space unless the
+ input data has it. Suggested by Jim Meyering.
+ * doc/diff.texi (Detailed Unified): Document this.
+ * src/context.c (pr_unidiff_hunk): Implement this.
+
+ Modernize bootstrap procedure to match current gnulib.
+ * bootstrap: Sync with coreutils bootstrap, except check that
+ the directory build-aux exists before trying to copy to it.
+ * bootstrap.conf: New file.
+ (gnulib_modules): Add config-h, dup2, extensions, fcntl, fdl,
+ stat-macros, unistd.
+ * configure.ac: Invoke gl_EARLY and gl_INIT rather than
+ GNULIB_AUTOCONF_SNIPPET.
+ (AC_CONFIG_HEADER): Rename config.h to lib/config.h.
+ (AC_CHECK_HEADERS_ONCE): Don't check for fcntl.h, locale.h,
+ sys/file.h, unistd.h. We now use the fcntl and unistd modules,
+ and locale.h can be assumed for any C89 compiler.
+ (DIFFUTILS_PREREQUISITES): Remove. No longer needed now that
+ we use the stdint module.
+ (AC_CHECK_FUNCS_ONCE): Remove dup2, which is no longer needed
+ now that we use the dup2 module.
+ (AM_GNU_GETTEXT): Use need-formatstring-macros, and ...
+ (AM_GNU_GETTEXT_VERSION): specify version 0.15 instead of 0.14.5,
+ to be consistent with coreutils.
+ * lib/Makefile.am (noinst_LIBRARIES):
+ (lib_SOURCES, libdiffutils_a_LIBADD):
+ (libdiffutils_a_DEPENDENCIES, BUILT_SOURCES, EXTRA_DIST):
+ (MOSTLYCLEANFILES): Remove; now computed automatically.
+ (noinst_HEADERS, libdiffutils_a_SOURCES): Just append
+ our special files now.
+ * lib/cmpbuf.c: Include config.h unconditionally, since we
+ no longer define HAVE_CONFIG_H.
+ * lib/prepargs.c: Likewise.
+ * src/Makefile.am (LDADD): Use $(LIBINTL), not @LIBINTL@.
+ (diff_LDADD): Use $(LIB_CLOCK_GETTIME), not @LIB_CLOCK_GETTIME@.
+ * src/dir.c (dir_read): Use _D_EXACT_NAMLEN, not NAMELEN.
+ * src/system.h (volatile): Remove, since we assume C89 or better.
+ Include stat-macros.h.
+ (S_IRWXU, S_IRWXG, S_IRWXO, S_IRUSR, S_IWUSR):
+ Remove, since we now use stat-macros.h.
+ (SEEK_SET, SEEK_CUR): Remove, since we assume C89 or better.
+ Include unistd.h unconditionally, since we use unistd.
+ Likewise for fcntl.h.
+ (dup2): Remove, since we now use dup2.
+ (O_RDONLY, O_RWDR, O_BINARY): Remove, since we now use
+ fcntl.
+ Include dirent.h unconditionally.
+ (NAMLEN): Remove, replacing with....
+ (_D_EXACT_NAMLEN): New macro.
+ Include inttypes.h unconditionally.
+ (PTRDIFF_MAX, SIZE_MAX, UINTMAX_MAX, strtoumax): Remove, since
+ we now use inttypes.
+ Include locale.h unconditionally.
+ (setlocale): Remove, since we now assume locale.h.
+
+2006-09-04 Jim Meyering <jim@meyering.net>
+
+ * src/context.c (print_context_function): Do not print
+ trailing white space in a context header.
+
+2006-05-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/cmp.c (cmp): The previous fix wasn't quite right either, as
+ it mishandled 'cmp A B >/dev/null' when A is shorter than B and
+ differs before A's end-of-file, by outputting a bogus EOF message.
+ Also, it was inefficient if A and B were large.
+
+2006-05-07 Jim Meyering <jim@meyering.net> (tiny change)
+
+ Fix bug introduced in 2006-03-09 change:
+ cmp always exits successfully, when stdout is redirected to /dev/null.
+ * src/cmp.c (cmp): When there's a difference, arrange to return nonzero
+ also when comparison_type is the new (from 2006-03-09) type_no_stdout.
+
+2006-05-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/context.c (pr_context_hunk, pr_unidiff_hunk):
+ Prefer fputs or fputc to fprintf, since it's a tad more efficient
+ with unlocked-IO on glibc. Long ago we avoided fputs to
+ work around an ancient SunOS bug, but that's no longer relevant.
+ * src/diff3.c (output_diff3, dotlines, undotlines):
+ (output_diff3_edscript, output_diff3_merge): Likewise.
+ This also avoids a gcc -Wformat-security warning reported
+ by Jim Meyering.
+ * src/ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk):
+ Likewise.
+ * src/normal.c (print_normal_hunk): Likewise.
+
+2006-05-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/io.c (find_identical_ends): Fix huge performance bug that I
+ introduced in the 2001-11-25 change: the code to remove the
+ identical suffix also looked at the trailing sentinel, which meant
+ the common suffix length was always incorrectly calculated to be
+ zero. Problem and fix reported by Daniel Hipschman. Instead of
+ his fix, revert to the pre-2001 code.
+
+ * doc/diff.texi: Switch from GFDL 1.1 to 1.2.
+
+2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/system.h (PARAMS, PROTOTYPES): Remove; no longer needed.
+ (IF_LINT): New macro, to pacify GCC.
+ * src/analyze.c (diag, compareseq): Use IF_LINT.
+ * src/cmp.c (cmp): Likewise.
+ * src/diff3.c (process_diff): Likewise. Also, prefer NULL to 0.
+ * src/ifdef.c (do_printf_spec, scan_char_literal): Likewise.
+ * src/sdiff.c (edit): Likewise.
+
+2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/cmp.c (type_no_stdout): New constant.
+ (main): Use it to avoid bug when the "EOF on foo" message is
+ generated and stdout is /dev/null.
+ Problem reported by Vincent Lefevre (Debian bug 356083).
+
+2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * README-alpha: Describe CVS access better, using the README-alpha
+ from GNU tar.
+ * AUTHORS: Simplify list by removing legalisms.
+ * THANKS: Add Larry Wall, who contributed to manual. Update email
+ addresses.
+ * Makefile.am (SUBDIRS): Remove m4. Put lib first, then other
+ source files, so documentation can rely on programs being built.
+ * bootstrap: Import changes from Bison bootstrap. Add gettext,
+ gettime, sh-quote, stat-time, verify, version-etc-fsf modules.
+ Remove posixver module. Retrieve doc/fdl.texi from gnulib.
+ Handle gettext.m4 like glibc21.m4. Don't remove po/en.po.
+ * configure.ac (AC_PREREQ): Bump to 2.59.
+ (AC_INIT): Bump version to 2.8.7-cvs.
+ (AC_CONFIG_AUX_DIR): Change from config to build-aux.
+ Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS
+ and AC_CHECK_FUNCS_ONCE to AC_CHECK_FUNCS.
+ Remove jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T,
+ AC_STRUCT_ST_MTIM_NSEC.
+ (DIFFUTILS_PREREQUISITES): New macro. Call it.
+ (REGEX_MALLOC): Remove; no longer needed.
+ (AM_GNU_GETTEXT_VERSION): Now 0.14.15.
+ (AM_GNU_GETTEXT): Call.
+ (LIB_CLOCK_GETTIME): Remove; bootstrap now does that.
+ (AC_FUNC_SETMODE_DOS): Remove.
+ (AC_CONFIG_FILES): Remove m4/Makefile.
+ * doc/diff.texi: Use @- at end of lines that should end in white space,
+ so that Emacs doesn't remove the white space.
+ (diff Options): "diff -NUM" is a pure extension to POSIX, so support
+ it unconditionally.
+ * lib/Makefile.am (noinst_HEADERS): Remove quotesys.h.
+ (lib_SOURCES): Remove quotesys.c.
+ (DISTCLEANFILES): Remove.
+ (EXTRA_DIST): Remove setmode.h, waitpid.c.
+ * lib/cmpbuf.c (block_read): Reword to avoid gcc -W warning.
+ * lib/setmode.c, lib/setmode.h: Remove.
+ * m4/setmode.m4, m4/gnu-source.m4, m4/Makefile.am.in: Remove.
+ * m4/jm-glibc-io.m4: Remove.
+ * src/cmp.c: Don't include <setmode.h>.
+ (specify_ignore_initial): Reword to avoid gcc -W warnings.
+ (main): Use freopen instead of setmode, since freopen is in POSIX.
+ * src/context.c: Revert most 2004-09-01 changes. Then:
+ (TIMESPEC_NS): Remove. All uses replaced by
+ get_stat_mtime_ns.
+ Include stat-time.h, strftime.h.
+ (nstrtime): Remove decl.
+ * src/diff.c: Revert most 2004-09-01 changes. Then:
+ Don't include <posixver.h>, <quotesys.h>, <setmode.h>.
+ Include <sh-quote.h>, <stat-time.h>, <timespec.h>.
+ All uses of quotesys replaced by sh-quote.
+ (main, compare_files):
+ Use freopen instead of setmode, since freopen is in POSIX.
+ (main): Don't complain about "diff -NUM'.
+ (main, set_mtime_to_now):
+ Adjust to stat-time.h macros when accessing nanoseconds.
+ * src/diff3.c: Include sh-quote.h rather than quotesys. All uses
+ changed.
+ * src/dir.c (dir_read): excluded_filename renamed to
+ excluded_file_name.
+ * src/io.c: Don't include <setmode.h>.
+ (sip, read_files): Remove binary file stuff, leaving a FIXME behind.
+ A DOS expert needs to look at this.
+ * src/diff.c: Include sh-quote.h rather than quotesys.h.
+ All uses changed.
+ * src/system.h: Include verify.h.
+ (verify): Remove. All uses changed to verify.h version.
+ Include <intprops.h>.
+ (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. Now uses
+ intprops.h versions.
+ (O_BINARY): New defns, taken from coreutils.
+ * src/util.c: Include sh-quote.h rather than quotesys.h.
+ All uses changed.
+
+2004-09-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/diff.c (recursive, new_file, unidirectional_new_file):
+ (report_identical_files):
+ Move into struct diffopt. All uses changed.
+ (exclude_options, compare_files, specify_style, check_stdout):
+ New arg OPT. All uses changed.
+ (GDIFF_MAIN): Remove. All uses removed.
+ (function_regexp_list, ignore_regexp_list): No longer static; now
+ locals in 'main'.
+ (main): Set opt.function_regexp, opt.ignore_regexp if using regexps;
+ all other code now tests these pointers rather than inspecting fastmap
+ internals.
+ New local OPT to hold former statics; initialize it.
+ (init_regexp_list): New function, used by main.
+ (summarize_regexp_list): Now returns struct re_pattern_buffer *, and
+ assumes reglist->regexps is not NULL. All uses changed.
+
+ * src/context.c (find_function_last_search): Move into struct diffopt.
+ All uses changed.
+ (pr_context_label, pr_context_header,
+ print_context_script, find_function, find_hunk, mark_ignorable,
+ pr_context_hunk, pr_unidiff_hunk): New arg OPT. All uses changed.
+ (print_context_number_range,
+ print_unidiff_number_range): New arg OUT. All uses changed.
+
+2004-07-19 Stepan Kasal <kasal@ucw.cz>
+
+ * src/ed.c (print_ed_hunk): Optimize the case where an insert's
+ last line is a single-dot line.
+
+2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/setmode.c:
+ Don't include <stdbool.h>, since setmode.h now does this.
+ Include setmode.h first, to catch interface errors.
+ Assume HAVE_SETMODE_DOS is defined.
+
+ * lib/setmode.h: Include stdbool.h.
+
+2004-04-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap: Don't remove po/en.po.
+
+2004-04-13 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.7.
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Add.
+ (XGETTEXT): Restore from pre-2004-04-12 version. This fixes
+ a bug that lost many msgids in doc/diffutils.pot.
+ * bootstrap: New file.
+ * exgettext: Don't generate a temporary file, as this runs afoul
+ of "make distcheck" which operates with read-only directories.
+ * Makefile.am (EXTRA_DIST): Add bootstrap.
+ Remove config/config.rpath as it is deduced automatically these days.
+
+2004-04-12 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.6.
+
+ * NEWS: Add news for 2.8.4, 2.8.6.
+
+ * README: Move copyright notice to end. Defer to "configure
+ --help" for special "configure" options. Suggest latest libiconv.
+ Update version numbers of Autoconf etc. to current.
+
+ * configure.ac: Quote various arguments better.
+ (AC_CONFIG_MACRO_DIR): Add call, specifying "m4".
+ (AC_CONFIG_HEADER): Replaces AM_CONFIG_HEADER.
+ (gl_USE_SYSTEM_EXTENSIONS): Replaces AC_GNU_SOURCE.
+ (AC_ISC_POSIX): Remove; nobody ports to ancient ISC any more.
+ (AC_PROG_CPP, AC_PROG_INSTALL, AC_C_INLINE,
+ AC_HEADER_STDBOOL, AC_HEADER_STDC, AM_GNU_GETTEXT, XGETTEXT,
+ AC_HEADER_STAT, AC_FUNC_VPRINTF, jm_FUNC_GLIBC_UNLOCKED_IO,
+ jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC, jm_FUNC_REALLOC,
+ jm_PREREQ_C_STACK, jm_PREREQ_ERROR, jm_PREREQ_HARD_LOCALE,
+ jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX, AC_FUNC_FNMATCH_GNU, jm_AC_DOS):
+ Remove; not needed here, as our files don't use them directly
+ or we rely on gnulib modules.
+ (AC_C_CONST): Remove; we assume C89 now.
+ (AC_CHECK_HEADERS): Remove libintl.h, limits.h, stdlib.h, string.h,
+ time.h.
+ (AC_CHECK_TYPE): Remove ptrdiff_t, ssize_t.
+ (AC_CHECK_FUNCS): Remove diraccess, strchr, strerror, tmpnam).
+ (AC_REPLACE_FUNCS): Remove memchr, mkstemp, strcasecmp.
+ (GNULIB_AUTOCONF_SNIPPET): Add call. This replaces much of
+ the above.
+ (AC_CONFIG_FILES): Remove lib/posix/Makefile.
+ (AC_CONFIG_COMMANDS): Remove.
+
+ * doc/diff.texi (dircategory): Change to "Text creation and
+ manipulation" from "GNU packages".
+ (Translations): New node.
+ (Overview): Improve quality of algorithm citations.
+ (Binary): -q doesn't exactly cause diff to assume files are binary.
+ (Normal): Place after Side by Side, since it's less important.
+ (Detailed Context, Detailed Unified, Detailed ed,
+ Detailed if-then-else, diff3 Hunks, Detailed diff3 Normal):
+ Place at end of menu.
+ (Detailed Unified): Mention that fractional timestamps are
+ omitted on hosts that don't support them.
+ Mention what happens when hunks contain just one line.
+ (Line Group Formats, Reject Names): Fix duplicate-word typos.
+ (Comparing Directories): Trailing white space and empty lines are
+ ignored in the -X file.
+ (diff Options): Add --strip-trailing-cr.
+ (Projects): gnu -> gvc@gnu.org.
+
+ * lib/Makefile.am (SUBDIRS): Remove.
+ (EXTRA_DIST, noinst_HEADERS): Remove most entries.
+ (libdiffutils_a_SOURCES): Now just lib_SOURCES.
+ (lib_SOURCES): New macro.
+ (DISTCLEANFILES, MOSTLYCLEANFILES): Set to empty now.
+ (gnulib.mk): Include: this does most of the work eliminated
+ by the above changes.
+
+ * lib/inttostr.c (inttostr): Protect i < 0 by compile-time
+ test intended to suppress compiler warnings.
+ * lib/inttostr.h: Include limits.h unilaterally.
+ (CHAR_BIT): Remove.
+ (PARAMS): Remove; all uses changed.
+ * lib/setmode.c (__attribute__): New macro.
+ (set_binary_mode): Define only if HAVE_SETMODE_DOS.
+ Otherwise define a dummy static char, as C89 requires
+ that we define something.
+ * lib/setmode.h (set_binary_mode): Return true, not 1.
+
+ * src/analyze.c, src/context.c, src/diff.c, src/io.c, src/util.c:
+ Do not include regex.h, as diff.h does this now.
+
+ * src/cmp.c: Sort includes. Include <exit.h>, <unlocked-io.h>.
+ (specify_comparison_type): Don't report an error if the comparison
+ type has already been specified the same way as this one.
+
+ * src/cmp.c (usage): Mention exit status.
+ * src/diff.c (option_help_msgid): Likewise.
+ * src/diff3.c (usage): Likewise.
+ * src/sdiff.c (usage): Likewise.
+
+ * src/cmp.c (main): Adjust to latest gnulib c_stack_action
+ calling conventions.
+ * src/diff.c (main): Likewise.
+ * src/diff3.c (main): Likewise.
+ * src/sdiff.c (main): Likewise.
+
+ * src/cmp.c (main): Adjust to latest version_etc calling conventions.
+ * src/diff.c (main): Likewise.
+ * src/diff3.c (main): Likewise.
+ * src/sdiff.c (main): Likewise.
+
+ * src/diff.c: Include <exit.h>.
+ (binary): Define to true if not declared.
+ (longopts): Set tabsize flag to 1.
+ (main): Don't output nanoseconds if platform lacks them.
+ Don't treat files as binary if !binary.
+ (set_mtime_to_now): Use 0, not NULL.
+ (compare_files): Mark files as nonexistent if it looks like
+ 'patch' created inaccessible regular empty files to denote
+ nonexistent backups. Don't compare such files.
+ Clear st_* members of status of nonexistent file.
+ Remove now-unnecessary tests.
+
+ * src/diff.h: Include regex.h, unlocked-io.h.
+ (struct file_data.changed): Now char *, not bool *, to save
+ space on hosts where bool takes more space than char.
+ All uses changed.
+
+ * src/diff3.c: Include unlocked-io.h.
+ (strip_trailing_cr): New var.
+ (STRIP_TRAILING_CR_OPTION): New enum.
+ (longopts, main, option_help_msgid, read_diff):
+ Add --strip-trailing-cr support.
+ (read_diff): Exit with status 126 (not 127) if errno != ENOENT
+ after failed execvp in child. Report this in parent.
+
+ * src/dir.c: Include <strcase.h>.
+ (failed_locale_specific_sorting): Renamed from failed_strcoll.
+ All uses changed.
+ (compare_names): Don't invoke strcasecmp first thing when
+ ignore_file_name_case; if locale_specific_sorting, we should
+ just use that.
+
+ * src/ifdef.c (next_line): Remove; replace with...
+ (next_line0, next_line1): New vars.
+ (print_ifdef_script, print_ifdef_hunk):
+ Use them to fix line-number computation bug.
+
+ * src/io.c (find_and_hash_each_line): Don't convert char *
+ to unsigned char *; just leave pointers as char *. This
+ lessens the number of potentially-dangerous casts.
+ * src/util.c (lines_differ): Likewise.
+
+ * src/sdiff.c: Include <unlocked-io.h>, <exit.h>.
+ (check_child_status): Renamed from ck_editor_status, and
+ accept a new arg MAX_OK_STATUS. All callers changed.
+ Handle status 126/127 as per POSIX.
+ (edit): Likewise.
+ (main): Likewise. Fix getopt typo: -E wasn't supported.
+
+ * src/system.h (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
+ (S_IXUSR, S_IXGRP, S_IXOTH): Remove.
+ Include <time.h> unconditionally, since we can assume C89 now.
+ Likewise for <stdlib.h>, <string.h>.
+ (getenv, EXIT_SUCCESS, EXIT_FAILURE, SSIZE_MAX, strchr, strrchr,
+ memcmp, memcpy): Remove decl; no longer needed.
+ (strcasecoll, strcasecmp): Define if not built in.
+ (CTYPE_DOMAIN, ISPRINT, ISSPACE, TOLOWER, _tolower, errno): Remove;
+ we now assume C89 or better. All uses changed.
+ Include <stdbool.h> unconditionally now, since gnulib supports it
+ if the C compiler doesn't. All boolean uses of 0 and 1 now
+ changed to false and true.
+ (lin_is_printable_as_long_int): Renamed from lin_is_printable_as_long.
+
+ * src/util.c (begin_output): Fix bug: 0 wasn't cast to char * arg,
+ which led to undefined behavior on 64-bit hosts.
+ Use more-standard test for exit status 126 versus 127.
+ (finish_output): Likewise.
+ (analyze_hunk): Do not cast bool to int.
+
+2004-03-15 Paul Eggert <eggert@twinsun.com>
+
+ * src/cmp.c (main): Don't consider two files with the same name to
+ be the same, if their initial skip values differ. This fixes a
+ bug reported by Hideki Iwamoto in
+ <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-03/msg00024.html>.
+
+2004-03-11 Paul Eggert <eggert@twinsun.com>
+
+ * src/analyze.c (diag): Return void, not lin, since the return
+ value wasn't needed. All callers changed.
+ (diag, diff_2_files):
+ Use 'true' and 'false' instead of '1' and '0', when appropriate.
+ (compareseq): Use lin const * local variables instead of lin *.
+ Don't bother checking diag's return value.
+ (shift_boundaries, build_reverse_script, build_script, diff_2_files):
+ Use char arrays, not bool arrays, since
+ sizeof (bool) might be greater than 1.
+
+2004-02-09 Paul Eggert <eggert@twinsun.com>
+
+ * m4/setmode.m4 (AC_FUNC_SETMODE_DOS): AC_LIBOBJ(setmode) if
+ we would return true.
+
+2002-10-14 Paul Eggert <eggert@twinsun.com>
+
+ * src/Makefile.am (diff3.$(OBJEXT), diff.$(OBJEXT),
+ sdiff.$(OBJEXT)): Rename from (misspelled) diff3.$(OBJECT),
+ diff.$(OBJECT), sdiff.$(OBJECT). Patch by Paul D. Smith in
+ <http://mail.gnu.org/pipermail/bug-gnu-utils/2002-October/003251.html>.
+ Bug reported by Chris Bainbridge.
+
+2002-10-13 Paul Eggert <eggert@twinsun.com>
+
+ * src/Makefile.am (MOSTLYCLEANFILES): Add paths.ht.
+ (paths.h): Send output to paths.ht first, and then rename to
+ paths.h at the end. This avoids problems if the disk is full.
+ It also works around what appears to be a bug with GNU make -j
+ (3.79.1); see <http://bugs.gentoo.org/show_bug.cgi?id=8934>.
+
+2002-06-27 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.4.
+
+ * config/config.sub: Sync with latest version maintained in other
+ packages.
+
+ * lib/file-type.h: Protect against double inclusion. Detect
+ whether <sys/stat.h> has been included. Fix from Jim Meyering.
+
+ * src/analyze.c (briefly_report): Don't say "Binary files differ",
+ since one of the files may not be a binary file.
+ Bug reported by Dan Jacobson.
+
+2002-06-22 Paul Eggert <eggert@twinsun.com>
+
+ * lib/c-stack.c (segv_handler, c_stack_action) [! defined
+ SA_SIGINFO]: Do not assume SA_SIGINFO behavior.
+ Bug reported by Jim Meyering on NetBSD 1.5.2.
+
+2002-06-16 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.3.
+
+ * config/depcomp, config/missing, README: Update to automake 1.6.2.
+
+ * po/LINGUAS: Add en_US.
+ * po/en_US.po: New file.
+ * po/POTFILES.in: Remove lib/freesoft.c.
+ Add lib/file-type.c, lib/version-etc.c, lib/xmalloc.c.
+
+2002-06-15 Paul Eggert <eggert@twinsun.com>
+
+ * doc/diff.texi (Special Files): Document behavior of symlink
+ loops.
+
+ * lib/Makefile.am (noinst_HEADERS): Remove freesoft.h.
+ Add version-etc.h.
+ (libdiffutils_a_SOURCES): Remove freesoft.c. Add version-etc.c.
+ * lib/freesoft.c, lib/freesoft.h: Remove.
+ * lib/version-etc.h (PARAMS): Remove; we now assume C89 at least.
+
+ * lib/version-etc.h (version_etc): Remove package and version args.
+ (version_etc_copyright): Remove.
+ * lib/version-etc.c: Likewise.
+ Do not include unlocked-io.h; no longer needed.
+ Include gettext.h rather than libinto.h.
+ (_): Define unconditionally.
+ (version_etc): Adjust wording to match current GNU coding standards.
+ Translate "(C)" if possible.
+
+ * lib/version-etc.c, lib/version-etc.h: New files, taken from
+ fileutils.
+
+ * src/Makefile.am (cmp_SOURCES, diff3_SOURCES, sdiff_SOURCES,
+ diff_SOURCES): Remove version.c.
+ (MAINTAINERCLEANFILES, $(srcdir)/version.c): Remove.
+
+ * src/cmp.c: Include version-etc.h, not freesoft.h.
+ (copyright_notice): Remove.
+ (main): Use version_etc to print version.
+ * src/diff.c, src/diff3.c, src/sdiff.c: Likewise.
+
+ * src/cmp.c (version_string): Remove decl.
+ * src/diff.h, src/diff3.c, src/sdiff.c: Likewise.
+
+2002-06-11 Paul Eggert <eggert@twinsun.com>
+
+ * lib/fnmatch.c, lib/fnmatch_loop.c (WIDE_CHAR_SUPPORT):
+ New macro. Use it uniformly instead of
+ (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
+ It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
+ reported by Vin Shelton.
+ * m4/fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Check for btowc.
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.2.
+
+ * ABOUT-NLS, config/config.guess, config/config.sub,
+ config/depcomp, config/texinfo.tex, lib/posix/regex.h,
+ m4/c-bs-a.m4, m4/gettext.m4, m4/gnu-source.m4, m4/lib-link.m4,
+ m4/malloc.m4:
+ Update to recent version (maintained in other packages).
+ * m4/prereq.m4 (jm_PREREQ_EXCLUSIVE): AC_FUNC_FNMATCH_GNU
+ no longer takes a lib.
+
+ * README: Incorporate contents from INSTALLME.
+ * INSTALLME: Remove.
+ * Makefile.am (EXTRA_DIST): Remove INSTALLME.
+
+ * configure.ac (AC_GNU_SOURCE): Move up, so that it affects
+ later compilations properly.
+ (DEFAULT_DIFF_PROGRAM, AC_TYPE_SIGNAL): Remove.
+ (jm_AC_TYPE_INTMAX_T): Add.
+ (AC_FUNC_FNMATCH_GNU): Use this, instead of AC_FUNC_FNMATCH.
+ (AC_CONFIG_LINKS): regex.hin renamed from regex_.h.
+
+ * doc/diff.texi: Reword "@option{-f} and @option{--foo}" to
+ "@option{-f} or @option{--foo}".
+ Use @acronym instead of @sc where appropriate.
+ (Specified Lines): Renamed from Specified Folding.
+ (Comparison, Blank Lines):
+ Clarify wordings for Blank Lines and Specified Lines nodes.
+ (Binary): Mention --verbose and --print-bytes.
+ (Tabs, sdiff Option Summary, diff Options):
+ New option --tabsize=COLUMNS.
+
+ * lib/Makefile.am (EXTRA_DIST): Add fnmatch_loop.c.
+ (noinst_HEADERS): fnmatch_.h renamed from fnmatch.hin.
+ regex_.h renamed from regex.hin.
+ Add file-type.h.
+ (libdiffutils_a_SOURCES): Add file-type.c.
+ (DISTCLEANFILES): Remove fnmatch.hno, regex.hno.
+
+ * lib/c-stack.c (__attribute__): New macro.
+ (EOVERFLOW): Define if not defined.
+ (stack_t): Define to struct sigaltstack if not defined or declared.
+ Include <sys/resource.h>, <ucontext.h> if available.
+ Include <stdio.h> if DEBUG.
+ Do not include <inttypes.h> or <stdint.h>.
+ (c_stack_die): Remove info and context args. All uses changed.
+ (segv_action): Likewise.
+ (alternate_signal_stack): Change uintmax_t to long, to ease porting.
+ (get_stack_location, min_address_from_argv, max_address_from_argv,
+ null_action): New functions.
+ (stack_base, stack_size): New vars.
+ (segv_handler): context arg may not be used.
+ Use global stack_base, stack_size if
+ ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
+ Add debug code.
+ Invoke die (rather than segv_action) to exit.
+ (c_stack_action): Accept new argv arg, and simpler handler arg.
+ All uses changed. Move code into new functions above.
+ Allow null action.
+ [! (defined SA_ONSTACK && defined _SC_PAGESIZE)]: Assume all segvs
+ are stack overflows.
+ (main) [DEBUG]: Describe what output should be like.
+
+ * lib/c-stack.h (siginfo_t, c_stack_die): Remove decl.
+
+ * lib/file-type.c, lib/file-type.h: New files. These contain code
+ that was in src/diff.c, but is now librarified and spiffed up a
+ bit. Jim Meyering suggested this.
+
+ * lib/fnmatch.c (alloca, __builtin_expect): Define for non-GCC hosts.
+ <strings.h>: Include only if HAVE_STRINGS_H.
+ <stddef.h>: Include if we include stdlib.h.
+ Do not comment out all code if ! HAVE_FNMATCH_GNU.
+ (getenv): Do not declare if HAVE_DECL_GETENV.
+ (__strchrnul, __wcschrnul): Remove; not used.
+ (MEMPCPY): Use mempcpy if not _LIBC; use memcpy if neither _LIBC
+ nor HAVE_MEMPCPY.
+ (FOLD) [HANDLE_MULTIBYTE]: Do not pass wide char to ISUPPER.
+ (STRLEN, STRCAT, MEMPCPY) [HANDLE_MULTIBYTE && !defined _LIBC]:
+ Use wcslen rather than __wcslen, and likewise for wcscat, wmempcpy.
+ (MEMPCPY) [HANDLE_MULTIBYTE]: Use wmempcpy if not _LIBC; use wmemcpy
+ if neither _LIBC nor HAVE_WMEMPCPY.
+ * lib/fnmatch_.h (__const): Do not define to empty, as this breaks
+ Sun cc. The code doesn't work with K&R anyway.
+ * lib/fnmatch_loop.c (struct patternlist.str): Size 1, not 0,
+ as C89 requires this.
+ (NEW_PATTERN): Use offsetof, not sizeof, since str now has size 1.
+ * lib/fnmatch_.h: Import from glibc fnmatch.h.
+ * lib/fnmatch.c, lib/fnmatch_loop.c: Import from glibc.
+
+ * lib/posixver.c: Include posixver.h.
+
+ * lib/regex_.h: Renamed from lib/regex.hin.
+
+ * m4/c-stack.m4 (jm_PREREQ_C_STACK): Do not AC_REQUIRE
+ jm_AC_TYPE_UINTMAX_T and do not use uintmax_t.
+ Check for sys/resource.h, uccontext.h.
+ Check for decls and existence of getcontext, sigaltstack.
+ Check for stack_t.
+
+ * m4/codeset.m4, m4/glibc21.m4, m4/lcmessage.m4: Remove.
+
+ * m4/fnmatch.m4: Update to latest Autoconf CVS for AC_FUNC_FNMATCH_GNU.
+ * m4/gnu-source.m4: Likewise, for AC_GNU_SOURCE (renamed from
+ AC__GNU_SOURCE).
+
+ * m4/mbstate_t.m4 (AC_TYPE_MBSTATE_T): Renamed from AC_MBSTATE_T.
+ All uses changed. Upgrade to recent Autoconf CVS.
+
+ * m4/stdbool.m4 (AC_HEADER_STDBOOL): Do not cast pointer to
+ bool in integer constant expression; C99 does not allow it.
+ Reported by Bruno Haible.
+
+ * po/LINGUAS: Add hu, pt_BR.
+ * po/hu.po, po/pt_BR.po: New files.
+
+ * src/Makefile.am (noinst_HEADERS): Remove diff.h.
+ (DEFS): Remove.
+ (diff_sources): Add diff.h.
+ (MOSTLYCLEANFILES): New macro.
+ (cmp.$(OBJEXT) diff3.$(OBJECT) diff.$(OBJECT) sdiff.$(OBJECT)): Depend
+ on paths.h.
+ (paths.h): New rule.
+
+ * src/analyze.c, src/cmp.c, src/diff.c, src/diff3.c, src/io.c,
+ src/sdiff.c: Include <file-type.h>.
+
+ * src/cmp.c: Include paths.h.
+ (copyright_notice): Renamed from copyright_string.
+ Now a msgid, so that copyright symbol can be translated.
+ All uses changed.
+ * src/diff.c, src/diff3.c, src/sdiff.c: Likewise.
+
+ * src/diff.c: Include posixver.h.
+ (TABSIZE_OPTION): New constant.
+ (main): Allow widths up to SIZE_MAX.
+ (filetype): Move to lib/file-type.c and rename to file_type.
+ All uses changed.
+
+ * src/diff.c (longopts, main, usage): New option --tabsize=COLUMNS.
+ * src/io.c (find_and_hash_each_line): Likewise.
+
+ * src/diff.h (TAB_WIDTH): Remove.
+ (tabsize): New decl.
+ (sdiff_half_width, sdiff_column2_offset): Now size_t rather than
+ unsigned int.
+
+ * src/diff3.c (skipwhite, readnum): New functions.
+ (process_diff_control): Use them.
+ (SKIPWHITE, READNUM): Remove.
+ (read_diff): Don't worry about errno == ENOEXEC.
+
+ * src/sdiff.c (catchsig, signal_handler, initial_action): Signal
+ handlers return void, not RETSIGTYPE, since we no longer support
+ K&R.
+ (TABSIZE_OPTION): New constant.
+ (longopts, usage, main): New option --tabsize=COLUMNS.
+ (cleanup): New arg signo. All uses changed.
+ (ck_editor_status, main, edit): Don't worry about ENOEXEC.
+
+ * src/side.c (tab_from_to, print_half_line, print_1sdiff_line):
+ New option --tabsize=COLUMNS.
+
+ * src/system.h (S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISREG,
+ S_ISSOCK): Remove; now in lib/file-type.h.
+
+ * src/util.c (finish_output): Check for ENOEXEC.
+ (lines_differ, output_1_line): New option --tabsize=COLUMNS.
+ (analyze_hunk): If -b or -w is also specified, -B now considers
+ lines to be empty if they contain only white space.
+
+2002-04-05 Paul Eggert <eggert@sic.twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.1.
+
+ * configure.ac (AC_HEADER_STDBOOL): Add.
+ (AC_CHECK_HEADERS): Remove stdbool.h.
+ * m4/stdbool.m4: New file.
+ * m4/prereq.m4 (jm_PREREQ_EXCLUDE):
+ Use AC_HEADER_STDBOOL rather than AC_CHECK_HEADERS(stdbool.h).
+ (jm_PREREQ_HASH): Likewise.
+
+ * src/system.h (SSIZE_MAX): Define if limits.h doesn't.
+
+ * src/analyze.c (diff_2_files): Assign PTRDIFF_MAX - 1 to a
+ size_t variable, just in case there's a problem with ptrdiff_t
+ versus size_t.
+
+ * lib/cmpbuf.c (errno): Remove decl; K&R C is no longer supported.
+ Include limits.h.
+ (SIZE_MAX, SSIZE_MAX): Define if standard headers don't.
+ (MIN): New macro.
+ (block_read): Do not attempt to read more than SSIZE_MAX bytes, as the
+ resulting behavior is implementation-defined. Work around bug in
+ Tru64 5.1, which can't read more than INT_MAX bytes at a time.
+ * src/cmp.c (cmp): Use block_read instead of read, to work
+ around Tru64 5.1 bug.
+ * src/diff3.c (read_diff): Likewise.
+ * src/diff3.c: Include cmpbuf.h.
+
+ * THANKS: Add Ulrich Drepper.
+
+ * INSTALLME: Mention GNU texinfo.
+
+ * doc/diff.texi:
+ Use new @copying directive.
+ Put @contents first, not last, since Texinfo now suggests this.
+ Fix bug in -w documentation noted by Karl Berry.
+ Mention links for speedup.
+ New node "Speedups" for future speedups.
+ Just say "Index", not "Concept Index".
+
+2002-03-26 Paul Eggert <eggert@twinsun.com>
+
+ * src/Makefile.am:
+ (INCLUDES): Remove this obsolete macro, replacing it with:
+ (AM_CPPFLAGS): New macro.
+
+2002-03-26 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * src/Makefile.am (datadir): Remove, as it conflicts with --datadir.
+
+2002-03-26 Paul Eggert <eggert@twinsun.com>
+
+ * doc/diff.texi (dircategory GNU packages): Fix typo: a "* " was
+ missing before the menu entry. Bug diagnosed by Adam Heath.
+ Also, put this dircategory after the Individual utilities dircategory,
+ to work around a compatibility problem with Debian install-info.
+
+2002-03-24 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * src/io.c (sip): Do not mishandle buffered count when reverting
+ to text mode.
+
+2002-03-23 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.8.
+ * configure.ac (AC_PREREQ): 2.53.
+ * INSTALLME: Upgrade to gettext 0.11.1 and help2man 1.27.
+
+ * doc/diff.texi: Upgrade the description of `patch' to GNU patch
+ 2.5.4, and revamp the documentation accordingly.
+
+ * src/diff.c (main): Fix typo that prevented diff -y from working.
+ Bug reported by Mitsuru Chinen.
+
+2002-03-15 Paul Eggert <eggert@twinsun.com>
+
+ * lib/c-stack.c (c_stack_die) [!HAVE_SIGINFO_T]: Don't use info.
+ Bug reported by Eli Zaretskii.
+
+2002-03-15 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ms/config.sed: Tweak editing of install-info-am target.
+
+2002-03-12 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.7.10.
+
+ * NEWS: cmp -l -s and cmp -s -l are not allowed.
+ Deprecate diff -h, -H, -L, -P, --inhibit-hunk-merge.
+
+ * configure.ac (jm_PREREQ_HARD_LOCALE): Add.
+ (AM_INIT_AUTOMAKE): Do not distribute shar file.
+
+ * doc/diff.texi (Overview): byte != character.
+ (Detailed Context, Detailed Unified, Alternate Names, diff Options):
+ Do not document diff -L.
+ (Comparing Directories, Making Patches, diff Options):
+ Do not document diff -P.
+ (diff Performance, sdiff Option Summary, diff Options, sdiff Options):
+ Do not document diff -H.
+ (diff Performance, diff Options): Do not document --horizon-lines.
+ (cmp Options): Prefer -b to -c.
+ (cmp Options, diff Options, diff3 Options, patch Options,
+ sdiff Options): Put short options next to the similar long options.
+ Document --help, and use the same wording for --verbose.
+ (diff3 Options): Fix typo in description of -E, which used wrongly used
+ "-e" instead of "-E".
+
+ * lib/hard-locale.c (alloca): Remove.
+ Include stdlib.h if available, for malloc.
+ (hard_locale): Use malloc, not alloca, so that we need not worry about
+ alloca issues. Test for storage allocation failure.
+
+ * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_HARD_LOCALE.
+ (jm_PREREQ_HARD_LOCALE): New macro.
+
+ * src/cmp.c (specify_comparison_type): New function.
+ (check_stdout): "indices and codes" -> "byte numbers and values"
+ (main): Detect clashing options.
+ (cmp): Use "byte" rather than "char" if a translation for "byte"
+ is available, even when in the POSIX locale.
+
+ * src/diff.c (option_help_msgid): Do not document -L, -P,
+ --horizon-lines, --inhibit-hunk-merge, -H.
+ * src/diff.h: -L -> --label
+
+2002-03-11 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT): Version 2.7.9.
+
+ * INSTALLME: Update to autoconf 2.53, automake 1.6, help2man
+ 1.25 with patch.
+
+ * configure.ac (AC_INIT):
+ Change package name from diff to diffutils.
+ (AM_INIT_AUTOMAKE): Use new form, with option gnits,
+ rather than old from that duplicated AC_INIT.
+ (AM_MISSING_PROG): Add help2man.
+ (REGEX_MALLOC): Define.
+ (AC_CONFIG_FILES): Add man/Makefile.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Remove.
+ * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
+ * lib/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
+ * ms/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
+ * src/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
+
+ * lib/c-stack.c: Include <errno.h>
+ (ENOTSUP): Define if errno.h doesn't.
+ (SA_NODEFER, SA_ONSTACK, SA_RESETHAND, SA_SIGINFO, SIGSTKSZ,
+ _SC_PAGESIZE, ALTERNATE_STACK_SIZE, stack_t, sigaltstack):
+ Remove; we now assume them all when
+ HAVE_XSI_STACK_OVERFLOW_HEURISTIC, so we don't need
+ substitutes.
+ (<ucontext.h>): Include only if HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
+ (alternate_signal_stack): Now of size SIGSTKSZ.
+ (segv_handler): Simplify, under the assumption that
+ HAVE_XSI_STACK_OVERFLOW_HEURISTIC is nonzero.
+ (c_stack_action): Likewise.
+ (exit_failure) [DEBUG]: Initialize to 0, not 1.
+ (recurse, main) [DEBUG]: Remove main args.
+
+ * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change
+ wording of message. Do not check for stdbool.h or ucontext.h,
+ or for ucontext_t or sigaction or sigaltstack.
+
+ * po/LINGUAS: Add zh_TW.
+
+ * Makefile.am (SUBDIRS): Add man.
+ * man/Makefile.am: New file.
+ * src/cmp.c (usage): Reword for help2man.
+ * src/diff.c (option_help_msgid): Likewise.
+ * src/diff3.c (option_help_msgid, usage): Likewise.
+ * src/sdiff3.c (option_help_msgid, usage): Likewise.
+ Reword for help2man.
+
+ * THANKS: Add email address for Tower.
+
+ * config/config.guess, config/config.sub, config/depcomp,
+ config/install-sh, config/mdate-sh, config/missing,
+ config/mkinstalldirs, config/texinfo.tex: Update
+ to recent version (maintained in other packages).
+
+2002-03-04 Bruno Haible <haible@ilog.fr>
+
+ * m4/gettext.m4 (AM_GNU_GETTEXT): Set LIBINTL and LTLIBINTL to empty if
+ no preinstalled GNU gettext was found.
+
+2002-03-02 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ms/config.sed: Tweak editing of install-info-am and
+ uninstall-info-am targets, to include 8+3-butchered names of Info
+ files.
+
+2002-02-28 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.8.
+
+ * doc/diff.texi: Add vr index.
+ Update copyright to 2002.
+ (Standards conformance): New chapter.
+ (Binary): Differing binary files are trouble unless the user asked for
+ brief output.
+ (Detailed Context): Prefer ISO time stamp format in discussion.
+ (Detailed Unified, Pagination): Likewise.
+ (Less Context): Likewise. Also use short option.
+ (Alternate Names): Separate option from arg.
+ (Making Patches): Mention -U 2.
+ (diff Options): Deprecate -LINES, as POSIX 1003.1-2001 does not
+ allow it.
+
+ * INSTALLME: Update advice for Solaris installation problems.
+ We no longer use a test version of gettext.
+ Autoconf test version updated from 2.52f to 2.52h.
+ POSIX 1003.1-2001 patch for Automake.
+
+ * configure.ac (AC__GNU_SOURCE): Add this,
+ replacing AH_VERBATIM of _GNU_SOURCE.
+ (tempname): Use AC_LIBOBJS, not LIBOBJS=, as now required by autoconf.
+ (jm_PREREQ_C_STACK): Add.
+ (AC_CONFIG_FILES): Remove intl/Makefile.
+ (AM_GNU_GETTEXT): Add external arg, from gettext 0.11.
+
+ * lib/c-stack.c, lib/c-stack.h, lib/exitfail.c, lib/exitfail.h,
+ lib/posixver.c, lib/posixver.h, m4/c-stack.m4, m4/gnu-source.m4,
+ po/cs.po, po/ja.po: New files.
+
+ * intl/ChangeLog, intl/Makefile.in, intl/VERSION,
+ intl/bindtextdom.c, intl/config.charset, intl/dcgettext.c,
+ intl/dcigettext.c, intl/dcngettext.c, intl/dgettext.c,
+ intl/dngettext.c, intl/explodename.c, intl/finddomain.c,
+ intl/gettext.c, intl/gettextP.h, intl/gmo.h, intl/hash-string.h,
+ intl/intl-compat.c, intl/l10nflist.c, intl/libgnuintl.h,
+ intl/loadinfo.h, intl/loadmsgcat.c, intl/localcharset.c,
+ intl/locale.alias, intl/localealias.c, intl/localename.c,
+ intl/ngettext.c, intl/os2compat.c, intl/os2compat.h, intl/osdep.c,
+ intl/plural-eval.c, intl/plural-exp.c, intl/plural-exp.h,
+ intl/plural.c, intl/plural.y, intl/ref-add.sin, intl/ref-del.sin,
+ intl/textdomain.c, m4/isc-posix.m4, m4/libtool.m4: Remove.
+
+ * ABOUT-NLS: Update to Gettext 0.11.
+
+ * Makefile.am (SUBDIRS): Remove intl.
+
+ * config/config.guess, config/config.rpath, config/config.sub,
+ config/texinfo.tex, config/depcomp, config/texinfo.tex,
+ lib/tempname.c: Update to latest version from other packages.
+
+ * lib/xalloc.h (xalloc_exit_failure): Remove; subsumed by exit_failure.
+ * lib/xmalloc.c: Include exitfail.h.
+ (xalloc_exit_failure): Remove; subsumed by exit_failure.
+ All uses changed.
+
+ * lib/Makefile.am (noinst_HEADERS): Add c-stack.h, exitfail.h.
+ (libdiffutils_a_SOURCES): Add c-stack.c, exitfail.c, quotesys.c.
+ (INCLUDES): Remove.
+
+ * lib/cmpbuf.h (buffer_lcm): New arg LCM_MAX.
+ * lib/cmpbuf.c: Include errno.h.
+ (errno): Declare if !STDC_HEADERS.
+ Include signal.h.
+ (SA_RESTART): Define if not already defined.
+ Include <inttypes.h>.
+ (PTRDIFF_MAX): Define if not already defined.
+ (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Likewise.
+ (block_read): Accommodate ancient AIX hosts that set errno to EINTR
+ after uncaught SIGCONT.
+ (buffer_lcm): Return a reasonable size if the multiple is too large.
+ New arg LCM_MAX. All callers changed.
+
+ * lib/hard-locale.c: Include "hard-locale.h".
+ (hard_locale): Ignore ENABLE_NLS, since we want to operate on
+ locales other than LC_MESSAGES.
+
+ * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_POSIXVER.
+ (jm_PREREQ_POSIXVER): New macro.
+
+ * m4/setmode.m4 (AC_FUNC_SETMODE_DOS):
+ Check for fcntl.h and unistd.h unconditionally.
+ Suggested by Bruno Haible.
+
+ * po/LINGUAS: Add cs, ja.
+ * po/POTFILES.in: Add lib/c-stack.c, src/dir.c.
+
+ * src/Makefile.am (datadir): @DATADIRNAME@ -> share.
+ (INCLUDES): Remove intl.
+ (LDADD): Change INTLLIBS to LIBINTL.
+ No longer need to link libdiffutils.a twice.
+
+ * src/analyze.c (diff_2_files):
+ Avoid arithmetic overflow in buffer size calculation.
+
+ * src/cmp.c: Include c-stack.h, exitfail.h.
+ (hard_locale_LC_MESSAGES): Depend on ENABLE_NLS.
+ (try_help, check_stdout, main, cmp): 2 -> EXIT_TROUBLE.
+ (main): Check for stack overflow.
+ 0 -> EXIT_SUCCESS.
+ 1 -> EXIT_FAILURE.
+ (cmp): Likewise.
+ Accommodate ancient AIX hosts that set errno to
+ EINTR after uncaught SIGCONT.
+
+ * src/context.c (pr_context_hunk):
+ Do not dump core if an enormous context causes an
+ arithmetic overflow.
+ (pr_unidiff_hunk): Likewise.
+ (find_hunk): Likewise.
+
+ * src/diff.h: unsigned -> unsigned int.
+ * src/diff.c: Include c-stack.h, exitfail.h.
+ Do not include signal.h.
+ (specify_style, specify_value): Bring these routines back, as POSIX
+ requires that the order of options not matter.
+ (shortopts): New constant.
+ (group_format_option, line_format_option): New constants.
+ (main): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE.
+ Ensure that order of options does not matter.
+ Check for stack overflow.
+ If contexts overflow, substitute LIN_MAX, as that's good enough.
+ If multiple contexts are specified, use their maximum.
+ -c is equivalent to -C 3 now, instead of having an implicit context;
+ likewise for -u and -U 3.
+ Use specify_style and specify_value.
+ (SIGCHLD): Do not define; now done in a header.
+ Use new style time stamp format for -u / -U.
+ Reject numeric-string options if operating in POSIX 1003.1-2001 mode.
+ Avoid overflow problems with tab width.
+ Simplify from-file and to-file code.
+ (usage): Do not mention obsolete options.
+ (filetype): Do not mention whether a file is executable.
+ Add typed memory objects.
+ (compare_files): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 ->
+ EXIT_TROUBLE.
+
+ * src/diff3.c: Include c-stack.h, exitfail.h.
+ (ALLOCATE): Remove. All uses changed to xmalloc, or to xmalloc plus
+ an overflow check.
+ (myread): Remove.
+ (main): Check for stack overflow.
+ 0 -> EXIT_SUCCESS, 1 -> EXIT_FAIULRE, 2 -> EXIT_TROUBLE.
+ (try_help): Likewise.
+ (process_diff): Check for integer overflow, to avoid core dumps.
+ 2 -> EXIT_TROUBLE.
+ (read_diff): Exit with status 126 if the file is not executable,
+ for compatibility with POSIX 1003.1-2001.
+ Accommodate ancient AIX hosts that set errno to EINTR after uncaught
+ SIGCONT.
+ Check for integer overflow to avoid core dumps.
+ (fatal, perror_with_exit): 2 -> EXIT_TROUBLE.
+
+ * src/dir.c (dir_read):
+ Ignore st_size of directories: POSIX says it's garbage.
+ Check for integer overflow to avoid core dumps.
+ (diff_dirs): 0 -> EXIT_SUCCESS, 2 -> EXIT_TROUBLE.
+
+ * src/ifdef.c: Include <xalloc.h>.
+ (format_group, print_ifdef_lines): Avoid core dumps with bad formats.
+ (do_printf_spec): Avoid alloca.
+
+ * src/io.c (sip):
+ Avoid integer overflow and core dumps if buffer alignments are
+ preposterously incompatible.
+ (slurp): Do not dump core if the file is growing as we read it.
+ If a regular file grows, keep reading until we catch up with its EOF.
+ (find_and_hash_each_line): Check for integer overflow to avoid cores.
+ (GUESS_LINES): Remove.
+ (guess_lines): New function. Avoid integer overflow.
+ (find_identical_ends): Use it.
+ Avoid integer overflow and possible core dumps.
+
+ * src/sdiff.c: Include c-stack.h, exitfail.h. Do not include signal.h.
+ 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE.
+ (ck_editor_status): New function.
+ (main): Check for stack overflow.
+ Adopt POSIX convention for subsidiary programs not found.
+ (diffarg): Check for integer overflow to avoid core dumps.
+ (trapsigs): Remove SA_INTERRUPT special case; now done by header.
+ (SIGCHLD): Likewise.
+ (edit): Adopt POSIX convention for subsidiary programs not found.
+
+ * src/side.c: unsigned -> unsigned int.
+
+ * src/system.h: Don't use alloca or include <alloca.h>.
+ unsigned -> unsigned int
+ (EXIT_SUCCESS, EXIT_FAILURE, EXIT_TROUBLE): Define if not defined.
+ Include signal.h.
+ (SA_RESTART): Define if not defined.
+ (SIGCHLD): Likewise.
+
+ * src/util.c: 2 -> EXIT_TROUBLE.
+ Adopt POSIX convention for ENOEXEC and exit status 126.
+ unsigned -> unsigned int
+
+2002-01-24 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.7.
+
+ * intl/plural.c: Regenerate with Bison 1.31.
+
+ * ABOUT-NLS, intl/*: Update to Gettext 0.11-pre5++.
+ * INSTALL: Update to Autoconf 2.52f.
+
+ * INSTALLME: New file.
+ * Makefile.am (EXTRA_DIST): Add config/config.rpath, INSTALLME.
+ (DISTCLEANFILES): Remove.
+ * NEWS: Reformat for imminent 2.8 release.
+ * README: Mention INSTALLME.
+ * README-alpha: Move most of contents to INSTALLME.
+ * THANKS: Add Bruno Haible, Jim Meyering, and Eli Zaretskii.
+
+ * config: New subdirectory, containing the following files from .:
+ config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs.
+ Move the following files here from doc: texinfo.tex, mdate-sh.
+ * config/config.guess, config/config.sub, config/texinfo.tex:
+ Update to latest version from FSF.
+ * config/config.rpath: New file, from Gettext 0.11-pre5++.
+
+ * configure.ac (AC_INIT): Use new 3-arg form.
+ (AC_CONFIG_SRCDIR): Specify src/diff.c here, not in AC_INIT.
+ (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11.
+ (AC_CONFIG_AUX_DIR): New macro invocation.
+
+ * lib/Makefile.am (noinst_HEADERS): Add gettext.h.
+ * lib/gettext.h: New file, from Gettext 0.11-pre5++.
+ * lib/prepargs.c: Include <string.h>. Reported by Bruno Haible.
+
+ * m4/codeset.m4, m4/gettext.m4, glibc21.m4, iconv.m4, isc-posix.m4,
+ lcmessage.m4, progtest.m4: Upgrade to Gettext 0.11-pre5++.
+ * m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4: New files, from
+ Gettext 0.11-pre5++.
+
+ * po/LINGUAS: New file.
+ * po/Makefile.in.in: Upgrade to Gettext 0.11-pre5++.
+ * po/Makevars, po/Rules-quot, po/boldquot.sed: New files,
+ from Gettext 0.11-pre5++.
+
+ * src/cmp.c (copyright_string): Update to 2002.
+ * src/diff.c (copyright_string): Likewise.
+ * src/diff3.c (copyright_string): Likewise.
+ * src/sdiff.c (copyright_string): Likewise.
+
+ * src/cmp.c (specify_ignore_initial): Renamed from
+ parse_ignore_initial, with different signature, to take the
+ maximum of multiple options rather than the last one.
+ All uses changed.
+
+ * src/cmp.c (bytes, specify_ignore_initial, cmp): Use UINTMAX_MAX
+ instead of (uintmax_t) -1, to avoid warnings on some compilers.
+ * src/io.c (file_block_read): Likewise, for SIZE_MAX.
+
+ * src/cmp.c (usage): Reformat messages to ease translation.
+ * src/diff3.c (usage): Likewise.
+ * src/sdiff.c (usage): Likewise.
+
+ * src/cmp.c (main): Two files with the same name are identical
+ only if the same offset is specified.
+ (block_compare_and_count): Avoid cast to unsigned char.
+
+ * src/diff3.c (main): Remove unused variable.
+
+ * src/dir.c: Include <setjmp.h>
+ (struct dirdata): New member nnames.
+ (locale_specific_sorting, failed_strcoll): New vars.
+ (dir_read): Renamed from dir_sort. Don't sort the dir.
+ Set new nnames member of struct dirdata. All callers changed.
+ (compare_names): Don't check for errno after strcasecmp.
+ Use strcoll only if locale_specific_sorting is nonzero.
+ If strcoll fails, longjmp out rather than returning a value
+ that might result in an invalid comparison function that might
+ make qsort dump core.
+ (diff_dirs): Sort the directory ourselves. Use setjmp to recover
+ from strcoll failure, falling back on native byte comparison.
+ Make local variables volatile if they need to preserve their value
+ after setjmp/longjmp.
+
+ * src/sdiff.c (handler_index_of_SIGINT, handler_index_of_SIGPIPE):
+ New macros.
+ (main): Do not confuse signal numbers with their indices.
+ Bug reported by Bruno Haible.
+ (edit): Cat lin to long before printing with %ld, since lin might
+ be narrow than long.
+
+ * src/system.h (UINTMAX_MAX): New macro.
+ Include gettext.h, not libgettext.h.
+ (N_): Do not wrap arg in parentheses. Fix from Bruno Haible.
+
+ * src/util.c (finish_output): Ensure that werrno is initialized.
+ (lines_differ): Have an explicit do-nothing case for
+ IGNORE_NO_WHITE_SPACE, to pacify gcc -Wall.
+
+2001-12-29 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * src/sdiff.c (interact): After extracting rlen from the editor
+ command, test for a terminating null character, not for a newline.
+
+ * ms/config.bat: Allow longer source directory names without
+ overflowing the line length limits. Create the cache in the
+ build directory, not in the source directory
+ * ms/config.sed: Fix AC_CONFIG_LINKS for when symlinks are
+ unavailable.
+
+2001-12-23 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.6.
+
+ * configure.ac (ALL_LINGUAS): Add tr.
+
+ * src/util.c (begin_output):
+ Have child exit with status 127 rather than reporting
+ failure on its own. Set errno to 0 before invoking popen.
+ (finish_output): Report errno on pclose failure.
+ Distinguish between subsidiary program not found, and failure.
+
+ * src/sdiff.c (not_found, execdiff): Remove.
+ (DIFF_PROGRAM_OPTION): New constant.
+ (longopts, option_help_msgid, main): Add --diff-program=PROGRAM.
+ (check_stdout): New function.
+ (main): Remove DIFF_PROGRAM. Check stdout after printing version.
+ Use check_stdout after printing help. Use execvp/perror_fatail rather
+ than execdiff. Set errno to 0 before invoking popen.
+ Check for pclose failure properly.
+ (main, edit): If child exec fails, exit with 127 rather than trying to
+ print diagnostic.
+ Distinguish between subsidiary program failing and not being found.
+ (edit): Handle signals the same way, regardless of whether we're using
+ system or fork+exec. Check for system returning -1.
+
+ * src/diff3.c (DIFF_PROGRAM_OPTION, HELP_OPTION): New constants.
+ (longopts, main): Use them.
+ (longopts, main, option_help_msgid): New option --diff-option=PROGRAM.
+ (main): Remove DIFF_PROGRAM support.
+ Check stdout after printing version.
+ (check_stdout): Report errno info if fclose fails.
+ (read_diff): Have child exit with status 127 when program is not found,
+ rather than trying to have the child report failure. Check for
+ pclose returning -1.
+
+ * src/diff.c (DEFAULT_WIDTH): Remove.
+ (main): Use 130 instead of DEFAULT_WIDTH, since it's not really
+ builder-settable. Do not prepend DIFF_OPTIONS.
+ (check-stdout): If fclose (stdout) fails, print errno info.
+ (option_help_msgid): Default context is 3, not 2.
+ (usage): Work even if ptrdiff_t is wider than int.
+
+ * doc/diff.texi (diff Options): Remove DIFF_OPTIONS.
+ (Invoking diff3, Invoking sdiff): Remove DIFF_PROGRAM.
+ (diff3 Options, sdiff Options): Add --diff-program.
+
+ * src/cmp.c (valid_suffixes):
+ Add '0', to support suffixes like "MB" and "MiB".
+ (check_stdout): Don't assume that the translations of "write failed"
+ and of "standard output" lack '%'.
+ (main): Check stdout after printing version.
+
+ * lib/setmode.c: [HAVE_FCNTL_H && HAVE_SETMODE_DOS]: Include <fcntl.h>.
+ [!HAVE_SETMODE_DOS]: Do not include <unistd.h>.
+ (set_binary_mode): Return mode (not 1) if fd is a tty.
+ Do not assume that O_TEXT is zero.
+
+ * doc/diff.texi (cmp Options):
+ In byte counts, a plain suffix (without any integer)
+ is assumed to modify the integer 1. Index terms like "kibibyte".
+ Document plain "k".
+
+ (Reporting Bugs): Mention bug-report archive and test version
+ location. Ask for "diff --version" in bug reports.
+
+2001-12-13 Paul Eggert <eggert@twinsun.com>
+
+ * src/diff.c (DEFAULT_WIDTH): Remove; couldn't be changed without
+ also changing option_help_msgid. All uses replaced with 130.
+
+ * lib/setmode.c: Include fcntl.h and unistd.h only if
+ HAVE_SETMODE_DOS.
+ (setmode): Assume a file is binary unless the mode is O_TEXT.
+ * ms/README: Fix minor typos.
+
+2001-12-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ms/README: New file.
+
+ * lib/setmode.c (set_binary_mode) [HAVE_SETMODE_DOS]: Don't assume
+ O_TEXT has a zero value. If FD is a terminal device, do nothing
+ and return MODE, thus pretending that it was already in the
+ requested MODE.
+ [HAVE_FCNTL_H]: Include fcntl.h (needed for O_BINARY).
+
+ * ms/config.sed: Remove the split prevention of config.status.
+ Fix Sed commands for converting absolute file names into
+ top_srcdir-relative ones.
+
+ * ms/config.bat: Fix typos.
+
+2001-12-12 Neal H Walfield <neal@cs.uml.edu>
+
+ * diff.c (option_help_msgid): Correct the default context width
+ from 2 to 3.
+
+2001-12-11 Paul Eggert <eggert@twinsun.com>
+
+ * m4/Makefile.am.in: Remove jm-glibc-io.m4
+
+ * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.5.
+
+ * configure.ac (PR_PROGRAM): Use AC_DEFINE_UNQUOTED, so that
+ $PR_PROGRAM is expanded by sh.
+ (ptrdiff_t, ssize_t): Use AC_CHECK_TYPE with a default of int,
+ not AC_CHECK_TYPES.
+ (jm_AC_DOS, AC_FUNC_SETMODE_DOS): New macros.
+ (AC_CONFIG_FILES): Add ms/Makefile.
+
+ * doc/diff.texi: Add --no-ignore-file-name-case.
+ File name case sensitivity now affects file name exclusion.
+ Fix typos.
+
+ * src/util.c: Include dirname.h.
+ (dir_file_pathname): Use base_name rather than file_name_lastdirchar.
+
+ * src/system.h (S_IXUSR, S_IXGRP, S_IXOTH): New macros.
+ Include <libgettext.h> rather than rolling it ourselves.
+ (file_name_lastdirchar, HAVE_SETMODE, set_binary_mode): Remove.
+
+ * src/sdiff.c: Include <dirname.h>.
+ (expand_name): Use base_name rather than file_name_lastdirchar, for
+ portability to DOS.
+ (main): Initialize xalloc_exit_failure before possibly invoking
+ any memory allocator.
+
+ * src/io.c: Include setmode.h.
+
+ * src/diff3.c (main):
+ Initialize xalloc_exit_failure before possibly invoking any memory
+ allocator.
+
+ * src/diff.c: Include dirname.h, setmode.h.
+
+ (main): Later values and/or styles now silently override earlier.
+ (specify_value, specify_style): Likewise. All callers changed.
+ Remove.
+ (binary, main, option_help_msgid, compare_files):
+ HAVE_SETMODE -> HAVE_SETMODE_DOS.
+ (NO_IGNORE_FILE_NAME_CASE_OPTION): New constant.
+ (longopts, main, option_help_msgid): Support it.
+ (exclude_options): New function.
+ (main): Use it. Initialize xalloc_exit_failure before potentially
+ allocating memory.
+
+ (filetype): Distinguish executable files from others, as POSIX
+ suggests.
+
+ (compare_files): Use base_name instead of file_name_lastdirchar.
+
+ * src/cmp.c: Include <hard-locale.h>, <setmode.h>.
+ (hard_locale_LC_MESSAGES): New macro.
+ (sprintc): Remove int width arg; it's now the caller's responsibility
+ to pad. All callers changed.
+ (stat_buf): New static var; was formerly a local var in 'main'.
+ (valid_suffixes): Add 'K', for 'KiB'.
+ (option_help_msgid): Don't confuse bytes with characters.
+ (main): Set xalloc_exit_failure before invoking anything that might
+ allocate memory. Fix bug: -n was incorrectly ignored when optimizing
+ the case of regular files with different lengths.
+ (cmp): Use an index column wide enough to store this comparison's
+ indexes. In locales other than the POSIX locale, say "byte"
+ rather than "char".
+
+ * ms/config.bat: pc -> ms
+
+ * ms/Makefile.am, m4/setmode.m4, lib/setmode.c, lib/setmode.h:
+ New file.
+
+ * lib/Makefile.am (noinst_HEADERS): Add dirname.h, setmode.h.
+ (libdiffutils_a_SOURCES): Add basename.c, setmode.c.
+
+ * Makefile.am (SUBDIRS): Add ms.
+
+2001-12-10 Paul Eggert <eggert@twinsun.com>
+
+ * m4/fnmatch.m4: Test for FNM_CASEFOLD.
+
+2001-12-03 Paul Eggert <eggert@twinsun.com>
+
+ * lib/posix/regex.h: Fix copyright notice.
+
+2001-12-03 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.4.
+
+ * diff.texi (direntry, Overview, Comparison, Binary, Invoking cmp):
+ Use "byte" rather than "character" when talking about cmp, since
+ it compares bytes, not character.
+ (Invoking cmp): New trailing operands FROM-SKIP and TO-SKIP.
+ -i or --ignore-initial now accepts FROM-SKIP:TO-SKIP.
+ New option -n or --bytes.
+ Count operands now may be in octal or hex, and may be followed by a
+ size multiplier.
+
+ * configure.ac (DEFAULT_DIFF_PROGRAM):
+ Define to "diff", not "$bindir/diff" (which didn't work anyway).
+ (AC_CHECK_MEMBERS): Add struct stat.st_blksize, struct stat.st_rdev.
+ (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Remove; obsolescent.
+ (AC_FUNC_FORK): Use this, instead of obsolescent AC_FUNC_VFORK.
+ (AC_CONFIG_FILES, AC_CONFIG_COMMANDS): Add.
+ (AC_OUTPUT): Remove args; they were obsolescent.
+
+ * util.c (setup_output, begin_output, finish_output):
+ HAVE_FORK -> HAVE_WORKING_FORK || HAVE_WORKING_VFORK.
+ * sdiff.c (diffpid, cleanup, main, edit): Likewise.
+ * diff3.c (read_diff): Likewise.
+
+ * system.h (STAT_BLOCKSIZE):
+ Use HAVE_STRUCT_STAT_ST_BLKSIZE, not HAVE_ST_BLKSIZE.
+ (vfork): New macro.
+ (HAVE_FORK): Remove.
+ (set_binary_mode): New macro.
+
+ * sdiff.c (main): HAVE_VFORK -> HAVE_WORKING_VFORK.
+ (edit): Reopen the temporary file after the editor has run, in case
+ the editor operates by unlinking the old file and linking a new one.
+ (P_tmpdir): Rename from PVT_tmpdir; this fixes a typo.
+ All uses changed.
+
+ * io.c (sip, read_files):
+ Remove tests for HAVE_SETMODE; use set_binary_mode
+ instead of setmode.
+ (sip): Fix typo in backward lseek when reverting to text mode.
+
+ * config.site, config.sed, config.bat: New file.
+
+ * Makefile.am (EXTRA_DIST): Add xstrtol.c.
+ (noinst_HEADERS): Add xstrtol.h.
+ (libdiffutils_a_SOURCES): Add xstrtoumax.c.
+
+ * cmp.c: <xstrtol.h>: Include.
+ (ignore_initial): Now an array with 2 elements. All uses changed.
+ (bytes): New var.
+ (HELP_OPTION): New constant.
+ (long_options, main): Use it.
+ (long_options, option_help_msgid, main, cmp):
+ Add support for -n or --bytes.
+ (parse_ignore_initial): New function.
+ (option_help_msgid, main): Add -i M:N.
+ (usage, main): Add two optional trailing operands, a la BSD.
+ (main): setmode -> set_binary_mode.
+ (cmp): Report byte number of what we've seen, not of the entire file.
+ This is to be consistent with the line number, which is always relative
+ with what we've seen.
+
+2001-12-02 Paul Eggert <eggert@twinsun.com>
+
+ * diff.c (main, compare_files): setmode -> set_binary_mode.
+
+ * xstrtol.c (__xstrtol): Don't accept 'Ki'; require 'KiB'.
+
+ * xstrtol.c (__xstrtol): Add support for IEC 60027-2.
+
+2001-11-25 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.3.
+
+ * README-alpha: New file.
+
+ * src/Makefile.am (INCLUDES): Add -I../lib, for regex.h.
+
+ * configure.ac:
+ Don't set LIB_CLOCK_GETTIME to 'none required'; set it to
+ the empty string instead.
+
+ * lib/Makefile.am (EXTRA_DIST): Add strtoimax.c, strtol.c.
+
+ * Makefile.am (SUBDIRS): Put intl before lib, so that libintl.h exists.
+
+ * lib/Makefile.am (noinst_HEADERS): Add unlocked-io.h.
+
+ * configure.ac (__EXTENSIONS__): New define, for the unlocked macros.
+
+ * README: Add copyright notice.
+ Remove stuff that doesn't apply any more.
+
+ * doc/diff.texi: offsets -> indices for cmp
+
+ * src/cmp.c (option_help_msgid): offsets -> indices
+
+ * src/diff.c (option_help_msgid):
+ Don't mention --binary on POSIX hosts.
+
+ * src/sdiff.c (STRIP_TRAILING_CR_OPTION): New constant.
+ (longopts, option_help_msgid, main): Add -E, --ignore-tab-expansion,
+ --strip-trailing-cr.
+
+ * doc/diff.texi: Change direcategory from Utilities to GNU Packages.
+ Add individual utilities.
+ Switch to Free Documentation License.
+ @code -> @command
+ @samp -> @option
+ GNU -> @sc{gnu}
+ Expand tabs to spaces, except when in an example that actually
+ uses tabs.
+ Prefer @node with just one arg.
+ Document -E or --ignore-tab-expansion, --strip-trailing-cr,
+ --ignore-file-name-case.
+ Regular expressions are now grep style, not Emacs style.
+ cmp's -c or --print-chars option is now -b or --print-bytes.
+ Time stamps now depend on LC_TIME.
+ -p now implies ^[[:alpha:]$_].
+ Flags now include ' and 0.
+ cmp -i is an alias for --ignore-initial
+ Document --from-file, --to-file.
+ Document DIFF_OPTIONS.
+
+ * configure.ac (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime.
+ (LIB_CLOCK_GETTIME): New subst.
+
+ * src/system.h: Assume C89 or better.
+ (_GNU_SOURCE): Remove; config.h now defines it.
+ (alloca): Declare like coreutils does it.
+ (verify, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, O_RDWR,
+ S_IRUSR, S_IWUSR): New macros.
+ (STAT_BLOCKSIZE): Parenthesize definiens.
+ <inttypes.h>: Include if HAVE_INTTYPES_H.
+ (CHAR_MAX, INT_MAX): Remove.
+ (PTRDIFF_MAX, SIZE_MAX): New macros.
+ (strtoumax): New decl.
+ Include stddef.h.
+ (bzero): Remove.
+ (bindtextdomain, textdomain, N_): New macros.
+ (ISPRINT, ISSPACE): Remove ifndef wrappers.
+ (ISUPPER, ISDIGIT): Remove.
+ (TOLOWER): New macro.
+ (MIN): Renamed from min; all callers changed.
+ (MAX): Likewise, from max.
+ (lin): New type.
+ (LIN_MAX): New macro.
+ (file_name_cmp): Renamed from filename_cmp. All callers changed.
+ (file_name_lastdirchar): Renamed from file_name_lastdirchar.
+ All callers changed.
+ (could_be_mvfs_stat_bug, could_be_nfs_stat_bug,
+ dev_may_have_duplicate_ino): Remove.
+ (HAVE_SETMODE, NULL_DEVICE): New macros.
+ (same_file): Do not check attributes.
+ (same_file_attributes): New macro.
+
+ * src/util.c: Assume C89 or better.
+ int -> bool for booleans.
+ int -> lin for line numbers.
+ int -> size_t for sizes.
+ Use angle-brackets when including quotesys.h.
+ Include error.h, regex.h, xalloc.h.
+ (message5): sizeof -> offsetof
+ (begin_output): Invoke pr without -f.
+ (lines_differ): Renamed from line_cmp, and return bool not 3-way int.
+ All callers changed.
+ Add support for IGNORE_TAB_EXPANSION.
+ (change_letter): Now an array rather than a function. All
+ callers changed.
+ (translate_range): Translate line numbers to long, not lin,
+ for convenience with printf.
+ (analyze_hunk): Return enum changes instead of a count of
+ inserts and deletes. All callers changed.
+ (zalloc): New function.
+
+ * src/side.c: Assume C89 or better.
+ int -> bool for booleans.
+ int -> lin for line numbers.
+
+ * src/sdiff.c: Assume C89 or better.
+ int -> bool for booleans.
+ int -> lin for line numbers.
+ Use angle-brackets when including getopt.h, quotesys.h.
+ Include error.h, freesoft.h, stdio.h, xalloc.h.
+ (copyright_string): Use only most recent year.
+ (authorship_msgid, option_help_msgid): Wrap in N_().
+
+ (tmpname): Now volatile.
+ (tmpmade): Remove.
+ (tmp): New var.
+ (private_tempnam, exists, letters): Remove.
+ (temporary_file): New function.
+ (edit): Use it.
+ (interact): Use strtoumax, not atoi.
+
+ * src/normal.c: Assume C89 or better.
+ int -> lin for line numbers.
+
+ * src/io.c: Assume C89 or better.
+ int -> bool for booleans.
+ int -> lin for line numbers.
+ int -> size_t for sizes.
+ Use angle-brackets when including cmpbuf.h.
+ Include regex.h, xalloc.h.
+ (word): Remove; now done in system.h.
+ (hash_value): New type; use it instead of 'unsigned' for hash values.
+ (file_block_read): New function.
+ (sip, slurp): Use it. Now static.
+ (sip): Ensure block size is a multiple of word size. Clear eof flag.
+ (slurp): Use xalloc_die to report memory exhaustion.
+ (find_and_hash_each_line): Use TOLOWER instead of _tolower.
+ Add support for IGNORE_TAB_EXPANSION.
+ (prepare_text_end): Strip trailing CR if requested.
+ (find_identical_ends): Prepare the text only once,
+ if they're duplicates.
+ Let the compiler take advantage more of the fact that the buffers are
+ word-aligned.
+ (primes): Remove.
+ (prime_offset): New var.
+ (read_var): Use prime_offset instead of primes.
+ Use zalloc instead of xmalloc + bzero.
+
+ * src/ifdef.c: Assume C89 or better.
+ int -> lin for line numbers.
+ (format_group): Use strtoumax to parse line numbers.
+ (format_group, print_ifdef_lines): Use do_printf_spec to
+ handle printf specs.
+ (groups_letter_value): Don't use _tolower; it's locale-dependent.
+ (do_printf_spec): Renamed from scan_printf_spec; now does the printing.
+
+ * src/ed.c: Assume C89 or better.
+ int -> lin for line numbers (or 'long' when that's more convenient).
+ (print_ed_hunk): Fix bug when handling double-dot inserts.
+
+ * src/dir.c: Assume C89 or better.
+ int -> bool for booleans.
+ Include error.h, exclude.h, xalloc.h.
+
+ (dir_sort): Return 0 on error, 1 on success. All callers changed.
+ compare_names -> compare_names_for_qsort.
+
+ (compare_names): Try strcasecmp if ignore_file_name_case. Then try
+ strcoll. Use file_name_cmp only as a last resort. Warn about
+ strcasecmp or strcoll failure.
+ (compare_names_for_qsort): New function.
+
+ (diff_dirs): Use compare_names rather than filename_cmp.
+
+ * src/diff3.c: Assume C89 or better.
+ int -> bool for booleans.
+ int -> lin for line numbers.
+ Use angle-brackets when including getopt.h, quotesys.h.
+ Include error.h, freesoft.h, inttostr.h, xalloc.h.
+ (copyright_string): Use only most recent year.
+ (authorship_msgid, option_help_msgid): Wrap in N_().
+
+ Rename the following variables for consistency with user-visible
+ option spellings. All uses changed.
+ (text): Renamed from always_text.
+ (initial_tab): Renamed from tab_align_flag.
+
+ (horizon_lines): Remove. Remove all uses.
+
+ (main): Invoke bindtextdomain and textdomain after setlocale.
+ Rename "DIFF" to "DIFF_PROGRAM".
+
+ Try to compare file0 to file1, because this is where changes are
+ expected to come from. Diffing between these pairs of files is more
+ likely to avoid phantom changes from file0 to file1.
+ However, use file2 as the common file if this is a 3-way diff,
+ for backward compatibility. Suggested by Karl Tomlinson.
+
+ (create_diff3_block): Use xcalloc instead of malloc + bzero.
+
+ (INT_STRLEN_BOUND): Remove; now in system.h.
+
+ (read_diff): Always use --horizon-lines=100 rather than trying
+ to guess it.
+ Do not pass --inhibit-hunk-merge.
+ Minimum chunk size is 1, not 8KiB.
+ Use xalloc_die to report memory exhaustion.
+ (undotlines): Use long for start, not int.
+
+ * src/diff.h: Assume C89 or better.
+ int -> bool for booleans.
+ int -> lin for line numbers.
+ Don't include regex.h.
+ (enum changes): New enum.
+ (enum line_class): Remove; subsumed by enum changes.
+ (enum output_style): New constant OUTPUT_UNSPECIFIED.
+
+ (ignore_space_change_flag, ignore_all_space_flag): Remove.
+ (ignore_white_space): New decl, subsuming the above two. All
+ uses changed.
+
+ Rename the following decls for consistency with user-visible
+ option spellings. All uses changed.
+ (text): Renamed from always_text_flag.
+ (ignore_blank_lines): Renamed from ignore_blank_lines_flag.
+ (ignore_case): Renamed from ignore_case_flag.
+ (brief): Renamed from no_details_flag.
+ (initial_tab): Renamed from tab_align_flag.
+ (expand_tabs): Renamed from tab_expand_flag.
+ (starting_file): Renamed from dir_start_file.
+ (paginate): Renamed from paginate_flag.
+ (sdiff_merge_assist): Renamed from sdiff_help_sdiff.
+ (left_column): Renamed from sdiff_left_only.
+ (suppress_common_lines): Renamed from sdiff_skip_common_lines.
+ (speed_large_files): Renamed from heuristic.
+ (minimal): Renamed from no_discards.
+
+ (inhibit_hunk_merge): Remove.
+
+ (strip_trailing_cr, excluded, time_format): New decls.
+
+ (files_can_be_treated_as_binary): Renamed from ignore_some_changes.
+
+ (group_format, line_format): Now char const *[], not char *[].
+
+ (struct file_data): Buffer is now word*, not char*, as it's always
+ aligned and this can help the compiler. buffered_chars -> buffered
+ (since it's a byte count, not a char count). All uses changed.
+ New member `eof'.
+
+ (FILE_BUFFER): New macro.
+
+ (excluded_filename, error, free_software_msgid): Remove decls; now in
+ other .h files.
+
+ (sip, slurp): Remove decls.
+ (file_block_read): New decl.
+ (change_letter): Now an array, not a function.
+ (lines_differ): Renamed from line_cmp.
+ (analyze_hunk): Now returns enum changes rather than two change counts.
+
+ * src/Makefile.am (diff_LDADD): New symbol.
+
+ * src/diff.c: Assume C89 or better.
+ int -> bool for booleans.
+ long -> off_t for line numbers.
+ Use angle-brackets when including getopt.h, fnmatch.h, quotesys.h.
+ Include error.h, exclude.h, freesoft.h, hard-locale.h, prepargs.h,
+ regex.h, signal.h, xalloc.h.
+ (copyright_string): Use only most recent year.
+ (authorship_msgid, option_help_msgid): Wrap in N_().
+
+ Rename the following variables for consistency with user-visible
+ option spellings. All uses changed.
+ (binary): Renamed from binary_flag.
+ (new_file): Renamed from entire_new_file_flag.
+ (unidirectional_new_file): Renamed from unidirectional_new_file_flag.
+ (report_identical_files): Renamed from print_file_same_flag.
+
+ (numeric_arg): Remove.
+
+ (exclude, exclude_alloc, exclude_count, excluded_filename, add_exclude,
+ add_exclude_file):
+ Remove; now done by exclude.h.
+
+ (BINARY_OPTION, FROM_FILE_OPTION, HELP_OPTION, HORIZON_LINES_OPTION,
+ IGNORE_FILE_NAME_CASE_OPTION, INHIBIT_HUNK_MERGE_OPTION,
+ LEFT_COLUMN_OPTION, LINE_FORMAT_OPTION, NORMAL_OPTION,
+ SDIFF_MERGE_ASSIST_OPTION, STRIP_TRAILING_CR_OPTION,
+ SUPPRESS_COMMON_LINES_OPTION, TO_FILE_OPTION,
+ UNCHANGED_LINE_FORMAT_OPTION, OLD_LINE_FORMAT_OPTION,
+ NEW_LINE_FORMAT_OPTION, UNCHANGED_GROUP_FORMAT_OPTION,
+ OLD_GROUP_FORMAT_OPTION, NEW_GROUP_FORMAT_OPTION,
+ CHANGED_GROUP_FORMAT_OPTION): New constants.
+ (longopts, main): Use them.
+
+ (longopts, main, option_help_msgid): Add -E, --from-file, --to-file.
+
+ (main): Invoke bindtextdomain and textdomain after setlocale.
+ Use grep syntax, not Emacs, for regular expressions.
+ Use exclude.h, not our own functions.
+ Use ISO 8601 time format in hard locales.
+ Prepend DIFF_OPTIONS.
+ Don't update ignore_some_changes.
+ Use strtoumax instead of numeric_arg.
+ Use specify_value when appropriate.
+ error -> try_help when appropriate.
+ -p now means ^[[:alpha:]$_], not ^[_a-zA-Z$].
+ Ignore --inhibit-hunk-merge.
+ Prefer changed group formats to unchanged ones.
+ Remove now-unnecessary casts.
+ Set files_can_be_treated_as_binary.
+
+ (specify_value): Renamed from specify_format. All uses changed.
+
+ (specify_style): Default is now unspecified, not normal. All
+ uses changed.
+
+ (set_mtime_to_now): New function.
+ (compare_files): Use it. Use memset, not bzero.
+ Set stdin mtime to current time even when stdin is not a regular file.
+ Check for same file attributes, as well as for same file.
+ Use files_can_be_treated_as_binary.
+ "write failed" -> "standard output on output failure.
+
+ * src/context.c: Assume C89 or better.
+ int -> lin for line numbers.
+ Include inttostr.h, regex.h.
+ (TIMESPEC_NS): New macro.
+ (nstrftime): New decl.
+ (print_context_label): Use nstrftime and time_format to format times.
+ Print numeric time stamp value if localtime fails.
+ (print_context_function): New function.
+ (pr_context_hunk, pr_unidiff_hunk): Use it.
+ (find_function): Use size_t for sizes, not int.
+
+ * src/cmp.c: Assume C89 or better.
+ int -> bool for booleans.
+ long -> off_t for line numbers.
+ Use angle-brackets when including cmpbuf.h, getopt.h.
+ Include error.h, freesoft.h, inttostr.h, xalloc.h.
+ (copyright_string): Use only most recent year.
+ (authorship_msgid): Wrap in N_().
+ (buffer): Now word*, not char*. All uses changed.
+ (word): Remove macro; now in system.h.
+ (long_options, option_help_msgid, main): -c --print-chars ->
+ -b --print-bytes
+ (check_stdout): "write failed" -> "standard output"
+ (option_help_msgid): Wrap in N_().
+ (main): Invoke bindtextdomain and textdomain after setlocale.
+ Use strtoumax instead of doing the work ourselves.
+ Check for same_file_attributes as well as same_file.
+ (cmp): Use ssize_t for read returns, not size_t.
+ Do not assume that size_t is not narrower than int.
+ Do not assume that line numbers fit in 'long'.
+ (block_compare_and_count, block_compare):
+ Compiler now checks that buffers are word-aligned.
+ (block_compare_and_count): Count sizes with size_t, not long.
+ (sprintc): byte arg is unsigned char, not unsigned.
+
+ * src/analyze.c: Assume C89 or better.
+ int -> lin for line numbers.
+ int -> bool for booleans.
+ unsigned int -> size_t for sizes.
+ Use angle-brackets when including cmpbuf.h.
+ Include error.h, regex.h, xalloc.h.
+ (discard_confusing_lines, diff_2_files): Use zalloc rather
+ than xalloc+bzero.
+ (discard_confusing_lines): unsigned int -> lin for values that
+ are really line numbers.
+ (shift_boundaries): Do not inhibit hunk merges.
+ (build_reverse_script, build_script, diff_2_files): Use |, not ||.
+ (diff_2_files): no_details_flag & ~ignore_some_changes ->
+ files_can_be_treated_as_binary. Esure that buffer size is a multiple
+ of sizeof (word). Use file_block_read to read buffers.
+ (diff_2_files): Abort if output style is not one of the
+ expected styles.
+
+2001-11-23 Paul Eggert <eggert@twinsun.com>
+
+ * src/Makefile.am, m4/vararrays.m4: New file.
+
+ * m4/prereq.m4 (jm_PREREQ_READUTMP):
+ Remove, as it gives autoheader the willies.
+
+ * m4/README, lib/prepargs.h, lib/prepargs.c, lib/offtostr.c,
+ lib/umaxtostr.c, lib/inttostr.c, lib/inttostr.h,
+ lib/imaxtostr.c, lib/freesoft.h: New files.
+
+ * lib/freesoft.c: Include config.h, freesoft.h rather than diff.h.
+ (free_software_msgid): Wrap contents in N_.
+
+ * lib/cmpbuf.h: Use prototypes instead of old-style functions.
+
+ * lib/cmpbuf.c:
+ Don't include system.h; instead, include config.h, unistd.h.
+ Use prototypes instead of old-style functions.
+ (block_read): Don't assume that int is no wider than size_t.
+
+ * lib/Makefile.am, po/POTFILES.in: New file.
+
+2001-11-22 Paul Eggert <eggert@twinsun.com>
+
+ * pc/config.h:
+ Define filename_cmp as an object-like macro, not as a function-like
+ macro.
+
+ * exgettext: Always operate in the C locale.
+ Set AWK using a method that works even with broken shells.
+
+ * doc/Makefile.am: New file.
+
+ * configure.ac (AC_INIT):
+ Use src/diff.c, not diff.h, as the source files got removed.
+ (AM_CONFIG_HEADER): Switch from AC_CONFIG_HEADER.
+ (AC_ARG_PROGRAM, AC_MINIX): Remove.
+
+ (AC_PREREQ, AM_INIT_AUTOMAKE, ALL_LINGUAS, AC_PROG_AWK,
+ AM_PROG_CC_STDC, AC_PROG_RANLIB, AC_C_INLINE, AC_C_VARARRAYS,
+ DEFAULT_DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM,
+ AC_STRUCT_ST_MTIM_NSEC): Add.
+
+ (PR_PROGRAM): AC_DEFINE.
+
+ (AC_SYS_LARGEFILE): Use instead of our homebrew version.
+
+ (_GNU_SOURCE): Define if not defined.
+
+ (AC_CHECK_HEADERS): Add stdbool.h, unistd.h.
+ (AC_CHECK_TYPES): Add ptrdiff_t, uintmax_t.
+ (AM_GNU_GETTEXT, XGETTEXT): Add.
+
+ (WITH_MVFS_STAT_BUG, WITH_NFS_STAT_BUG): Remove.
+ (HAVE_MEMCHR): Remove.
+ (AC_CHECK_FUNCS): Add diraccess.
+ (AC_REPLACE_FUNCS): Add memchr, waitpid.
+ (jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC,
+ jm_FUNC_REALLOC, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX,
+ jm_PREREQ_TEMPNAME, jm_AC_PREREQ_XSTRTOUMAX, AC_FUNC_FNMATCH): Add.
+ (fnmatch.h, regex.h): Do not create these files unless we're using
+ our own fnmatch and regex.
+
+ (AC_OUTPUT): Add doc/Makefile, intl/Makefile, lib/Makefile,
+ lib/posix/Makefile, m4/Makefile, po/Makefile.in, src/Makefile.
+
+ * Makefile.am: New file.
+
+ * po/en_GB.po: Don't translate "program" to "programme".
+
+2001-11-20 Paul Eggert <eggert@twinsun.com>
+
+ * m4/prereq.m4: New file.
+
+2001-03-16 Paul Eggert <eggert@twinsun.com>
+
+ * lib/tempname.c (uint64_t):
+ Define if not defined, and if UINT64_MAX is not defined.
+
+2001-02-26 Paul Eggert <eggert@twinsun.com>
+
+ * lib/tempname.c: glibc 1.32
+
+2001-02-17 Paul Eggert <eggert@twinsun.com>
+
+ * m4/Makefile.am.in: GNU fileutils 4.1
+
+2001-01-09 Paul Eggert <eggert@twinsun.com>
+
+ * lib/tempname.c (struct_stat64): New macro.
+ (direxists, __gen_tempname): Use it. This avoids a portability problem
+ with Solaris 8.
+
+ * lib/tempname.c (<config.h>): Include if HAVE_CONFIG_H.
+ (<stddef.h>, <stdint.h>, <string.h>):
+ Include only if STDC_HEADERS || _LIBC.
+ (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
+ (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
+ (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
+ (__set_errno): Define this macro if <errno.h> doesn't.
+ (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
+ Define these macros if <stdio.h> doesn't.
+ (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
+ Define these macros if <sys/stat.h>
+ doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
+ (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
+ __xstat64): Define if not _LIBC.
+ (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
+ (__gen_tempname): Invoke gettimeofday only if HAVE_GETTIMEOFDAY
+ || _LIBC; otherwise, fall back on plain "time".
+ Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
+
+ * lib/mkstemp.c (__GT_FILE): Define to zero if not defined.
+
+2000-10-25 Paul Eggert <eggert@twinsun.com>
+
+ * lib/hard-locale.c: New file.
+
+2000-02-05 Paul Eggert <eggert@twinsun.com>
+
+ * exgettext: From GCC repository
+
+1999-07-06 Paul Eggert <eggert@twinsun.com>
+
+ * lib/mkstemp.c: glibc 2.2
+
+1998-12-11 Paul Eggert <eggert@twinsun.com>
+
+ * src/sdiff.c (lf_snarf):
+ Fix bug when help line wrapped around the input buffer.
+
+1998-09-15 Paul Eggert <eggert@twinsun.com>
+
+ * diff.texi: Add @dircategory and @direntry.
+
+1998-09-14 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.in (VERSION): Version 2.7.2.
+ (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM.
+ (PR_PROGRAM): All `configure' to define it.
+ (srcs): Add $(diffutils_srcs), freesoft.c, quotearg.c instead of
+ quote.c, quotearg.h.
+ (distfiles): Add acconfig.h, message/*.
+ (all): Depend on $(destfiles), not info.
+ (version.c): Parenthesize `GNU diffutils'.
+ (common_o): Add freesoft.o
+ (diff_o): quote.o -> quotearg.o
+ (diff3_o, sdiff_o): Likewise.
+ (diff.dvi): Depend on version.texi.
+ (diff.o diff3.o quotearg.o sdiff.o util.o):
+ New dependency on quotearg.h
+ (diff3.o): DIFF_PROGRAM -> DEFAULT_DIFF_PROGRAM.
+ (sdiff.o): Likewise.
+ (messages.po): Remove.
+ (message/msgid.po, message/template.po): New rules.
+ (maintainer-clean): Renamed from realclean.
+ (install): Install from source directory, if applicable.
+ Invoke install-info if needed.
+ (install-strip): New rule.
+ (check): Set DIFF.
+ (stamp-h.in): Don't put the date into the timestamp.
+ (D_dirs): Add $D/message.
+ ($D.tar.gz): Compress with gzip -9.
+ Don't use ln to create distribution; it doesn't work with symlinks.
+ (srcs, distfiles, diff_o, diff3_o, sdiff_o): Rename quotearg.c to
+ quotesys.c and quotearg.h to quotesys.h.
+
+ * configure.in (AC_PATH_PROG): Add PR_PROGRAM.
+ If available, prefer support for large files unless the user specified
+ one of the CPPFLAGS, LDFLAGS, or LIBS variables.
+ (AC_STRUCT_ST_RDEV): Add.
+ (HAVE_ST_FSTYPE_STRING): Add.
+ (--with-mvfs-stat-bug, --with-nfs-stat-bug): New options.
+ (HAVE_MEMCHR): New macro.
+ (AC_CHECK_FUNCS): Add sicprocmask.
+
+ * diff.h (XTERN): Renamed from EXTERN.
+ (struct filedata): Remove dir_p arg.
+ (struct comparison): New type.
+ (diff_2_files, diff_dirs)" Ise ot/
+ (error): Add printf attribute if applicable.
+ (free_software_msgid): New decl.
+ (pr_program): New decl.
+ (fatal): Add noreturn attribute.
+ (pfatal_with_name): Likewise.
+
+ * system.h (__attribute__): New macro.
+ (getenv): Don't declare if HAVE_STDLIB_H.
+ (CHAR_MAX): New macro.
+ (<locale.h>): New include.
+ (<locale.h>): Include before <libintl.h>.
+ (could_be_mvfs_stat_bug, could_be_nfs_stat_bug,
+ dev_may_have_duplicate_ino, same_special_file): New macros.
+ (same_file): Use them.
+
+ * cmp.c (authorship_msgid): New var.
+ (free_software_msgid): New decl.
+ (error): Now has printf attribute.
+ (try_help): Likewise.
+ (long_options): Don't assume ASCII.
+ (try_help): Now accepts operand arg.
+ (main): Check for -1, not EOF, when calling getopt_long.
+ Report --ignore-initial value when complaining about it.
+ Output copyright and free software info with -v.
+ Don't assume ASCII.
+ Report last operand when one is missing.
+ Report text of extra operand.
+ Move block_read into cmpbuf.c.
+
+ * diff.c (authorship_msgid): New var.
+ (quotesys.h): Include.
+ (ck_atoi): Remove.
+ (function_regexp_list, ignore_regexp_list): Now static.
+ (binary_flag): Renamed from binary_I_O.
+ (entire_new_file_flag, unidirectional_new_file_flag,
+ print_file_same_flag): Now static.
+ (numeric_arg): Renamed from ck_atoi.
+ New argument specifying the argument type.
+ (longopts, main): Don't assume ASCII.
+ (longopts): Remove old aliases --file-label, --entire-new-file,
+ --ascii, --print.
+ (main): Check for -1, not EOF, when calling getopt_long.
+ Use numeric_arg to report errors.
+ Report error if -l specified but pagination is not supported.
+ Report error if -S is specified twice with conflicting values.
+ Have --version conform to the new GNU standards.
+ Add new --from-file, --to-file, --inhibit-hun,-merge options.
+ Make the horizon at least as large as the context.
+ Add casts to pacify gcc -Wall.
+ (try_help): Add operand arg.
+ (option_help_msgid): Doc fix to match above.
+ (usage): Indent option_help_msgid.
+ (compare_files): Now takes struct comparison
+ instead of two directory names and a depth.
+ (NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE):
+ New macros.
+ (DIR_P): New macro.
+ Report error if fflush does.
+
+ * cmpbuf.c (block_read): Moved here from cmp.c.
+
+ * cmpbuf.h (block_read): New decl.
+
+ * io.c (cmpbuf.h): Include.
+ (slurp): Check for arithmetic overflow when computing buffer size.
+
+ * dir.c (diff_dirs): Check for recursive directory loop.
+ Arg is now struct comparison const *.
+ (dir_loop): New function
+
+ * analyze.c (no_discards): Remove.
+ (inhibit): Remove.
+ (shift_boundaries): Don't inhibit. If inhibit_hunk_merge is nonzero,
+ don't merge hunks.
+ (briefly_report): Now returns 2 if trouble, CHANGES otherwise.
+ (diff_2_files): Now takes struct comparison. If briefly_report reports
+ trouble, pass it on to caller.
+
+ * side.c (print_half_line): Add brackets to pacify GCC -Wall.
+
+ * sdiff.c (quotesys.h): Include.
+ (DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM): Remove.
+ (free_software_msgid, editor_program, not_found): New vars.
+ (diffbin, edbin): Remove.
+ (editor_program): Renamed from edbin.
+ (edit, interact): Now take extra string arg.
+ (exiterr, fatal, perror_fatal, try_help): Add noreturn attribute.
+ (sigset_t, sigemptyset, sigmask, sigaddset, SIG_BLOCK, SIG_SETMASK):
+ (sigprocmask): New macros, if !HAVE_SIGPROCMASK.
+ (error): Now has printf attribute.
+ (longopts, main): Don't assume ASCII.
+ (try_help): New operand arg.
+ (usage): Conform to new GNU standards.
+ (main): Set static vars for editor and diff program.
+ Compare getopt_long result to -1, not EOF.
+ -v conforms to new GNU standard.
+ Complain better about extra and missing operands.
+ If HAVE_VFORK, block SIGINT and SIGPIPE in the parent, since when
+ the child munges its handlers it may somp on the parent.
+ Pass rname to intract.
+ Translate not-found message before forking.
+ (give_help): Just output it all at once.
+ (edit): New args lname, lline, rname, rline.
+ (edit): New command 'd'.
+ (interact): New args lname, rname.
+
+ * util.c (quotesys.h): Include.
+ (PR_PROGRAM): New macro.
+ (pfatal_with_name): Abort if error returns.
+ (fatal): Likewise.
+ (print_message_queue): Free message chain after printing.
+ (currently_recursive): Renamed from current_depth, and now a boolean.
+ (begin_output): Report error if fflush does.
+ Avoid stdio and gettext in child.
+
+ * diff3.c (quotesys.h): Include.
+ (free_software_msgid): New decl.
+ (RANGE_START, RANGE_END): Renamed from START and END.
+ (fatal, perror_with_exit, try_help): Add noreturn attribute.
+ (error): Add printf attribute.
+ (diff_program): Now a ptr, not an array.
+ Initialize to DEFAULT_DIFF_PROGRAM instead of DIFF_PROGRAM.
+ (longopts, main): Don't assume ASCII.
+ (main): Use DIFF environment var to specify name of diff program.
+ Compare getopt_long result to -1, not EOF.
+ -v now reports version according to new GNU standard.
+ Report spelling of extra operand, or last operand before missing one.
+ (try_help): Now takes operand arg.
+ (option_help_ms): Fix typo: missing comma.
+ (usage): Update as per current GNU standards.
+ (environ): Remove decl.
+ (read_diff): Invoke diff with --inhibit-hunk-merge.
+ Translate `not found' message before forking.
+ Quote name of diff program.
+ Pass horizon lines.
+ `memory exhausted' -> `Memory exhausted'
+
+ * pc/makefile (%.exe): Remove.
+ (pc-clean): Remove *.exe
+ * pc/makefile.sed (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM.
+ When editing mkinstalldirs rule, look for exec_prefix and prefix.
+ Add .exe when installing files.
+ * pc/emx/config.h (same_file): Add.
+ * pc/config.h (same_file): Remove.
+ * pc/djgpp/config.h: Adjust to latest patch from eliz.
+ * pc/djgpp/makefile.sed: Don't alter PROGRAMS.
+ * pc/pc.c: Update FSF address.
+ (quote_system_arg): Renamed from system_quote_arg.
+
+ * README: Add --with-mvfs-stat-bug, --with-nfs-stat-bug.
+
+ * getmsgids: Add copyright date and update FSF address.
+
+ * diff.texi: Document recent changes.
+ The patch doc still corresponds to patch 2.2, unfortunately.
+ Update GNU bug reporting address. Omit Larry Wall's address;
+ it's obsolete and he's busy with perl.
+
+ * context.c: Fix spacing.
+
+ * NEWS: Mention --from-file=FILE, --to-file=FILE, ed.
+
+ * acconfig.h, freesoft.c, message/de.po, message/en_UK.po,
+ message/es.po, message/fr.po, message/pl.po, message/sv.po:
+ New files.
+
+ * ed.c: Remove `#if 0'ed code.
+
+ * normal.c, waitpid.c: Update FSF address.
+
+1998-03-15 Paul Eggert <eggert@twinsun.com>
+
+ * quotesys.c: Renamed from quotearg.c.
+
+ * quotesys.h: Renamed from quotearg.h
+ (__QUOTESYS_P): Renamed from __QUOTEARG_P.
+
+1997-05-05 Paul Eggert <eggert@twinsun.com>
+
+ * quotesys.c, quotesys.h: New file.
+
+Mon Nov 14 05:10:56 1994 Paul Eggert <eggert@twinsun.com>
+
+ Add internationalization support.
+ Several messages have been changed slightly,
+ to make them more consistent and easier to translate.
+ All strings that are messages are passed through gettext once before
+ being used, so that they can be localized.
+ Each function and macro whose first parameter is a gettext msgid
+ has had its first parameter's name changed so it ends in `msgid'.
+ All arrays of msgids have had their names changed to end in `msgid'.
+ `getmsgids' uses this to determine which strings are msgids.
+
+ * pc/COPYING, pc/INSTALL, pc/config.h,
+ pc/djgpp/config.h, pc/djgpp/makefile.sed,
+ pc/emx/config.h, pc/emx/diff.def, pc/emx/gnuregex.def,
+ pc/emx/makefile.sed,
+ pc/makefile, pc/makefile.sed, pc/pc.c: New files, for PC support.
+
+ * getmsgids: New file.
+
+ * Makefile.in (PACKAGE, VERSION, diffutils_srcs, D): New vars.
+ (version.c, version.texi, messages.po): New files.
+ messages.po is built automatically from source files and `getmsgids'.
+ (distfiles): Add them, pc/*, and getmsgids.
+ (diff.info): Now depends on version.texi.
+ (realclean): Clean messages.po, version.*.
+ (dist): Just build $D.tar.gz.
+ ($D.tar.gz): New file, takes over old `dist' function.
+ Don't assume $(distfiles) are all in same directory.
+
+ * configure.in (AC_CHECK_HEADERS): Add libintl.h, locale.h.
+ (AC_CHECK_LIB): Check for -lintl.
+
+ * analyze.c (briefly_report): Rewrite `message (A?"B":"C")' as
+ `if (A) message ("B") : message ("C")'; this is for getmsgids.
+ (briefly_report, diff_2_files): For label, use file_label if set.
+ * diff.c (compare_files): Likewise.
+
+ * system.h (gettext): Declare; use a stub if ! HAVE_LIBINTL_H.
+ (setlocale): Declare; use a stub if ! HAVE_LOCALE_H.
+
+ * cmp.c, diff.c, diff3.c, sdiff.c (main):
+ Invoke setlocale first thing, to tell library we're internationalized.
+ (option_help_msgid): New constant.
+ (usage): Use it, so message is translated one option at a time.
+ * sdiff (help_msgid, give_help): Likewise.
+
+ * cmp.c (sprintc): Renamed from `printc'.
+ Now outputs to a buffer instead of stdout.
+ (cmp): Use new sprintc; it's easier to internationalize.
+
+ * diff.c (main): -D FOO now outputs `/* ! FOO */ instead of
+ `/* not FOO */'.
+
+ * sdiff.c (version_string): Fix decl typo: `const' was missing.
+ (trapsigs): Ignore sigaction failure, to be compatible with `signal'.
+
+ * util.c (struct msg, message5, print_message_queue):
+ Allocate just one block of memory to save a message.
+
+Wed Nov 9 17:42:44 1994 Paul Eggert <eggert@twinsun.com>
+
+ * sdiff.c (trapsigs): Don't check signal return value, since it's
+ bogus under djgpp.
+
+Mon Oct 31 07:27:27 1994 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.in (srcs, diff_o, diff3_o, sdiff_o):
+ New files quote.c, quote.o.
+
+ * diff.h (function_regexp, ignore_regexp): Replace lists of compiled
+ regexps with these single compiled regexps. All users changed.
+ (regexp_list,function_regexp_list,ignore_regexp_list): Move to diff.c.
+ * diff.c (add_regexp): Build one big regexp instead of a regexp list.
+ (summarize_regexp_list): New function.
+ (regexp_list): Redesigned struct; moved here from diff.h.
+ (function_regexp_list, ignore_regexp_list): Likewise, for vars.
+
+ * context.c (find_function): Simplify interface:
+ don't return size of function line. All callers changed.
+ (print_context_script, find_function): INT_MAX now denotes no
+ previous match; this is simpler than `- file->prefix_lines - 1'.
+
+ * diff3.c (read_diff): Quote arguments with system_quote_arg.
+ * sdiff.c (main): Use system_quote_arg to compute command.
+ * diff.c (option_list): Quote options with system_quote_arg.
+ * util.c (begin_output): Use system_quote_arg to compute command.
+
+ * util.c (pr_program): New var.
+ (analyze_hunk): Fix off-by-1 line length bug.
+ Match with one big regexp instead of a list of regexps.
+ Use new `trivial_length' local instead of comparing first byte to `\n'.
+ Help the compiler with linbuf local vars.
+
+ * system.h (system_quote_arg):
+ New function; replaces SYSTEM_QUOTE_ARG macro.
+
+Sat Oct 15 20:09:12 1994 Paul Eggert <eggert@twinsun.com>
+
+ * system.h (_tolower): Define if not already defined.
+ * io.c (find_and_hash_each_line): Change tolower to _tolower; this
+ speeds up diff -i considerably on some hosts (e.g. Solaris 2.3).
+ * util.c (line_cmp): Likewise.
+ * ifdef.c (groups_letter_value): Likewise.
+
+ * diff.h (ignore_some_line_changes): Remove. All users changed.
+ * io.c (find_and_hash_each_line): Don't invoke line_cmp if the length
+ differs and -i is in force. Don't assume ISSPACE ('\n') is nonzero.
+
+ * diff.h (xmalloc_exit_failure): New variable.
+ All `main' programs set this variable at the start.
+ xmalloc and xrealloc are now taken from GNU library.
+ * cmp.c (main): Align buffer size to word size; some mallocs care.
+ * io.c (slurp): Likewise.
+ * diff.c (add_exclude): Can now assume xrealloc (0, ...) works.
+ (add_regexp): Free storage on failure. Allocate storage all at one go.
+ * system.h (malloc, realloc): Remove unused declarations.
+ * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Remove.
+ * sdiff.c (diffarg): Take advantage of cleaner xrealloc semantics.
+
+ * io.c (ROL): Use sizeof to make it more generic.
+
+ * Makefile.in (common_o): New variable.
+ Link error.o and xmalloc.o into all programs.
+ (check): Depend on $(PROGRAMS).
+
+ * diff.h (error): Change to GNU library standard. All callers changed.
+ * diff3.c (main): Use strerror (EISDIR) instead of "Is a directory".
+ (fatal, perror_with_exit): Use `error'.
+ * util.c (perror_with_name, fatal): Use GNU `error'.
+ (error): Remove.
+
+Wed Oct 12 17:04:40 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu)
+
+ * cmp.c (main): Set xmalloc_exit_failure.
+
+Sat Oct 1 05:24:19 1994 Paul Eggert <eggert@twinsun.com>
+
+ * Version 2.7 released.
+
+ * configure.in (AC_HEADER_SYS_WAIT): Add.
+ (AC_CHECK_HEADERS): Remove sys/wait.h.
+ (AC_CHECK_FUNCS): Add tmpnam.
+ * system.h (<sys/wait.h>, WEXITSTATUS): Use simpler scheme
+ now that HAVE_SYS_WAIT_H is not set on hosts
+ that are incompatible with Posix applications.
+
+ * util.c (dir_file_pathname): Use filename_lastdirchar not strrchr.
+ * sdiff.c (expand_name): Likewise.
+ (private_tempnam): Use tmpnam if HAVE_TMPNAM; this simplifies porting.
+ (exists, letters): Omit if HAVE_TMPNAM.
+
+ * diff3.c (read_diff): If STAT_BLOCKSIZE yields zero,
+ adjust it to a more reasonable value.
+
+Sat Sep 24 20:36:40 1994 Paul Eggert <eggert@twinsun.com>
+
+ * sdiff.c (exists, private_tempname): Adopt latest GNU libc algorithm.
+ (private_tempnam): Specialize for sdiff to avoid portability problems.
+
+Thu Sep 22 16:47:00 1994 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (AC_ARG_PROGRAM): Added.
+ (AC_OUTPUT): Add [date > stamp-h].
+
+ * Makefile.in (DEFAULT_EDITOR_PROGRAM, DIFF_PROGRAM, LIBOBJS,
+ NULL_DEVICE, PR_PROGRAM, PROGRAMS): New variables.
+ (check, stamp-h.in, cmp.o, util.o): New targets.
+ (edit_program_name): New variable; replaces old binprefix method.
+ (install, uninstall): Use it.
+ (binprefix): Removed.
+ (distfiles): Add stamp-h.in.
+ (clean): Clean stamp-h.
+ (config.hin, config.h): Use time stamp files.
+ (cmp_o): Add $(LIBOBJS).
+ (install): Install info files from srcdir if they're not in `.'.
+
+ * cmp.c, io.c (word): Don't define if already defined.
+
+ * comp.c (main): Use setmode, not open(..., O_BINARY); this gets stdin.
+ Use NULL_DEVICE instead of "/dev/null".
+ (cmp): Use %lu instead of %ld when it is more likely to be right.
+
+ * diff.h (PR_FILE_NAME): Rename to PR_PROGRAM and move to Makefile.in,
+ util.c.
+
+ * diff3.c (main): Give proper diagnostic if too many labels were given.
+ (read_diff): Use SYSTEM_QUOTE_ARG.
+
+ * system.h: <string.h>: Include if HAVE_STRING_H, too.
+ <ctype.h>: Include here. All includers changed.
+ (CTYPE_DOMAIN, ISDIGIT, ISPRINT, ISSPACE, ISUPPER): New macros that
+ work around common <ctype.h> problems.
+ (O_BINARY): Remove.
+ (SYSTEM_QUOTE_ARG): New macros.
+
+ * diff.c: Add comment.
+
+ * util.c (PR_PROGRAM): Moved here from diff.h.
+ (begin_output): Use SYSTEM_QUOTE_ARG.
+
+ * io.c (read_files): Set mode to binary before returning 1.
+
+ * sdiff.c (TMPDIR_ENV): New macro.
+ (DEFAULT_EDITOR_PROGRAM): Renamed from DEFAULT_EDITOR for consistency.
+ (expand_name): Change `isdir' to `is_dir' to avoid theoretical ctype
+ namespace contamination.
+ (main): Use SYSTEM_QUOTE_ARG.
+ (private_tempnam): Don't access "/tmp" directly; use PVT_tmpdir.
+
+Tue Sep 13 18:46:43 1994 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (AC_FUNC_MEMCHR): Remove. Autoconf didn't adopt this,
+ since we need not worry about an old experimental library
+ where memchr didn't work.
+ (AC_FUNC_MEMCMP): Not needed, since we only test for equality.
+ (AC_REPLACE_FUNCS): Add test for memchr.
+ (AC_CHECK_FUNCS): Check for memchr, not memcpy, since it'll be cached.
+ (AC_CHECK_HEADERS): Add string.h; regex.c uses on some old hosts.
+
+ * system.h (memcmp): Define in terms of bcmp.
+ Use HAVE_MEMCHR to test for all mem* routines.
+
+ * Makefile.in (srcs): Remove memcmp.c.
+ We use bcmp if memcmp doesn't work, since we only test for equality.
+
+Mon Sep 12 15:52:22 1994 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (AC_CONFIG_HEADER): Rename config.h.in to config.hin.
+ (AC_ISC_POSIX, AC_MINIX): Go back to these old names for Autoconf 2.
+ (AC_CHECK_HEADERS): Remove now-redundant check for <string.h>.
+ (AC_CHECK_FUNCS): Check for strchr.
+ (AC_FUNC_MEMCHR, AC_FUNC_MEMCMP, AC_CHECK_FUNCS): Use special-purpose
+ macros when suitable.
+ * memcmp.c: New file.
+ * Makefile.in (CPPFLAGS, DEFS, CFLAGS, LDFLAGS, prefix, exec_prefix):
+ Default to autoconf-specified strings.
+ (COMPILE): Use the defaults.
+ (srcs): Add memcmp.c.
+ (distfiles): Rename config.h.in->config.hin, install.sh->install-sh.
+ (Makefile, config.h, config.hin, config.status): Rework for
+ compatibility with Autoconf 2.
+ * io.c (binary_file_p): Assume non-broken memchr.
+ * memchr.c: Assume compiler understands void *; otherwise
+ we don't match GCC's internal declaration of memchr.
+ * system.h: Use more modern autoconf approach to standard C headers.
+ * version.c: Include <config.h>, not "config.h".
+
+ * diff.c, diff.h (ignore_some_line_changes):
+ New variable; replaces `length_varies'.
+ (line_end_char): Replace with '\n'; it wasn't being used consistently.
+
+ * io.c (find_and_hash_each_line): Fix inconsistencies with -b -w -i and
+ incomplete lines. Put incomplete lines into their own bucket.
+ This means line_cmp no longer needs line length arguments,
+ and equivalence classes' line lengths no longer need to include \n.
+ Invoke line_cmp only if ignore_some_line_changes.
+ (prepare_text_end): -B no longer ignores missing newlines.
+ (read_files): Allocate another bucket for incomplete lines.
+
+ * util.c (line_cmp): Now takes just two arguments. No longer
+ optimizes for common case of exact equality; the caller does that
+ optimization now. The caller is changed accordingly.
+ Optimize for the common case of mostly equality.
+ Use isupper+tolower instead of islower+toupper, for consistency.
+
+ * waitpid.c (waitpid): Fix typo with internal scoping.
+
+Thu Sep 8 08:23:15 1994 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in: Revamp for Autoconf 2.
+ * memchr.c, waitpid.c: New source files for substitute functions.
+ * Makefile.in (diff_o, diff3_o, sdiff_o): Add $(LIBOBJS).
+ (srcs): Add memchr.c, waitpid.c.
+ (distfiles): Add install.sh, memchr.c, waitpid.c, install.sh.
+ * system.h: Use Autoconf 2 style HAVE_DIRENT_H etc. macros for dirs.
+ * dir.c (dir_sort): Prefer NAMLEN (p) to strlen (p->d_name).
+ Change VOID_CLOSEDIR to CLOSEDIR_VOID for Autoconf 2.
+ * sdiff.c, util.c (memchr, waitpid): Remove; use new substitutes.
+ * diff3.c (read_diff): Use new waitpid substitute.
+
+ * cmp.c, diff.c, diff3.c, sdiff.c (check_stdout, try_help): New fns.
+ (usage): Just print more detailed usage message; let caller exit.
+ * diff.c (option_help): New variable.
+ (filetype): Add Posix.1b file types.
+
+Fri Sep 2 16:01:49 1994 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in: Switch to new autoconf names. Add sys/file.h test.
+ * Makefile.in (distclean): Clean config.cache, config.log
+ (used by new autoconf).
+
+ * diff.c, diff3.c, (main), sdiff.c (trapsigs): If we'll have children,
+ make sure SIGCHLD isn't ignored.
+
+ * diff3.c (DIFF_CHUNK_SIZE): Removed. Get size from STAT_BLOCKSIZE.
+ (INT_STRLEN_BOUND): New macro.
+
+ * ifdef.c (format_group, groups_letter_value):
+ Use * instead of [] in prototypes.
+
+ * system.h: Include <sys/file.h> only if HAVE_SYS_FILE_H.
+ (S_IXGRP, S_IXOTH, S_IXUSR): Remove unused macros.
+
+ * util.c (begin_output): Check fdopen result.
+
+ The following changes simplify porting to non-Posix environments.
+ * cmp.c, diff.c, diff3.c, sdiff.c, (main): Call initialize_main first.
+ * diff.c (binary_I_O): New variable for --binary option.
+ (main, usage, compare_files): Support --binary option.
+ (compare_files): Use filename_lastdirchar to find last
+ directory char in a file name.
+ * cmp.c (main), diff.c (compare_files), dir.c (compare_names,
+ diff_dirs): Use filename_cmp to compare file names.
+ Use same_file to determine whether two files are the same.
+ * context.c (print_context_label): Check whether ctime yields 0.
+ * diff3.c (read_diff), sdiff.c (cleanup, main, waitpid),
+ util.c (begin_output): Use popen+pclose if !HAVE_FORK.
+ * io.c (sip): If HAVE_SETMODE, test for binary files in O_BINARY mode.
+ * sdiff.c (ck_fdopen): Function removed.
+ (edit): Use system if !HAVE_FORK.
+ (execdiff): Now assumes caller has pushed all args, plus trailing 0.
+ All callers changed.
+ (private_tempnam): Try TMP if TMPDIR isn't defined.
+ Fit temporary filenames into 8.3 limit.
+ * system.h (STAT_BLOCKSIZE): Don't define if already defined.
+ (min, max): Undef if already defined.
+ (filename_cmp, filename_lastdirchar, HAVE_FORK, HAVE_SETMODE,
+ initialize_main, O_BINARY, same_file): New macros.
+
+Fri Jun 17 11:23:53 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
+
+ * Makefile.in (info, dvi, diff.dvi): New targets.
+ (clean): Remove TeX output files.
+
+Fri Jun 17 05:37:52 1994 Paul Eggert (eggert@twinsun.com)
+
+ * cmp.c, io.c (word): Change from typedef to #define, to avoid
+ collision with Unicos 8.0 <sys/types.h>, which also typedefs `word'.
+
+Thu Apr 15 00:53:01 1994 Paul Eggert (eggert@twinsun.com)
+
+ * diff3.c (scan_diff_line), util.c (print_number_range): Don't
+ rely on promotion to make the old-style parameter type agree
+ with the prototype parameter type; this doesn't work on
+ Apollos running bsd4.3.
+
+Mon Jan 3 02:05:51 1994 Paul Eggert (eggert@twinsun.com)
+
+ * Makefile.in (LDFLAGS): Remove -g. Change all link commands
+ to use both $(CFLAGS) and $(LDFLAGS).
+
+Mon Dec 13 12:23:27 1993 Paul Eggert (eggert@twinsun.com)
+
+ * system.h: Don't assume dirent.h exists just because
+ _POSIX_VERSION is defined.
+
+Fri Dec 3 18:39:39 1993 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main): allow -pu.
+
+Tue Nov 23 03:51:08 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Makefile.in (distclean): Remove config.h.
+
+Wed Nov 10 00:28:27 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Version 2.6 released.
+
+ * analyze.c (too_expensive): New variable, for heuristic to
+ limit the worst-case cost to O(N**1.5 log N) at the price of
+ producing suboptimal output for large inputs with many differences.
+ (diff_2_files): Initialize it.
+ (struct partition): New type.
+ (SNAKE_LIMIT): New macro; merely documents already-used number 20.
+ (diag): New `minimal' arg; all callers changed. Put results into
+ struct partition. Apply `too_expensive' heuristic. Tune.
+ (compareseq): New `minimal' arg; all callers changed. Tune.
+ (shift_boundaries): Improve heuristic to also coalesce adjacent runs
+ of changes more often.
+
+ * diff.c (long_options, main, usage): Add `--help'.
+ (main): Send version number to stdout, not stderr.
+ (usage): Send usage to stdout, not stderr.
+ (compare_files): Initialize `inf' properly.
+
+ * io.c (word): Change to `int'; it makes a big difference on x86.
+ (sip, slurp): Put off allocating room to hold the whole file until we
+ have to read the whole file. This wins if the file turns out
+ to be binary.
+
+ * util.c (xmalloc, xrealloc): "virtual memory" -> "memory"
+ (primes): Omit large primes if INT_MAX is small.
+
+ * sdiff.c (usage): Send usage to stdout, not stderr.
+ (long_options, main, usage): Add `--help'.
+ (main): Send version number to stdout, not stderr. Exit afterwards.
+
+ * diff3.c (usage): Send usage to stdout, not stderr.
+ (long_options, main, usage): Add `--help'.
+ (read_diff): Detect integer overflow in buffer size calculations.
+
+ * cmp.c (word): New type. All uses of `long' for
+ word-at-a-time comparisons changed to `word'.
+ (long_options, main, usage): Add `--help'.
+ (usage): Send usage to stdout, not stderr.
+ (main): Add `-v'. Send version number to stdout, not stderr.
+
+ * configure.in (AC_HAVE_HEADERS): Add unistd.h; remove AC_UNISTD_H.
+
+Mon Sep 27 07:20:24 1993 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (add_exclude_file): Cast memchr to (char *)
+ to suppress bogus warnings on some nonstandard hosts.
+
+ * Makefile.in (cmp): Add version.o.
+
+ * analyze.c (diff_2_files): Work around memcmp bug with size=0.
+
+ * cmp.c (main, usage, version_string): Add --version option.
+
+ * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H.
+ (memchr): Declare only if !HAVE_MEMCHR. These changes are
+ needed to keep some nonstandard hosts happy.
+
+ * util.c (memchr): Make first arg char const *
+ to match standard.
+ (xmalloc, xrealloc): Cast malloc, realloc
+ to (VOID *) to suppress bogus warnings on some nonstandard hosts.
+
+ * diff3.c (xmalloc, xrealloc): Cast malloc, realloc
+ to (VOID *) to suppress bogus warnings on some nonstandard hosts.
+
+ * sdiff.c (xmalloc, xrealloc): Cast malloc, realloc
+ to (VOID *) to suppress bogus warnings on some nonstandard hosts.
+ (lf_copy, lf_skip, lf_snarf): Cast memchr to (char *)
+ to suppress bogus warnings on some nonstandard hosts.
+ (memchr): Make first arg char const *
+ to match standard.
+
+Mon Sep 27 00:23:37 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Version 2.5 released.
+
+ * analyze.c (diff_2_files): Work around memcmp bug with size=0.
+
+ * cmp.c (main, usage, version_string): Add --version option.
+ * Makefile.in (cmp): Add version.o.
+
+ * diff.c (add_exclude_file): Cast memchr to (char *)
+ to suppress bogus warnings on some nonstandard hosts.
+ * sdiff.c (lf_copy, lf_skip, lf_snarf): Likewise.
+
+ * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Cast malloc, realloc
+ to (VOID *) to suppress bogus warnings on some nonstandard hosts.
+
+ * sdiff.c, util.c (memchr): Make first arg char const *
+ to match standard.
+
+ * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H.
+ (memchr): Declare only if !HAVE_MEMCHR. These changes are
+ needed to keep some nonstandard hosts happy.
+
+ * xmalloc.c: Include <sys/types.h> always; some nonstandard hosts
+ need it for size_t even if STDC_HEADERS.
+
+Sat Sep 18 01:33:07 1993 Paul Eggert (eggert@twinsun.com)
+
+ * configure.in (AC_STAT_MACROS_BROKEN): Add.
+ * system.h (S_IS{BLK,CHR,DIR,FIFO,REG,SOCK}): Fix defns if
+ STAT_MACROS_BROKEN.
+
+ * Makefile.in (diff3, sdiff, cmp): Do not link $(ALLOCA).
+
+ * analyze.c (discard_confusing_lines): Make defn static, like decl.
+ * sdiff.c (xmalloc): Likewise.
+
+ * ifdef.c (format_group): Ensure isdigit argument isn't < 0.
+
+ * side.c (print_half_line): Use isprint, since some hosts lack isgraph.
+ * util.c (output_1_line): Likewise. Ensure its argument isn't < 0.
+ (xmalloc, xrealloc): Remove needless casts.
+
+ * system.h (volatile, const):
+ Define these before including any system headers,
+ so that they're used consistently in all system includes.
+ (getenv, malloc, realloc): Declare even if HAVE_STDLIB_H, since some
+ <stdlib.h>s don't declare them.
+ (memchr): Likewise for <string.h>.
+
+ * cmp.c, diff3.c, diff.h, sdiff.c: Include "system.h" first.
+ * diff.c: Remove redundant "system.h" inclusion.
+
+ * diff3.c (xmalloc): Now static.
+ (xmalloc, realloc): Remove needless casts.
+ (READNUM): Ensure isdigit argument isn't negative.
+
+Wed Sep 14 07:14:15 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Version 2.4 released.
+
+ * ifdef.c (scan_char_literal): New function, for new %c'x' and
+ %c'\ooo' format specs.
+ (format_group, print_ifdef_lines): Use it. Remove %0 format spec.
+
+ * cmp.c (cmp): Don't try to read past end of file; this doesn't
+ work on ttys.
+
+ * system.h, version.c: #include <config.h>, not "config.h", to allow
+ configuring in a separate directory when the source directory has
+ already been configured.
+ * Makefile.in (COMPILE): New defn, with proper -I options so that
+ `#include <config.h>' works.
+ (.c.o, diff3.o, sdiff.o): Use it.
+
+Mon Sep 13 06:45:43 1993 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main, longopts): Add --line-format=FORMAT option.
+ (specify_format): Args no longer const pointers. All callers changed.
+
+ * ifdef.c: Add support for %?c, %(A=B?T:E), PRINTF_SPECn formats.
+ (struct group): New struct.
+ (print_ifdef_lines): Use it to simplify argument passing.
+ Remove the convention that last arg -1 signifies that the lines
+ from file 2 are the same as the lines from file 1; this
+ convention no longer works, now that line numbers might be
+ printed out, since the line numbers may differ.
+ Add first FILE * argument to output to. All callers changed.
+ Use a faster test for the single-fwrite optimization.
+ (format_group, scan_printf_spec, groups_letter_value): New functions.
+
+ * diff.h (group_format, line_format): No longer const pointers.
+ (format_ifdef): 1st arg is no longer const pointer.
+
+ * configure.in: Configure HAVE_LIMITS_H, HAVE_STDLIB_H.
+ * system.h <limits.h>, <stdlib.h>, <string.h>:
+ Include only if HAVE_LIMITS_H etc.
+
+ * system.h (memcmp, memcpy, strchr, strrchr, struct dirent): Prefer
+ these standard names to the traditional names (bcmp, bcpy, index,
+ rindex, struct direct). All callers changed.
+
+ * system.h (PARAMS, VOID):
+ Define earlier so that malloc decl can use VOID.
+ (STAT_BLOCKSIZE): Simplify ersatz defn; just use 8K.
+
+Fri Sep 3 00:21:02 1993 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (compare_files): Two files with the same name must be
+ the same file; avoid a needless `stat' in that case.
+
+Fri Aug 27 06:59:03 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Pervasive changes for portability to 64-bit hosts:
+ Add prototypes to function declarations.
+ Use size_t, not int, when needed.
+
+ * Other pervasive changes:
+ Use `const' more often.
+ Use STD{IN,OUT,ERR}_FILENO instead of [012].
+ Use 0, not NULL, for portability to broken hosts.
+
+ * Makefile.in: (srcs, objs, distfiles, cmp): New files cmpbuf.[ch].
+ (distfiles): New files config.h.in, mkinstalldirs.
+ (.c.o): Add -DHAVE_CONFIG_H.
+
+ * analyze.c: (diag): Pacify `gcc -Wall' with a useless assignment.
+ (diff_2_files): Use l.c.m., not max, of files' buffer sizes.
+
+ * cmp.c: Make globals static when possible.
+
+ (file): Now a 2-element array; replaces `file1' and `file2'.
+ (file_desc, buffer): Likewise, for file[12]_desc and buf[12].
+ (main): Likewise, for stat_buf[12]. Index these variables with `i'.
+
+ (ignore_initial): New var.
+ (long_options): Now const. Add `--ignore-initial'.
+ (usage): Sort options and add `--ignore-initial'.
+ (main, cmp): Add `--ignore-initial' support.
+
+ (main): `cmp - -' now succeeds.
+ When comparing standard input to a file, and using a shortcut (e.g.
+ looking at file sizes or inode numbers), take the lseek offset into
+ account before deciding whether the files are identical.
+ Avoid mentioning `dev_t', `ino_t' for portability to nonstandard hosts.
+ Use l.c.m. of files' buffer sizes, not 8 * 1024.
+ ferror (stdout) does not imply errno has a useful value.
+ If 2nd file is "-", treat it first, in case stdin is closed.
+
+ (cmp): Always compute `char_number', `smaller' for speed and simplicity.
+ Say `cmp: EOF on input', not `/usr/gnu/bin/cmp: EOF on input',
+ as per Posix.2.
+
+ (block_compare_and_count): Increment line_number argument.
+ Remove end_char argument; it's always '\n'. All callers changed.
+ Do not assume sizeof(long) == 4; this isn't true on some 64-bit hosts.
+ (block_compare): Minimize differences with block_compare_and_count.
+
+ (block_read): Coalesce `bp += nread's.
+
+ (printc): Remove `FILE *' arg; output to stdout. All callers changed.
+
+ * configure.in: Configure HAVE_SIGACTION, RETSIGTYPE, HAVE_VPRINTF.
+ Configure into config.h.
+
+ * context.c (print_context_label):
+ Standard input's st_mtime is no longer a special case
+ here, since `compare_files' now sets it to the current time.
+
+ * diff.c (usage): Sort options.
+ (filetype): New function.
+ (compare_files): Set stdin's st_mtime to be the current time.
+ Leave its name "-" instead of changing it to "Standard Input";
+ to test whether a file is stdin, we must compare its name to "-" instead
+ of its desc to 0, since if it's closed other file descs may be 0.
+ When comparing standard input to a file, and using a shortcut (e.g.
+ looking at file sizes or inode numbers), take the lseek offset into
+ account before deciding whether the files are identical.
+ Pretend that nonexistent files have the same filetype as existing files.
+ Rename `errorcount' to `failed', since it's boolean.
+ In directory comparisons, if a file is neither a regular file nor a
+ directory, just print its type and the other file's type.
+
+ * diff.h (Is_space, textchar): Remove.
+ (struct msg, msg_chain, msg_chain_end): Move to util.c.
+ (VOID): Move to system.h.
+ (line_cmp, version_string, change_letter, print_number_range,
+ find_change): New decls.
+
+ * diff.texi:
+ whitespace -> white space. It now stands for whatever isspace yields.
+ Add --ignore-initial.
+
+ * diff3.c (VOID): Move to system.h.
+ (version_string): Now char[].
+ (usage): Sort options.
+ (process_diff): Pacify `gcc -Wall' with a useless assignment.
+ (read_diff): pid is of type pid_t, not int. Use waitpid if available.
+ (output_diff3): Simplify test for `\ No newline at end of file' message.
+
+ * dir.c (struct dirdata): Rename `files' to `names' to avoid confusion
+ with external struct file_data `files'.
+
+ * io.c (line_cmp): Move declaration to diff.h.
+ (textchar): Remove.
+ (find_and_hash_each_line): Use locale's definition of white space
+ instead of using one hardwired defn for -b and another for -w.
+
+ * normal.c (change_letter, print_number_range, find_change):
+ Move decls to diff.h.
+ (print_normal_hunk): Now static.
+
+ * sdiff.c (SEEK_SET): Move to system.h.
+ (version_string): Now char[], not char*.
+ (private_tempnam): Remove hardcoded limit on temporary file names.
+ (exiterr, perror_fatal, main): When exiting because of a signal,
+ exit with that signal's status.
+ (lf_refill, main, skip_white, edit, interact): Check for signal.
+ (ignore_SIGINT): Renamed from `ignore_signals'.
+ (NUM_SIGS, initial_handler): New macros.
+ (initial_action, signal_received, sigs_trapped): New vars.
+ (catchsig, trapsigs): Use sigaction if possible, since this closes the
+ windows of vulnerability that `signal' has. Use RETSIGTYPE not void.
+ When a signal comes in, just set a global variable; this is safer.
+ (checksigs, untrapsig): New functions.
+ (edit): Pacify `gcc -Wall' with a useless assignment.
+ Respond to each empty line with help, not to every other empty line.
+ (private_tempnam): Remove hardcoded limit on temporary file name length.
+ Don't assume sizeof (pid_t) <= sizeof (int).
+
+ * system.h: (S_IXOTH, S_IXGRP, S_IXUSR,
+ SEEK_SET, SEEK_CUR,
+ STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
+ New macros, if system doesn't define them.
+ (volatile): Don't define if already defined.
+ (PARAMS): New macro.
+ (VOID): Move here from diff.h.
+
+ * util.c (struct msg, msg_chain, msg_chain_end): Moved here from diff.h.
+ (message5): New function.
+ (pr_pid): New var.
+ (begin_output): Allocate `name' more precisely.
+ Put child pid into pr_pid, so that we can wait for it later.
+ Don't check execl's return value, since any return must be an error.
+ (finish_output): Detect and report output errors.
+ Use waitpid if available. Check pr exit status.
+ (line_cmp): Use locale's definition of white space
+ instead of using one hardwired defn for -b and another for -w.
+ (analyze_cmp): Avoid double negation with `! nontrivial'.
+ Pacify `gcc -Wall' be rewriting for-loop into do-while-loop.
+ (dir_file_pathname): New function.
+
+ * version.c (version_string): Now char[], not char*.
+
+Thu Jul 29 20:44:30 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
+
+ * Makefile.in (config.status): Run config.status --recheck, not
+ configure, to get the right args passed.
+
+Thu Jul 22 10:46:30 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Makefile.in (dist): Replace `if [ ! TEST ]; then ACTION; fi'
+ with `[ TEST ] || ACTION || exit' so that the containing for-loop exits
+ with proper status for `make'.
+
+Thu Jul 8 19:47:22 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
+
+ * Makefile.in (installdirs): New target.
+ (install): Use it.
+ (Makefile, config.status, configure): New targets.
+
+Sat Jun 5 23:10:40 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Makefile.in (dist): Switch from .z to .gz.
+
+Wed May 26 17:16:02 1993 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main): Cast args to compare_files, for traditional C.
+ * side.c (print_sdiff_common_lines, print_sdiff_hunk): Likewise.
+ * analyze.c, diff3.c, sdiff.c, util.c: Don't assume NULL is defined
+ properly.
+
+Tue May 25 14:54:05 1993 Paul Eggert (eggert@twinsun.com)
+
+ * analyze.c (diff_2_files): With -q, do not report that files differ
+ if all their differences are ignored.
+ (briefly_report): New function.
+ * diff.h (ignore_some_changes): New variable.
+ * diff.c (compare_files): Don't use the file size shortcut if
+ ignore_some_changes is nonzero, since the file size may differ
+ merely due to ignored changes.
+ (main): Set ignore_some_changes if we might ignore some changes.
+ Remove unsystematic assignment of 0 to static vars.
+ * io.c (read_files): New argument PRETEND_BINARY says whether to
+ pretend the files are binary.
+
+ * diff3.c (tab_align_flag): New variable, for new -T option.
+ (main, usage, output_diff3): Add support for -T.
+
+Sun May 23 15:25:29 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * dir.c (dir_sort): Always init `data' to avoid GCC warning.
+
+Sat May 22 15:35:02 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Makefile.in (dist): Change name of package from diff to diffutils.
+ Don't bother to build .Z dist; .z suffices.
+
+Fri May 21 16:35:22 1993 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c: Include "system.h" to get memchr declaration.
+ * system.h (memchr): Declare if !HAVE_MEMCHR, not if
+ !HAVE_MEMCHR && !STDC_HEADERS.
+
+Wed May 19 17:43:55 1993 Paul Eggert (eggert@twinsun.com)
+
+ * Version 2.3 released.
+
+Fri Apr 23 17:18:44 1993 Paul Eggert (eggert@twinsun.com)
+
+ * io.c (find_identical_ends): Do not discard the last HORIZON_LINES
+ lines of the prefix, or the first HORIZON_LINES lines of the suffix.
+ * diff.c (main, longopts, usage): Add --horizon-lines option.
+ * diff3.c (main, process_diff, read_diff): Invoke second diff
+ with --horizon-lines determined by the first diff.
+ * diff.h, diff3.c (horizon_lines): New variable.
+
+Mon Mar 22 16:16:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * system.h [HAVE_STRING_H || STDC_HEADERS] (bcopy, bcmp, bzero):
+ Don't define if already defined.
+
+Fri Mar 5 00:20:16 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * diff.c (main): Use NULL in arg to compare_files.
+
+Thu Feb 25 15:26:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * system.h: Declare memchr #if !HAVE_MEMCHR && !STDC_HEADERS,
+ not #if !HAVE_MEMCHR || !STDC_HEADERS.
+
+Mon Feb 22 15:04:46 1993 Richard Stallman (rms@geech.gnu.ai.mit.edu)
+
+ * io.c (find_identical_ends): Move complicated arg outside GUESS_LINES.
+
+Mon Feb 22 12:56:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Makefile.in (.c.o): Add -I$(srcdir); put $(CFLAGS) last before $<.
+
+Sat Feb 20 19:18:56 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * io.c (binary_file_p): Return zero if file size is zero.
+
+Fri Feb 19 17:31:32 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 2.2 released.
+
+ * system.h [HAVE_STRING_H || STDC_HEADERS] (index, rindex): Don't
+ define if already defined.
+
+Wed Feb 17 17:08:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Makefile.in (srcs): Remove limits.h.
+
+Thu Feb 11 03:36:00 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * diff3.c (xmalloc): No longer static.
+
+ * sdiff.c (edit): Allocate buf dynamically.
+
+ * dir.c (dir_sort): Handle VOID_CLOSEDIR.
+
+Wed Feb 10 00:15:54 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * limits.h: File deleted (should never have been there).
+
+Tue Feb 9 03:53:22 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * Makefile.in (.c.o, diff3.o, sdiff.o): Put $(CFLAGS) last.
+
+Wed Feb 3 15:42:10 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
+
+ * system.h: Don't #define const; let configure do it.
+
+Mon Feb 1 02:13:23 1993 Paul Eggert (eggert@hal.gnu.ai.mit.edu)
+
+ * Version 2.1 released.
+
+ * Makefile.in (dist): Survive ln failures. Create .tar.z
+ (gzipped tar) file as well as .tar.Z (compressed tar) file.
+
+Fri Jan 8 22:31:41 1993 Paul Eggert (eggert@twinsun.com)
+
+ * side.c (print_half_line): When the input position falls
+ outside the column, do not output a tab even if the output
+ position still falls within the column.
+
+Mon Dec 21 13:54:36 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
+
+ * Makefile.in (.c.o): Add -I.
+
+Fri Dec 18 14:08:20 1992 Paul Eggert (eggert@twinsun.com)
+
+ * configure.in: Add HAVE_FCNTL_H, since system.h uses it.
+
+Tue Nov 24 10:06:48 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
+
+ * Makefile.in: Note change from USG to HAVE_STRING_H.
+
+Mon Nov 23 18:44:00 1992 Paul Eggert (eggert@twinsun.com)
+
+ * io.c (find_and_hash_each_line): When running out of lines,
+ double the number of allocated lines, instead of just doubling
+ that number minus the prefix lines. This is more likely to
+ avoid the need for further memory allocation.
+
+Wed Nov 18 20:40:28 1992 Paul Eggert (eggert@twinsun.com)
+
+ * dir.c (dir_sort): Plug memory leak: space holding directory
+ contents was not being reclaimed. Get directory size from
+ struct file_data for initial guess at memory needed.
+ Detect errors when reading and closing directory.
+ (diff_dirs): Pass struct file_data to dir_sort. Finish plugging leak.
+ * diff.c (compare_files): Pass struct file_data to diff_dirs.
+
+ * io.c (find_and_hash_each_line): Don't assume alloc_lines is
+ nonzero when allocating more lines.
+
+Thu Nov 12 16:02:18 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main): Add `-U lines' as an alias for `--unified=lines'.
+
+ * diff3.c (usage): Add third --label option in example.
+
+ * util.c (analyze_hunk): Fix test for ignoring blank lines.
+
+ * configure.in, system.h: Avoid USG; use HAVE_TIME_H etc. instead.
+
+Mon Nov 9 05:13:25 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff3.c (main, usage): Add -A or --show-all.
+ -m now defaults to -A, not -E. Allow up to three -L options.
+ (output_diff3_edscript, output_diff3_merge):
+ Remove spurious differences between these two functions.
+ Output ||||||| for -A. Distinguish between conflicts and overlaps.
+ (dotlines, undotlines): New functions that output `Ns', not `N,Ns'.
+ (output_diff3_edscript, output_diff3_merge): Use them.
+
+ * io.c (find_identical_ends): shift_boundaries needs an extra
+ identical line at the end, not at the beginning.
+
+ * sdiff.c (edit): execvp wants char **, not const char **.
+
+Mon Oct 19 04:39:32 1992 Paul Eggert (eggert@twinsun.com)
+
+ * context.c (print_context_script, find_function): Context
+ line numbers start with - file->prefix_lines, not 0.
+
+ * io.c (binary_file_p): Undo last change; it was a library bug.
+
+Sun Oct 18 00:17:29 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * io.c (binary_file_p): Consider empty file as non-binary.
+
+Mon Oct 5 05:18:46 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff3.c (main, make_3way_diff, using_to_diff3_block): Don't
+ report bogus differences (for one of -mexEX3) just because the
+ file0-file1 diffs don't line up with the file0-file2 diffs.
+ (This is entirely possible since we don't use diff's -n
+ option.) Always compare file1 to file2, so that diff3 sees
+ those changes directly. Typically, file2 is now the common
+ file, not file0.
+ (output_diff3_merge): The input file is file 0, not the common file.
+
+ (FC, FO): New macros; they replace FILE1, FILE0 for two-way diffs,
+ to distinguish them from three-way diffs.
+
+ * diff3.c (using_to_diff3_block): Fold repeated code into loops.
+
+ * diff3.c (make_3way_diff, process_diff): Have the *_end
+ variable point to the next field to be changed, not to the last
+ object allocated; this saves an if-then-else.
+
+ * diff3.c (process_diff): Use D_NUMLINES instead of its definiens.
+
+ * diff3.c: Make fns and vars static unless they must be external.
+
+Wed Sep 30 09:21:59 1992 Paul Eggert (eggert@twinsun.com)
+
+ * analyze.c (diff_2_files): OUTPUT_IFDEF is now robust.
+ * diff.h (ROBUST_OUTPUT_STYLE): Likewise.
+ (default_line_format): Remove. All refs removed.
+
+ * ifdef.c (print_ifdef_lines): Add %L. Optimize %l\n even if user
+ specified it, as opposed to its being the default.
+
+Tue Sep 29 19:01:28 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (longopts, main): --{old,new,unchanged,changed}--group-format
+ are new options, so that -D is no longer overloaded. Set
+ no_diff_means_no_output if --unchanged-{line,group}-format allows it.
+ * diff.h (enum line_class): New type.
+ (group_format, line_format): Use it to regularize option flags.
+ All refs changed.
+
+ * ifdef.c (format_ifdef, print_ifdef_lines): %n is no longer a format.
+
+Mon Sep 28 04:51:42 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main, usage): Replace --line-prefix with the more general
+ --{old,new,unchanged}-line-format options.
+ * ifdef.c (format_ifdef, print_ifdef_lines): Likewise.
+ * diff.h (line_format): Renamed from line_prefix. All refs changed.
+ * diff.h, ifdef.c (default_line_format): New variable.
+ * util.c (output_1_line): New function.
+ (print_1_line): Use it.
+
+ * ifdef.c: (format_ifdef, print_ifdef_lines): Add %0 format.
+
+Sun Sep 27 05:38:13 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main): Add -E or --line-prefix option. Add -D'=xxx'
+ for common lines. Change default -D< format from copy of -D>
+ format to to -D<%<; similarly for default -D> format.
+ * diff.h (common_format, line_prefix): New variables.
+ * ifdef.c (format_ifdef): New function.
+ (print_ifdef_script, print_ifdef_hunk, print_ifdef_lines):
+ Use it for -D'=xxx', -E.
+
+ * context.c (find_hunk): Glue together two non-ignorable changes that
+ are exactly CONTEXT * 2 lines apart. This shortens output, removes
+ a behavioral discontinuity at CONTEXT = 0, and is more compatible
+ with traditional diff.
+
+ * io.c (find_identical_ends): Slurp stdin at most once.
+
+ * util.c (print_line_line): line_flag is const char *.
+
+Thu Sep 24 15:18:07 1992 Paul Eggert (eggert@twinsun.com)
+
+ * ifdef.c (print_ifdef_lines): New function, which fwrites a sequence
+ of lines all at once for speed.
+ (print_ifdef_script, print_ifdef_hunk): Use it.
+
+Thu Sep 24 05:54:14 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff.c (main): Support new -D options for if-then-else formats.
+ (specify_format): New function.
+ * diff.h (ifndef_format, ifdef_format, ifnelse_format): New variables.
+ * ifdef.c (print_ifdef_hunk): Use the new variables instead of
+ a hardwired format.
+
+ * side.c (print_1sdiff_line): Represent incomplete lines on output.
+ (print_sdiff_script): Likewise. Don't print 'q' at end,
+ since that doesn't work with incomplete lines.
+ * sdiff.c (interact): Don't assume diff output ends with 'q' line.
+ * diff.h (ROBUST_OUTPUT_STYLE): OUTPUT_SDIFF is now robust.
+
+ * sdiff.c (lf_copy, lf_snarf): Use memchr instead of index,
+ to avoid dumping core when files contain null characters.
+ (memchr): New function (if memchr is missing).
+
+ * io.c (sip): New arg SKIP_TEST to skip test for binary file.
+ (read_files): Don't bother testing second file if first is binary.
+
+Thu Sep 17 21:17:49 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * system.h [!USG && !_POSIX_VERSION]: Protect from conflicting
+ prototype for wait in sys/wait.h.
+
+Wed Sep 16 12:32:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * Makefile.in: Include binprefix in -DDIFF_PROGRAM.
+
+Tue Sep 15 14:27:25 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * Version 2.0.
+
+Sat Sep 12 01:31:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * util.c, diff.h, system.h [!HAVE_MEMCHR]: Don't use void *
+ and const when declaring memchr replacement. Declare memchr
+ if !STDC_HEADERS && !USG.
+
+Thu Sep 10 15:17:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * Makefile.in (uninstall): New target.
+
+ * diff.c (excluded_filename): Use fnmatch, not wildmat.
+ (usage): Document -x, -X, --exclude, --exclude-from.
+ Makefile.in: Use fnmatch.c, not wildmat.c.
+
+Sun Sep 6 23:46:25 1992 Paul Eggert (eggert@twinsun.com)
+
+ * configure.in: Add HAVE_MEMCHR.
+ * diff.h, util.c: Use it instead of MEMCHR_MISSING.
+
+Sun Sep 6 07:25:49 1992 Paul Eggert (eggert@twinsun.com)
+
+ * diff.h: (struct line_def): Replace this 3-word struct with char *.
+ This uses less memory, particularly for large files with short lines.
+ (struct file_data): New member linbuf_base counts number of lines
+ in common prefix that are not recorded in linbuf;
+ this uses less memory if files are identical or differ only at end.
+ New member buffered_lines counts possibly differing lines.
+ New member valid_lines counts valid data.
+ New member alloc_lines - linbuf_base replaces old linbufsize.
+ linbuf[0] now always points at first differing line.
+ Remove unused members ltran, suffix_lines.
+ Add const where appropriate.
+ (Is_space): New macro, for consistent definition of `white space'.
+ (excluded_filename, memchr, sip, slurp): New declarations.
+ * ed.c (print_ed_hunk): Adjust to diff.h's struct changes.
+ * context.c (pr_context_hunk): Likewise.
+ * ifdef.c (print_ifdef_script): Likewise.
+ * side.c (print_sdiff_script, print_half_line): Likewise.
+ * util.c (analyze_hunk, line_cmp, print_1_line): Likewise.
+
+ * analyze.c (shift_boundaries): Remove unneeded variable `end' and
+ unnecessary comparisons of `preceding' and `other_preceding' against 0.
+ (diff_2_files): When comparing files byte-by-byte for equality,
+ don't slurp them all in at once; just compare them a buffer at a time.
+ This can win big if they differ early on.
+ Move some code to compare_files to enable this change.
+ Use only one buffer for stdin with `diff - -'.
+ (discard_confusing_lines, diff_2_files): Coalesce malloc/free calls.
+ (build_script): Remove obsolete OUTPUT_RCS code.
+
+ * diff.c (add_exclude, add_exclude_file, excluded_filename): New fns.
+ (main): Use them for the new --exclude and --exclude-from options.
+ (compare_files): Don't open a file unless it must be read.
+ Treat `diff file file' and `diff file dir' similarly.
+ Move some code here from diff_2_files to enable this.
+ Simplify file vs dir warning.
+
+ * dir.c (dir_sort): Support new --exclude* options.
+
+ * io.c (struct equivclass): Put hash code and line length here instead
+ of struct line_def, so that they can be shared.
+ (find_and_hash_each_line): Compute equivalence class as we go,
+ instead of doing it in a separate pass; this thrashes memory less.
+ Make buckets realloc-able, since we can't preallocate them.
+ Record one more line start than there are lines, so that we can compute
+ any line's length by subtracting its start from the next line's,
+ instead of storing the length explicitly. This saves memory.
+ Move prefix-handling code to find_identical_ends;
+ this wins with large prefixes.
+ Use Is_space, not is_space, for consistent treatment of white space.
+ (prepare_text_end): New function.
+ (find_identical_ends): Move slurping here, so it's only done when
+ needed. Work even if the buffers are the same (because of `diff - -').
+ Compare prefixes a word at a time for speed.
+ (find_equiv_class): Delete; now done by find_and_hash_each_line.
+ (read_files): Don't slurp unless needed.
+ find_equiv_class's work is now folded into find_and_hash_each_line.
+ Don't copy stdin buffer if `diff - -'.
+ Check for running out of primes.
+ (sip, slurp): Split first part of `slurp' into another function `sip'.
+ `sip' sets things up and perhaps reads the first ST_BLKSIZE buffer to
+ see whether the file is binary; `slurp' now just finishes the job.
+ This lets diff_2_files compare binary files lazily.
+ Allocate a one-word sentinel to allow word-at-a-time prefix comparison.
+ Count prefix lines only if needed, only count the first file's prefix.
+ Don't bother to count suffix lines; it's never needed.
+ Set up linbuf[0] to point at first differing line.
+ (binary_file_p): Change test for binary files:
+ if it has a null byte in its first buffer, it's binary.
+ (primes): Add more primes.
+
+ * util.c (line_cmp): Use bcmp for speed.
+ Use Is_space, not is_space, for consistent treatment of white space.
+ (translate_line_number): Internal line numbers now count from 0
+ starting after the prefix.
+ (memchr): New function (if memchr is missing).
+
+ * Makefile.in: Document HAVE_ST_BLKSIZE. Link with wildmat.o.
+ * system.h (STAT_BLOCKSIZE): New macro based on HAVE_ST_BLKSIZE.
+ * configure.in: Add AC_ST_BLKSIZE.
+ * wildmat.c: New file.
+
+Fri Sep 4 01:28:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * sdiff.c (xmalloc): Renamed from ck_malloc. Callers changed.
+
+Thu Sep 3 15:28:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * diff.h: Don't declare free, index, rindex.
+
+Tue Aug 11 22:18:06 1992 John Gilmore (gnu at cygnus.com)
+
+ * io.c (binary_file_p): Use heuristic to avoid declaring info
+ files as binary files. Allow about 1.5% non-printing
+ characters (in info's case, ^_).
+
+Tue Jul 7 01:09:26 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * diff.h: Replace function_regexp and ignore_regexp with lists
+ of compiled regexps.
+ * analyze.c, context.c, util.c: Test whether the lists, not
+ the old variables, are empty.
+ * util.c (analyze_hunk), context.c (find_function): Compare
+ lines with the lists of regexps.
+ * diff.c (add_regexp): New function.
+ (main): Use it.
+
+ * diff3: Add -v --version option.
+ * Makefile.in: Link with version.o.
+
+ * system.h: New file.
+ * diff.h, cmp.c, diff3.c, sdiff.c: Use it.
+
+ * diff.h, diff3.c: Include string.h or strings.h, as appropriate.
+ Declare malloc and realloc.
+
+ * diff3.c (perror_with_exit): Include program name in message.
+
+ * diff3.c: Lowercase error messages for GNU standards.
+
+ * sdiff.c [USG || STDC_HEADERS]: Define bcopy in terms of memcpy.
+
+ * sdiff.c: Use the version number from version.c.
+ * Makefile.in: Link with version.o.
+
+ * cmp.c error.c xmalloc.c: New files from textutils.
+ * Makefile.in: Add rules for them.
+
+ * diff.c (longopts): --unidirectional-new-file is like -P, not -N.
+ Rename --file-label to --label (leave old name, but undocumented).
+
+ * sdiff.c, diff.c (usage): Condense messages and fix some errors.
+
+ * diff3.c (main, usage): Add long-named options.
+
+Fri Jul 3 14:31:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
+
+ * diff.h, diff3.c, sdiff.c: Change FOO_MISSING macros to HAVE_FOO.
+
+Thu Jun 25 16:59:47 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu)
+
+ * diff.c: --reversed-ed -> --forward-ed.
+
+Wed Feb 26 12:17:32 1992 Paul Eggert (eggert@yata.uucp)
+
+ * analyze.c, diff.c, diff.h, io.c: For -y, compare even if same file.
+
+Fri Feb 14 22:46:38 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * io.c, diff3.c, analyze.c: Add extra parentheses.
+
+Sun Feb 9 00:22:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * diff.h (unidirectional_new_file_flag): New variable.
+ * diff.c (main): Set that for -P.
+ (compare_files): Support -P, somewhat like -N.
+ (longopts): Support long name for -P.
+
+Sat Jan 4 20:10:34 1992 Paul Eggert (eggert at yata.uucp)
+
+ * Makefile.in: Distribute diff.info-* too.
+
+ * README, sdiff.c: version number now matches version.c.
+
+ * configure: Fix and document vfork test.
+
+ * ifdef.c: Don't dump core if `diff -Dx f f'.
+
+Mon Dec 23 23:36:08 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
+
+ * diff.h, diff3.c, sdiff.c: Change POSIX ifdefs to
+ HAVE_UNISTD_H and _POSIX_VERSION.
+
+Wed Dec 18 17:00:31 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
+
+ * Makefile.in (srcs): Add sdiff.c.
+ (tapefiles): Add diff.texi and diff.info.
+
+ * diff.h, diff3.c, sdiff.c: Use HAVE_VFORK_H instead of
+ VFORK_HEADER and VFORK_WORKS.
+
+Tue Dec 17 00:02:59 1991 Paul Eggert (eggert at yata.uucp)
+
+ * Makefile.in (all): Add diff.info, sdiff.
+
+ * configure, diff.c, sdiff.c:
+ Prefix long options with `--', not `+'.
+ * diff.c: Regularize option names.
+
+ * configure: Fix check for vfork.
+ * configure, diff.c, diff.h, diff3.c, sdiff.c:
+ Use Posix definitions when possible.
+
+ * context.c: Align context with tab if -T is given. Tune.
+ * diff.c, diff.h, side.c: Calculate column widths so that tabs line up.
+ * io.c: Add distinction between white space and printing chars.
+ * side.c: Don't expand tabs unless -t is given.
+ * side.c, util.c: Tab expansion now knows about '\b', '\f', '\r', '\v'.
+ * util.c: -w skips all white space. Remove lint. Tune.
+
+ * sdiff.c: Support many more diff options, e.g. `-', `sdiff file dir'.
+ Ignore interrupts while the subsidiary editor is in control.
+ Clean up temporary file and kill subsidiary diff if interrupted.
+ Ensure subsidiary diff doesn't ignore SIGPIPE.
+ Don't get confused while waiting for two subprocesses.
+ Don't let buffers overflow. Check for I/O errors.
+ Convert to GNU style. Tune.
+
+ * sdiff.c, util.c: Don't lose errno.
+ Don't confuse sdiff with messages like `Binary files differ'.
+ * sdiff.c, side.c: Don't assume that common lines are identical.
+ Simplify --sdiff-merge-assist format.
+
+Mon Sep 16 16:42:01 1991 Tom Lord (lord at churchy.gnu.ai.mit.edu)
+
+ * Makefile.in, sdiff.c: introduced sdiff front end to diff.
+
+ * Makefile.in, analyze.c, diff.c, diff.h, io.c, side.c: Added
+ sdiff-style output format to diff.
+
+Mon Aug 26 16:44:55 1991 David J. MacKenzie (djm at pogo.gnu.ai.mit.edu)
+
+ * Makefile.in, configure: Only put $< in Makefile if using VPATH,
+ because older makes don't understand it.
+
+Fri Aug 2 12:22:30 1991 David J. MacKenzie (djm at apple-gunkies)
+
+ * configure: Create config.status. Remove it and Makefile if
+ interrupted while creating them.
+
+Thu Aug 1 22:24:31 1991 David J. MacKenzie (djm at apple-gunkies)
+
+ * configure: Check for +srcdir etc. arg and look for
+ Makefile.in in that directory. Set VPATH if srcdir is not `.'.
+ * Makefile.in: Get rid of $(archpfx).
+
+Tue Jul 30 21:28:44 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
+
+ * Makefile.in (prefix): Renamed from DESTDIR.
+
+Wed Jul 24 23:08:56 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
+
+ * diff.h, diff3.c: Rearrange ifdefs to use POSIX,
+ STDC_HEADERS, VFORK_MISSING, DIRENT. This way it works on
+ more systems that aren't pure USG or BSD.
+ Don't not define const if __GNUC__ is defined -- that would
+ break with -traditional.
+ * configure: Check for those features.
+
+Wed Jul 10 01:39:23 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
+
+ * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL).
+
+Sat Jul 6 16:39:04 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
+
+ * Replace Makefile with configure and Makefile.in.
+ Update README with current compilation instructions.
+
+Sat Jul 6 14:03:29 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
+
+ * util.c (setup_output): Just save the args for later use.
+ (begin_output): Do the real work, with the values that were saved.
+ It's safe to call begin_output more than once.
+ Print the special headers for context format here.
+ * analyze.c (diff_2_files): Don't print special headers here.
+ * context.c (pr_context_hunk, pr_unidiff_hunk): Call begin_output.
+ * ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk):
+ * normal.c (print_normal_hunk): Likewise.
+ * ifdef.c (print_ifdef_hunk): Likewise.
+ * util.c (finish_output): Don't die if begin_output was not called.
+
+Thu Jun 20 23:10:01 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
+
+ * Makefile: Add TAGS, distclean, and realclean targets.
+ Set SHELL.
+
+Tue Apr 30 13:54:36 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
+
+ * diff.h (TRUE, FALSE): Undefine these before defining.
+
+Thu Mar 14 18:27:27 1991 Richard Stallman (rms@mole.ai.mit.edu)
+
+ * Makefile (objs): Include $(ALLOCA).
+
+Sat Mar 9 22:34:03 1991 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.h: Include regex.h.
+
+Thu Feb 28 18:59:53 1991 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * Makefile (diff3): Link with GNU getopt.
+
+Sat Feb 23 12:49:43 1991 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * io.c (find_equiv_class): Make hash code unsigned before mod.
+
+ * diff.h (files): Add EXTERN.
+
+Sun Jan 13 21:33:01 1991 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.c: +print option renamed +paginate. Remove +all-text.
+
+Mon Jan 7 06:18:01 1991 David J. MacKenzie (djm at geech.ai.mit.edu)
+
+ * Makefile (dist): New target, replacing diff.tar and
+ diff.tar.Z, to encode version number in distribution directory
+ and tar file names.
+
+Sun Jan 6 18:42:23 1991 Michael I Bushnell (mib at geech.ai.mit.edu)
+
+ * Version 1.15 released.
+
+ * version.c: Updated from 1.15 alpha to 1.15
+
+ * context.c (print_context_number_range,
+ print_unidiff_number_range): Don't print N,M when N=M, print
+ just N instead.
+
+ * README: Updated for version 1.15.
+ Makefile: Updated for version 1.15.
+
+ * diff3.c (main): Don't get confused if one of the arguments
+ is a directory.
+
+ * diff.c (compare_files): Don't get confused if comparing
+ standard input to a directory; print error instead.
+
+ * analyze.c (diff_2_files), context.c (print_context_header,
+ print_context_script), diff.c (main), diff.h (enum
+ output_style): Tread unidiff as an output style in its own
+ right. This also generates an error when both -u and -c are
+ given.
+
+ * diff.c (main): Better error messages when regexps are bad.
+
+ * diff.c (compare_files): Don't assume stdin is opened.
+
+ * diff3.c (read_diff): Don't assume things about the order of
+ descriptor assignment and closes.
+
+ * util.c (setup_output): Don't assume things about the order
+ of descriptor assignment and closes.
+
+ * diff.c (compare_files): Set a flag so that closes don't
+ happen more than once.
+
+ * diff.c (main): Don't just flush stdout, do a close. That
+ way on broken systems we can still get errors.
+
+Mon Dec 24 16:24:17 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.c (usage): Use = for args of long options.
+
+Mon Dec 17 18:19:20 1990 Michael I Bushnell (mib at geech.ai.mit.edu)
+
+ * context.c (print_context_label): Labels were interchanged badly.
+
+ * context.c (pr_unidiff_hunk): Changes to deal with files
+ ending in incomplete lines.
+ * util.c (print_1_line): Other half of the changes.
+
+Mon Dec 3 14:23:55 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.c (longopts, usage): unidiff => unified.
+
+Wed Nov 7 17:13:08 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * analyze.c (diff_2_files): No warnings about newlines for -D.
+
+ * diff.c (pr_unidiff_hunk): Remove ref to output_patch_flag.
+
+Tue Oct 23 23:19:18 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.c (compare_files): For -D, compare even args are same file.
+ * analyze.c (diff_2_files): Likewise.
+ Also, output even if files have no differences.
+
+ * analyze.c (diff_2_files): Print missing newline messages last.
+ Return 2 if a newline is missing.
+ Print them even if files end with identical text.
+
+Mon Oct 22 19:40:09 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.c (usage): Return 2.
+
+Wed Oct 10 20:54:04 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.c (longopts): Add +new-files.
+
+Sun Sep 23 22:49:29 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * context.c (print_context_script): Handle unidiff_flag.
+ (print_context_header): Likewise.
+ (print_unidiff_number_range, pr_unidiff_hunk): New functions.
+ * diff.c (longopts): Add element for +unidiff.
+ (main): Handle +unidiff and -u.
+ (usage): Mention them.
+
+Wed Sep 5 16:33:22 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * io.c (find_and_hash_each_line): Deal with missing final newline
+ after buffering necessary context lines.
+
+Sat Sep 1 16:32:32 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * io.c (find_identical_ends): ROBUST_OUTPUT_FORMAT test was backward.
+
+Thu Aug 23 17:17:20 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff3.c (WIFEXITED): Undef it if WEXITSTATUS is not defined.
+ * context.c (find_function): Don't try to return values.
+
+Wed Aug 22 11:54:39 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * diff.h (O_RDONLY): Define if not defined.
+
+Tue Aug 21 13:49:26 1990 Richard Stallman (rms at mole.ai.mit.edu)
+
+ * Handle -L option.
+ * context.c (print_context_label): New function.
+ (print_context_header): Use that.
+ * diff.c (main): Recognize the option.
+ (usage): Updated.
+ * diff.h (file_label): New variable.
+ * diff3.c (main): Recognize -L instead of -t.
+
+ * diff3.c (main): Support -m without other option.
+
+ * diff3.c (WEXITSTATUS, WIFEXITED): Define whenever not defined.
+
+ * diff3.c (bcopy, index, rindex): Delete definitions; not used.
+ (D_LINENUM, D_LINELEN): Likewise.
+ (struct diff_block): lengths includes newlines.
+ (struct diff3_block): Likewise.
+ (always_text, merge): New variables.
+ (read_diff): Return address of end, not size read. Calls changed.
+ Pass -a to diff if given to diff3.
+ current_chunk_size now an int. Detect error in `pipe'.
+ Check for incomplete line of output here.
+ (scan_diff_line): Don't make scan_ptr + 2 before knowing it is valid.
+ No need to check validity of diff output here.
+ Include newline in length of line.
+ (main): Compute rev_mapping here. Handle -a and -m.
+ Error message if excess -t operands. Error for incompatible options.
+ Error if `-' given more than once.
+ Fix error storing in tag_strings.
+ (output_diff3): REV_MAPPING is now an arg. Call changed.
+ Change syntax of "missing newline" message.
+ Expect length of line to include newline.
+ (output_diff3_edscript): Return just 0 or 1.
+ REV_MAPPING is now an arg. Call changed.
+ (output_diff3_merge): New function.
+ (process_diff): Better error message for bad diff format.
+ (fatal, perror_with_exit): Return status 2.
+
+ * analyze.c (diff_2_files): Report missing newline in either
+ or both files, if not robust output style.
+
+ * util.c (setup_output): Detect error from pipe.
+ No need to close stdin.
+
+ * util.c (print_1_line): Change format of missing-newline msg.
+ Change if statements to switch.
+
+ * io.c (slurp): Don't mention differences in final newline if -B.
+
+ * io.c (binary_file_p): Use ISO char set as criterion, not ASCII.
+
+ * io.c (find_identical_ends): Increase value of BEG0 by 1.
+ Other changes in backwards scan to avoid decrementing pointers
+ before start of array, and set LINES properly.
+
+ * diff.h (ROBUST_OUTPUT_STYLE): New macro.
+ * io.c (find_identical_ends, find_and_hash_each_line): Use that macro.
+
+ * diff.h (dup2): Don't define if XENIX.
+
+ * diff.c (main): Check for write error at end.
+
+ * context.c (find_function): Don't return a value.
+ Use argument FILE rather than global files.
+
+ * analyze.c: Add external function declarations.
+ * analyze.c (build_script): Turn off explicit check for final newline.
+
+ * analyze.c (discard_confusing_lines): Make integers unsigned.
+
+Tue Jul 31 21:37:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * io.c (find_and_hash_each_line): Correct the criterion
+ for leaving out the newline from the end of the line.
+
+Tue May 29 21:28:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * dir.c (diff_dirs): Free things only if nonzero.
+
+Mon Apr 16 18:31:05 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.h (NDIR_IN_SYS): New macro controls location of ndir.h.
+
+ * diff3.c (xmalloc, xrealloc): Don't die if size == 0 returns 0.
+
+Sun Mar 25 15:58:42 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * analyze.c (discard_confusing_lines):
+ `many' wasn't being used; use it.
+ Canceling provisionals near start of run must handle already
+ canceled provisionals.
+ Canceling subruns of provisionals was canceling last nonprovisional.
+
+Sat Mar 24 14:02:51 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * analyze.c (discard_confusing_lines):
+ Threshold for line occurring many times scales by square root
+ of total lines.
+ Within each run, cancel any long subrun of provisionals.
+ Don't update `provisional' while canceling provisionals.
+ In big outer loop, handle provisional and nonprovisional separately.
+
+Thu Mar 22 16:35:33 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * analyze.c (discard_confusing_lines):
+ The first loops to discard provisionals from ends failed to step.
+ In second such loops, keep discarding all consecutive provisionals.
+ Increase threshold for stopping discarding, and also check for
+ consecutive nondiscardables as separate threshold.
+
+Fri Mar 16 00:33:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c (read_diff): Pass -- as first arg to diff.
+
+ * diff3.c: Include wait.h or define equivalent macros.
+ (read_diff): Don't use stdio printing error in the inferior.
+ Remember the pid and wait for it. Report failing status.
+ Report failure of vfork.
+
+Sun Mar 11 17:10:32 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c (main): Accept -t options and pass to output_diff3_edscript.
+ (usage): Mention -t.
+ (read_diff): Use vfork.
+ (vfork): Don't use it on Sparc.
+
+ * diff.h (vfork): Don't use it on Sparc.
+
+Tue Mar 6 22:37:20 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c (dup2): Don't define on Xenix.
+
+ * Makefile: Comments for Xenix.
+
+Thu Mar 1 17:19:23 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * analyze.c (diff_2_files): `message' requires three args.
+
+Fri Feb 23 10:56:50 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
+
+ * diff.h, util.c, diff3.c: Change 'void *' to 'VOID *', with
+ VOID defined as void if __STDC__, char if not.
+
+Sun Feb 18 20:31:58 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
+
+ * Makefile: Add rules for getopt.c, getopt1.c, getopt.h.
+
+ * getopt.c, getopt.h, getopt1.c: New files.
+
+ * main.c (main, usage): Add long options.
+
+ * analyze.c (shift_boundaries): Remove unused var 'j_end'.
+
+Thu Feb 8 02:43:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * GNUmakefile: include ../Makerules before Makefile.
+
+Fri Feb 2 23:21:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * analyze.c (diff_2_files): If -B or -I, don't return 1
+ if all changes were ignored.
+
+Wed Jan 24 20:43:57 1990 Richard Stallman (rms at albert.ai.mit.edu)
+
+ * diff3.c (fatal): Output to stderr.
+
+Thu Jan 11 00:25:56 1990 David J. MacKenzie (djm at hobbes.ai.mit.edu)
+
+ * diff.c (usage): Mention -v.
+
+Wed Jan 10 16:06:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c (output_diff3_edscript): Return number of overlaps.
+ (main): If have overlaps, exit with status 1.
+
+Sun Dec 24 10:29:20 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * io.c (find_equiv_class): Fix typo that came from changing init of B
+ to an assignment.
+
+ * version.c: New file.
+ * diff.c (main): -v prints version number.
+
+ * io.c (binary_file_p): Null char implies binary file.
+
+Fri Nov 17 23:44:55 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * util.c (print_1_line): Fix off by 1 error.
+
+Thu Nov 16 13:51:10 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * util.c (xcalloc): Function deleted.
+
+ * io.c (slurp): Null-terminate the buffer.
+
+ * io.c (read_files): Delete unused vars.
+
+ * io.c (find_equiv_class): Don't index by N if too low.
+
+ * dir.c (dir_sort): Delete the extra declaration of compare_names.
+
+ * diff.h: Don't declare xcalloc. Declare some other functions.
+
+ * analyze.c (shift_boundaries):
+ Test for END at end of range before indexing by it.
+ Fix misspelling of `preceding' in var names.
+
+Sat Nov 11 14:04:16 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c (using_to_diff3_block): Delete unused vars.
+ (make_3way_diff, process_diff_control, read_diff, output_diff3): Likewise.
+
+Mon Nov 6 18:15:50 EST 1989 Jay Fenlason (hack@ai.mit.edu)
+
+ * README Fix typo.
+
+Fri Nov 3 15:27:47 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (usage): Mention -D.
+
+ * ifdef.c (print_ifdef_hunk): Write comments on #else and #endif.
+
+Sun Oct 29 16:41:07 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (compare_files): Don't fflush for identical files.
+
+Wed Oct 25 17:57:12 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * diff3.c (using_to_diff3_block): When defaulting lines from
+ FILE0, only copy up to just under the *lowest* line mentioned
+ in the next diff.
+
+ * diff3.c (fatal): Add \n to error messages.
+
+Wed Oct 25 15:05:49 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * Makefile (tapefiles): Add ChangeLog.
+
+Tue Oct 3 00:51:17 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c (process_diff, create_diff3_block): Init ->next field.
+
+Fri Sep 29 08:16:45 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * util.c (line_cmp): Alter end char of line 2, not line 1.
+
+Wed Sep 20 00:12:37 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * Makefile (diff.tar): Expect ln to fail on some files;
+ copy them with cp.
+
+Mon Sep 18 02:54:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * Handle -D option:
+ * io.c (find_and_hash_each_line): Keep all lines of 1st file.
+ * diff.c (main): Handle -D option.
+ (compare_files): Reject -D if files spec'd are directories.
+ * analyze.c (diff_2_files): Handle OUTPUT_IFDEF case.
+
+Fri Sep 1 20:15:50 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (option_list): Rename arg VECTOR as OPTIONVEC.
+
+Mon Aug 28 17:58:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (compare_files): Clear entire inf[i].stat.
+
+Wed Aug 23 17:48:47 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu)
+
+ * io.c (find_identical_ends): Sign was backward
+ determining where to bound the scan for the suffix.
+
+Wed Aug 16 12:49:16 1989 Richard Stallman (rms at hobbes.ai.mit.edu)
+
+ * analyze.c (diff_2_files): If -q, treat all files as binary.
+ * diff.c (main): Detect -q, record in no_details_flag.
+
+Sun Jul 30 23:12:00 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (usage): New function.
+ (main): Call it.
+
+Wed Jul 26 02:02:19 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (main): Make -C imply -c.
+
+Thu Jul 20 17:57:51 1989 Chris Hanson (cph at kleph)
+
+ * io.c (find_and_hash_each_line): Bug fix in context handling,
+ introduced by last change.
+
+Fri Jul 14 17:39:20 1989 Chris Hanson (cph at kleph)
+
+ * analyze.c: To make RCS work correctly on files that don't
+ necessarily end in newline, introduce some changes that cause
+ diffs to be sensitive to missing final newline. Because
+ non-RCS modes don't want to be affected by these changes, they
+ are conditional on `output_style == OUTPUT_RCS'.
+ (diff_2_files) [OUTPUT_RCS]: Suppress the "File X missing
+ newline" message.
+ (build_script) [OUTPUT_RCS]: Cause the last line to compare as
+ different if exactly one of the files is missing its final
+ newline.
+
+ * io.c (find_and_hash_each_line): Bug fix in
+ ignore_space_change mode. Change line's length to include the
+ newline. For OUTPUT_RCS, decrement last line's length if
+ there is no final newline.
+ (find_identical_ends) [OUTPUT_RCS]: If one of the files is
+ missing a final newline, make sure it's not included in either
+ the prefix or suffix.
+
+ * util.c (print_1_line): Change line output routine to account
+ for line length including the newline.
+
+Tue Jun 27 02:35:28 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Makefile: Inserted $(archpfx) where appropriate.
+
+Wed May 17 20:18:43 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff3.c [USG]: Include fcntl.h.
+
+ * diff.h [USG]: New compilation flags HAVE_NDIR, HAVE_DIRECT.
+
+Wed Apr 26 15:35:57 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * dir.c (diff_dirs): Two new args, NONEX1 and NONEX2, say to pretend
+ nonex dirs are empty.
+ (dir_sort): New arg NONEX, likewise.
+ * diff.c (compare_files): Pass those args.
+ Sometimes call diff_dirs if subdir exists in just one place.
+
+Wed Apr 12 01:10:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * io.c (find_identical_ends): Set END0 *after* last char
+ during backward scan for suffix.
+
+Sat Apr 8 15:49:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * diff3.c (using_to_diff3_block): Now find high marks in files 1
+ and 2 through mapping off of the last difference instead of the
+ first.
+
+ * diff3.c: Many trivial changes to spelling inside comments.
+
+Fri Feb 24 12:38:03 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * util.c, normal.c, io.c, ed.c, dir.c, diff.h, diff.c, context.c,
+ analyze.c, Makefile: Changed copyright header to conform with new
+ GNU General Public license.
+ * diff3.c: Changed copyright header to conform with new GNU
+ General Public license.
+ * COPYING: Made a hard link to /gp/rms/COPYING.
+
+Fri Feb 24 10:01:58 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * io.c (slurp): Leave 2 chars space at end of buffer, not one.
+ (find_identical_ends): Special case if either file is empty;
+ don't try to make a sentinel since could crash.
+
+Wed Feb 15 14:24:48 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu)
+
+ * diff3.c (message) Re-wrote routine to avoid using alloca()
+
+Wed Feb 15 06:19:14 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * io.c (find_identical_ends): Delete the variable `bytes'.
+
+Sun Feb 12 11:50:36 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * io.c (slurp): ->bufsize is nominal amount we have room for;
+ add room for sentinel when calling xmalloc or xrealloc.
+
+ * io.c (find_identical_ends): Do need overrun check in finding suffix.
+
+Fri Feb 10 01:28:15 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.c (main): -C now takes arg to specify context length.
+ Now -p to show C function name--Damned IEEE!
+ Fatal error if context length spec'd twice.
+
+ * ed.c (print_ed_hunk): Now special treatment only for lines containing
+ precisely a dot and nothing else. Output `..', end the insert,
+ substitute that one line, then resume the insert if nec.
+
+ * io.c (find_and_hash_lines): When backing up over starting context,
+ don't move past buffer-beg.
+
+ * io.c (find_identical_ends): Use sentinels to make the loops faster.
+ If files are identical, skip the 2nd loop and return quickly.
+ (slurp): Leave 1 char extra space after each buffer.
+
+ * analyze.c (diff_2_files): Mention difference in final newlines.
+
+Wed Jan 25 22:44:44 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * dir.c (diff_dirs): Use * when calling fcn ptr variable.
+
+Sat Dec 17 14:12:06 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * Makefile: New vars INSTALL and LIBS used in some rules;
+ provide default defns plus commented-put defns for sysV.
+
+Thu Nov 17 16:42:53 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * dir.c (dir_sort): Open-trouble not fatal; just say # files is -1.
+ (diff_dirs): If dir_sort does that, give up and return 2.
+
+ * diff.c (compare_files): Don't open directories.
+ Don't close them specially either.
+ Cross-propagate inf[i].dir_p sooner.
+
+Sun Nov 13 11:19:36 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * diff.h: Declare index, rindex.
+
+ * diff.c (compare_files): If comparing foodir with b/f,
+ use foodir/f, not foodir/b/f.
+
+ * diff.c (compare_files): Don't print "are identical" msg for 2 dirs.
+ Status now 1 if one file is a dir and the other isn't, etc.
+
+Thu Nov 3 16:30:24 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * Makefile: Added a define for diff3 to define DIFF_PROGRAM.
+
+ * util.c: Added hack to make sure that perror was not called with
+ a null pointer.
+
+ * diff.c: Changed S_IFDIR to S_IFMT in masking type of file bits
+ out.
+
+ * diff3.c: Included USG compatibility defines.
+
+ * diff.h: Moved sys/file.h into #else USG section (not needed or
+ wanted on System V).
+
+ * ed.c, analyze.c, context.c: Shortened names to 12 characters for
+ the sake of System V (too simple not to do).
+
+
+ -----
+
+ Copyright (C) 1988-1994, 1997-2002, 2004, 2006, 2009-2013, 2015-2016
+ Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without
+ modification, are permitted provided the copyright notice and this
+ notice are preserved.
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..a869da5
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,127 @@
+# Having a separate GNUmakefile lets me 'include' the dynamically
+# generated rules created via cfg.mk (package-local configuration)
+# as well as maint.mk (generic maintainer rules).
+# This makefile is used only if you run GNU Make.
+# It is necessary if you want to build targets usually of interest
+# only to the maintainer.
+
+# Copyright (C) 2001, 2003, 2006-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# If the user runs GNU make but has not yet run ./configure,
+# give them a diagnostic.
+_gl-Makefile := $(wildcard [M]akefile)
+ifneq ($(_gl-Makefile),)
+
+# Make tar archive easier to reproduce.
+export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
+
+# Allow the user to add to this in the Makefile.
+ALL_RECURSIVE_TARGETS =
+
+include Makefile
+
+# Some projects override e.g., _autoreconf here.
+-include $(srcdir)/cfg.mk
+
+# Allow cfg.mk to override these.
+_build-aux ?= build-aux
+_autoreconf ?= autoreconf -v
+
+include $(srcdir)/maint.mk
+
+# Ensure that $(VERSION) is up to date for dist-related targets, but not
+# for others: rerunning autoreconf and recompiling everything isn't cheap.
+_have-git-version-gen := \
+ $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
+ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
+ _is-dist-target ?= $(filter-out %clean, \
+ $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
+ _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
+ ifneq (,$(_is-dist-target)$(_is-install-target))
+ _curr-ver := $(shell cd $(srcdir) \
+ && $(_build-aux)/git-version-gen \
+ .tarball-version \
+ $(git-version-gen-tag-sed-script))
+ ifneq ($(_curr-ver),$(VERSION))
+ ifeq ($(_curr-ver),UNKNOWN)
+ $(info WARNING: unable to verify if $(VERSION) is the correct version)
+ else
+ ifneq (,$(_is-install-target))
+ # GNU Coding Standards state that 'make install' should not cause
+ # recompilation after 'make all'. But as long as changing the version
+ # string alters config.h, the cost of having 'make all' always have an
+ # up-to-date version is prohibitive. So, as a compromise, we merely
+ # warn when installing a version string that is out of date; the user
+ # should run 'autoreconf' (or something like 'make distcheck') to
+ # fix the version, 'make all' to propagate it, then 'make install'.
+ $(info WARNING: version string $(VERSION) is out of date;)
+ $(info run '$(MAKE) _version' to fix it)
+ else
+ $(info INFO: running autoreconf for new version string: $(_curr-ver))
+GNUmakefile: _version
+ touch GNUmakefile
+ endif
+ endif
+ endif
+ endif
+endif
+
+.PHONY: _version
+_version:
+ cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
+ $(MAKE) $(AM_MAKEFLAGS) Makefile
+
+else
+
+.DEFAULT_GOAL := abort-due-to-no-makefile
+srcdir = .
+
+# The package can override .DEFAULT_GOAL to run actions like autoreconf.
+-include ./cfg.mk
+
+# Allow cfg.mk to override these.
+_build-aux ?= build-aux
+_autoreconf ?= autoreconf -v
+
+include ./maint.mk
+
+ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
+$(MAKECMDGOALS): abort-due-to-no-makefile
+endif
+
+abort-due-to-no-makefile:
+ @echo There seems to be no Makefile in this directory. 1>&2
+ @echo "You must run ./configure before running 'make'." 1>&2
+ @exit 1
+
+endif
+
+# Tell version 3.79 and up of GNU make to not build goals in this
+# directory in parallel, in case someone tries to build multiple
+# targets, and one of them can cause a recursive target to be invoked.
+
+# Only set this if Automake doesn't provide it.
+AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) \
+ dist distcheck tags ctags
+
+ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS)
+
+ifneq ($(word 2, $(MAKECMDGOALS)), )
+ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), )
+.NOTPARALLEL:
+endif
+endif
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..8865734
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,368 @@
+Installation Instructions
+*************************
+
+ Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
+Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+ Briefly, the shell command './configure && make && make install'
+should configure, build, and install this package. The following
+more-detailed instructions are generic; see the 'README' file for
+instructions specific to this package. Some packages provide this
+'INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+ The 'configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a 'Makefile' in each directory of the package.
+It may also create one or more '.h' files containing system-dependent
+definitions. Finally, it creates a shell script 'config.status' that
+you can run in the future to recreate the current configuration, and a
+file 'config.log' containing compiler output (useful mainly for
+debugging 'configure').
+
+ It can also use an optional file (typically called 'config.cache' and
+enabled with '--cache-file=config.cache' or simply '-C') that saves the
+results of its tests to speed up reconfiguring. Caching is disabled by
+default to prevent problems with accidental use of stale cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how 'configure' could check whether to do them, and mail
+diffs or instructions to the address given in the 'README' so they can
+be considered for the next release. If you are using the cache, and at
+some point 'config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file 'configure.ac' (or 'configure.in') is used to create
+'configure' by a program called 'autoconf'. You need 'configure.ac' if
+you want to change it or regenerate 'configure' using a newer version of
+'autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. 'cd' to the directory containing the package's source code and type
+ './configure' to configure the package for your system.
+
+ Running 'configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type 'make' to compile the package.
+
+ 3. Optionally, type 'make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type 'make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the 'make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type 'make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior 'make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing 'make clean'. To also remove the
+ files that 'configure' created (so you can compile the package for
+ a different kind of computer), type 'make distclean'. There is
+ also a 'make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type 'make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide 'make
+ distcheck', which can by used by developers to test that all other
+ targets like 'make install' and 'make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the 'configure' script does not know about. Run './configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give 'configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here is
+an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU 'make'. 'cd' to the
+directory where you want the object files and executables to go and run
+the 'configure' script. 'configure' automatically checks for the source
+code in the directory that 'configure' is in and in '..'. This is known
+as a "VPATH" build.
+
+ With a non-GNU 'make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use 'make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you 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"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the 'lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, 'make install' installs the package's commands under
+'/usr/local/bin', include files under '/usr/local/include', etc. You
+can specify an installation prefix other than '/usr/local' by giving
+'configure' the option '--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like '--bindir=DIR' to specify different values for particular
+kinds of files. Run 'configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the default
+for these options is expressed in terms of '${prefix}', so that
+specifying just '--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to 'configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+'make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, 'make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+'${prefix}'. Any directories that were specified during 'configure',
+but not in terms of '${prefix}', must each be overridden at install time
+for the entire installation to be relocated. The approach of makefile
+variable overrides for each directory variable is required by the GNU
+Coding Standards, and ideally causes no recompilation. However, some
+platforms have known limitations with the semantics of shared libraries
+that end up requiring recompilation when using this method, particularly
+noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the 'DESTDIR' variable. For
+example, 'make install DESTDIR=/alternate/directory' will prepend
+'/alternate/directory' before all installation names. The approach of
+'DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of '${prefix}'
+at 'configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving 'configure' the
+option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
+
+ Some packages pay attention to '--enable-FEATURE' options to
+'configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to '--with-PACKAGE' options, where PACKAGE
+is something like 'gnu-as' or 'x' (for the X Window System). The
+'README' should mention any '--enable-' and '--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, 'configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the 'configure' options '--x-includes=DIR' and
+'--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of 'make' will be. For these packages, running './configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with 'make V=1'; while running './configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with 'make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
+is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ HP-UX 'make' updates targets which have the same time stamps as their
+prerequisites, which makes it generally unusable when shipped generated
+files such as 'configure' are involved. Use GNU 'make' instead.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
+workaround. If GNU CC is not installed, it is therefore recommended to
+try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
+in your 'PATH', put it _after_ '/usr/bin'.
+
+ On Haiku, software installed for all users goes in '/boot/common',
+not '/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features 'configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, 'configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+'--build=TYPE' option. TYPE can either be a short name for the system
+type, such as 'sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file 'config.sub' for the possible values of each field. If
+'config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option '--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with '--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for 'configure' scripts to share,
+you can create a site shell script called 'config.site' that gives
+default values for variables like 'CC', 'cache_file', and 'prefix'.
+'configure' looks for 'PREFIX/share/config.site' if it exists, then
+'PREFIX/etc/config.site' if it exists. Or, you can set the
+'CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all 'configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to 'configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the 'configure' command line, using 'VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified 'gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
+Autoconf limitation. Until the limitation is lifted, you can use this
+workaround:
+
+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+'configure' Invocation
+======================
+
+ 'configure' recognizes the following options to control how it
+operates.
+
+'--help'
+'-h'
+ Print a summary of all of the options to 'configure', and exit.
+
+'--help=short'
+'--help=recursive'
+ Print a summary of the options unique to this package's
+ 'configure', and exit. The 'short' variant lists options used only
+ in the top level, while the 'recursive' variant lists options also
+ present in any nested packages.
+
+'--version'
+'-V'
+ Print the version of Autoconf used to generate the 'configure'
+ script, and exit.
+
+'--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally 'config.cache'. FILE defaults to '/dev/null' to
+ disable caching.
+
+'--config-cache'
+'-C'
+ Alias for '--cache-file=config.cache'.
+
+'--quiet'
+'--silent'
+'-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to '/dev/null' (any error
+ messages will still be shown).
+
+'--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ 'configure' can determine that directory automatically.
+
+'--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names:: for
+ more details, including other options available for fine-tuning the
+ installation locations.
+
+'--no-create'
+'-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+'configure' also accepts some other, not widely useful, options. Run
+'configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..edee5fa
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,58 @@
+# Main Automakefile for GNU diffutils.
+
+# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2016 Free Software
+# Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALL_RECURSIVE_TARGETS =
+
+EXTRA_DIST = bootstrap exgettext ChangeLog-2008 cfg.mk dist-check.mk
+SUBDIRS = lib src tests doc man po gnulib-tests
+
+ACLOCAL_AMFLAGS = -I m4
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
+# Arrange so that .tarball-version appears only in the distribution
+# tarball, and never in a checked-out repository.
+dist-hook: gen-ChangeLog
+ $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
+
+gen_start_date = '2009-11-11 15:00'
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ $(AM_V_GEN)if test -d .git; then \
+ $(top_srcdir)/build-aux/gitlog-to-changelog \
+ --since=$(gen_start_date) > $(distdir)/cl-t && \
+ { rm -f $(distdir)/ChangeLog && \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
+ fi
+
+ALL_RECURSIVE_TARGETS += distcheck-hook
+distcheck-hook:
+ $(MAKE) my-distcheck
+
+# Some of our git hook scripts are supposed to be identical to git's samples.
+# See if they are still in sync.
+.PHONY: check-git-hook-script-sync
+check-git-hook-script-sync:
+ @fail=0; \
+ t=$$(mktemp -d) \
+ && cd $$t && git init -q && cd .git/hooks \
+ && for i in pre-commit pre-applypatch applypatch-msg; do \
+ diff -u $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \
+ || fail=1; \
+ done; \
+ rm -rf $$t; \
+ test $$fail = 0
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..ae71ba1
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,1737 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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@
+
+# Main Automakefile for GNU diffutils.
+
+# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2016 Free Software
+# Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+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@
+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@
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 =
+SOURCES =
+DIST_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
+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 \
+ cscope distdir dist dist-all distcheck
+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)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build-aux/ar-lib \
+ $(top_srcdir)/build-aux/compile \
+ $(top_srcdir)/build-aux/config.guess \
+ $(top_srcdir)/build-aux/config.rpath \
+ $(top_srcdir)/build-aux/config.sub \
+ $(top_srcdir)/build-aux/install-sh \
+ $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \
+ ChangeLog INSTALL NEWS README THANKS TODO build-aux/ar-lib \
+ build-aux/compile build-aux/config.guess \
+ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
+ build-aux/install-sh build-aux/mdate-sh build-aux/missing \
+ build-aux/texinfo.tex
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+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"
+GZIP_ENV = --best
+DIST_ARCHIVES = $(distdir).tar.xz
+DIST_TARGETS = dist-xz
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ALL_RECURSIVE_TARGETS = distcheck-hook
+EXTRA_DIST = bootstrap exgettext ChangeLog-2008 cfg.mk dist-check.mk
+SUBDIRS = lib src tests doc man po gnulib-tests
+ACLOCAL_AMFLAGS = -I m4
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+gen_start_date = '2009-11-11 15:00'
+all: all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+# 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"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+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
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @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
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: 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:
+
+clean-generic:
+
+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)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic 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 $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-cscope clean-generic \
+ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ dist-gzip dist-hook dist-lzip dist-xz dist-zip distcheck \
+ distclean distclean-generic distclean-tags distcleancheck \
+ distdir distuninstallcheck 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 mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Arrange so that .tarball-version appears only in the distribution
+# tarball, and never in a checked-out repository.
+dist-hook: gen-ChangeLog
+ $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ $(AM_V_GEN)if test -d .git; then \
+ $(top_srcdir)/build-aux/gitlog-to-changelog \
+ --since=$(gen_start_date) > $(distdir)/cl-t && \
+ { rm -f $(distdir)/ChangeLog && \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
+ fi
+distcheck-hook:
+ $(MAKE) my-distcheck
+
+# Some of our git hook scripts are supposed to be identical to git's samples.
+# See if they are still in sync.
+.PHONY: check-git-hook-script-sync
+check-git-hook-script-sync:
+ @fail=0; \
+ t=$$(mktemp -d) \
+ && cd $$t && git init -q && cd .git/hooks \
+ && for i in pre-commit pre-applypatch applypatch-msg; do \
+ diff -u $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \
+ || fail=1; \
+ done; \
+ rm -rf $$t; \
+ test $$fail = 0
+
+# 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/NEWS b/NEWS
new file mode 100644
index 0000000..674e35f
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,396 @@
+GNU diffutils NEWS -*- outline -*-
+
+* Noteworthy changes in release 3.5 (2016-08-20) [stable]
+
+** Bug fixes
+
+ diff3 no longer malfunctions due to use-after-free
+ [bug introduced in 3.4]
+
+ diff --color no longer colorizes when TERM=dumb
+
+
+* Noteworthy changes in release 3.4 (2016-08-08) [stable]
+
+** New features
+
+ diff accepts two new options --color and --palette to generate
+ and configure colored output. --color takes an optional argument
+ specifying when to colorize a line: --color=always, --color=auto,
+ --color=never. --palette is used to configure which colors are used.
+
+** Bug fixes
+
+ When binary files differ, diff now exits with status 1 as POSIX requires.
+ Formerly it exited with status 2.
+
+ Unless the --ignore-file-name-case option is used, diff now
+ considers file names to be equal only if they are byte-for-byte
+ equivalent. This fixes a bug where diff in an English locale might
+ consider two Asian file names to be the same merely because they
+ contain no English characters.
+
+ diff -B no longer generates incorrect output if the two inputs
+ each end with a one-byte incomplete line.
+
+ diff --brief no longer reports a difference for unusual identical files.
+ For example, when comparing a file like /proc/cmdline (for which the linux
+ kernel reports st_size of 0 even though it is not an empty file) to a
+ copy of that file's contents residing on a "normal" file system:
+ $ f=/proc/cmdline; cp $f k; diff --brief $f k
+ Files /proc/cmdline and k differ
+
+** Performance changes
+
+ diff's default algorithm has been adjusted to output higher-quality
+ results at somewhat greater computational cost, as CPUs have gotten
+ faster since the algorithm was last tweaked in diffutils-2.6 (1993).
+
+
+* Noteworthy changes in release 3.3 (2013-03-24) [stable]
+
+** New features
+
+ diff accepts a new option, --no-dereference. With this option, symbolic
+ links are treated specially: as a separate type of file that can compare
+ equal only to another symbolic link with the same value. For example,
+ with --no-dereference, two symbolic links compare equal when they have
+ the same value, even when that value does not reference a readable file.
+
+ --new-file (-N) and --unidirectional-new-file now allow comparisons to "-".
+ A standard input that's closed acts like a nonexistent file.
+
+ A file name containing spaces, double quotes, backslashes or control
+ characters is now encoded in a diff header as a double-quoted C string
+ literal. The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v and
+ \ooo (a three-digit octal number between 0 and 255) are used.
+
+** Packaging
+
+ diffutils is now designed to build with Cygwin or MinGW rather than DJGPP.
+ The ms subdirectory has been removed.
+
+
+* Noteworthy changes in release 3.2 (2011-09-02) [stable]
+
+** Changes in behavior
+
+ --ignore-file-name-case now applies at the top level too.
+ For example, "diff dir inIt" might compare "dir/Init" to "inIt".
+
+** New features
+
+ diff and sdiff have a new option --ignore-trailing-space (-Z).
+
+** Packaging
+
+ The texinfo documentation no longer specifies "front-cover" or "back-cover"
+ texts, so that it may now be included in Debian's "main" section.
+
+
+* Noteworthy changes in release 3.1 (2011-08-10) [stable]
+
+** Bug fixes
+
+ diff no longer reports spurious differences merely because two entries
+ in the same directory have names that compare equal in the current
+ locale, or compare equal because --ignore-file-name-case was given.
+
+* Noteworthy changes in release 3.0 (2010-05-03) [stable]
+
+** Bug fixes
+
+ diff once again prints the required "\ No newline at end of file" line
+ when at least one input lacks a newline-at-EOF and the final hunk plus
+ context-length aligns exactly with the end of the newline-lacking file.
+ [bug introduced between 2.8.7 and 2.9]
+
+** Changes in behavior
+
+ In context-style diffs, diff prints a portion of a preceding "function"
+ line for each hunk, with --show-function-line=RE (-F) or
+ --show-c-function (-p). Now, it trims leading blanks from such lines
+ before extracting a prefix. This is useful especially when a function
+ line is so far indented that the name itself would be truncated or not
+ included in the limited-width substring that diff appends.
+
+ diff once again reports a difference with the diagnostic
+ "Binary files A and B differ" when at least one of the files
+ appears to be binary. From 2.8.4 through diffutils-2.9, it printed
+ "Files A and B differ".
+
+
+* Noteworthy changes in release 2.9 (2010-02-11) [stable]
+
+** New features
+
+ New diff option --suppress-blank-empty.
+
+ Bring back support for 'diff -NUM', where NUM is a number,
+ even when conforming to POSIX 1003.1-2001. This change reverts to
+ the behavior of GNU diff 2.7 and earlier. This is a change only
+ when conforming to POSIX 1003.1-2001; there is no effect when
+ conforming to older POSIX versions.
+
+ This change is in response to decisions taken in the January 2005
+ Austin Group standardization meeting. For more details, please see
+ "Utility Syntax Guidelines" in the Minutes of the January 2005
+ Meeting <http://www.opengroup.org/austin/docs/austin_239.html>.
+
+ sdiff now understands '1' and '2' as synonyms for 'l' and 'r'.
+
+** Changes in behavior
+
+ sdiff and diff3 now invoke diff, not $(bindir)/diff
+
+** Administrivia
+
+ New discussion and bug-reporting address: bug-diffutils@gnu.org
+
+ updated gnulib support
+
+
+* Noteworthy changes in release 2.8.7 (2004-04-13) [stable]
+
+ Version 2.8.7 contains no user-visible changes.
+
+User-visible changes in version 2.8.6:
+
+* New diff3 option --strip-trailing-cr.
+
+* With -N and -P, inaccessible empty regular files (the kind of files
+ that 'patch' creates to indicate nonexistent backups) are now
+ treated as nonexistent when they are in the 'backup' file position.
+
+* If multiple SKIP values are given to cmp, e.g., 'cmp -i 10 -i 20',
+ cmp now uses the maximal value instead of the last one.
+
+* diff now omits the ".000000000" on hosts that do not support
+ fractional time stamps.
+
+Version 2.8.5 was not publicly released.
+
+User-visible changes in version 2.8.4:
+
+* Diff now simply prints "Files A and B differ" instead of "Binary
+ files A and B differ". The message is output if either A or B
+ appears to be a binary file, and the old wording was misleading
+ because it implied that both files are binary, which is not
+ necessarily the case.
+
+User-visible changes in version 2.8.3:
+
+* New locale: en_US.
+
+User-visible changes in version 2.8.2:
+
+* New diff and sdiff option:
+ --tabsize=COLUMNS
+* If --ignore-space-change or --ignore-all-space is also specified,
+ --ignore-blank-lines now considers lines to be empty if they contain
+ only white space.
+* More platforms now handle multibyte characters correctly when
+ excluding files by name (diff -x and -X).
+* New locales: hu, pt_BR.
+
+User-visible changes in version 2.8.1:
+
+* Documentation fixes.
+
+User-visible changes in version 2.8:
+
+* cmp and diff now conform to POSIX 1003.1-2001 (IEEE Std 1003.1-2001)
+ if the underlying system conforms to POSIX and if the _POSIX2_VERSION
+ environment variable is set to 200112. Conformance removes support
+ for 'diff -NUM', where NUM is a number. Use -C NUM or -U NUM instead.
+* cmp now supports trailing operands SKIP1 and SKIP2, like BSD cmp.
+* cmp -i or --ignore-initial now accepts SKIP1:SKIP2 option value.
+* New cmp option: -n or --bytes.
+* cmp's old -c or --print-chars option has been renamed;
+ use -b or --print-bytes instead.
+* cmp now outputs "byte" rather than "char" outside the POSIX locale.
+* cmp -l's index column width now adjusts to fit larger (or smaller) files.
+* cmp -l -s and cmp -s -l are not allowed. Use cmp -s or cmp -l instead.
+* diff uses ISO 8601 style time stamps for output times (e.g. "2001-11-23
+ 16:44:36.875702460 -0800") unless in the C or POSIX locale and the
+ -c style is specified.
+* diff's -I and -F options use the regexp syntax of grep, not of Emacs.
+* diff now accepts multiple context arguments, and uses their maximum value.
+* New diff and sdiff options:
+ -E --ignore-tab-expansion
+ --strip-trailing-cr
+* New diff options:
+ --from-file=FILE, --to-file=FILE
+ --ignore-file-name-case
+ --no-ignore-file-name-case
+* New diff3 and sdiff option:
+ --diff-program=PROGRAM
+* The following diff options are still accepted, but are no longer documented.
+ They may be withdrawn in future releases.
+ -h (omit; it has no effect)
+ -H (use --speed-large-files instead)
+ -L (use --label instead)
+ -P (use --unidirectional-new-file instead)
+ --inhibit-hunk-merge (omit; it has no effect)
+* Recursive diffs now sort file names according to the LC_COLLATE locale
+ category if possible, instead of using native byte comparison.
+* Recursive diffs now detect and report directory loops.
+* Diff printf specs can now use the "0" and "'" flags.
+* The new sdiff interactive command 'ed' precedes each version with a header.
+* On 64-bit hosts, files larger than 2 GB can be compared.
+* Some internationalization support has been added, but multibyte locales
+ are still not completely supported yet.
+* Some diagnostics have been reworded slightly for consistency.
+ Also, 'diff -D FOO' now outputs '/* ! FOO */' instead of '/* not FOO */'.
+* The 'patch' part of the manual now describes 'patch' version 2.5.4.
+* Man pages are now distributed and installed.
+* There is support for DJGPP; see the 'ms' subdirectory and the files
+ m4/dos.m4 and */setmode.*.
+
+
+User-visible changes in version 2.7:
+
+* New diff option: --binary (useful only on non-POSIX hosts)
+* diff -b and -w now ignore line incompleteness; -B no longer does this.
+* cmp -c now uses locale to decide which output characters to quote.
+* Help and version messages are reorganized.
+
+
+User-visible changes in version 2.6:
+
+* New cmp, diff, diff3, sdiff option: --help
+* A new heuristic for diff greatly reduces the time needed to compare
+ large input files that contain many differences.
+* Partly as a result, GNU diff's output is not exactly the same as before.
+ Usually it is a bit smaller, but sometimes it is a bit larger.
+
+
+User-visible changes in version 2.5:
+
+* New cmp option: -v --version
+
+
+User-visible changes in version 2.4:
+
+* New cmp option: --ignore-initial=BYTES
+* New diff3 option: -T --initial-tab
+* New diff option: --line-format=FORMAT
+* New diff group format specifications:
+ <PRINTF_SPEC>[eflmnEFLMN]
+ A printf spec followed by one of the following letters
+ causes the integer corresponding to that letter to be
+ printed according to the printf specification.
+ E.g. '%5df' prints the number of the first line in the
+ group in the old file using the "%5d" format.
+ e: line number just before the group in old file; equals f - 1
+ f: first line number in group in the old file
+ l: last line number in group in the old file
+ m: line number just after the group in old file; equals l + 1
+ n: number of lines in group in the old file; equals l - f + 1
+ E, F, L, M, N: likewise, for lines in the new file
+ %(A=B?T:E)
+ If A equals B then T else E. A and B are each either a decimal
+ constant or a single letter interpreted as above. T and E are
+ arbitrary format strings. This format spec is equivalent to T if
+ A's value equals B's; otherwise it is equivalent to E. For
+ example, '%(N=0?no:%dN) line%(N=1?:s)' is equivalent to 'no lines'
+ if N (the number of lines in the group in the new file) is 0,
+ to '1 line' if N is 1, and to '%dN lines' otherwise.
+ %c'C'
+ where C is a single character, stands for the character C. C may not
+ be a backslash or an apostrophe. E.g. %c':' stands for a colon.
+ %c'\O'
+ where O is a string of 1, 2, or 3 octal digits, stands for the
+ character with octal code O. E.g. %c'\0' stands for a null character.
+* New diff line format specifications:
+ <PRINTF_SPEC>n
+ The line number, printed with <PRINTF_SPEC>.
+ E.g. '%5dn' prints the line number with a "%5d" format.
+ %c'C'
+ %c'\O'
+ The character C, or with octal code O, as above.
+* Supported <PRINTF_SPEC>s have the same meaning as with printf, but must
+ match the extended regular expression %-*[0-9]*(\.[0-9]*)?[doxX].
+* The format spec %0 introduced in version 2.1 has been removed, since it
+ is incompatible with printf specs like %02d. To represent a null char,
+ use %c'\0' instead.
+* cmp and diff now conform to POSIX 1003.2-1992 (ISO/IEC 9945-2:1993)
+ if the underlying system conforms to POSIX:
+ - Some messages' wordings are changed in minor ways.
+ - "White space" is now whatever C's 'isspace' says it is.
+ - When comparing directories, if 'diff' finds a file that is not a regular
+ file or a directory, it reports the file's type instead of diffing it.
+ (As usual, it follows symbolic links first.)
+ - When signaled, sdiff exits with the signal's status, not with status 2.
+* Now portable to hosts where int, long, pointer, etc. are not all the same
+ size.
+* 'cmp - -' now works like 'diff - -'.
+
+
+User-visible changes in version 2.3:
+
+* New diff option: --horizon-lines=lines
+
+
+User-visible changes in version 2.1:
+
+* New diff options:
+ --{old,new,unchanged}-line-format='format'
+ --{old,new,unchanged,changed}-group-format='format'
+ -U
+* New diff3 option:
+ -A --show-all
+* diff3 -m now defaults to -A, not -E.
+* diff3 now takes up to three -L or --label options, not just two.
+ If just two options are given, they refer to the first two input files,
+ not the first and third input files.
+* sdiff and diff -y handle incomplete lines.
+
+
+User-visible changes in version 2.0:
+
+* Add sdiff and cmp programs.
+* Add Texinfo documentation.
+* Add configure script.
+* Improve diff performance.
+* New diff options:
+-x --exclude
+-X --exclude-from
+-P --unidirectional-new-file
+-W --width
+-y --side-by-side
+--left-column
+--sdiff-merge-assist
+--suppress-common-lines
+* diff options renamed:
+--label renamed from --file-label
+--forward-ed renamed from --reversed-ed
+--paginate renamed from --print
+--entire-new-file renamed from --entire-new-files
+--new-file renamed from --new-files
+--all-text removed
+* New diff3 options:
+-v --version
+* Add long-named equivalents for other diff3 options.
+* diff options -F (--show-function-line) and -I (--ignore-matching-lines)
+ can now be given more than once.
+
+
+
+Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2016 Free
+Software Foundation, Inc.
+
+This file is part of GNU Diffutils.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/README b/README
new file mode 100644
index 0000000..30bb380
--- /dev/null
+++ b/README
@@ -0,0 +1,64 @@
+README for GNU DIFF
+
+This directory contains the GNU diff, diff3, sdiff, and cmp utilities.
+Their features are a superset of the Unix features and they are
+significantly faster.
+
+Please see the file COPYING for copying conditions.
+
+Please see the file doc/version.texi for version information.
+
+Please see the file doc/diffutils.texi (or doc/diffutils.info) for
+documentation that can be printed with TeX, or read with the 'info'
+program or with Emacs's 'M-x info'. Brief man pages are in man/*,
+but they are no substitute for the documentation.
+
+Please see the file ABOUT-NLS for notes about translations.
+
+Please see the file INSTALL for generic compilation and installation
+instructions. Briefly, you can run "./configure; make install". The
+command "./configure --help" lists the supported --enable and --with
+options.
+
+If you have a problem with internationalization, you might be able to
+work around it as described in ABOUT-NLS by invoking './configure
+--disable-nls'. Many of the problems arise from dynamic linking
+issues on non-GNU platforms (e.g. with the iconv library). Such
+problems tend to be shared by other GNU applications on these
+platforms, and can usually be fixed by carefully tweaking your non-GNU
+installation. If you have an older version of libiconv, please
+upgrade to the latest one; see <ftp://ftp.gnu.org/gnu/libiconv/>. If
+the problem seems isolated to diffutils, though, please report a bug.
+
+This program requires a Standard C compiler (C89 or later). If you
+have a nonstandard compiler, please install GCC first.
+
+If you make changes to the source code, you may need appropriate
+versions of GNU build tools to regenerate the intermediate files. The
+following versions were used to generate the intermediate files in
+this distribution:
+
+* Autoconf 2.59 <ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz>
+* Automake 1.8.3 <ftp://ftp.gnu.org/gnu/automake/automake-1.8.3.tar.gz>
+* gettext 0.14.1 <ftp://ftp.gnu.org/gnu/gettext/gettext-0.14.1.tar.gz>
+* help2man 1.33 <ftp://ftp.gnu.org/gnu/help2man/help2man-1.33.1.tar.gz>
+* Texinfo 4.7 <ftp://ftp.gnu.org/gnu/texinfo/texinfo-4.7.tar.gz>
+
+For any copyright year range specified as YYYY-ZZZZ in this package
+note that the range specifies every single year in that closed interval.
+
+Please report bugs to <bug-diffutils@gnu.org>.
+
+-----
+
+Copyright (C) 1992, 1998, 2001-2002, 2004, 2009-2013, 2015-2016 Free Software
+Foundation, Inc.
+
+This file is part of GNU Diffutils.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the "GNU Free
+Documentation License" file as part of this distribution.
diff --git a/README-release b/README-release
new file mode 100644
index 0000000..713d77d
--- /dev/null
+++ b/README-release
@@ -0,0 +1,100 @@
+Here are most of the steps we (maintainers) follow when making a release.
+
+* Start from a clean, up-to-date git directory on "master":
+
+ make -k maintainer-clean || { ./configure && make maintainer-clean; }
+ git checkout master
+ git pull origin master
+
+* Ensure that the latest stable versions of autoconf, automake, etc.
+ are in your PATH. See the buildreq list in bootstrap.conf for
+ the complete list of tools.
+
+* Ensure that you have no uncommitted diffs. This should produce no
+ output:
+
+ git diff
+
+* Ensure that you've pushed all changes that belong in the release:
+
+ git push origin master
+
+* Check that the NixOS/Hydra autobuilder is reporting all is well:
+
+ http://hydra.nixos.org/jobset/gnu/diffutils-master
+
+* Run the following command to download any new translations:
+
+ ./bootstrap && ./configure
+
+* Pre-release testing: ensure that the following command succeeds:
+
+ make check syntax-check distcheck
+
+* To (i) set the date, version number, and release TYPE on line 3 of
+ NEWS, (ii) commit that, and (iii) tag the release, run
+
+ # "TYPE" must be stable, beta or alpha
+ make release-commit RELEASE='X.Y TYPE'
+
+* Run the following to create release tarballs. Your choice selects the
+ corresponding upload-to destination in the emitted gnupload command.
+ The different destinations are specified in cfg.mk. See the definitions
+ of gnu_ftp_host-{alpha,beta,stable}.
+
+ make release RELEASE='X.Y TYPE'
+
+* Test the tarball. Copy it to a few odd-ball systems and ensure that
+ it builds and passes all tests.
+
+* While that's happening, write the release announcement that you will
+ soon post. Start with the template, $HOME/announce-diffutils-X.Y
+ that was just created by that "make" command.
+
+Once all the builds and tests have passed,
+
+* Run the gnupload command that was suggested by your "make release"
+ run above, or run
+
+ make upload RELEASE='X.Y TYPE'
+
+* Wait a few minutes (maybe up to 30?) and then use the release URLs to
+ download all tarball/signature pairs and use gpg --verify to ensure
+ that they're all valid.
+
+* Push the NEWS-updating changes and the new tag:
+
+ v=$(cat .prev-version)
+ git push origin master tag v$v
+
+* Announce it on Savannah first, so you can include the savannah.org
+ announcement link in the email message.
+
+ Go to the news-submission form:
+
+ https://savannah.gnu.org/news/submit.php?group=diffutils
+
+ If it does not work, then enable "News" for the project via this link:
+
+ https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=diffutils
+
+ Write something like the following:
+
+ Subject: diffutils-X.Y released [stable]
+ +verbatim+
+ ...paste the announcement here...
+ -verbatim-
+
+ Then go here to approve it:
+
+ https://savannah.gnu.org/news/approve.php?group=diffutils
+
+* Send the announcement email message.
+
+* After each non-alpha release, run
+
+ make web-manual-update
+
+ to update the on-line manual accessible at
+
+ http://www.gnu.org/software/diffutils/manual/
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..a96b68d
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,23 @@
+Thanks to all the following for their contributions to GNU diffutils:
+
+Thomas Bushnell, BSG <tb@becket.net>
+Wayne Davison <wayne@opencoder.net>
+Ulrich Drepper <drepper@redhat.com>
+Paul Eggert <eggert@cs.ucla.edu>
+Jay Fenlason <fenlason@redhat.com>
+John Gilmore <gnu@toad.com>
+Torbjorn Granlund <tege@swox.com>
+Mike Haertel <mike@ichips.intel.com>
+Bruno Haible <haible@clisp.org>
+Chris Hanson <cph@gnu.org>
+Jim Kingdon <kingdon@panix.com>
+Tom Lord <lord@gnu.org>
+David J. MacKenzie <djm@gnu.org>
+Roland McGrath <roland@redhat.com>
+Jim Meyering <jim@meyering.net>
+Gene Myers <gene@eecs.berkeley.edu>
+Randy Smith <randy@gnu.org>
+Richard Stallman <rms@gnu.org>
+Leonard H. Tower Jr. <tower@art.net>
+Larry Wall <larry@wall.org>
+Eli Zaretskii <eliz@gnu.org>
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..5132de8
--- /dev/null
+++ b/TODO
@@ -0,0 +1,9 @@
+Add --include option (opposite of --exclude).
+
+Look into sdiff improvement here:
+http://www.pkix.net/~chuck/sdiff2.diff
+
+Propagate stderr from subprocess so that diff3 does
+a better job of explaining _why_:
+ > $ diff3 /bin/sh /bin/false /bin/mv
+ > diff3: subsidiary program 'diff' failed (exit status 2)
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..a880f93
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1358 @@
+# generated automatically by aclocal 1.99a -*- Autoconf -*-
+
+# Copyright (C) 1996-2015 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.
+
+# 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.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69.147-5ad35],,
+[m4_warning([this file was generated for autoconf 2.69.147-5ad35.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2015 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.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.99a'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.99a], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.99a])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Copyright (C) 2011-2015 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.
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed. If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+ [AC_LANG_PUSH([C])
+ am_cv_ar_interface=ar
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+ [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([am_ar_try])
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=ar
+ else
+ am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([am_ar_try])
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=lib
+ else
+ am_cv_ar_interface=unknown
+ fi
+ fi
+ rm -f conftest.lib libconftest.a
+ ])
+ AC_LANG_POP([C])])
+
+case $am_cv_ar_interface in
+ar)
+ ;;
+lib)
+ # Microsoft lib, so override with the ar-lib wrapper script.
+ # FIXME: It is wrong to rewrite AR.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__AR in this case,
+ # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+ # similar.
+ AR="$am_aux_dir/ar-lib $AR"
+ ;;
+unknown)
+ m4_default([$1],
+ [AC_MSG_ERROR([could not determine $AR interface])])
+ ;;
+esac
+AC_SUBST([AR])dnl
+])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2015 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.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2015 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.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2015 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.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR], [AC_SUBST([DEPDIR], [.deps])])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2015 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.
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2015 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.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Without this, packages using Gettext 0.18.2 might break horribly.
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2015 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.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2015 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.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2015 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.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2015 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.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2015 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.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2015 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.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2015 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.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2015 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.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2015 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.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2015 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.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2015 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.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/00gnulib.m4])
+m4_include([m4/absolute-header.m4])
+m4_include([m4/alloca.m4])
+m4_include([m4/arpa_inet_h.m4])
+m4_include([m4/btowc.m4])
+m4_include([m4/c-stack.m4])
+m4_include([m4/clock_time.m4])
+m4_include([m4/close.m4])
+m4_include([m4/codeset.m4])
+m4_include([m4/config-h.m4])
+m4_include([m4/configmake.m4])
+m4_include([m4/ctype.m4])
+m4_include([m4/dirname.m4])
+m4_include([m4/double-slash-root.m4])
+m4_include([m4/dup2.m4])
+m4_include([m4/eealloc.m4])
+m4_include([m4/environ.m4])
+m4_include([m4/errno_h.m4])
+m4_include([m4/error.m4])
+m4_include([m4/exponentd.m4])
+m4_include([m4/extensions.m4])
+m4_include([m4/extern-inline.m4])
+m4_include([m4/fcntl-o.m4])
+m4_include([m4/fcntl.m4])
+m4_include([m4/fcntl_h.m4])
+m4_include([m4/fdopen.m4])
+m4_include([m4/filenamecat.m4])
+m4_include([m4/flexmember.m4])
+m4_include([m4/float_h.m4])
+m4_include([m4/fnmatch.m4])
+m4_include([m4/fpieee.m4])
+m4_include([m4/freopen.m4])
+m4_include([m4/fstat.m4])
+m4_include([m4/ftruncate.m4])
+m4_include([m4/getcwd.m4])
+m4_include([m4/getdtablesize.m4])
+m4_include([m4/getopt.m4])
+m4_include([m4/getpagesize.m4])
+m4_include([m4/gettext.m4])
+m4_include([m4/gettime.m4])
+m4_include([m4/gettimeofday.m4])
+m4_include([m4/glibc21.m4])
+m4_include([m4/gnu-make.m4])
+m4_include([m4/gnulib-common.m4])
+m4_include([m4/gnulib-comp.m4])
+m4_include([m4/hard-locale.m4])
+m4_include([m4/iconv.m4])
+m4_include([m4/iconv_h.m4])
+m4_include([m4/iconv_open.m4])
+m4_include([m4/include_next.m4])
+m4_include([m4/inet_pton.m4])
+m4_include([m4/inline.m4])
+m4_include([m4/intlmacosx.m4])
+m4_include([m4/intmax_t.m4])
+m4_include([m4/inttostr.m4])
+m4_include([m4/inttypes-pri.m4])
+m4_include([m4/inttypes.m4])
+m4_include([m4/inttypes_h.m4])
+m4_include([m4/ioctl.m4])
+m4_include([m4/isblank.m4])
+m4_include([m4/iswblank.m4])
+m4_include([m4/langinfo_h.m4])
+m4_include([m4/largefile.m4])
+m4_include([m4/lib-ld.m4])
+m4_include([m4/lib-link.m4])
+m4_include([m4/lib-prefix.m4])
+m4_include([m4/libsigsegv.m4])
+m4_include([m4/libunistring-base.m4])
+m4_include([m4/localcharset.m4])
+m4_include([m4/locale-fr.m4])
+m4_include([m4/locale-ja.m4])
+m4_include([m4/locale-tr.m4])
+m4_include([m4/locale-zh.m4])
+m4_include([m4/locale_h.m4])
+m4_include([m4/localeconv.m4])
+m4_include([m4/longlong.m4])
+m4_include([m4/lstat.m4])
+m4_include([m4/malloc.m4])
+m4_include([m4/malloca.m4])
+m4_include([m4/manywarnings.m4])
+m4_include([m4/mbchar.m4])
+m4_include([m4/mbiter.m4])
+m4_include([m4/mbrtowc.m4])
+m4_include([m4/mbsinit.m4])
+m4_include([m4/mbslen.m4])
+m4_include([m4/mbsrtowcs.m4])
+m4_include([m4/mbstate_t.m4])
+m4_include([m4/mbtowc.m4])
+m4_include([m4/memchr.m4])
+m4_include([m4/mkstemp.m4])
+m4_include([m4/mktime.m4])
+m4_include([m4/mmap-anon.m4])
+m4_include([m4/mode_t.m4])
+m4_include([m4/msvc-inval.m4])
+m4_include([m4/msvc-nothrow.m4])
+m4_include([m4/multiarch.m4])
+m4_include([m4/nanosleep.m4])
+m4_include([m4/netinet_in_h.m4])
+m4_include([m4/nl_langinfo.m4])
+m4_include([m4/nls.m4])
+m4_include([m4/nocrash.m4])
+m4_include([m4/off_t.m4])
+m4_include([m4/open.m4])
+m4_include([m4/pathmax.m4])
+m4_include([m4/perror.m4])
+m4_include([m4/pipe.m4])
+m4_include([m4/po.m4])
+m4_include([m4/printf.m4])
+m4_include([m4/progtest.m4])
+m4_include([m4/putenv.m4])
+m4_include([m4/quote.m4])
+m4_include([m4/quotearg.m4])
+m4_include([m4/raise.m4])
+m4_include([m4/rawmemchr.m4])
+m4_include([m4/readlink.m4])
+m4_include([m4/regex.m4])
+m4_include([m4/secure_getenv.m4])
+m4_include([m4/select.m4])
+m4_include([m4/setenv.m4])
+m4_include([m4/setlocale.m4])
+m4_include([m4/sigaction.m4])
+m4_include([m4/signal_h.m4])
+m4_include([m4/signalblocking.m4])
+m4_include([m4/size_max.m4])
+m4_include([m4/sleep.m4])
+m4_include([m4/snprintf.m4])
+m4_include([m4/socketlib.m4])
+m4_include([m4/sockets.m4])
+m4_include([m4/socklen.m4])
+m4_include([m4/sockpfaf.m4])
+m4_include([m4/ssize_t.m4])
+m4_include([m4/stat-time.m4])
+m4_include([m4/stat.m4])
+m4_include([m4/stdalign.m4])
+m4_include([m4/stdarg.m4])
+m4_include([m4/stdbool.m4])
+m4_include([m4/stddef_h.m4])
+m4_include([m4/stdint.m4])
+m4_include([m4/stdint_h.m4])
+m4_include([m4/stdio_h.m4])
+m4_include([m4/stdlib_h.m4])
+m4_include([m4/strcase.m4])
+m4_include([m4/strerror.m4])
+m4_include([m4/strerror_r.m4])
+m4_include([m4/strftime.m4])
+m4_include([m4/string_h.m4])
+m4_include([m4/strings_h.m4])
+m4_include([m4/strndup.m4])
+m4_include([m4/strnlen.m4])
+m4_include([m4/strptime.m4])
+m4_include([m4/strtoull.m4])
+m4_include([m4/strtoumax.m4])
+m4_include([m4/symlink.m4])
+m4_include([m4/sys_ioctl_h.m4])
+m4_include([m4/sys_select_h.m4])
+m4_include([m4/sys_socket_h.m4])
+m4_include([m4/sys_stat_h.m4])
+m4_include([m4/sys_time_h.m4])
+m4_include([m4/sys_types_h.m4])
+m4_include([m4/sys_uio_h.m4])
+m4_include([m4/sys_wait_h.m4])
+m4_include([m4/tempname.m4])
+m4_include([m4/time_h.m4])
+m4_include([m4/time_r.m4])
+m4_include([m4/time_rz.m4])
+m4_include([m4/timegm.m4])
+m4_include([m4/timespec.m4])
+m4_include([m4/tm_gmtoff.m4])
+m4_include([m4/unistd_h.m4])
+m4_include([m4/unlocked-io.m4])
+m4_include([m4/vararrays.m4])
+m4_include([m4/vasnprintf.m4])
+m4_include([m4/vasprintf.m4])
+m4_include([m4/version-etc.m4])
+m4_include([m4/warn-on-use.m4])
+m4_include([m4/warnings.m4])
+m4_include([m4/wchar_h.m4])
+m4_include([m4/wchar_t.m4])
+m4_include([m4/wcrtomb.m4])
+m4_include([m4/wctob.m4])
+m4_include([m4/wctomb.m4])
+m4_include([m4/wctype_h.m4])
+m4_include([m4/wcwidth.m4])
+m4_include([m4/wint_t.m4])
+m4_include([m4/xalloc.m4])
+m4_include([m4/xsize.m4])
+m4_include([m4/xstrndup.m4])
+m4_include([m4/xstrtol.m4])
+m4_include([m4/xvasprintf.m4])
diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..f060bab
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,1026 @@
+#! /bin/sh
+# Print a version string.
+scriptversion=2016-01-24.06; # UTC
+
+# Bootstrap this package from checked-out sources.
+
+# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Originally written by Paul Eggert. The canonical version of this
+# script is maintained as build-aux/bootstrap in gnulib, however, to
+# be useful to your project, you should place a copy of it under
+# version control in the top-level directory of your project. The
+# intent is that all customization can be done with a bootstrap.conf
+# file also maintained in your version control; gnulib comes with a
+# template build-aux/bootstrap.conf to get you started.
+
+# Please report bugs or propose patches to bug-gnulib@gnu.org.
+
+nl='
+'
+
+# Ensure file names are sorted consistently across platforms.
+LC_ALL=C
+export LC_ALL
+
+# Ensure that CDPATH is not set. Otherwise, the output from cd
+# would cause trouble in at least one use below.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+local_gl_dir=gl
+
+# Honor $PERL, but work even if there is none.
+PERL="${PERL-perl}"
+
+me=$0
+
+usage() {
+ cat <<EOF
+Usage: $me [OPTION]...
+Bootstrap this package from the checked-out sources.
+
+Options:
+ --gnulib-srcdir=DIRNAME specify the local directory where gnulib
+ sources reside. Use this if you already
+ have gnulib sources on your machine, and
+ do not want to waste your bandwidth downloading
+ them again. Defaults to \$GNULIB_SRCDIR
+ --bootstrap-sync if this bootstrap script is not identical to
+ the version in the local gnulib sources,
+ update this script, and then restart it with
+ /bin/sh or the shell \$CONFIG_SHELL
+ --no-bootstrap-sync do not check whether bootstrap is out of sync
+ --copy copy files instead of creating symbolic links
+ --force attempt to bootstrap even if the sources seem
+ not to have been checked out
+ --no-git do not use git to update gnulib. Requires that
+ --gnulib-srcdir point to a correct gnulib snapshot
+ --skip-po do not download po files
+
+If the file $me.conf exists in the same directory as this script, its
+contents are read as shell variables to configure the bootstrap.
+
+For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
+are honored.
+
+Running without arguments will suffice in most cases.
+EOF
+}
+
+# warnf_ FORMAT-STRING ARG1...
+warnf_ ()
+{
+ warnf_format_=$1
+ shift
+ nl='
+'
+ case $* in
+ *$nl*) me_=$(printf "$me"|tr "$nl|" '??')
+ printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
+ *) printf "$me: $warnf_format_" "$@" ;;
+ esac >&2
+}
+
+# warn_ WORD1...
+warn_ ()
+{
+ # If IFS does not start with ' ', set it and emit the warning in a subshell.
+ case $IFS in
+ ' '*) warnf_ '%s\n' "$*";;
+ *) (IFS=' '; warn_ "$@");;
+ esac
+}
+
+# die WORD1...
+die() { warn_ "$@"; exit 1; }
+
+# Configuration.
+
+# Name of the Makefile.am
+gnulib_mk=gnulib.mk
+
+# List of gnulib modules needed.
+gnulib_modules=
+
+# Any gnulib files needed that are not in modules.
+gnulib_files=
+
+: ${AUTOPOINT=autopoint}
+: ${AUTORECONF=autoreconf}
+
+# A function to be called right after gnulib-tool is run.
+# Override it via your own definition in bootstrap.conf.
+bootstrap_post_import_hook() { :; }
+
+# A function to be called after everything else in this script.
+# Override it via your own definition in bootstrap.conf.
+bootstrap_epilogue() { :; }
+
+# The command to download all .po files for a specified domain into
+# a specified directory. Fill in the first %s is the domain name, and
+# the second with the destination directory. Use rsync's -L and -r
+# options because the latest/%s directory and the .po files within are
+# all symlinks.
+po_download_command_format=\
+"rsync --delete --exclude '*.s1' -Lrtvz \
+ 'translationproject.org::tp/latest/%s/' '%s'"
+
+# Fallback for downloading .po files (if rsync fails).
+po_download_command_format2=\
+"wget --mirror -nd -q -np -A.po -P '%s' \
+ http://translationproject.org/latest/%s/"
+
+# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
+# fall back to the package name (1st argument with munging)
+extract_package_name='
+ /^AC_INIT(\[*/{
+ s///
+ /^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
+ s//\1/
+ s/[],)].*//
+ p
+ q
+ }
+ s/[],)].*//
+ s/^GNU //
+ y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
+ p
+ }
+'
+package=$(sed -n "$extract_package_name" configure.ac) \
+ || die 'cannot find package name in configure.ac'
+gnulib_name=lib$package
+
+build_aux=build-aux
+source_base=lib
+m4_base=m4
+doc_base=doc
+tests_base=tests
+gnulib_extra_files=''
+
+# Additional gnulib-tool options to use. Use "\newline" to break lines.
+gnulib_tool_option_extras=
+
+# Other locale categories that need message catalogs.
+EXTRA_LOCALE_CATEGORIES=
+
+# Additional xgettext options to use. Use "\\\newline" to break lines.
+XGETTEXT_OPTIONS='\\\
+ --flag=_:1:pass-c-format\\\
+ --flag=N_:1:pass-c-format\\\
+ --flag=error:3:c-format --flag=error_at_line:5:c-format\\\
+'
+
+# Package bug report address and copyright holder for gettext files
+COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
+MSGID_BUGS_ADDRESS=bug-$package@gnu.org
+
+# Files we don't want to import.
+excluded_files=
+
+# File that should exist in the top directory of a checked out hierarchy,
+# but not in a distribution tarball.
+checkout_only_file=README-hacking
+
+# Whether to use copies instead of symlinks.
+copy=false
+
+# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
+# those files to be generated in directories like lib/, m4/, and po/.
+# Or set it to 'auto' to make this script select which to use based
+# on which version control system (if any) is used in the source directory.
+vc_ignore=auto
+
+# Set this to true in bootstrap.conf to enable --bootstrap-sync by
+# default.
+bootstrap_sync=false
+
+# Use git to update gnulib sources
+use_git=true
+
+check_exists() {
+ if test "$1" = "--verbose"; then
+ ($2 --version </dev/null) >/dev/null 2>&1
+ if test $? -ge 126; then
+ # If not found, run with diagnostics as one may be
+ # presented with env variables to set to find the right version
+ ($2 --version </dev/null)
+ fi
+ else
+ ($1 --version </dev/null) >/dev/null 2>&1
+ fi
+
+ test $? -lt 126
+}
+
+# find_tool ENVVAR NAMES...
+# -------------------------
+# Search for a required program. Use the value of ENVVAR, if set,
+# otherwise find the first of the NAMES that can be run.
+# If found, set ENVVAR to the program name, die otherwise.
+#
+# FIXME: code duplication, see also gnu-web-doc-update.
+find_tool ()
+{
+ find_tool_envvar=$1
+ shift
+ find_tool_names=$@
+ eval "find_tool_res=\$$find_tool_envvar"
+ if test x"$find_tool_res" = x; then
+ for i; do
+ if check_exists $i; then
+ find_tool_res=$i
+ break
+ fi
+ done
+ fi
+ if test x"$find_tool_res" = x; then
+ warn_ "one of these is required: $find_tool_names;"
+ die "alternatively set $find_tool_envvar to a compatible tool"
+ fi
+ eval "$find_tool_envvar=\$find_tool_res"
+ eval "export $find_tool_envvar"
+}
+
+# Override the default configuration, if necessary.
+# Make sure that bootstrap.conf is sourced from the current directory
+# if we were invoked as "sh bootstrap".
+case "$0" in
+ */*) test -r "$0.conf" && . "$0.conf" ;;
+ *) test -r "$0.conf" && . ./"$0.conf" ;;
+esac
+
+# Extra files from gnulib, which override files from other sources.
+test -z "${gnulib_extra_files}" && \
+ gnulib_extra_files="
+ build-aux/install-sh
+ build-aux/mdate-sh
+ build-aux/texinfo.tex
+ build-aux/depcomp
+ build-aux/config.guess
+ build-aux/config.sub
+ doc/INSTALL
+"
+
+if test "$vc_ignore" = auto; then
+ vc_ignore=
+ test -d .git && vc_ignore=.gitignore
+ test -d CVS && vc_ignore="$vc_ignore .cvsignore"
+fi
+
+# Translate configuration into internal form.
+
+# Parse options.
+
+for option
+do
+ case $option in
+ --help)
+ usage
+ exit;;
+ --gnulib-srcdir=*)
+ GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
+ --skip-po)
+ SKIP_PO=t;;
+ --force)
+ checkout_only_file=;;
+ --copy)
+ copy=true;;
+ --bootstrap-sync)
+ bootstrap_sync=true;;
+ --no-bootstrap-sync)
+ bootstrap_sync=false;;
+ --no-git)
+ use_git=false;;
+ *)
+ die "$option: unknown option";;
+ esac
+done
+
+$use_git || test -d "$GNULIB_SRCDIR" \
+ || die "Error: --no-git requires --gnulib-srcdir"
+
+if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
+ die "Bootstrapping from a non-checked-out distribution is risky."
+fi
+
+# Strip blank and comment lines to leave significant entries.
+gitignore_entries() {
+ sed '/^#/d; /^$/d' "$@"
+}
+
+# If $STR is not already on a line by itself in $FILE, insert it at the start.
+# Entries are inserted at the start of the ignore list to ensure existing
+# entries starting with ! are not overridden. Such entries support
+# whitelisting exceptions after a more generic blacklist pattern.
+insert_if_absent() {
+ file=$1
+ str=$2
+ test -f $file || touch $file
+ test -r $file || die "Error: failed to read ignore file: $file"
+ duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
+ if [ "$duplicate_entries" ] ; then
+ die "Error: Duplicate entries in $file: " $duplicate_entries
+ fi
+ linesold=$(gitignore_entries $file | wc -l)
+ linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
+ if [ $linesold != $linesnew ] ; then
+ { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
+ || die "insert_if_absent $file $str: failed"
+ fi
+}
+
+# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
+# insert_if_absent.
+insert_vc_ignore() {
+ vc_ignore_file="$1"
+ pattern="$2"
+ case $vc_ignore_file in
+ *.gitignore)
+ # A .gitignore entry that does not start with '/' applies
+ # recursively to subdirectories, so prepend '/' to every
+ # .gitignore entry.
+ pattern=$(echo "$pattern" | sed s,^,/,);;
+ esac
+ insert_if_absent "$vc_ignore_file" "$pattern"
+}
+
+# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
+found_aux_dir=no
+grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
+ >/dev/null && found_aux_dir=yes
+grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
+ >/dev/null && found_aux_dir=yes
+test $found_aux_dir = yes \
+ || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
+
+# If $build_aux doesn't exist, create it now, otherwise some bits
+# below will malfunction. If creating it, also mark it as ignored.
+if test ! -d $build_aux; then
+ mkdir $build_aux
+ for dot_ig in x $vc_ignore; do
+ test $dot_ig = x && continue
+ insert_vc_ignore $dot_ig $build_aux
+ done
+fi
+
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+sort_ver() { # sort -V is not generally available
+ ver1="$1"
+ ver2="$2"
+
+ # split on '.' and compare each component
+ i=1
+ while : ; do
+ p1=$(echo "$ver1" | cut -d. -f$i)
+ p2=$(echo "$ver2" | cut -d. -f$i)
+ if [ ! "$p1" ]; then
+ echo "$1 $2"
+ break
+ elif [ ! "$p2" ]; then
+ echo "$2 $1"
+ break
+ elif [ ! "$p1" = "$p2" ]; then
+ if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
+ echo "$2 $1"
+ elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
+ echo "$1 $2"
+ else # numeric, then lexicographic comparison
+ lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1)
+ if [ "$lp" = "$p2" ]; then
+ echo "$1 $2"
+ else
+ echo "$2 $1"
+ fi
+ fi
+ break
+ fi
+ i=$(($i+1))
+ done
+}
+
+get_version() {
+ app=$1
+
+ $app --version >/dev/null 2>&1 || { $app --version; return 1; }
+
+ $app --version 2>&1 |
+ sed -n '# Move version to start of line.
+ s/.*[v ]\([0-9]\)/\1/
+
+ # Skip lines that do not start with version.
+ /^[0-9]/!d
+
+ # Remove characters after the version.
+ s/[^.a-z0-9-].*//
+
+ # The first component must be digits only.
+ s/^\([0-9]*\)[a-z-].*/\1/
+
+ #the following essentially does s/5.005/5.5/
+ s/\.0*\([1-9]\)/.\1/g
+ p
+ q'
+}
+
+check_versions() {
+ ret=0
+
+ while read app req_ver; do
+ # We only need libtoolize from the libtool package.
+ if test "$app" = libtool; then
+ app=libtoolize
+ fi
+ # Exempt git if --no-git is in effect.
+ if test "$app" = git; then
+ $use_git || continue
+ fi
+ # Honor $APP variables ($TAR, $AUTOCONF, etc.)
+ appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
+ test "$appvar" = TAR && appvar=AMTAR
+ case $appvar in
+ GZIP) ;; # Do not use $GZIP: it contains gzip options.
+ PERL::*) ;; # Keep perl modules as-is
+ *) eval "app=\${$appvar-$app}" ;;
+ esac
+
+ # Handle the still-experimental Automake-NG programs specially.
+ # They remain named as the mainstream Automake programs ("automake",
+ # and "aclocal") to avoid gratuitous incompatibilities with
+ # pre-existing usages (by, say, autoreconf, or custom autogen.sh
+ # scripts), but correctly identify themselves (as being part of
+ # "GNU automake-ng") when asked their version.
+ case $app in
+ automake-ng|aclocal-ng)
+ app=${app%-ng}
+ ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
+ warn_ "Error: '$app' not found or not from Automake-NG"
+ ret=1
+ continue
+ } ;;
+ # Another check is for perl modules. These can be written as
+ # e.g. perl::XML::XPath in case of XML::XPath module, etc.
+ perl::*)
+ # Extract module name
+ app="${app#perl::}"
+ if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
+ warn_ "Error: perl module '$app' not found"
+ ret=1
+ fi
+ continue
+ ;;
+ esac
+ if [ "$req_ver" = "-" ]; then
+ # Merely require app to exist; not all prereq apps are well-behaved
+ # so we have to rely on $? rather than get_version.
+ if ! check_exists --verbose $app; then
+ warn_ "Error: '$app' not found"
+ ret=1
+ fi
+ else
+ # Require app to produce a new enough version string.
+ inst_ver=$(get_version $app)
+ if [ ! "$inst_ver" ]; then
+ warn_ "Error: '$app' not found"
+ ret=1
+ else
+ latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
+ if [ ! "$latest_ver" = "$inst_ver" ]; then
+ warnf_ '%s\n' \
+ "Error: '$app' version == $inst_ver is too old" \
+ " '$app' version >= $req_ver is required"
+ ret=1
+ fi
+ fi
+ fi
+ done
+
+ return $ret
+}
+
+print_versions() {
+ echo "Program Min_version"
+ echo "----------------------"
+ printf %s "$buildreq"
+ echo "----------------------"
+ # can't depend on column -t
+}
+
+# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
+# Also find the compatible sha1 utility on the BSDs
+if test x"$SKIP_PO" = x; then
+ find_tool SHA1SUM sha1sum gsha1sum shasum sha1
+fi
+
+use_libtool=0
+# We'd like to use grep -E, to see if any of LT_INIT,
+# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
+# but that's not portable enough (e.g., for Solaris).
+grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
+ && use_libtool=1
+grep '^[ ]*LT_INIT' configure.ac >/dev/null \
+ && use_libtool=1
+if test $use_libtool = 1; then
+ find_tool LIBTOOLIZE glibtoolize libtoolize
+fi
+
+# gnulib-tool requires at least automake and autoconf.
+# If either is not listed, add it (with minimum version) as a prerequisite.
+case $buildreq in
+ *automake*) ;;
+ *) buildreq="automake 1.9
+$buildreq" ;;
+esac
+case $buildreq in
+ *autoconf*) ;;
+ *) buildreq="autoconf 2.59
+$buildreq" ;;
+esac
+
+# When we can deduce that gnulib-tool will require patch,
+# and when patch is not already listed as a prerequisite, add it, too.
+if test -d "$local_gl_dir" \
+ && ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
+ case $buildreq in
+ *patch*) ;;
+ *) buildreq="patch -
+$buildreq" ;;
+ esac
+fi
+
+if ! printf "$buildreq" | check_versions; then
+ echo >&2
+ if test -f README-prereq; then
+ die "See README-prereq for how to get the prerequisite programs"
+ else
+ die "Please install the prerequisite programs"
+ fi
+fi
+
+# Warn the user if autom4te appears to be broken; this causes known
+# issues with at least gettext 0.18.3.
+probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
+if test "x$probe" != xhi; then
+ warn_ "WARNING: your autom4te wrapper eats stdin;"
+ warn_ "if bootstrap fails, consider upgrading your autotools"
+fi
+
+echo "$0: Bootstrapping from checked-out $package sources..."
+
+# See if we can use gnulib's git-merge-changelog merge driver.
+if $use_git && test -d .git && check_exists git; then
+ if git config merge.merge-changelog.driver >/dev/null ; then
+ :
+ elif check_exists git-merge-changelog; then
+ echo "$0: initializing git-merge-changelog driver"
+ git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
+ git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
+ else
+ echo "$0: consider installing git-merge-changelog from gnulib"
+ fi
+fi
+
+
+cleanup_gnulib() {
+ status=$?
+ rm -fr "$gnulib_path"
+ exit $status
+}
+
+git_modules_config () {
+ test -f .gitmodules && git config --file .gitmodules "$@"
+}
+
+if $use_git; then
+ gnulib_path=$(git_modules_config submodule.gnulib.path)
+ test -z "$gnulib_path" && gnulib_path=gnulib
+fi
+
+# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
+# submodule, for use in the rest of the script.
+
+case ${GNULIB_SRCDIR--} in
+-)
+ # Note that $use_git is necessarily true in this case.
+ if git_modules_config submodule.gnulib.url >/dev/null; then
+ echo "$0: getting gnulib files..."
+ git submodule init -- "$gnulib_path" || exit $?
+ git submodule update -- "$gnulib_path" || exit $?
+
+ elif [ ! -d "$gnulib_path" ]; then
+ echo "$0: getting gnulib files..."
+
+ trap cleanup_gnulib 1 2 13 15
+
+ shallow=
+ git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
+ git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
+ cleanup_gnulib
+
+ trap - 1 2 13 15
+ fi
+ GNULIB_SRCDIR=$gnulib_path
+ ;;
+*)
+ # Use GNULIB_SRCDIR directly or as a reference.
+ if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
+ git_modules_config submodule.gnulib.url >/dev/null; then
+ echo "$0: getting gnulib files..."
+ if git submodule -h|grep -- --reference > /dev/null; then
+ # Prefer the one-liner available in git 1.6.4 or newer.
+ git submodule update --init --reference "$GNULIB_SRCDIR" \
+ "$gnulib_path" || exit $?
+ else
+ # This fallback allows at least git 1.5.5.
+ if test -f "$gnulib_path"/gnulib-tool; then
+ # Since file already exists, assume submodule init already complete.
+ git submodule update -- "$gnulib_path" || exit $?
+ else
+ # Older git can't clone into an empty directory.
+ rmdir "$gnulib_path" 2>/dev/null
+ git clone --reference "$GNULIB_SRCDIR" \
+ "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
+ && git submodule init -- "$gnulib_path" \
+ && git submodule update -- "$gnulib_path" \
+ || exit $?
+ fi
+ fi
+ GNULIB_SRCDIR=$gnulib_path
+ fi
+ ;;
+esac
+
+# $GNULIB_SRCDIR now points to the version of gnulib to use, and
+# we no longer need to use git or $gnulib_path below here.
+
+if $bootstrap_sync; then
+ cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
+ echo "$0: updating bootstrap and restarting..."
+ case $(sh -c 'echo "$1"' -- a) in
+ a) ignored=--;;
+ *) ignored=ignored;;
+ esac
+ exec sh -c \
+ 'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
+ $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
+ "$0" "$@" --no-bootstrap-sync
+ }
+fi
+
+gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
+<$gnulib_tool || exit $?
+
+# Get translations.
+
+download_po_files() {
+ subdir=$1
+ domain=$2
+ echo "$me: getting translations into $subdir for $domain..."
+ cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
+ eval "$cmd" && return
+ # Fallback to HTTP.
+ cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
+ eval "$cmd"
+}
+
+# Mirror .po files to $po_dir/.reference and copy only the new
+# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
+# Note po files that exist locally only are left in $po_dir but will
+# not be included in LINGUAS and hence will not be distributed.
+update_po_files() {
+ # Directory containing primary .po files.
+ # Overwrite them only when we're sure a .po file is new.
+ po_dir=$1
+ domain=$2
+
+ # Mirror *.po files into this dir.
+ # Usually contains *.s1 checksum files.
+ ref_po_dir="$po_dir/.reference"
+
+ test -d $ref_po_dir || mkdir $ref_po_dir || return
+ download_po_files $ref_po_dir $domain \
+ && ls "$ref_po_dir"/*.po 2>/dev/null |
+ sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
+
+ langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
+ test "$langs" = '*' && langs=x
+ for po in $langs; do
+ case $po in x) continue;; esac
+ new_po="$ref_po_dir/$po.po"
+ cksum_file="$ref_po_dir/$po.s1"
+ if ! test -f "$cksum_file" ||
+ ! test -f "$po_dir/$po.po" ||
+ ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
+ echo "$me: updated $po_dir/$po.po..."
+ cp "$new_po" "$po_dir/$po.po" \
+ && $SHA1SUM < "$new_po" > "$cksum_file" || return
+ fi
+ done
+}
+
+case $SKIP_PO in
+'')
+ if test -d po; then
+ update_po_files po $package || exit
+ fi
+
+ if test -d runtime-po; then
+ update_po_files runtime-po $package-runtime || exit
+ fi;;
+esac
+
+symlink_to_dir()
+{
+ src=$1/$2
+ dst=${3-$2}
+
+ test -f "$src" && {
+
+ # If the destination directory doesn't exist, create it.
+ # This is required at least for "lib/uniwidth/cjk.h".
+ dst_dir=$(dirname "$dst")
+ if ! test -d "$dst_dir"; then
+ mkdir -p "$dst_dir"
+
+ # If we've just created a directory like lib/uniwidth,
+ # tell version control system(s) it's ignorable.
+ # FIXME: for now, this does only one level
+ parent=$(dirname "$dst_dir")
+ for dot_ig in x $vc_ignore; do
+ test $dot_ig = x && continue
+ ig=$parent/$dot_ig
+ insert_vc_ignore $ig "${dst_dir##*/}"
+ done
+ fi
+
+ if $copy; then
+ {
+ test ! -h "$dst" || {
+ echo "$me: rm -f $dst" &&
+ rm -f "$dst"
+ }
+ } &&
+ test -f "$dst" &&
+ cmp -s "$src" "$dst" || {
+ echo "$me: cp -fp $src $dst" &&
+ cp -fp "$src" "$dst"
+ }
+ else
+ # Leave any existing symlink alone, if it already points to the source,
+ # so that broken build tools that care about symlink times
+ # aren't confused into doing unnecessary builds. Conversely, if the
+ # existing symlink's time stamp is older than the source, make it afresh,
+ # so that broken tools aren't confused into skipping needed builds. See
+ # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
+ test -h "$dst" &&
+ src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
+ dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
+ test "$src_i" = "$dst_i" &&
+ both_ls=$(ls -dt "$src" "$dst") &&
+ test "X$both_ls" = "X$dst$nl$src" || {
+ dot_dots=
+ case $src in
+ /*) ;;
+ *)
+ case /$dst/ in
+ *//* | */../* | */./* | /*/*/*/*/*/)
+ die "invalid symlink calculation: $src -> $dst";;
+ /*/*/*/*/) dot_dots=../../../;;
+ /*/*/*/) dot_dots=../../;;
+ /*/*/) dot_dots=../;;
+ esac;;
+ esac
+
+ echo "$me: ln -fs $dot_dots$src $dst" &&
+ ln -fs "$dot_dots$src" "$dst"
+ }
+ fi
+ }
+}
+
+version_controlled_file() {
+ parent=$1
+ file=$2
+ if test -d .git; then
+ git rm -n "$file" > /dev/null 2>&1
+ elif test -d .svn; then
+ svn log -r HEAD "$file" > /dev/null 2>&1
+ elif test -d CVS; then
+ grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
+ grep '^/[^/]*/[0-9]' > /dev/null
+ else
+ warn_ "no version control for $file?"
+ false
+ fi
+}
+
+# NOTE: we have to be careful to run both autopoint and libtoolize
+# before gnulib-tool, since gnulib-tool is likely to provide newer
+# versions of files "installed" by these two programs.
+# Then, *after* gnulib-tool (see below), we have to be careful to
+# run autoreconf in such a way that it does not run either of these
+# two just-pre-run programs.
+
+# Import from gettext.
+with_gettext=yes
+grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
+ with_gettext=no
+
+if test $with_gettext = yes || test $use_libtool = 1; then
+
+ tempbase=.bootstrap$$
+ trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
+
+ > $tempbase.0 > $tempbase.1 &&
+ find . ! -type d -print | sort > $tempbase.0 || exit
+
+ if test $with_gettext = yes; then
+ # Released autopoint has the tendency to install macros that have been
+ # obsoleted in current gnulib, so run this before gnulib-tool.
+ echo "$0: $AUTOPOINT --force"
+ $AUTOPOINT --force || exit
+ fi
+
+ # Autoreconf runs aclocal before libtoolize, which causes spurious
+ # warnings if the initial aclocal is confused by the libtoolized
+ # (or worse out-of-date) macro directory.
+ # libtoolize 1.9b added the --install option; but we support back
+ # to libtoolize 1.5.22, where the install action was default.
+ if test $use_libtool = 1; then
+ install=
+ case $($LIBTOOLIZE --help) in
+ *--install*) install=--install ;;
+ esac
+ echo "running: $LIBTOOLIZE $install --copy"
+ $LIBTOOLIZE $install --copy
+ fi
+
+ find . ! -type d -print | sort >$tempbase.1
+ old_IFS=$IFS
+ IFS=$nl
+ for file in $(comm -13 $tempbase.0 $tempbase.1); do
+ IFS=$old_IFS
+ parent=${file%/*}
+ version_controlled_file "$parent" "$file" || {
+ for dot_ig in x $vc_ignore; do
+ test $dot_ig = x && continue
+ ig=$parent/$dot_ig
+ insert_vc_ignore "$ig" "${file##*/}"
+ done
+ }
+ done
+ IFS=$old_IFS
+
+ rm -f $tempbase.0 $tempbase.1
+ trap - 1 2 13 15
+fi
+
+# Import from gnulib.
+
+gnulib_tool_options="\
+ --import\
+ --no-changelog\
+ --aux-dir $build_aux\
+ --doc-base $doc_base\
+ --lib $gnulib_name\
+ --m4-base $m4_base/\
+ --source-base $source_base/\
+ --tests-base $tests_base\
+ --local-dir $local_gl_dir\
+ $gnulib_tool_option_extras\
+"
+if test $use_libtool = 1; then
+ case "$gnulib_tool_options " in
+ *' --libtool '*) ;;
+ *) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
+ esac
+fi
+echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
+$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+ || die "gnulib-tool failed"
+
+for file in $gnulib_files; do
+ symlink_to_dir "$GNULIB_SRCDIR" $file \
+ || die "failed to symlink $file"
+done
+
+bootstrap_post_import_hook \
+ || die "bootstrap_post_import_hook failed"
+
+# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
+# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
+# The following requires GNU find 4.2.3 or newer. Considering the usual
+# portability constraints of this script, that may seem a very demanding
+# requirement, but it should be ok. Ignore any failure, which is fine,
+# since this is only a convenience to help developers avoid the relatively
+# unusual case in which a symlinked-to .m4 file is git-removed from gnulib
+# between successive runs of this script.
+find "$m4_base" "$source_base" \
+ -depth \( -name '*.m4' -o -name '*.[ch]' \) \
+ -type l -xtype l -delete > /dev/null 2>&1
+
+# Invoke autoreconf with --force --install to ensure upgrades of tools
+# such as ylwrap.
+AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
+
+# Some systems (RHEL 5) are using ancient autotools, for which the
+# --no-recursive option had not been invented. Detect that lack and
+# omit the option when it's not supported. FIXME in 2017: remove this
+# hack when RHEL 5 autotools are updated, or when they become irrelevant.
+case $($AUTORECONF --help) in
+ *--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
+esac
+
+# Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
+echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS"
+AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \
+ || die "autoreconf failed"
+
+# Get some extra files from gnulib, overriding existing files.
+for file in $gnulib_extra_files; do
+ case $file in
+ */INSTALL) dst=INSTALL;;
+ build-aux/*) dst=$build_aux/${file#build-aux/};;
+ *) dst=$file;;
+ esac
+ symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
+ || die "failed to symlink $file"
+done
+
+if test $with_gettext = yes; then
+ # Create gettext configuration.
+ echo "$0: Creating po/Makevars from po/Makevars.template ..."
+ rm -f po/Makevars
+ sed '
+ /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
+ /^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
+ /^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'|
+ /^XGETTEXT_OPTIONS *=/{
+ s/$/ \\/
+ a\
+ '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
+ }
+ ' po/Makevars.template >po/Makevars \
+ || die 'cannot generate po/Makevars'
+
+ # If the 'gettext' module is in use, grab the latest Makefile.in.in.
+ # If only the 'gettext-h' module is in use, assume autopoint already
+ # put the correct version of this file into place.
+ case $gnulib_modules in
+ *gettext-h*) ;;
+ *gettext*)
+ cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
+ || die "cannot create po/Makefile.in.in"
+ ;;
+ esac
+
+ if test -d runtime-po; then
+ # Similarly for runtime-po/Makevars, but not quite the same.
+ rm -f runtime-po/Makevars
+ sed '
+ /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
+ /^subdir *=.*/s/=.*/= runtime-po/
+ /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
+ /^XGETTEXT_OPTIONS *=/{
+ s/$/ \\/
+ a\
+ '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
+ }
+ ' po/Makevars.template >runtime-po/Makevars \
+ || die 'cannot generate runtime-po/Makevars'
+
+ # Copy identical files from po to runtime-po.
+ (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
+ fi
+fi
+
+bootstrap_epilogue
+
+echo "$0: done. Now you can run './configure'."
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/announce-gen b/build-aux/announce-gen
new file mode 100755
index 0000000..b461174
--- /dev/null
+++ b/build-aux/announce-gen
@@ -0,0 +1,557 @@
+eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
+ & eval 'exec perl -wS "$0" $argv:q'
+ if 0;
+# Generate a release announcement message.
+
+my $VERSION = '2016-01-12 23:09'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
+use strict;
+
+use Getopt::Long;
+use POSIX qw(strftime);
+
+(my $ME = $0) =~ s|.*/||;
+
+my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
+my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
+my %digest_classes =
+ (
+ 'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'),
+ 'sha1' => ((eval { require Digest::SHA; } and 'Digest::SHA')
+ or (eval { require Digest::SHA1; } and 'Digest::SHA1'))
+ );
+my $srcdir = '.';
+
+sub usage ($)
+{
+ my ($exit_code) = @_;
+ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+ if ($exit_code != 0)
+ {
+ print $STREAM "Try '$ME --help' for more information.\n";
+ }
+ else
+ {
+ my @types = sort keys %valid_release_types;
+ print $STREAM <<EOF;
+Usage: $ME [OPTIONS]
+Generate an announcement message. Run this from builddir.
+
+OPTIONS:
+
+These options must be specified:
+
+ --release-type=TYPE TYPE must be one of @types
+ --package-name=PACKAGE_NAME
+ --previous-version=VER
+ --current-version=VER
+ --gpg-key-id=ID The GnuPG ID of the key used to sign the tarballs
+ --url-directory=URL_DIR
+
+The following are optional:
+
+ --news=NEWS_FILE include the NEWS section about this release
+ from this NEWS_FILE; accumulates.
+ --srcdir=DIR where to find the NEWS_FILEs (default: $srcdir)
+ --bootstrap-tools=TOOL_LIST a comma-separated list of tools, e.g.,
+ autoconf,automake,bison,gnulib
+ --gnulib-version=VERSION report VERSION as the gnulib version, where
+ VERSION is the result of running git describe
+ in the gnulib source directory.
+ required if gnulib is in TOOL_LIST.
+ --no-print-checksums do not emit MD5 or SHA1 checksums
+ --archive-suffix=SUF add SUF to the list of archive suffixes
+ --mail-headers=HEADERS a space-separated list of mail headers, e.g.,
+ To: x\@example.com Cc: y-announce\@example.com,...
+
+ --help display this help and exit
+ --version output version information and exit
+
+EOF
+ }
+ exit $exit_code;
+}
+
+
+=item C<%size> = C<sizes (@file)>
+
+Compute the sizes of the C<@file> and return them as a hash. Return
+C<undef> if one of the computation failed.
+
+=cut
+
+sub sizes (@)
+{
+ my (@file) = @_;
+
+ my $fail = 0;
+ my %res;
+ foreach my $f (@file)
+ {
+ my $cmd = "du -h $f";
+ my $t = `$cmd`;
+ # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
+ $@
+ and (warn "command failed: '$cmd'\n"), $fail = 1;
+ chomp $t;
+ $t =~ s/^\s*([\d.]+[MkK]).*/${1}B/;
+ $res{$f} = $t;
+ }
+ return $fail ? undef : %res;
+}
+
+=item C<print_locations ($title, \@url, \%size, @file)
+
+Print a section C<$title> dedicated to the list of <@file>, which
+sizes are stored in C<%size>, and which are available from the C<@url>.
+
+=cut
+
+sub print_locations ($\@\%@)
+{
+ my ($title, $url, $size, @file) = @_;
+ print "Here are the $title:\n";
+ foreach my $url (@{$url})
+ {
+ for my $file (@file)
+ {
+ print " $url/$file";
+ print " (", $$size{$file}, ")"
+ if exists $$size{$file};
+ print "\n";
+ }
+ }
+ print "\n";
+}
+
+=item C<print_checksums (@file)
+
+Print the MD5 and SHA1 signature section for each C<@file>.
+
+=cut
+
+sub print_checksums (@)
+{
+ my (@file) = @_;
+
+ print "Here are the MD5 and SHA1 checksums:\n";
+ print "\n";
+
+ foreach my $meth (qw (md5 sha1))
+ {
+ my $class = $digest_classes{$meth} or next;
+ foreach my $f (@file)
+ {
+ open IN, '<', $f
+ or die "$ME: $f: cannot open for reading: $!\n";
+ binmode IN;
+ my $dig = $class->new->addfile(*IN)->hexdigest;
+ close IN;
+ print "$dig $f\n";
+ }
+ }
+ print "\n";
+}
+
+=item C<print_news_deltas ($news_file, $prev_version, $curr_version)
+
+Print the section of the NEWS file C<$news_file> addressing changes
+between versions C<$prev_version> and C<$curr_version>.
+
+=cut
+
+sub print_news_deltas ($$$)
+{
+ my ($news_file, $prev_version, $curr_version) = @_;
+
+ my $news_name = $news_file;
+ $news_name =~ s|^\Q$srcdir\E/||;
+
+ print "\n$news_name\n\n";
+
+ # Print all lines from $news_file, starting with the first one
+ # that mentions $curr_version up to but not including
+ # the first occurrence of $prev_version.
+ my $in_items;
+
+ my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/;
+
+ my $found_news;
+ open NEWS, '<', $news_file
+ or die "$ME: $news_file: cannot open for reading: $!\n";
+ while (defined (my $line = <NEWS>))
+ {
+ if ( ! $in_items)
+ {
+ # Match lines like these:
+ # * Major changes in release 5.0.1:
+ # * Noteworthy changes in release 6.6 (2006-11-22) [stable]
+ $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o
+ or next;
+ $in_items = 1;
+ print $line;
+ }
+ else
+ {
+ # This regexp must not match version numbers in NEWS items.
+ # For example, they might well say "introduced in 4.5.5",
+ # and we don't want that to match.
+ $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o
+ and last;
+ print $line;
+ $line =~ /\S/
+ and $found_news = 1;
+ }
+ }
+ close NEWS;
+
+ $in_items
+ or die "$ME: $news_file: no matching lines for '$curr_version'\n";
+ $found_news
+ or die "$ME: $news_file: no news item found for '$curr_version'\n";
+}
+
+sub print_changelog_deltas ($$)
+{
+ my ($package_name, $prev_version) = @_;
+
+ # Print new ChangeLog entries.
+
+ # First find all CVS-controlled ChangeLog files.
+ use File::Find;
+ my @changelog;
+ find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
+ and push @changelog, $File::Find::name}},
+ '.');
+
+ # If there are no ChangeLog files, we're done.
+ @changelog
+ or return;
+ my %changelog = map {$_ => 1} @changelog;
+
+ # Reorder the list of files so that if there are ChangeLog
+ # files in the specified directories, they're listed first,
+ # in this order:
+ my @dir = qw ( . src lib m4 config doc );
+
+ # A typical @changelog array might look like this:
+ # ./ChangeLog
+ # ./po/ChangeLog
+ # ./m4/ChangeLog
+ # ./lib/ChangeLog
+ # ./doc/ChangeLog
+ # ./config/ChangeLog
+ my @reordered;
+ foreach my $d (@dir)
+ {
+ my $dot_slash = $d eq '.' ? $d : "./$d";
+ my $target = "$dot_slash/ChangeLog";
+ delete $changelog{$target}
+ and push @reordered, $target;
+ }
+
+ # Append any remaining ChangeLog files.
+ push @reordered, sort keys %changelog;
+
+ # Remove leading './'.
+ @reordered = map { s!^\./!!; $_ } @reordered;
+
+ print "\nChangeLog entries:\n\n";
+ # print join ("\n", @reordered), "\n";
+
+ $prev_version =~ s/\./_/g;
+ my $prev_cvs_tag = "\U$package_name\E-$prev_version";
+
+ my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
+ open DIFF, '-|', $cmd
+ or die "$ME: cannot run '$cmd': $!\n";
+ # Print two types of lines, making minor changes:
+ # Lines starting with '+++ ', e.g.,
+ # +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
+ # and those starting with '+'.
+ # Don't print the others.
+ my $prev_printed_line_empty = 1;
+ while (defined (my $line = <DIFF>))
+ {
+ if ($line =~ /^\+\+\+ /)
+ {
+ my $separator = "*"x70 ."\n";
+ $line =~ s///;
+ $line =~ s/\s.*//;
+ $prev_printed_line_empty
+ or print "\n";
+ print $separator, $line, $separator;
+ }
+ elsif ($line =~ /^\+/)
+ {
+ $line =~ s///;
+ print $line;
+ $prev_printed_line_empty = ($line =~ /^$/);
+ }
+ }
+ close DIFF;
+
+ # The exit code should be 1.
+ # Allow in case there are no modified ChangeLog entries.
+ $? == 256 || $? == 128
+ or warn "warning: '$cmd' had unexpected exit code or signal ($?)\n";
+}
+
+sub get_tool_versions ($$)
+{
+ my ($tool_list, $gnulib_version) = @_;
+ @$tool_list
+ or return ();
+
+ my $fail;
+ my @tool_version_pair;
+ foreach my $t (@$tool_list)
+ {
+ if ($t eq 'gnulib')
+ {
+ push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version;
+ next;
+ }
+ # Assume that the last "word" on the first line of
+ # 'tool --version' output is the version string.
+ my ($first_line, undef) = split ("\n", `$t --version`);
+ if ($first_line =~ /.* (\d[\w.-]+)$/)
+ {
+ $t = ucfirst $t;
+ push @tool_version_pair, "$t $1";
+ }
+ else
+ {
+ defined $first_line
+ and $first_line = '';
+ warn "$t: unexpected --version output\n:$first_line";
+ $fail = 1;
+ }
+ }
+
+ $fail
+ and exit 1;
+
+ return @tool_version_pair;
+}
+
+{
+ # Neutralize the locale, so that, for instance, "du" does not
+ # issue "1,2" instead of "1.2", what confuses our regexps.
+ $ENV{LC_ALL} = "C";
+
+ my $mail_headers;
+ my $release_type;
+ my $package_name;
+ my $prev_version;
+ my $curr_version;
+ my $gpg_key_id;
+ my @url_dir_list;
+ my @news_file;
+ my $bootstrap_tools;
+ my $gnulib_version;
+ my $print_checksums_p = 1;
+
+ # Reformat the warnings before displaying them.
+ local $SIG{__WARN__} = sub
+ {
+ my ($msg) = @_;
+ # Warnings from GetOptions.
+ $msg =~ s/Option (\w)/option --$1/;
+ warn "$ME: $msg";
+ };
+
+ GetOptions
+ (
+ 'mail-headers=s' => \$mail_headers,
+ 'release-type=s' => \$release_type,
+ 'package-name=s' => \$package_name,
+ 'previous-version=s' => \$prev_version,
+ 'current-version=s' => \$curr_version,
+ 'gpg-key-id=s' => \$gpg_key_id,
+ 'url-directory=s' => \@url_dir_list,
+ 'news=s' => \@news_file,
+ 'srcdir=s' => \$srcdir,
+ 'bootstrap-tools=s' => \$bootstrap_tools,
+ 'gnulib-version=s' => \$gnulib_version,
+ 'print-checksums!' => \$print_checksums_p,
+ 'archive-suffix=s' => \@archive_suffixes,
+
+ help => sub { usage 0 },
+ version => sub { print "$ME version $VERSION\n"; exit },
+ ) or usage 1;
+
+ my $fail = 0;
+ # Ensure that each required option is specified.
+ $release_type
+ or (warn "release type not specified\n"), $fail = 1;
+ $package_name
+ or (warn "package name not specified\n"), $fail = 1;
+ $prev_version
+ or (warn "previous version string not specified\n"), $fail = 1;
+ $curr_version
+ or (warn "current version string not specified\n"), $fail = 1;
+ $gpg_key_id
+ or (warn "GnuPG key ID not specified\n"), $fail = 1;
+ @url_dir_list
+ or (warn "URL directory name(s) not specified\n"), $fail = 1;
+
+ my @tool_list = split ',', $bootstrap_tools
+ if $bootstrap_tools;
+
+ grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version
+ and (warn "when specifying gnulib as a tool, you must also specify\n"
+ . "--gnulib-version=V, where V is the result of running git describe\n"
+ . "in the gnulib source directory.\n"), $fail = 1;
+
+ !$release_type || exists $valid_release_types{$release_type}
+ or (warn "'$release_type': invalid release type\n"), $fail = 1;
+
+ @ARGV
+ and (warn "too many arguments:\n", join ("\n", @ARGV), "\n"),
+ $fail = 1;
+ $fail
+ and usage 1;
+
+ my $my_distdir = "$package_name-$curr_version";
+
+ my $xd = "$package_name-$prev_version-$curr_version.xdelta";
+
+ my @candidates = map { "$my_distdir.$_" } @archive_suffixes;
+ my @tarballs = grep {-f $_} @candidates;
+
+ @tarballs
+ or die "$ME: none of " . join(', ', @candidates) . " were found\n";
+ my @sizable = @tarballs;
+ -f $xd
+ and push @sizable, $xd;
+ my %size = sizes (@sizable);
+ %size
+ or exit 1;
+
+ my $headers = '';
+ if (defined $mail_headers)
+ {
+ ($headers = $mail_headers) =~ s/\s+(\S+:)/\n$1/g;
+ $headers .= "\n";
+ }
+
+ # The markup is escaped as <\# so that when this script is sent by
+ # mail (or part of a diff), Gnus is not triggered.
+ print <<EOF;
+
+${headers}Subject: $my_distdir released [$release_type]
+
+<\#secure method=pgpmime mode=sign>
+
+FIXME: put comments here
+
+EOF
+
+ if (@url_dir_list == 1 && @tarballs == 1)
+ {
+ # When there's only one tarball and one URL, use a more concise form.
+ my $m = "$url_dir_list[0]/$tarballs[0]";
+ print "Here are the compressed sources and a GPG detached signature[*]:\n"
+ . " $m\n"
+ . " $m.sig\n\n";
+ }
+ else
+ {
+ print_locations ("compressed sources", @url_dir_list, %size, @tarballs);
+ -f $xd
+ and print_locations ("xdelta diffs (useful? if so, "
+ . "please tell bug-gnulib\@gnu.org)",
+ @url_dir_list, %size, $xd);
+ my @sig_files = map { "$_.sig" } @tarballs;
+ print_locations ("GPG detached signatures[*]", @url_dir_list, %size,
+ @sig_files);
+ }
+
+ if ($url_dir_list[0] =~ "gnu\.org")
+ {
+ print "Use a mirror for higher download bandwidth:\n";
+ if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!)
+ {
+ (my $m = "$url_dir_list[0]/$tarballs[0]")
+ =~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!;
+ print " $m\n"
+ . " $m.sig\n\n";
+
+ }
+ else
+ {
+ print " http://www.gnu.org/order/ftp.html\n\n";
+ }
+ }
+
+ $print_checksums_p
+ and print_checksums (@sizable);
+
+ print <<EOF;
+[*] Use a .sig file to verify that the corresponding file (without the
+.sig suffix) is intact. First, be sure to download both the .sig file
+and the corresponding tarball. Then, run a command like this:
+
+ gpg --verify $tarballs[0].sig
+
+If that command fails because you don't have the required public key,
+then run this command to import it:
+
+ gpg --keyserver keys.gnupg.net --recv-keys $gpg_key_id
+
+and rerun the 'gpg --verify' command.
+EOF
+
+ my @tool_versions = get_tool_versions (\@tool_list, $gnulib_version);
+ @tool_versions
+ and print "\nThis release was bootstrapped with the following tools:",
+ join ('', map {"\n $_"} @tool_versions), "\n";
+
+ print_news_deltas ($_, $prev_version, $curr_version)
+ foreach @news_file;
+
+ $release_type eq 'stable'
+ or print_changelog_deltas ($package_name, $prev_version);
+
+ exit 0;
+}
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## mode: perl
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## perl-extra-newline-before-brace: t
+## perl-merge-trailing-else: nil
+## eval: (add-hook 'write-file-hooks 'time-stamp)
+## time-stamp-start: "my $VERSION = '"
+## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+## time-stamp-time-zone: "UTC0"
+## time-stamp-end: "'; # UTC"
+## End:
diff --git a/build-aux/ar-lib b/build-aux/ar-lib
new file mode 100755
index 0000000..1700c5e
--- /dev/null
+++ b/build-aux/ar-lib
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# This program is free software; you can 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, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+ echo "$me: $1" 1>&2
+ exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv in
+ mingw)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+ operation=$2
+ archive=$3
+ at_file_contents=`cat "$1"`
+ eval set x "$at_file_contents"
+ shift
+
+ for member
+ do
+ $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+ done
+}
+
+case $1 in
+ '')
+ func_error "no command. Try '$0 --help' for more information."
+ ;;
+ -h | --h*)
+ cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "$me, version $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test $# -lt 3; then
+ func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+ if test $# -lt 2; then
+ func_error "you must specify a program, an action and an archive"
+ fi
+ case $1 in
+ -lib | -LIB \
+ | -ltcg | -LTCG \
+ | -machine* | -MACHINE* \
+ | -subsystem* | -SUBSYSTEM* \
+ | -verbose | -VERBOSE \
+ | -wx* | -WX* )
+ AR="$AR $1"
+ shift
+ ;;
+ *)
+ action=$1
+ shift
+ break
+ ;;
+ esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+ case $action in
+ d*) delete=yes ;;
+ x*) extract=yes ;;
+ t*) list=yes ;;
+ q*) quick=yes ;;
+ r*) replace=yes ;;
+ s*) index=yes ;;
+ S*) ;; # the index is always updated implicitly
+ c*) create=yes ;;
+ u*) ;; # TODO: don't ignore the update modifier
+ v*) ;; # TODO: don't ignore the verbose modifier
+ *)
+ func_error "unknown action specified"
+ ;;
+ esac
+ action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+ yes,* | ,yes)
+ ;;
+ yesyes*)
+ func_error "more than one action specified"
+ ;;
+ *)
+ func_error "no action specified"
+ ;;
+esac
+
+if test -n "$delete"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ for member
+ do
+ case $1 in
+ @*)
+ func_at_file "${1#@}" -REMOVE "$archive"
+ ;;
+ *)
+ func_file_conv "$1"
+ $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+ ;;
+ esac
+ done
+
+elif test -n "$extract"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ if test $# -gt 0; then
+ for member
+ do
+ case $1 in
+ @*)
+ func_at_file "${1#@}" -EXTRACT "$archive"
+ ;;
+ *)
+ func_file_conv "$1"
+ $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+ ;;
+ esac
+ done
+ else
+ $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+ do
+ $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+ done
+ fi
+
+elif test -n "$quick$replace"; then
+ if test ! -f "$orig_archive"; then
+ if test -z "$create"; then
+ echo "$me: creating $orig_archive"
+ fi
+ orig_archive=
+ else
+ orig_archive=$archive
+ fi
+
+ for member
+ do
+ case $1 in
+ @*)
+ func_file_conv "${1#@}"
+ set x "$@" "@$file"
+ ;;
+ *)
+ func_file_conv "$1"
+ set x "$@" "$file"
+ ;;
+ esac
+ shift
+ shift
+ done
+
+ if test -n "$orig_archive"; then
+ $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+ else
+ $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+ fi
+
+elif test -n "$list"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff --git a/build-aux/compile b/build-aux/compile
new file mode 100755
index 0000000..4bfd30c
--- /dev/null
+++ b/build-aux/compile
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1999-2015 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can 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, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/config.guess b/build-aux/config.guess
new file mode 100755
index 0000000..c4bd827
--- /dev/null
+++ b/build-aux/config.guess
@@ -0,0 +1,1456 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2016 Free Software Foundation, Inc.
+
+timestamp='2016-05-15'
+
+# 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 program is distributed in the hope that it will be useful, but
+# WITHOUT 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/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2016 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || \
+ echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently (or will in the future) and ABI.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ os=netbsdelf
+ ;;
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # Determine ABI tags.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}${abi}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:Sortix:*:*)
+ echo ${UNAME_MACHINE}-unknown-sortix
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE=alpha ;;
+ "EV5 (21164)")
+ UNAME_MACHINE=alphaev5 ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE=alphaev56 ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE=alphapca56 ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE=alphapca57 ;;
+ "EV6 (21264)")
+ UNAME_MACHINE=alphaev6 ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE=alphaev67 ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE=alphaev69 ;;
+ "EV7 (21364)")
+ UNAME_MACHINE=alphaev7 ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE=alphaev79 ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH=x86_64
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = hppa2.0w ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH=hppa2.0w
+ else
+ HP_ARCH=hppa64
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ e2k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ k1om:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configure will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = x86; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = 386; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+esac
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
new file mode 100755
index 0000000..98183ff
--- /dev/null
+++ b/build-aux/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2016 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # 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.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ 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
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ 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
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/build-aux/config.sub b/build-aux/config.sub
new file mode 100755
index 0000000..9feb73b
--- /dev/null
+++ b/build-aux/config.sub
@@ -0,0 +1,1823 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2016 Free Software Foundation, Inc.
+
+timestamp='2016-06-20'
+
+# 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 program is distributed in the hope that it will be useful, but
+# WITHOUT 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/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches to <config-patches@gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2016 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | ba \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 | or1k | or1knd | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | riscv32 | riscv64 \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | ba-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | e2k-* | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | or1k*-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | riscv32-* | riscv64-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | visium-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -ios)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/depcomp b/build-aux/depcomp
new file mode 100755
index 0000000..28ce42a
--- /dev/null
+++ b/build-aux/depcomp
@@ -0,0 +1,756 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1999-2015 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 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/do-release-commit-and-tag b/build-aux/do-release-commit-and-tag
new file mode 100755
index 0000000..b4f3251
--- /dev/null
+++ b/build-aux/do-release-commit-and-tag
@@ -0,0 +1,179 @@
+#!/bin/sh
+# In a git/autoconf/automake-enabled project with a NEWS file and a version-
+# controlled .prev-version file, automate the procedure by which we record
+# the date, release-type and version string in the NEWS file. That commit
+# will serve to identify the release, so apply a signed tag to it as well.
+VERSION=2016-01-12.23 # UTC
+
+# Note: this is a bash script (could be zsh or dash)
+
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
+ME=$(basename "$0")
+warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
+die() { warn "$*"; exit 1; }
+
+help()
+{
+ cat <<EOF
+Usage: $ME [OPTION...] VERSION RELEASE_TYPE
+
+Run this script from top_srcdir to perform the final pre-release NEWS
+update in which the date, release-type and version string are
+recorded. Commit that result with a log entry marking the release,
+and apply a signed tag. Run it from your project's top-level
+directory.
+
+Requirements:
+- you use git for version-control
+- a version-controlled .prev-version file
+- a NEWS file, with line 3 identical to this:
+$noteworthy_stub
+
+Options:
+ --branch=BRANCH set release branch (default: $branch)
+ -C, --builddir=DIR location of (configured) Makefile (default: $builddir)
+ --help print this help, then exit
+ --version print version number, then exit
+
+EXAMPLE:
+To update NEWS and tag the beta 8.1 release of coreutils, I would run this:
+
+ $ME 8.1 beta
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+ exit
+}
+
+version()
+{
+ year=$(echo "$VERSION" | sed 's/[^0-9].*//')
+ cat <<EOF
+$ME $VERSION
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+ exit
+}
+
+## ------ ##
+## Main. ##
+## ------ ##
+
+# Constants.
+noteworthy='* Noteworthy changes in release'
+noteworthy_stub="$noteworthy ?.? (????-??-??) [?]"
+
+# Variables.
+branch=$(git branch | sed -ne '/^\* /{s///;p;q;}')
+builddir=.
+
+while test $# != 0
+do
+ # Handle --option=value by splitting apart and putting back on argv.
+ case $1 in
+ --*=*)
+ opt=$(echo "$1" | sed -e 's/=.*//')
+ val=$(echo "$1" | sed -e 's/[^=]*=//')
+ shift
+ set dummy "$opt" "$val" "$@"; shift
+ ;;
+ esac
+
+ case $1 in
+ --help|--version) ${1#--};;
+ --branch) shift; branch=$1; shift ;;
+ -C|--builddir) shift; builddir=$1; shift ;;
+ --*) die "unrecognized option: $1";;
+ *) break;;
+ esac
+done
+
+test $# = 2 \
+ || die "Usage: $ME [OPTION...] VERSION TYPE"
+
+ver=$1
+type=$2
+
+
+## ---------------------- ##
+## First, sanity checks. ##
+## ---------------------- ##
+
+# Verify that $ver looks like a version number, and...
+echo "$ver"|grep -E '^[0-9][0-9.]*[0-9]$' > /dev/null \
+ || die "invalid version: $ver"
+prev_ver=$(cat .prev-version) \
+ || die 'failed to determine previous version number from .prev-version'
+
+# Verify that $ver is sensible (> .prev-version).
+case $(printf "$prev_ver\n$ver\n"|sort -V -u|tr '\n' ':') in
+ "$prev_ver:$ver:") ;;
+ *) die "invalid version: $ver (<= $prev_ver)";;
+esac
+
+case $type in
+ alpha|beta|stable) ;;
+ *) die "invalid release type: $type";;
+esac
+
+# No local modifications allowed.
+case $(git diff-index --name-only HEAD) in
+ '') ;;
+ *) die 'this tree is dirty; commit your changes first';;
+esac
+
+# Ensure the current branch name is correct:
+curr_br=$(git rev-parse --symbolic-full-name HEAD)
+test "$curr_br" = refs/heads/$branch || die not on branch $branch
+
+# Extract package name from Makefile.
+Makefile=$builddir/Makefile
+pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' "$Makefile") \
+ || die "failed to determine package name from $Makefile"
+
+# Check that line 3 of NEWS is the stub line about to be replaced.
+test "$(sed -n 3p NEWS)" = "$noteworthy_stub" \
+ || die "line 3 of NEWS must be exactly '$noteworthy_stub'"
+
+## --------------- ##
+## Then, changes. ##
+## --------------- ##
+
+# Update NEWS to have today's date, plus desired version number and $type.
+perl -MPOSIX -ni -e 'my $today = strftime "%F", localtime time;' \
+ -e 'my ($type, $ver) = qw('"$type $ver"');' \
+ -e 'my $pfx = "'"$noteworthy"'";' \
+ -e 'print $.==3 ? "$pfx $ver ($today) [$type]\n" : $_' \
+ NEWS || die 'failed to update NEWS'
+
+printf "version $ver\n\n* NEWS: Record release date.\n" \
+ | git commit -F - -a || die 'git commit failed'
+git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed'
+
+# Local variables:
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "VERSION="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: " # UTC"
+# End:
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
new file mode 100755
index 0000000..fef6280
--- /dev/null
+++ b/build-aux/gendocs.sh
@@ -0,0 +1,504 @@
+#!/bin/sh -e
+# gendocs.sh -- generate a GNU manual in many formats. This script is
+# mentioned in maintain.texi. See the help message below for usage details.
+
+scriptversion=2016-05-20.09
+
+# Copyright 2003-2016 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Original author: Mohit Agarwal.
+# Send bug reports and any other correspondence to bug-gnulib@gnu.org.
+#
+# The latest version of this script, and the companion template, is
+# available from the Gnulib repository:
+#
+# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
+# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
+
+# TODO:
+# - image importing was only implemented for HTML generated by
+# makeinfo. But it should be simple enough to adjust.
+# - images are not imported in the source tarball. All the needed
+# formats (PDF, PNG, etc.) should be included.
+
+prog=`basename "$0"`
+srcdir=`pwd`
+
+scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
+templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
+
+: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
+: ${MAKEINFO="makeinfo"}
+: ${TEXI2DVI="texi2dvi"}
+: ${DOCBOOK2HTML="docbook2html"}
+: ${DOCBOOK2PDF="docbook2pdf"}
+: ${DOCBOOK2TXT="docbook2txt"}
+: ${GENDOCS_TEMPLATE_DIR="."}
+: ${PERL='perl'}
+: ${TEXI2HTML="texi2html"}
+unset CDPATH
+unset use_texi2html
+
+MANUAL_TITLE=
+PACKAGE=
+EMAIL=webmasters@gnu.org # please override with --email
+commonarg= # passed to all makeinfo/texi2html invcations.
+dirargs= # passed to all tools (-I dir).
+dirs= # -I directories.
+htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
+infoarg=--no-split
+generate_ascii=true
+generate_html=true
+generate_info=true
+generate_tex=true
+outdir=manual
+source_extra=
+split=node
+srcfile=
+texarg="-t @finalout"
+
+version="gendocs.sh $scriptversion
+
+Copyright 2016 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
+
+Generate output in various formats from PACKAGE.texinfo (or .texi or
+.txi) source. See the GNU Maintainers document for a more extensive
+discussion:
+ http://www.gnu.org/prep/maintain_toc.html
+
+Options:
+ --email ADR use ADR as contact in generated web pages; always give this.
+
+ -s SRCFILE read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi}
+ -o OUTDIR write files into OUTDIR, instead of manual/.
+ -I DIR append DIR to the Texinfo search path.
+ --common ARG pass ARG in all invocations.
+ --html ARG pass ARG to makeinfo or texi2html for HTML targets,
+ instead of '$htmlarg'.
+ --info ARG pass ARG to makeinfo for Info, instead of --no-split.
+ --no-ascii skip generating the plain text output.
+ --no-html skip generating the html output.
+ --no-info skip generating the info output.
+ --no-tex skip generating the dvi and pdf output.
+ --source ARG include ARG in tar archive of sources.
+ --split HOW make split HTML by node, section, chapter; default node.
+ --tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout.
+
+ --texi2html use texi2html to make HTML target, with all split versions.
+ --docbook convert through DocBook too (xml, txt, html, pdf).
+
+ --help display this help and exit successfully.
+ --version display version information and exit successfully.
+
+Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\"
+
+Typical sequence:
+ cd PACKAGESOURCE/doc
+ wget \"$scripturl\"
+ wget \"$templateurl\"
+ $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\"
+
+Output will be in a new subdirectory \"manual\" (by default;
+use -o OUTDIR to override). Move all the new files into your web CVS
+tree, as explained in the Web Pages node of maintain.texi.
+
+Please use the --email ADDRESS option so your own bug-reporting
+address will be used in the generated HTML pages.
+
+MANUAL-TITLE is included as part of the HTML <title> of the overall
+manual/index.html file. It should include the name of the package being
+documented. manual/index.html is created by substitution from the file
+$GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the
+generic template for your own purposes.)
+
+If you have several manuals, you'll need to run this script several
+times with different MANUAL values, specifying a different output
+directory with -o each time. Then write (by hand) an overall index.html
+with links to them all.
+
+If a manual's Texinfo sources are spread across several directories,
+first copy or symlink all Texinfo sources into a single directory.
+(Part of the script's work is to make a tar.gz of the sources.)
+
+As implied above, by default monolithic Info files are generated.
+If you want split Info, or other Info options, use --info to override.
+
+You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML,
+and PERL to control the programs that get executed, and
+GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is
+looked for. With --docbook, the environment variables DOCBOOK2HTML,
+DOCBOOK2PDF, and DOCBOOK2TXT are also consulted.
+
+By default, makeinfo and texi2dvi are run in the default (English)
+locale, since that's the language of most Texinfo manuals. If you
+happen to have a non-English manual and non-English web site, see the
+SETLANG setting in the source.
+
+Email bug reports or enhancement requests to bug-gnulib@gnu.org.
+"
+
+while test $# -gt 0; do
+ case $1 in
+ -s) shift; srcfile=$1;;
+ -o) shift; outdir=$1;;
+ -I) shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";;
+ --common) shift; commonarg=$1;;
+ --docbook) docbook=yes;;
+ --email) shift; EMAIL=$1;;
+ --html) shift; htmlarg=$1;;
+ --info) shift; infoarg=$1;;
+ --no-ascii) generate_ascii=false;;
+ --no-html) generate_ascii=false;;
+ --no-info) generate_info=false;;
+ --no-tex) generate_tex=false;;
+ --source) shift; source_extra=$1;;
+ --split) shift; split=$1;;
+ --tex) shift; texarg=$1;;
+ --texi2html) use_texi2html=1;;
+
+ --help) echo "$usage"; exit 0;;
+ --version) echo "$version"; exit 0;;
+ -*)
+ echo "$0: Unknown option \`$1'." >&2
+ echo "$0: Try \`--help' for more information." >&2
+ exit 1;;
+ *)
+ if test -z "$PACKAGE"; then
+ PACKAGE=$1
+ elif test -z "$MANUAL_TITLE"; then
+ MANUAL_TITLE=$1
+ else
+ echo "$0: extra non-option argument \`$1'." >&2
+ exit 1
+ fi;;
+ esac
+ shift
+done
+
+# makeinfo uses the dirargs, but texi2dvi doesn't.
+commonarg=" $dirargs $commonarg"
+
+# For most of the following, the base name is just $PACKAGE
+base=$PACKAGE
+
+if test -n "$srcfile"; then
+ # but here, we use the basename of $srcfile
+ base=`basename "$srcfile"`
+ case $base in
+ *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;;
+ esac
+ PACKAGE=$base
+elif test -s "$srcdir/$PACKAGE.texinfo"; then
+ srcfile=$srcdir/$PACKAGE.texinfo
+elif test -s "$srcdir/$PACKAGE.texi"; then
+ srcfile=$srcdir/$PACKAGE.texi
+elif test -s "$srcdir/$PACKAGE.txi"; then
+ srcfile=$srcdir/$PACKAGE.txi
+else
+ echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2
+ exit 1
+fi
+
+if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
+ echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2
+ echo "$0: it is available from $templateurl." >&2
+ exit 1
+fi
+
+# Function to return size of $1 in something resembling kilobytes.
+calcsize()
+{
+ size=`ls -ksl $1 | awk '{print $1}'`
+ echo $size
+}
+
+# copy_images OUTDIR HTML-FILE...
+# -------------------------------
+# Copy all the images needed by the HTML-FILEs into OUTDIR.
+# Look for them in . and the -I directories; this is simpler than what
+# makeinfo supports with -I, but hopefully it will suffice.
+copy_images()
+{
+ local odir
+ odir=$1
+ shift
+ $PERL -n -e "
+BEGIN {
+ \$me = '$prog';
+ \$odir = '$odir';
+ @dirs = qw(. $dirs);
+}
+" -e '
+/<img src="(.*?)"/g && ++$need{$1};
+
+END {
+ #print "$me: @{[keys %need]}\n"; # for debugging, show images found.
+ FILE: for my $f (keys %need) {
+ for my $d (@dirs) {
+ if (-f "$d/$f") {
+ use File::Basename;
+ my $dest = dirname ("$odir/$f");
+ #
+ use File::Path;
+ -d $dest || mkpath ($dest)
+ || die "$me: cannot mkdir $dest: $!\n";
+ #
+ use File::Copy;
+ copy ("$d/$f", $dest)
+ || die "$me: cannot copy $d/$f to $dest: $!\n";
+ next FILE;
+ }
+ }
+ die "$me: $ARGV: cannot find image $f\n";
+ }
+}
+' -- "$@" || exit 1
+}
+
+case $outdir in
+ /*) abs_outdir=$outdir;;
+ *) abs_outdir=$srcdir/$outdir;;
+esac
+
+echo "Making output for $srcfile"
+echo " in `pwd`"
+mkdir -p "$outdir/"
+
+#
+if $generate_info; then
+ cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
+ echo "Generating info... ($cmd)"
+ rm -f $PACKAGE.info* # get rid of any strays
+ eval "$cmd"
+ tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
+ ls -l "$outdir/$PACKAGE.info.tar.gz"
+ info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
+ # do not mv the info files, there's no point in having them available
+ # separately on the web.
+fi # end info
+
+#
+if $generate_tex; then
+ cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\""
+ printf "\nGenerating dvi... ($cmd)\n"
+ eval "$cmd"
+ # compress/finish dvi:
+ gzip -f -9 $PACKAGE.dvi
+ dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
+ mv $PACKAGE.dvi.gz "$outdir/"
+ ls -l "$outdir/$PACKAGE.dvi.gz"
+
+ cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\""
+ printf "\nGenerating pdf... ($cmd)\n"
+ eval "$cmd"
+ pdf_size=`calcsize $PACKAGE.pdf`
+ mv $PACKAGE.pdf "$outdir/"
+ ls -l "$outdir/$PACKAGE.pdf"
+fi # end tex (dvi + pdf)
+
+#
+if $generate_ascii; then
+ opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
+ cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
+ printf "\nGenerating ascii... ($cmd)\n"
+ eval "$cmd"
+ ascii_size=`calcsize $PACKAGE.txt`
+ gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
+ ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"`
+ mv $PACKAGE.txt "$outdir/"
+ ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
+fi
+
+#
+
+if $generate_html; then
+# Split HTML at level $1. Used for texi2html.
+html_split()
+{
+ opt="--split=$1 --node-files $commonarg $htmlarg"
+ cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\""
+ printf "\nGenerating html by $1... ($cmd)\n"
+ eval "$cmd"
+ split_html_dir=$PACKAGE.html
+ (
+ cd ${split_html_dir} || exit 1
+ ln -sf ${PACKAGE}.html index.html
+ tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html
+ )
+ eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"`
+ rm -f "$outdir"/html_$1/*.html
+ mkdir -p "$outdir/html_$1/"
+ mv ${split_html_dir}/*.html "$outdir/html_$1/"
+ rmdir ${split_html_dir}
+}
+
+if test -z "$use_texi2html"; then
+ opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg"
+ cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
+ printf "\nGenerating monolithic html... ($cmd)\n"
+ rm -rf $PACKAGE.html # in case a directory is left over
+ eval "$cmd"
+ html_mono_size=`calcsize $PACKAGE.html`
+ gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
+ html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
+ copy_images "$outdir/" $PACKAGE.html
+ mv $PACKAGE.html "$outdir/"
+ ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz"
+
+ # Before Texinfo 5.0, makeinfo did not accept a --split=HOW option,
+ # it just always split by node. So if we're splitting by node anyway,
+ # leave it out.
+ if test "x$split" = xnode; then
+ split_arg=
+ else
+ split_arg=--split=$split
+ fi
+ #
+ opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg"
+ cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
+ printf "\nGenerating html by $split... ($cmd)\n"
+ eval "$cmd"
+ split_html_dir=$PACKAGE.html
+ copy_images $split_html_dir/ $split_html_dir/*.html
+ (
+ cd $split_html_dir || exit 1
+ tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- *
+ )
+ eval \
+ html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"`
+ rm -rf "$outdir/html_$split/"
+ mv $split_html_dir "$outdir/html_$split/"
+ du -s "$outdir/html_$split/"
+ ls -l "$outdir/$PACKAGE.html_$split.tar.gz"
+
+else # use texi2html:
+ opt="--output $PACKAGE.html $commonarg $htmlarg"
+ cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\""
+ printf "\nGenerating monolithic html with texi2html... ($cmd)\n"
+ rm -rf $PACKAGE.html # in case a directory is left over
+ eval "$cmd"
+ html_mono_size=`calcsize $PACKAGE.html`
+ gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
+ html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
+ mv $PACKAGE.html "$outdir/"
+
+ html_split node
+ html_split chapter
+ html_split section
+fi
+fi # end html
+
+#
+printf "\nMaking .tar.gz for sources...\n"
+d=`dirname $srcfile`
+(
+ cd "$d"
+ srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true
+ tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles
+ ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
+)
+texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
+
+#
+# Do everything again through docbook.
+if test -n "$docbook"; then
+ opt="-o - --docbook $commonarg"
+ cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
+ printf "\nGenerating docbook XML... ($cmd)\n"
+ eval "$cmd"
+ docbook_xml_size=`calcsize $PACKAGE-db.xml`
+ gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz"
+ docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"`
+ mv $PACKAGE-db.xml "$outdir/"
+
+ split_html_db_dir=html_node_db
+ opt="$commonarg -o $split_html_db_dir"
+ cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\""
+ printf "\nGenerating docbook HTML... ($cmd)\n"
+ eval "$cmd"
+ (
+ cd ${split_html_db_dir} || exit 1
+ tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html
+ )
+ html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"`
+ rm -f "$outdir"/html_node_db/*.html
+ mkdir -p "$outdir/html_node_db"
+ mv ${split_html_db_dir}/*.html "$outdir/html_node_db/"
+ rmdir ${split_html_db_dir}
+
+ cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\""
+ printf "\nGenerating docbook ASCII... ($cmd)\n"
+ eval "$cmd"
+ docbook_ascii_size=`calcsize $PACKAGE-db.txt`
+ mv $PACKAGE-db.txt "$outdir/"
+
+ cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\""
+ printf "\nGenerating docbook PDF... ($cmd)\n"
+ eval "$cmd"
+ docbook_pdf_size=`calcsize $PACKAGE-db.pdf`
+ mv $PACKAGE-db.pdf "$outdir/"
+fi
+
+#
+printf "\nMaking index.html for $PACKAGE...\n"
+if test -z "$use_texi2html"; then
+ CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
+ /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d"
+else
+ # should take account of --split here.
+ CONDS="/%%ENDIF.*%%/d;/%%IF *HTML_SECTION%%/d;/%%IF *HTML_CHAPTER%%/d"
+fi
+
+curdate=`$SETLANG date '+%B %d, %Y'`
+sed \
+ -e "s!%%TITLE%%!$MANUAL_TITLE!g" \
+ -e "s!%%EMAIL%%!$EMAIL!g" \
+ -e "s!%%PACKAGE%%!$PACKAGE!g" \
+ -e "s!%%DATE%%!$curdate!g" \
+ -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \
+ -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \
+ -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \
+ -e "s!%%HTML_SECTION_TGZ_SIZE%%!$html_section_tgz_size!g" \
+ -e "s!%%HTML_CHAPTER_TGZ_SIZE%%!$html_chapter_tgz_size!g" \
+ -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \
+ -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \
+ -e "s!%%PDF_SIZE%%!$pdf_size!g" \
+ -e "s!%%ASCII_SIZE%%!$ascii_size!g" \
+ -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \
+ -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \
+ -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \
+ -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \
+ -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \
+ -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \
+ -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \
+ -e "s,%%SCRIPTURL%%,$scripturl,g" \
+ -e "s!%%SCRIPTNAME%%!$prog!g" \
+ -e "$CONDS" \
+$GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
+
+echo "Done, see $outdir/ subdirectory for new files."
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
new file mode 100755
index 0000000..bd2c4b6
--- /dev/null
+++ b/build-aux/git-version-gen
@@ -0,0 +1,226 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2016-05-08.18; # UTC
+
+# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+# produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+# presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+# a checked-out repository. Created with contents that were learned at
+# the last time autoconf was run, and used by git-version-gen. Must not
+# be present in either $(srcdir) or $(builddir) for git-version-gen to
+# give accurate answers during normal development with a checked out tree,
+# but must be present in a tarball when there is no version control system.
+# Therefore, it cannot be used in any dependencies. GNUmakefile has
+# hooks to force a reconfigure at distribution time to get the value
+# correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+# tarball. Usable in dependencies, particularly for files that don't
+# want to depend on config.h but do want to track version changes.
+# Delete this file prior to any autoconf run where you want to rebuild
+# files to pick up a version string change; and leave it stale to
+# minimize rebuild time after unrelated changes to configure sources.
+#
+# As with any generated file in a VC'd directory, you should add
+# /.version to .gitignore, so that you don't accidentally commit it.
+# .tarball-version is never generated in a VC'd directory, so needn't
+# be listed there.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+# [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# will be present for dependencies, and so that .version and
+# .tarball-version will exist in distribution tarballs.
+#
+# EXTRA_DIST = $(top_srcdir)/.version
+# BUILT_SOURCES = $(top_srcdir)/.version
+# $(top_srcdir)/.version:
+# echo $(VERSION) > $@-t && mv $@-t $@
+# dist-hook:
+# echo $(VERSION) > $(distdir)/.tarball-version
+
+
+me=$0
+
+version="git-version-gen $scriptversion
+
+Copyright 2011 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="\
+Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
+Print a version string.
+
+Options:
+
+ --prefix PREFIX prefix of git tags (default 'v')
+ --fallback VERSION
+ fallback version to use if \"git --version\" fails
+
+ --help display this help and exit
+ --version output version information and exit
+
+Running without arguments will suffice in most cases."
+
+prefix=v
+fallback=
+
+while test $# -gt 0; do
+ case $1 in
+ --help) echo "$usage"; exit 0;;
+ --version) echo "$version"; exit 0;;
+ --prefix) shift; prefix=${1?};;
+ --fallback) shift; fallback=${1?};;
+ -*)
+ echo "$0: Unknown option '$1'." >&2
+ echo "$0: Try '--help' for more information." >&2
+ exit 1;;
+ *)
+ if test "x$tarball_version_file" = x; then
+ tarball_version_file="$1"
+ elif test "x$tag_sed_script" = x; then
+ tag_sed_script="$1"
+ else
+ echo "$0: extra non-option argument '$1'." >&2
+ exit 1
+ fi;;
+ esac
+ shift
+done
+
+if test "x$tarball_version_file" = x; then
+ echo "$usage"
+ exit 1
+fi
+
+tag_sed_script="${tag_sed_script:-s/x/x/}"
+
+nl='
+'
+
+# Avoid meddling by environment variable of the same name.
+v=
+v_from_git=
+
+# First see if there is a tarball-only version file.
+# then try "git describe", then default.
+if test -f $tarball_version_file
+then
+ v=`cat $tarball_version_file` || v=
+ case $v in
+ *$nl*) v= ;; # reject multi-line output
+ [0-9]*) ;;
+ *) v= ;;
+ esac
+ test "x$v" = x \
+ && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
+fi
+
+if test "x$v" != x
+then
+ : # use $v
+# Otherwise, if there is at least one git commit involving the working
+# directory, and "git describe" output looks sensible, use that to
+# derive a version string.
+elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
+ && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
+ || git describe --abbrev=4 HEAD 2>/dev/null` \
+ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
+ && case $v in
+ $prefix[0-9]*) ;;
+ *) (exit 1) ;;
+ esac
+then
+ # Is this a new git that lists number of commits since the last
+ # tag or the previous older version that did not?
+ # Newer: v6.10-77-g0f8faeb
+ # Older: v6.10-g0f8faeb
+ case $v in
+ *-*-*) : git describe is okay three part flavor ;;
+ *-*)
+ : git describe is older two part flavor
+ # Recreate the number of commits and rewrite such that the
+ # result is the same as if we were using the newer version
+ # of git describe.
+ vtag=`echo "$v" | sed 's/-.*//'`
+ commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
+ || { commit_list=failed;
+ echo "$0: WARNING: git rev-list failed" 1>&2; }
+ numcommits=`echo "$commit_list" | wc -l`
+ v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+ test "$commit_list" = failed && v=UNKNOWN
+ ;;
+ esac
+
+ # Change the first '-' to a '.', so version-comparing tools work properly.
+ # Remove the "g" in git describe's output string, to save a byte.
+ v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
+ v_from_git=1
+elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
+ v=UNKNOWN
+else
+ v=$fallback
+fi
+
+v=`echo "$v" |sed "s/^$prefix//"`
+
+# Test whether to append the "-dirty" suffix only if the version
+# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
+# or if it came from .tarball-version.
+if test "x$v_from_git" != x; then
+ # Don't declare a version "dirty" merely because a time stamp has changed.
+ git update-index --refresh > /dev/null 2>&1
+
+ dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
+ case "$dirty" in
+ '') ;;
+ *) # Append the suffix only if there isn't one already.
+ case $v in
+ *-dirty) ;;
+ *) v="$v-dirty" ;;
+ esac ;;
+ esac
+fi
+
+# Omit the trailing newline, so that m4_esyscmd can use the result directly.
+printf %s "$v"
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
new file mode 100755
index 0000000..83bafdf
--- /dev/null
+++ b/build-aux/gitlog-to-changelog
@@ -0,0 +1,499 @@
+eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
+ & eval 'exec perl -wS "$0" $argv:q'
+ if 0;
+# Convert git log output to ChangeLog format.
+
+my $VERSION = '2016-03-22 21:49'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
+use strict;
+use warnings;
+use Getopt::Long;
+use POSIX qw(strftime);
+
+(my $ME = $0) =~ s|.*/||;
+
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
+
+sub usage ($)
+{
+ my ($exit_code) = @_;
+ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+ if ($exit_code != 0)
+ {
+ print $STREAM "Try '$ME --help' for more information.\n";
+ }
+ else
+ {
+ print $STREAM <<EOF;
+Usage: $ME [OPTIONS] [ARGS]
+
+Convert git log output to ChangeLog format. If present, any ARGS
+are passed to "git log". To avoid ARGS being parsed as options to
+$ME, they may be preceded by '--'.
+
+OPTIONS:
+
+ --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
+ makes a change to SHA1's commit log text or metadata.
+ --append-dot append a dot to the first line of each commit message if
+ there is no other punctuation or blank at the end.
+ --no-cluster never cluster commit messages under the same date/author
+ header; the default is to cluster adjacent commit messages
+ if their headers are the same and neither commit message
+ contains multiple paragraphs.
+ --srcdir=DIR the root of the source tree, from which the .git/
+ directory can be derived.
+ --since=DATE convert only the logs since DATE;
+ the default is to convert all log entries.
+ --until=DATE convert only the logs older than DATE.
+ --ignore-matching=PAT ignore commit messages whose first lines match PAT.
+ --ignore-line=PAT ignore lines of commit messages that match PAT.
+ --format=FMT set format string for commit subject and body;
+ see 'man git-log' for the list of format metacharacters;
+ the default is '%s%n%b%n'
+ --strip-tab remove one additional leading TAB from commit message lines.
+ --strip-cherry-pick remove data inserted by "git cherry-pick";
+ this includes the "cherry picked from commit ..." line,
+ and the possible final "Conflicts:" paragraph.
+ --help display this help and exit
+ --version output version information and exit
+
+EXAMPLE:
+
+ $ME --since=2008-01-01 > ChangeLog
+ $ME -- -n 5 foo > last-5-commits-to-branch-foo
+
+SPECIAL SYNTAX:
+
+The following types of strings are interpreted specially when they appear
+at the beginning of a log message line. They are not copied to the output.
+
+ Copyright-paperwork-exempt: Yes
+ Append the "(tiny change)" notation to the usual "date name email"
+ ChangeLog header to mark a change that does not require a copyright
+ assignment.
+ Co-authored-by: Joe User <user\@example.com>
+ List the specified name and email address on a second
+ ChangeLog header, denoting a co-author.
+ Signed-off-by: Joe User <user\@example.com>
+ These lines are simply elided.
+
+In a FILE specified via --amend, comment lines (starting with "#") are ignored.
+FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
+a line) referring to a commit in the current project, and CODE refers to one
+or more consecutive lines of Perl code. Pairs must be separated by one or
+more blank line.
+
+Here is sample input for use with --amend=FILE, from coreutils:
+
+3a169f4c5d9159283548178668d2fae6fced3030
+# fix typo in title:
+s/all tile types/all file types/
+
+1379ed974f1fa39b12e2ffab18b3f7a607082202
+# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
+# Change the author to be Paul. Note the escaped "@":
+s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
+
+EOF
+ }
+ exit $exit_code;
+}
+
+# If the string $S is a well-behaved file name, simply return it.
+# If it contains white space, quotes, etc., quote it, and return the new string.
+sub shell_quote($)
+{
+ my ($s) = @_;
+ if ($s =~ m![^\w+/.,-]!)
+ {
+ # Convert each single quote to '\''
+ $s =~ s/\'/\'\\\'\'/g;
+ # Then single quote the string.
+ $s = "'$s'";
+ }
+ return $s;
+}
+
+sub quoted_cmd(@)
+{
+ return join (' ', map {shell_quote $_} @_);
+}
+
+# Parse file F.
+# Comment lines (starting with "#") are ignored.
+# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1
+# (alone on a line) referring to a commit in the current project, and
+# CODE refers to one or more consecutive lines of Perl code.
+# Pairs must be separated by one or more blank line.
+sub parse_amend_file($)
+{
+ my ($f) = @_;
+
+ open F, '<', $f
+ or die "$ME: $f: failed to open for reading: $!\n";
+
+ my $fail;
+ my $h = {};
+ my $in_code = 0;
+ my $sha;
+ while (defined (my $line = <F>))
+ {
+ $line =~ /^\#/
+ and next;
+ chomp $line;
+ $line eq ''
+ and $in_code = 0, next;
+
+ if (!$in_code)
+ {
+ $line =~ /^([0-9a-fA-F]{40})$/
+ or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
+ $fail = 1, next;
+ $sha = lc $1;
+ $in_code = 1;
+ exists $h->{$sha}
+ and (warn "$ME: $f:$.: duplicate SHA1\n"),
+ $fail = 1, next;
+ }
+ else
+ {
+ $h->{$sha} ||= '';
+ $h->{$sha} .= "$line\n";
+ }
+ }
+ close F;
+
+ $fail
+ and exit 1;
+
+ return $h;
+}
+
+# git_dir_option $SRCDIR
+#
+# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR
+# is undef). Return as a list (0 or 1 element).
+sub git_dir_option($)
+{
+ my ($srcdir) = @_;
+ my @res = ();
+ if (defined $srcdir)
+ {
+ my $qdir = shell_quote $srcdir;
+ my $cmd = "cd $qdir && git rev-parse --show-toplevel";
+ my $qcmd = shell_quote $cmd;
+ my $git_dir = qx($cmd);
+ defined $git_dir
+ or die "$ME: cannot run $qcmd: $!\n";
+ $? == 0
+ or die "$ME: $qcmd had unexpected exit code or signal ($?)\n";
+ chomp $git_dir;
+ push @res, "--git-dir=$git_dir/.git";
+ }
+ @res;
+}
+
+{
+ my $since_date;
+ my $until_date;
+ my $format_string = '%s%n%b%n';
+ my $amend_file;
+ my $append_dot = 0;
+ my $cluster = 1;
+ my $ignore_matching;
+ my $ignore_line;
+ my $strip_tab = 0;
+ my $strip_cherry_pick = 0;
+ my $srcdir;
+ GetOptions
+ (
+ help => sub { usage 0 },
+ version => sub { print "$ME version $VERSION\n"; exit },
+ 'since=s' => \$since_date,
+ 'until=s' => \$until_date,
+ 'format=s' => \$format_string,
+ 'amend=s' => \$amend_file,
+ 'append-dot' => \$append_dot,
+ 'cluster!' => \$cluster,
+ 'ignore-matching=s' => \$ignore_matching,
+ 'ignore-line=s' => \$ignore_line,
+ 'strip-tab' => \$strip_tab,
+ 'strip-cherry-pick' => \$strip_cherry_pick,
+ 'srcdir=s' => \$srcdir,
+ ) or usage 1;
+
+ defined $since_date
+ and unshift @ARGV, "--since=$since_date";
+ defined $until_date
+ and unshift @ARGV, "--until=$until_date";
+
+ # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
+ # that makes a correction in the log or attribution of that commit.
+ my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
+
+ my @cmd = ('git',
+ git_dir_option $srcdir,
+ qw(log --log-size),
+ '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV);
+ open PIPE, '-|', @cmd
+ or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
+ . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
+
+ my $prev_multi_paragraph;
+ my $prev_date_line = '';
+ my @prev_coauthors = ();
+ my @skipshas = ();
+ while (1)
+ {
+ defined (my $in = <PIPE>)
+ or last;
+ $in =~ /^log size (\d+)$/
+ or die "$ME:$.: Invalid line (expected log size):\n$in";
+ my $log_nbytes = $1;
+
+ my $log;
+ my $n_read = read PIPE, $log, $log_nbytes;
+ $n_read == $log_nbytes
+ or die "$ME:$.: unexpected EOF\n";
+
+ # Extract leading hash.
+ my ($sha, $rest) = split ':', $log, 2;
+ defined $sha
+ or die "$ME:$.: malformed log entry\n";
+ $sha =~ /^[0-9a-fA-F]{40}$/
+ or die "$ME:$.: invalid SHA1: $sha\n";
+
+ my $skipflag = 0;
+ if (@skipshas)
+ {
+ foreach(@skipshas)
+ {
+ if ($sha =~ /^$_/)
+ {
+ $skipflag = $_;
+ last;
+ }
+ }
+ }
+
+ # If this commit's log requires any transformation, do it now.
+ my $code = $amend_code->{$sha};
+ if (defined $code)
+ {
+ eval 'use Safe';
+ my $s = new Safe;
+ # Put the unpreprocessed entry into "$_".
+ $_ = $rest;
+
+ # Let $code operate on it, safely.
+ my $r = $s->reval("$code")
+ or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n";
+
+ # Note that we've used this entry.
+ delete $amend_code->{$sha};
+
+ # Update $rest upon success.
+ $rest = $_;
+ }
+
+ # Remove lines inserted by "git cherry-pick".
+ if ($strip_cherry_pick)
+ {
+ $rest =~ s/^\s*Conflicts:\n.*//sm;
+ $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
+ }
+
+ my @line = split /[ \t]*\n/, $rest;
+ my $author_line = shift @line;
+ defined $author_line
+ or die "$ME:$.: unexpected EOF\n";
+ $author_line =~ /^(\d+) (.*>)$/
+ or die "$ME:$.: Invalid line "
+ . "(expected date/author/email):\n$author_line\n";
+
+ # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
+ # `(tiny change)' annotation.
+ my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
+ ? ' (tiny change)' : '');
+
+ my $date_line = sprintf "%s %s$tiny\n",
+ strftime ("%Y-%m-%d", localtime ($1)), $2;
+
+ my @coauthors = grep /^Co-authored-by:.*$/, @line;
+ # Omit meta-data lines we've already interpreted.
+ @line = grep !/^(?:Signed-off-by:[ ].*>$
+ |Co-authored-by:[ ]
+ |Copyright-paperwork-exempt:[ ]
+ |Tiny-change:[ ]
+ )/x, @line;
+
+ # Remove leading and trailing blank lines.
+ if (@line)
+ {
+ while ($line[0] =~ /^\s*$/) { shift @line; }
+ while ($line[$#line] =~ /^\s*$/) { pop @line; }
+ }
+
+ # Handle Emacs gitmerge.el "skipped" commits.
+ # Yes, this should be controlled by an option. So sue me.
+ if ( grep /^(; )?Merge from /, @line )
+ {
+ my $found = 0;
+ foreach (@line)
+ {
+ if (grep /^The following commit.*skipped:$/, $_)
+ {
+ $found = 1;
+ ## Reset at each merge to reduce chance of false matches.
+ @skipshas = ();
+ next;
+ }
+ if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+ {
+ push ( @skipshas, $1 );
+ }
+ }
+ }
+
+ # Ignore commits that match the --ignore-matching pattern, if specified.
+ if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/)
+ {
+ $skipflag = 1;
+ }
+ elsif ($skipflag)
+ {
+ ## Perhaps only warn if a pattern matches more than once?
+ warn "$ME: warning: skipping $sha due to $skipflag\n";
+ }
+
+ if (! $skipflag)
+ {
+ if (defined $ignore_line && @line)
+ {
+ @line = grep ! /$ignore_line/, @line;
+ while ($line[$#line] =~ /^\s*$/) { pop @line; }
+ }
+
+ # Record whether there are two or more paragraphs.
+ my $multi_paragraph = grep /^\s*$/, @line;
+
+ # Format 'Co-authored-by: A U Thor <email@example.com>' lines in
+ # standard multi-author ChangeLog format.
+ for (@coauthors)
+ {
+ s/^Co-authored-by:\s*/\t /;
+ s/\s*</ </;
+
+ /<.*?@.*\..*>/
+ or warn "$ME: warning: missing email address for "
+ . substr ($_, 5) . "\n";
+ }
+
+ # If clustering of commit messages has been disabled, if this header
+ # would be different from the previous date/name/etc. header,
+ # or if this or the previous entry consists of two or more paragraphs,
+ # then print the header.
+ if ( ! $cluster
+ || $date_line ne $prev_date_line
+ || "@coauthors" ne "@prev_coauthors"
+ || $multi_paragraph
+ || $prev_multi_paragraph)
+ {
+ $prev_date_line eq ''
+ or print "\n";
+ print $date_line;
+ @coauthors
+ and print join ("\n", @coauthors), "\n";
+ }
+ $prev_date_line = $date_line;
+ @prev_coauthors = @coauthors;
+ $prev_multi_paragraph = $multi_paragraph;
+
+ # If there were any lines
+ if (@line == 0)
+ {
+ warn "$ME: warning: empty commit message:\n $date_line\n";
+ }
+ else
+ {
+ if ($append_dot)
+ {
+ # If the first line of the message has enough room, then
+ if (length $line[0] < 72)
+ {
+ # append a dot if there is no other punctuation or blank
+ # at the end.
+ $line[0] =~ /[[:punct:]\s]$/
+ or $line[0] .= '.';
+ }
+ }
+
+ # Remove one additional leading TAB from each line.
+ $strip_tab
+ and map { s/^\t// } @line;
+
+ # Prefix each non-empty line with a TAB.
+ @line = map { length $_ ? "\t$_" : '' } @line;
+
+ print "\n", join ("\n", @line), "\n";
+ }
+ }
+
+ defined ($in = <PIPE>)
+ or last;
+ $in ne "\n"
+ and die "$ME:$.: unexpected line:\n$in";
+ }
+
+ close PIPE
+ or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
+ # FIXME-someday: include $PROCESS_STATUS in the diagnostic
+
+ # Complain about any unused entry in the --amend=F specified file.
+ my $fail = 0;
+ foreach my $sha (keys %$amend_code)
+ {
+ warn "$ME:$amend_file: unused entry: $sha\n";
+ $fail = 1;
+ }
+
+ exit $fail;
+}
+
+# Local Variables:
+# mode: perl
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "my $VERSION = '"
+# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "'; # UTC"
+# End:
diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update
new file mode 100755
index 0000000..271e693
--- /dev/null
+++ b/build-aux/gnu-web-doc-update
@@ -0,0 +1,210 @@
+#!/bin/sh
+# Run this after each non-alpha release, to update the web documentation at
+# http://www.gnu.org/software/$pkg/manual/
+
+VERSION=2016-01-12.23; # UTC
+
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ME=$(basename "$0")
+warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
+die() { warn "$*"; exit 1; }
+
+help()
+{
+ cat <<EOF
+Usage: $ME
+
+Run this script from top_srcdir (no arguments) after each non-alpha
+release, to update the web documentation at
+http://www.gnu.org/software/\$pkg/manual/
+
+This script assumes you're using git for revision control, and
+requires a .prev-version file as well as a Makefile, from which it
+extracts the version number and package name, respectively. Also, it
+assumes all documentation is in the doc/ sub-directory.
+
+Options:
+ -C, --builddir=DIR location of (configured) Makefile (default: .)
+ -n, --dry-run don't actually commit anything
+ -m, --mirror remove out of date files from document server
+ --help print this help, then exit
+ --version print version number, then exit
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+ exit
+}
+
+version()
+{
+ year=$(echo "$VERSION" | sed 's/[^0-9].*//')
+ cat <<EOF
+$ME $VERSION
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+ exit
+}
+
+# find_tool ENVVAR NAMES...
+# -------------------------
+# Search for a required program. Use the value of ENVVAR, if set,
+# otherwise find the first of the NAMES that can be run (i.e.,
+# supports --version). If found, set ENVVAR to the program name,
+# die otherwise.
+#
+# FIXME: code duplication, see also bootstrap.
+find_tool ()
+{
+ find_tool_envvar=$1
+ shift
+ find_tool_names=$@
+ eval "find_tool_res=\$$find_tool_envvar"
+ if test x"$find_tool_res" = x; then
+ for i
+ do
+ if ($i --version </dev/null) >/dev/null 2>&1; then
+ find_tool_res=$i
+ break
+ fi
+ done
+ else
+ find_tool_error_prefix="\$$find_tool_envvar: "
+ fi
+ test x"$find_tool_res" != x \
+ || die "one of these is required: $find_tool_names"
+ ($find_tool_res --version </dev/null) >/dev/null 2>&1 \
+ || die "${find_tool_error_prefix}cannot run $find_tool_res --version"
+ eval "$find_tool_envvar=\$find_tool_res"
+ eval "export $find_tool_envvar"
+}
+
+## ------ ##
+## Main. ##
+## ------ ##
+
+# Requirements: everything required to bootstrap your package, plus
+# these.
+find_tool CVS cvs
+find_tool GIT git
+find_tool RSYNC rsync
+find_tool XARGS gxargs xargs
+
+builddir=.
+dryrun=
+rm_stale='echo'
+while test $# != 0
+do
+ # Handle --option=value by splitting apart and putting back on argv.
+ case $1 in
+ --*=*)
+ opt=$(echo "$1" | sed -e 's/=.*//')
+ val=$(echo "$1" | sed -e 's/[^=]*=//')
+ shift
+ set dummy "$opt" "$val" "$@"; shift
+ ;;
+ esac
+
+ case $1 in
+ --help|--version) ${1#--};;
+ -C|--builddir) shift; builddir=$1; shift ;;
+ -n|--dry-run) dryrun=echo; shift;;
+ -m|--mirror) rm_stale=''; shift;;
+ --*) die "unrecognized option: $1";;
+ *) break;;
+ esac
+done
+
+test $# = 0 \
+ || die "too many arguments"
+
+prev=.prev-version
+version=$(cat $prev) || die "no $prev file?"
+pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \
+ || die "no Makefile?"
+tmp_branch=web-doc-$version-$$
+current_branch=$($GIT branch | sed -ne '/^\* /{s///;p;q;}')
+
+cleanup()
+{
+ __st=$?
+ $dryrun rm -rf "$tmp"
+ $GIT checkout "$current_branch"
+ $GIT submodule update --recursive
+ $GIT branch -d $tmp_branch
+ exit $__st
+}
+trap cleanup 0
+trap 'exit $?' 1 2 13 15
+
+# We must build using sources for which --version reports the
+# just-released version number, not some string like 7.6.18-20761.
+# That version string propagates into all documentation.
+set -e
+$GIT checkout -b $tmp_branch v$version
+$GIT submodule update --recursive
+./bootstrap
+srcdir=$(pwd)
+cd "$builddir"
+builddir=$(pwd)
+ ./config.status --recheck
+ ./config.status
+ make
+ make web-manual
+cd "$srcdir"
+set +e
+
+tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1
+( cd $tmp \
+ && $CVS -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
+$RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
+
+(
+ cd $tmp/$pkg/manual
+
+ # Add all the files. This is simpler than trying to add only the
+ # new ones because of new directories
+ # First add non empty dirs individually
+ find . -name CVS -prune -o -type d \! -empty -print \
+ | $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko
+ # Now add all files
+ find . -name CVS -prune -o -type f -print \
+ | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko
+
+ # Report/Remove stale files
+ # excluding doc server specific files like CVS/* and .symlinks
+ if test -n "$rm_stale"; then
+ echo 'Consider the --mirror option if all of the manual is generated,' >&2
+ echo 'which will run `cvs remove` to remove stale files.' >&2
+ fi
+ { find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print
+ (cd "$builddir"/doc/manual/ && find . -type f -print | sed p)
+ } | sort | uniq -u \
+ | $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f
+
+ $dryrun $CVS ci -m $version
+)
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "VERSION="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/gnupload b/build-aux/gnupload
new file mode 100755
index 0000000..8d0299d
--- /dev/null
+++ b/build-aux/gnupload
@@ -0,0 +1,440 @@
+#!/bin/sh
+# Sign files and upload them.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 2004-2016 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
+# The master copy of this file is maintained in the gnulib Git repository.
+# Please send bug reports and feature requests to bug-gnulib@gnu.org.
+
+set -e
+
+GPG='gpg --batch --no-tty'
+conffile=.gnuploadrc
+to=
+dry_run=false
+replace=
+symlink_files=
+delete_files=
+delete_symlinks=
+collect_var=
+dbg=
+nl='
+'
+
+usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
+
+Sign all FILES, and process them at the destinations specified with --to.
+If CMD is not given, it defaults to uploading. See examples below.
+
+Commands:
+ --delete delete FILES from destination
+ --symlink create symbolic links
+ --rmsymlink remove symbolic links
+ -- treat the remaining arguments as files to upload
+
+Options:
+ --to DEST specify a destination DEST for FILES
+ (multiple --to options are allowed)
+ --user NAME sign with key NAME
+ --replace allow replacements of existing files
+ --symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names
+ --dry-run do nothing, show what would have been done
+ (including the constructed directive file)
+ --version output version information and exit
+ --help print this help text and exit
+
+If --symlink-regex is given without EXPR, then the link target name
+is created by replacing the version information with '-latest', e.g.:
+ foo-1.3.4.tar.gz -> foo-latest.tar.gz
+
+Recognized destinations are:
+ alpha.gnu.org:DIRECTORY
+ savannah.gnu.org:DIRECTORY
+ savannah.nongnu.org:DIRECTORY
+ ftp.gnu.org:DIRECTORY
+ build directive files and upload files by FTP
+ download.gnu.org.ua:{alpha|ftp}/DIRECTORY
+ build directive files and upload files by SFTP
+ [user@]host:DIRECTORY upload files with scp
+
+Options and commands are applied in order. If the file $conffile exists
+in the current working directory, its contents are prepended to the
+actual command line options. Use this to keep your defaults. Comments
+(#) and empty lines in $conffile are allowed.
+
+<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
+gives some further background.
+
+Examples:
+1. Upload foobar-1.0.tar.gz to ftp.gnu.org:
+ gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz
+
+2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org:
+ gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz foobar-1.0.tar.xz
+
+3. Same as above, and also create symbolic links to foobar-latest.tar.*:
+ gnupload --to ftp.gnu.org:foobar \\
+ --symlink-regex \\
+ foobar-1.0.tar.gz foobar-1.0.tar.xz
+
+4. Upload foobar-0.9.90.tar.gz to two sites:
+ gnupload --to alpha.gnu.org:foobar \\
+ --to sources.redhat.com:~ftp/pub/foobar \\
+ foobar-0.9.90.tar.gz
+
+5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
+ (the -- terminates the list of files to delete):
+ gnupload --to alpha.gnu.org:foobar \\
+ --to sources.redhat.com:~ftp/pub/foobar \\
+ --delete oopsbar-0.9.91.tar.gz \\
+ -- foobar-0.9.91.tar.gz
+
+gnupload executes a program ncftpput to do the transfers; if you don't
+happen to have an ncftp package installed, the ncftpput-ftp script in
+the build-aux/ directory of the gnulib package
+(http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
+
+Send patches and bug reports to <bug-gnulib@gnu.org>."
+
+# Read local configuration file
+if test -r "$conffile"; then
+ echo "$0: Reading configuration file $conffile"
+ conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" ' '`
+ eval set x "$conf \"\$@\""
+ shift
+fi
+
+while test -n "$1"; do
+ case $1 in
+ -*)
+ collect_var=
+ case $1 in
+ --help)
+ echo "$usage"
+ exit $?
+ ;;
+ --to)
+ if test -z "$2"; then
+ echo "$0: Missing argument for --to" 1>&2
+ exit 1
+ elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then
+ echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2
+ echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2
+ echo "$0: is used for direct ftp uploads, not with gnupload)." >&2
+ echo "$0: See --help and its examples if need be." >&2
+ exit 1
+ else
+ to="$to $2"
+ shift
+ fi
+ ;;
+ --user)
+ if test -z "$2"; then
+ echo "$0: Missing argument for --user" 1>&2
+ exit 1
+ else
+ GPG="$GPG --local-user $2"
+ shift
+ fi
+ ;;
+ --delete)
+ collect_var=delete_files
+ ;;
+ --replace)
+ replace="replace: true"
+ ;;
+ --rmsymlink)
+ collect_var=delete_symlinks
+ ;;
+ --symlink-regex=*)
+ symlink_expr=`expr "$1" : '[^=]*=\(.*\)'`
+ ;;
+ --symlink-regex)
+ symlink_expr='s|-[0-9][0-9\.]*\(-[0-9][0-9]*\)\{0,1\}\.|-latest.|'
+ ;;
+ --symlink)
+ collect_var=symlink_files
+ ;;
+ --dry-run|-n)
+ dry_run=:
+ ;;
+ --version)
+ echo "gnupload $scriptversion"
+ exit $?
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ if test -z "$collect_var"; then
+ break
+ else
+ eval "$collect_var=\"\$$collect_var $1\""
+ fi
+ ;;
+ esac
+ shift
+done
+
+dprint()
+{
+ echo "Running $* ..."
+}
+
+if $dry_run; then
+ dbg=dprint
+fi
+
+if test -z "$to"; then
+ echo "$0: Missing destination sites" >&2
+ exit 1
+fi
+
+if test -n "$symlink_files"; then
+ x=`echo "$symlink_files" | sed 's/[^ ]//g;s/ //g'`
+ if test -n "$x"; then
+ echo "$0: Odd number of symlink arguments" >&2
+ exit 1
+ fi
+fi
+
+if test $# = 0; then
+ if test -z "${symlink_files}${delete_files}${delete_symlinks}"; then
+ echo "$0: No file to upload" 1>&2
+ exit 1
+ fi
+else
+ # Make sure all files exist. We don't want to ask
+ # for the passphrase if the script will fail.
+ for file
+ do
+ if test ! -f $file; then
+ echo "$0: Cannot find '$file'" 1>&2
+ exit 1
+ elif test -n "$symlink_expr"; then
+ linkname=`echo $file | sed "$symlink_expr"`
+ if test -z "$linkname"; then
+ echo "$0: symlink expression produces empty results" >&2
+ exit 1
+ elif test "$linkname" = $file; then
+ echo "$0: symlink expression does not alter file name" >&2
+ exit 1
+ fi
+ fi
+ done
+fi
+
+# Make sure passphrase is not exported in the environment.
+unset passphrase
+unset passphrase_fd_0
+GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg}
+
+# Reset PATH to be sure that echo is a built-in. We will later use
+# 'echo $passphrase' to output the passphrase, so it is important that
+# it is a built-in (third-party programs tend to appear in 'ps'
+# listings with their arguments...).
+# Remember this script runs with 'set -e', so if echo is not built-in
+# it will exit now.
+if $dry_run || grep -q "^use-agent" $GNUPGHOME/gpg.conf; then :; else
+ PATH=/empty echo -n "Enter GPG passphrase: "
+ stty -echo
+ read -r passphrase
+ stty echo
+ echo
+ passphrase_fd_0="--passphrase-fd 0"
+fi
+
+if test $# -ne 0; then
+ for file
+ do
+ echo "Signing $file ..."
+ rm -f $file.sig
+ echo "$passphrase" | $dbg $GPG $passphrase_fd_0 -ba -o $file.sig $file
+ done
+fi
+
+
+# mkdirective DESTDIR BASE FILE STMT
+# Arguments: See upload, below
+mkdirective ()
+{
+ stmt="$4"
+ if test -n "$3"; then
+ stmt="
+filename: $3$stmt"
+ fi
+
+ cat >${2}.directive<<EOF
+version: 1.2
+directory: $1
+comment: gnupload v. $scriptversion$stmt
+EOF
+ if $dry_run; then
+ echo "File ${2}.directive:"
+ cat ${2}.directive
+ echo "File ${2}.directive:" | sed 's/./-/g'
+ fi
+}
+
+mksymlink ()
+{
+ while test $# -ne 0
+ do
+ echo "symlink: $1 $2"
+ shift
+ shift
+ done
+}
+
+# upload DEST DESTDIR BASE FILE STMT FILES
+# Arguments:
+# DEST Destination site;
+# DESTDIR Destination directory;
+# BASE Base name for the directive file;
+# FILE Name of the file to distribute (may be empty);
+# STMT Additional statements for the directive file;
+# FILES List of files to upload.
+upload ()
+{
+ dest=$1
+ destdir=$2
+ base=$3
+ file=$4
+ stmt=$5
+ files=$6
+
+ rm -f $base.directive $base.directive.asc
+ case $dest in
+ alpha.gnu.org:*)
+ mkdirective "$destdir" "$base" "$file" "$stmt"
+ echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
+ $dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files $base.directive.asc
+ ;;
+ ftp.gnu.org:*)
+ mkdirective "$destdir" "$base" "$file" "$stmt"
+ echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
+ $dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc
+ ;;
+ savannah.gnu.org:*)
+ if test -z "$files"; then
+ echo "$0: warning: standalone directives not applicable for $dest" >&2
+ fi
+ $dbg ncftpput savannah.gnu.org /incoming/savannah/$destdir $files
+ ;;
+ savannah.nongnu.org:*)
+ if test -z "$files"; then
+ echo "$0: warning: standalone directives not applicable for $dest" >&2
+ fi
+ $dbg ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files
+ ;;
+ download.gnu.org.ua:alpha/*|download.gnu.org.ua:ftp/*)
+ destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'`
+ destdir_topdir=`echo "$destdir" | sed 's,/.*,,'`
+ mkdirective "$destdir_p1" "$base" "$file" "$stmt"
+ echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
+ for f in $files $base.directive.asc
+ do
+ echo put $f
+ done | $dbg sftp -b - puszcza.gnu.org.ua:/incoming/$destdir_topdir
+ ;;
+ /*)
+ dest_host=`echo "$dest" | sed 's,:.*,,'`
+ mkdirective "$destdir" "$base" "$file" "$stmt"
+ echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
+ $dbg cp $files $base.directive.asc $dest_host
+ ;;
+ *)
+ if test -z "$files"; then
+ echo "$0: warning: standalone directives not applicable for $dest" >&2
+ fi
+ $dbg scp $files $dest
+ ;;
+ esac
+ rm -f $base.directive $base.directive.asc
+}
+
+#####
+# Process any standalone directives
+stmt=
+if test -n "$symlink_files"; then
+ stmt="$stmt
+`mksymlink $symlink_files`"
+fi
+
+for file in $delete_files
+do
+ stmt="$stmt
+archive: $file"
+done
+
+for file in $delete_symlinks
+do
+ stmt="$stmt
+rmsymlink: $file"
+done
+
+if test -n "$stmt"; then
+ for dest in $to
+ do
+ destdir=`echo $dest | sed 's/[^:]*://'`
+ upload "$dest" "$destdir" "`hostname`-$$" "" "$stmt"
+ done
+fi
+
+# Process actual uploads
+for dest in $to
+do
+ for file
+ do
+ echo "Uploading $file to $dest ..."
+ stmt=
+ #
+ # allowing file replacement is all or nothing.
+ if test -n "$replace"; then stmt="$stmt
+$replace"
+ fi
+ #
+ files="$file $file.sig"
+ destdir=`echo $dest | sed 's/[^:]*://'`
+ if test -n "$symlink_expr"; then
+ linkname=`echo $file | sed "$symlink_expr"`
+ stmt="$stmt
+symlink: $file $linkname
+symlink: $file.sig $linkname.sig"
+ fi
+ upload "$dest" "$destdir" "$file" "$file" "$stmt" "$files"
+ done
+done
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/install-sh b/build-aux/install-sh
new file mode 100755
index 0000000..0360b79
--- /dev/null
+++ b/build-aux/install-sh
@@ -0,0 +1,501 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2016-01-11.22; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab=' '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ dstdir=`dirname "$dst"`
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ set -f
+ set fnord $dstdir
+ shift
+ set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ set +f &&
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh
new file mode 100755
index 0000000..6022eff
--- /dev/null
+++ b/build-aux/mdate-sh
@@ -0,0 +1,224 @@
+#!/bin/sh
+# Get modification time of a file or directory and pretty-print it.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1995-2015 Free Software Foundation, Inc.
+# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+#
+# This program is free software; you can 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, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+fi
+
+case $1 in
+ '')
+ echo "$0: No file. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: mdate-sh [--help] [--version] FILE
+
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "mdate-sh $scriptversion"
+ exit $?
+ ;;
+esac
+
+error ()
+{
+ echo "$0: $1" >&2
+ exit 1
+}
+
+
+# Prevent date giving response in another language.
+LANG=C
+export LANG
+LC_ALL=C
+export LC_ALL
+LC_TIME=C
+export LC_TIME
+
+# GNU ls changes its time format in response to the TIME_STYLE
+# variable. Since we cannot assume 'unset' works, revert this
+# variable to its documented default.
+if test "${TIME_STYLE+set}" = set; then
+ TIME_STYLE=posix-long-iso
+ export TIME_STYLE
+fi
+
+save_arg1=$1
+
+# Find out how to get the extended ls output of a file or directory.
+if ls -L /dev/null 1>/dev/null 2>&1; then
+ ls_command='ls -L -l -d'
+else
+ ls_command='ls -l -d'
+fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+ ls_command="$ls_command -n"
+fi
+
+# A 'ls -l' line looks as follows on OS/2.
+# drwxrwx--- 0 Aug 11 2001 foo
+# This differs from Unix, which adds ownership information.
+# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
+#
+# To find the date, we split the line on spaces and iterate on words
+# until we find a month. This cannot work with files whose owner is a
+# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
+# will be owned by a user whose name is a month. So we first look at
+# the extended ls output of the root directory to decide how many
+# words should be skipped to get the date.
+
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
+set x`$ls_command /`
+
+# Find which argument is the month.
+month=
+command=
+until test $month
+do
+ test $# -gt 0 || error "failed parsing '$ls_command /' output"
+ shift
+ # Add another shift to the command.
+ command="$command shift;"
+ case $1 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+ esac
+done
+
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
+# Get the extended ls output of the file or directory.
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
+
+# Remove all preceding arguments
+eval $command
+
+# Because of the dummy argument above, month is in $2.
+#
+# On a POSIX system, we should have
+#
+# $# = 5
+# $1 = file size
+# $2 = month
+# $3 = day
+# $4 = year or time
+# $5 = filename
+#
+# On Darwin 7.7.0 and 7.6.0, we have
+#
+# $# = 4
+# $1 = day
+# $2 = month
+# $3 = year or time
+# $4 = filename
+
+# Get the month.
+case $2 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+esac
+
+case $3 in
+ ???*) day=$1;;
+ *) day=$3; shift;;
+esac
+
+# Here we have to deal with the problem that the ls output gives either
+# the time of day or the year.
+case $3 in
+ *:*) set `date`; eval year=\$$#
+ case $2 in
+ Jan) nummonthtod=1;;
+ Feb) nummonthtod=2;;
+ Mar) nummonthtod=3;;
+ Apr) nummonthtod=4;;
+ May) nummonthtod=5;;
+ Jun) nummonthtod=6;;
+ Jul) nummonthtod=7;;
+ Aug) nummonthtod=8;;
+ Sep) nummonthtod=9;;
+ Oct) nummonthtod=10;;
+ Nov) nummonthtod=11;;
+ Dec) nummonthtod=12;;
+ esac
+ # For the first six month of the year the time notation can also
+ # be used for files modified in the last year.
+ if (expr $nummonth \> $nummonthtod) > /dev/null;
+ then
+ year=`expr $year - 1`
+ fi;;
+ *) year=$3;;
+esac
+
+# The result.
+echo $day $month $year
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/missing b/build-aux/missing
new file mode 100755
index 0000000..594918c
--- /dev/null
+++ b/build-aux/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h
new file mode 100644
index 0000000..c44ad89
--- /dev/null
+++ b/build-aux/snippet/_Noreturn.h
@@ -0,0 +1,10 @@
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
diff --git a/build-aux/snippet/arg-nonnull.h b/build-aux/snippet/arg-nonnull.h
new file mode 100644
index 0000000..584649f
--- /dev/null
+++ b/build-aux/snippet/arg-nonnull.h
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* _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_MINOR__ >= 3) || __GNUC__ > 3
+# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+# define _GL_ARG_NONNULL(params)
+# endif
+#endif
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
new file mode 100644
index 0000000..813f2e2
--- /dev/null
+++ b/build-aux/snippet/c++defs.h
@@ -0,0 +1,271 @@
+/* C++ compatible function declaration macros.
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _GL_CXXDEFS_H
+#define _GL_CXXDEFS_H
+
+/* 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, ...));
+ */
+#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 \
+ { \
+ rettype (*const func) parameters = ::rpl_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_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 \
+ { \
+ rettype (*const func) parameters = \
+ reinterpret_cast<rettype(*)parameters>(::rpl_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_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, ...));
+ */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+ /* If we were to write
+ rettype (*const func) parameters = ::func;
+ like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
+ better (remove an indirection through a 'static' pointer variable),
+ but then the _GL_CXXALIASWARN macro below would cause a warning not only
+ for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static rettype (*func) parameters = ::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 rettype (*func) parameters = \
+ reinterpret_cast<rettype(*)parameters>(::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 rettype (*func) parameters = \
+ reinterpret_cast<rettype(*)parameters>( \
+ (rettype2(*)parameters2)(::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 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !__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 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !__OPTIMIZE__
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ extern __typeof__ (func) func
+# 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/build-aux/snippet/unused-parameter.h b/build-aux/snippet/unused-parameter.h
new file mode 100644
index 0000000..843db76
--- /dev/null
+++ b/build-aux/snippet/unused-parameter.h
@@ -0,0 +1,36 @@
+/* A C macro for declaring that specific function parameters are not used.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
+ declarations for parameters that are not used. This helps to reduce
+ warnings, such as from GCC -Wunused-parameter. The syntax is as follows:
+ type param _GL_UNUSED_PARAMETER
+ or more generally
+ param_decl _GL_UNUSED_PARAMETER
+ For example:
+ int param _GL_UNUSED_PARAMETER
+ int *(*param)(void) _GL_UNUSED_PARAMETER
+ Other possible, but obscure and discouraged syntaxes:
+ int _GL_UNUSED_PARAMETER *(*param)(void)
+ _GL_UNUSED_PARAMETER int *(*param)(void)
+ */
+#ifndef _GL_UNUSED_PARAMETER
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_UNUSED_PARAMETER __attribute__ ((__unused__))
+# else
+# define _GL_UNUSED_PARAMETER
+# endif
+#endif
diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h
new file mode 100644
index 0000000..2948b47
--- /dev/null
+++ b/build-aux/snippet/warn-on-use.h
@@ -0,0 +1,109 @@
+/* A C macro for emitting warnings if a function is used.
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* _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.
+
+ This macro is 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. 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
+ */
+#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) \
+extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
+ is like _GL_WARN_ON_USE (function, "string"), except that 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 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes \
+ __attribute__ ((__warning__ (msg)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# 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/build-aux/test-driver b/build-aux/test-driver
new file mode 100755
index 0000000..d7eac82
--- /dev/null
+++ b/build-aux/test-driver
@@ -0,0 +1,148 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 2011-2015 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 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex
new file mode 100644
index 0000000..65425d1
--- /dev/null
+++ b/build-aux/texinfo.tex
@@ -0,0 +1,11724 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2016-08-09.22}
+%
+% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex 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 texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT 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/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+% LaTeX's \typeout. This ensures that the messages it is used for
+% are identical in format to the corresponding ones from latex/pdflatex.
+\def\typeout{\immediate\write17}%
+
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexraggedright=\raggedright
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexsp=\sp
+\let\ptexstar=\*
+\let\ptexsup=\sup
+\let\ptext=\t
+\let\ptextop=\top
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined \gdef\putworderror{error}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+
+% Give the space character the catcode for a space.
+\def\spaceisspace{\catcode`\ =10\relax}
+
+\chardef\dashChar = `\-
+\chardef\slashChar = `\/
+\chardef\underChar = `\_
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+ ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ spell-ing spell-ings
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines16
+}%
+
+% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+%
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
+% Output routine
+%
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt }
+
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Output a mark which sets \thischapter, \thissection and \thiscolor.
+% We dump everything together because we only have one kind of mark.
+% This works because we only use \botmark / \topmark, not \firstmark.
+%
+% A mark contains a subexpression of the \ifcase ... \fi construct.
+% \get*marks macros below extract the needed part using \ifcase.
+%
+% Another complication is to let the user choose whether \thischapter
+% (\thissection) refers to the chapter (section) in effect at the top
+% of a page, or that at the bottom of a page.
+
+% \domark is called twice inside \chapmacro, to add one
+% mark before the section break, and one after.
+% In the second call \prevchapterdefs is the same as \lastchapterdefs,
+% and \prevsectiondefs is the same as \lastsectiondefs.
+% Then if the page is not broken at the mark, some of the previous
+% section appears on the page, and we can get the name of this section
+% from \firstmark for @everyheadingmarks top.
+% @everyheadingmarks bottom uses \botmark.
+%
+% See page 260 of The TeXbook.
+\def\domark{%
+ \toks0=\expandafter{\lastchapterdefs}%
+ \toks2=\expandafter{\lastsectiondefs}%
+ \toks4=\expandafter{\prevchapterdefs}%
+ \toks6=\expandafter{\prevsectiondefs}%
+ \toks8=\expandafter{\lastcolordefs}%
+ \mark{%
+ \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
+ \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
+ \noexpand\else \the\toks8 % 2: color marks
+ }%
+}
+
+% \gettopheadingmarks, \getbottomheadingmarks,
+% \getcolormarks - extract needed part of mark.
+%
+% \topmark doesn't work for the very first chapter (after the title
+% page or the contents), so we use \firstmark there -- this gets us
+% the mark with the chapter defs, unless the user sneaks in, e.g.,
+% @setcolor (or @url, or @link, etc.) between @contents and the very
+% first @chapter.
+\def\gettopheadingmarks{%
+ \ifcase0\topmark\fi
+ \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
+}
+\def\getbottomheadingmarks{\ifcase1\botmark\fi}
+\def\getcolormarks{\ifcase2\topmark\fi}
+
+% Avoid "undefined control sequence" errors.
+\def\lastchapterdefs{}
+\def\lastsectiondefs{}
+\def\lastsection{}
+\def\prevchapterdefs{}
+\def\prevsectiondefs{}
+\def\lastcolordefs{}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\txipagewidth \newdimen\txipageheight
+
+% Main output routine.
+%
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument.
+% \shipout a vbox for a single page, adding an optional header, footer,
+% cropmarks, and footnote. This also causes index entries for this page
+% to be written to the auxiliary files.
+%
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Common context changes for both heading and footing.
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
+ %
+ % Retrieve the information for the headings from the marks in the page,
+ % and call Plain TeX's \makeheadline and \makefootline, which use the
+ % values in \headline and \footline.
+ %
+ % This is used to check if we are on the first page of a chapter.
+ \ifcase1\topmark\fi
+ \let\prevchaptername\thischaptername
+ \ifcase0\firstmark\fi
+ \let\curchaptername\thischaptername
+ %
+ \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+ \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
+ %
+ \ifx\curchaptername\prevchaptername
+ \let\thischapterheading\thischapter
+ \else
+ % \thischapterheading is the same as \thischapter except it is blank
+ % for the first page of a chapter. This is to prevent the chapter name
+ % being shown twice.
+ \def\thischapterheading{}%
+ \fi
+ %
+ \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
+ \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
+ %
+ {%
+ % Set context for writing to auxiliary files like index files.
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ % We don't want .vr (or whatever) entries like this:
+ % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
+ % "\acronym" won't work when it's read back in;
+ % it needs to be
+ % {\code {{\backslashcurfont }acronym}
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingyyy.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 24pt
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \indexdummies
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+% Main part of page, including any footnotes
+\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1\relax \unvbox#1\relax
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+
+% Argument parsing
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+% For example, \def\foo{\parsearg\fooxxx}.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\argtorun{#2}%
+ \begingroup
+ \obeylines
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ \argremovecomment #1\comment\ArgTerm%
+ }%
+}
+
+% First remove any @comment, then any @c comment. Also remove a @texinfoc
+% comment (see \scanmacro for details). Pass the result on to \argcheckspaces.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
+\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+% @end itemize @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \argtorun.
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
+
+
+% \parseargdef - define a command taking an argument on the line
+%
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+ \obeyspaces
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as environments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At run-time, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
+ \else
+ \badenverr
+ \fi
+}
+
+% Environment mismatch, #1 expected:
+\def\badenverr{%
+ \errhelp = \EMsimple
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ outside of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal.
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+ \def\temp{#1}%
+ \ifx\temp\onword \plainfrenchspacing
+ \else\ifx\temp\offword \plainnonfrenchspacing
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
+ \fi\fi
+}
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ \startsavinginserts
+ %
+ \setbox\groupbox = \vtop\bgroup
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ \addgroupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+
+\def\addgroupbox{
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\txipageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+}
+
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\parseargdef\need{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change). This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% @include FILE -- \input text of FILE.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable % we want to expand any @value in FILE.
+ \turnoffactive % and allow special characters in the expansion
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @include of #1^^J}%
+ \edef\temp{\noexpand\input #1 }%
+ %
+ % This trickery is to read FILE outside of a group, in case it makes
+ % definitions, etc.
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \catcode`-=\other
+ \catcode`\`=\other
+ \catcode`\'=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
+%
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+ \ifhmode
+ \let\centersub\centerH
+ \else
+ \let\centersub\centerV
+ \fi
+ \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+ \let\centersub\relax % don't let the definition persist, just in case
+}
+\def\centerH#1{{%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+ % The idea here is the same as in \startdefun, \cartouche, etc.: if
+ % @center is the first thing after a section heading, we need to wipe
+ % out the negative parskip inserted by \sectionheading, but still
+ % prevent a page break here.
+ \centerpenalty = \lastpenalty
+ \ifnum\centerpenalty>10000 \vskip\parskip \fi
+ \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+ \line{\kern\leftskip #1\kern\rightskip}%
+}
+
+% @sp n outputs n lines of vertical space
+%
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+%
+\def\comment{\begingroup \catcode`\^^M=\active%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}%
+
+{\catcode`\^^M=\active%
+\gdef\commentxxx#1^^M{\endgroup%
+\futurelet\nexttoken\commentxxxx}%
+\gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}%
+}
+
+\def\c{\begingroup \catcode`\^^M=\active%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\cxxx}
+{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
+% See comment in \scanmacro about why the definitions of @c and @comment differ
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent {\restorefirstparagraphindent \indent}%
+ \gdef\noindent{\restorefirstparagraphindent \noindent}%
+ \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
+}
+%
+\gdef\restorefirstparagraphindent{%
+ \global\let\indent = \ptexindent
+ \global\let\noindent = \ptexnoindent
+ \global\everypar = {}%
+}
+
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% @setfilename INFO-FILENAME - ignored
+\let\setfilename=\comment
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newbox\boxB
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+%
+% For LuaTeX
+%
+
+\newif\iftxiuseunicodedestname
+\txiuseunicodedestnamefalse % For pdfTeX etc.
+
+\ifx\luatexversion\thisisundefined
+\else
+ % Use Unicode destination names
+ \txiuseunicodedestnametrue
+ % Escape PDF strings with converting UTF-16 from UTF-8
+ \begingroup
+ \catcode`\%=12
+ \directlua{
+ function UTF16oct(str)
+ tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
+ for c in string.utfvalues(str) do
+ if c < 0x10000 then
+ tex.sprint(
+ string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o',
+ (c / 256), (c % 256)))
+ else
+ c = c - 0x10000
+ local c_hi = c / 1024 + 0xd800
+ local c_lo = c % 1024 + 0xdc00
+ tex.sprint(
+ string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o',
+ (c_hi / 256), (c_hi % 256),
+ (c_lo / 256), (c_lo % 256)))
+ end
+ end
+ end
+ }
+ \endgroup
+ \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
+ % Escape PDF strings without converting
+ \begingroup
+ \directlua{
+ function PDFescstr(str)
+ for c in string.bytes(str) do
+ if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
+ tex.sprint(
+ string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
+ c))
+ else
+ tex.sprint(string.char(c))
+ end
+ end
+ end
+ }
+ \endgroup
+ \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
+ \ifnum\luatexversion>84
+ % For LuaTeX >= 0.85
+ \def\pdfdest{\pdfextension dest}
+ \let\pdfoutput\outputmode
+ \def\pdfliteral{\pdfextension literal}
+ \def\pdfcatalog{\pdfextension catalog}
+ \def\pdftexversion{\numexpr\pdffeedback version\relax}
+ \let\pdfximage\saveimageresource
+ \let\pdfrefximage\useimageresource
+ \let\pdflastximage\lastsavedimageresourceindex
+ \def\pdfendlink{\pdfextension endlink\relax}
+ \def\pdfoutline{\pdfextension outline}
+ \def\pdfstartlink{\pdfextension startlink}
+ \def\pdffontattr{\pdfextension fontattr}
+ \def\pdfobj{\pdfextension obj}
+ \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
+ \let\pdfpagewidth\pagewidth
+ \let\pdfpageheight\pageheight
+ \edef\pdfhorigin{\pdfvariable horigin}
+ \edef\pdfvorigin{\pdfvariable vorigin}
+ \fi
+\fi
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets,
+% for display in the outlines, and in other places. Thus, we have to
+% double any backslashes. Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e. Not good.
+%
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages. The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+ \ifx\pdfescapestring\thisisundefined
+ % No primitive available; should we give a warning or log?
+ % Many times it won't matter.
+ \xdef#1{#1}%
+ \else
+ % The expandable \pdfescapestring primitive escapes parentheses,
+ % backslashes, and other special chars.
+ \xdef#1{\pdfescapestring{#1}}%
+ \fi
+}
+\def\txiescapepdfutfsixteen#1{%
+ \ifx\pdfescapestrutfsixteen\thisisundefined
+ % No UTF-16 converting macro available.
+ \txiescapepdf{#1}%
+ \else
+ \xdef#1{\pdfescapestrutfsixteen{#1}}%
+ \fi
+}
+
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found. (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
+\ifpdf
+ %
+ % Color manipulation macros using ideas from pdfcolor.tex,
+ % except using rgb instead of cmyk; the latter is said to render as a
+ % very dark gray on-screen and a very dark halftone in print, instead
+ % of actual black. The dark red here is dark enough to print on paper as
+ % nearly black, but still distinguishable for online viewing. We use
+ % black by default, though.
+ \def\rgbDarkRed{0.50 0.09 0.12}
+ \def\rgbBlack{0 0 0}
+ %
+ % rg sets the color for filling (usual text, etc.);
+ % RG sets the color for stroking (thin rules, e.g., normal _'s).
+ \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
+ %
+ % Set color, and create a mark which defines \thiscolor accordingly,
+ % so that \makeheadline knows which color to restore.
+ \def\setcolor#1{%
+ \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ }
+ %
+ \def\maincolor{\rgbBlack}
+ \pdfsetcolor{\maincolor}
+ \edef\thiscolor{\maincolor}
+ \def\lastcolordefs{}
+ %
+ \def\makefootline{%
+ \baselineskip24pt
+ \line{\pdfsetcolor{\maincolor}\the\footline}%
+ }
+ %
+ \def\makeheadline{%
+ \vbox to 0pt{%
+ \vskip-22.5pt
+ \line{%
+ \vbox to8.5pt{}%
+ % Extract \thiscolor definition from the marks.
+ \getcolormarks
+ % Typeset the headline with \maincolor, then restore the color.
+ \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+ }%
+ \vss
+ }%
+ \nointerlineskip
+ }
+ %
+ %
+ \pdfcatalog{/PageMode /UseOutlines}
+ %
+ % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+ \def\dopdfimage#1#2#3{%
+ \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+ % others). Let's try in that order, PDF first since if
+ % someone has a scalable image, presumably better to use that than a
+ % bitmap.
+ \let\pdfimgext=\empty
+ \begingroup
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \errhelp = \nopdfimagehelp
+ \errmessage{Could not find image file #1 for pdf}%
+ \else \gdef\pdfimgext{JPG}%
+ \fi
+ \else \gdef\pdfimgext{jpeg}%
+ \fi
+ \else \gdef\pdfimgext{jpg}%
+ \fi
+ \else \gdef\pdfimgext{png}%
+ \fi
+ \else \gdef\pdfimgext{PDF}%
+ \fi
+ \else \gdef\pdfimgext{pdf}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ % without \immediate, ancient pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifdim \wd0 >0pt width \pdfimagewidth \fi
+ \ifdim \wd2 >0pt height \pdfimageheight \fi
+ \ifnum\pdftexversion<13
+ #1.\pdfimgext
+ \else
+ {#1.\pdfimgext}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ %
+ \def\setpdfdestname#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ \iftxiuseunicodedestname
+ \ifx \declaredencoding \latone
+ % Pass through Latin-1 characters.
+ % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
+ \else
+ \ifx \declaredencoding \utfeight
+ % Pass through Unicode characters.
+ \else
+ % Use ASCII approximations in destination names.
+ \passthroughcharsfalse
+ \fi
+ \fi
+ \else
+ % Use ASCII approximations in destination names.
+ \passthroughcharsfalse
+ \fi
+ \def\pdfdestname{#1}%
+ \txiescapepdf\pdfdestname
+ }}
+ %
+ \def\setpdfoutlinetext#1{{%
+ \indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ \ifx \declaredencoding \latone
+ % The PDF format can use an extended form of Latin-1 in bookmark
+ % strings. See Appendix D of the PDF Reference, Sixth Edition, for
+ % the "PDFDocEncoding".
+ \passthroughcharstrue
+ % Pass through Latin-1 characters.
+ % LuaTeX: Convert to Unicode
+ % pdfTeX: Use Latin-1 as PDFDocEncoding
+ \def\pdfoutlinetext{#1}%
+ \else
+ \ifx \declaredencoding \utfeight
+ \ifx\luatexversion\thisisundefined
+ % For pdfTeX with UTF-8.
+ % TODO: the PDF format can use UTF-16 in bookmark strings,
+ % but the code for this isn't done yet.
+ % Use ASCII approximations.
+ \passthroughcharsfalse
+ \def\pdfoutlinetext{#1}%
+ \else
+ % For LuaTeX with UTF-8.
+ % Pass through Unicode characters for title texts.
+ \passthroughcharstrue
+ \def\pdfoutlinetext{#1}%
+ \fi
+ \else
+ % For non-Latin-1 or non-UTF-8 encodings.
+ % Use ASCII approximations.
+ \passthroughcharsfalse
+ \def\pdfoutlinetext{#1}%
+ \fi
+ \fi
+ % LuaTeX: Convert to UTF-16
+ % pdfTeX: Use Latin-1 as PDFDocEncoding
+ \txiescapepdfutfsixteen\pdfoutlinetext
+ }}
+ %
+ \def\pdfmkdest#1{%
+ \setpdfdestname{#1}%
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }
+ %
+ % used to mark target names; must be expandable.
+ \def\pdfmkpgn#1{#1}
+ %
+ % by default, use black for everything.
+ \def\urlcolor{\rgbBlack}
+ \def\linkcolor{\rgbBlack}
+ \def\endlink{\setcolor{\maincolor}\pdfendlink}
+ %
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by 1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ %
+ % #1 is the section text, which is what will be displayed in the
+ % outline by the pdf viewer. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node text,
+ % which might be empty if this toc entry had no corresponding node.
+ % #4 is the page number
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worth the trouble, since most documents are normally structured.
+ \setpdfoutlinetext{#1}
+ \setpdfdestname{#3}
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{#4}%
+ \fi
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \def\thischapnum{0}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ \readdatafile{toc}%
+ %
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
+ %
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % TODO this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Too
+ % much work for too little return. Just use the ASCII equivalents
+ % we use for the index sort strings.
+ %
+ \indexnofonts
+ \setupdatafile
+ % We can have normal brace characters in the PDF outlines, unlike
+ % Texinfo index files. So set that up.
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+ {\catcode`[=1 \catcode`]=2
+ \catcode`{=\other \catcode`}=\other
+ \gdef\lbracecharliteral[{]%
+ \gdef\rbracecharliteral[}]%
+ ]
+ %
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \nextsp}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ % do we want to go so far as to use \indexnofonts instead of just
+ % special-casing \var here?
+ \def\var##1{##1}%
+ %
+ \leavevmode\setcolor{\urlcolor}%
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \setcolor{\linkcolor}#1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+ % non-pdf mode
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\setcolor = \gobble
+ \let\pdfsetcolor = \gobble
+ \let\pdfmakeoutlines = \relax
+\fi % \ifx\pdfoutput
+
+%
+% For XeTeX
+%
+\ifx\XeTeXrevision\thisisundefined
+\else
+ %
+ % XeTeX version check
+ %
+ \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
+ % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
+ % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
+ % For avoiding PDF destination name replacement, we use this special
+ % instead of xdvipdfmx's command line option `-C 0x0010'.
+ \special{dvipdfmx:config C 0x0010}
+ % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
+ % It can handle Unicode destination names for PDF.
+ \txiuseunicodedestnametrue
+ \else
+ % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
+ % `dvipdfmx:config' special.
+ % So for avoiding PDF destination name replacement,
+ % xdvipdfmx's command line option `-C 0x0010' is necessary.
+ %
+ % XeTeX < 0.99995 can not handle Unicode destination names for PDF
+ % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
+ % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
+ \txiuseunicodedestnamefalse
+ \fi
+ %
+ % Color support
+ %
+ \def\rgbDarkRed{0.50 0.09 0.12}
+ \def\rgbBlack{0 0 0}
+ %
+ \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
+ %
+ % Set color, and create a mark which defines \thiscolor accordingly,
+ % so that \makeheadline knows which color to restore.
+ \def\setcolor#1{%
+ \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ }
+ %
+ \def\maincolor{\rgbBlack}
+ \pdfsetcolor{\maincolor}
+ \edef\thiscolor{\maincolor}
+ \def\lastcolordefs{}
+ %
+ \def\makefootline{%
+ \baselineskip24pt
+ \line{\pdfsetcolor{\maincolor}\the\footline}%
+ }
+ %
+ \def\makeheadline{%
+ \vbox to 0pt{%
+ \vskip-22.5pt
+ \line{%
+ \vbox to8.5pt{}%
+ % Extract \thiscolor definition from the marks.
+ \getcolormarks
+ % Typeset the headline with \maincolor, then restore the color.
+ \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+ }%
+ \vss
+ }%
+ \nointerlineskip
+ }
+ %
+ % PDF outline support
+ %
+ % Emulate pdfTeX primitive
+ \def\pdfdest name#1 xyz{%
+ \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
+ }
+ %
+ \def\setpdfdestname#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ \iftxiuseunicodedestname
+ % Pass through Unicode characters.
+ \else
+ % Use ASCII approximations in destination names.
+ \passthroughcharsfalse
+ \fi
+ \def\pdfdestname{#1}%
+ \txiescapepdf\pdfdestname
+ }}
+ %
+ \def\setpdfoutlinetext#1{{%
+ \turnoffactive
+ % Always use Unicode characters in title texts.
+ \def\pdfoutlinetext{#1}%
+ % For XeTeX, xdvipdfmx converts to UTF-16.
+ % So we do not convert.
+ \txiescapepdf\pdfoutlinetext
+ }}
+ %
+ \def\pdfmkdest#1{%
+ \setpdfdestname{#1}%
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }
+ %
+ % by default, use black for everything.
+ \def\urlcolor{\rgbBlack}
+ \def\linkcolor{\rgbBlack}
+ \def\endlink{\setcolor{\maincolor}\pdfendlink}
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ \setpdfoutlinetext{#1}
+ \setpdfdestname{#3}
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{#4}%
+ \fi
+ %
+ \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
+ << /S /GoTo /D (\pdfdestname) >> >> }%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ %
+ % For XeTeX, counts of subentries are not necessary.
+ % Therefore, we read toc only once.
+ %
+ % We use node names as destinations.
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{1}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{2}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{3}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{4}{##3}{##4}}%
+ %
+ \let\appentry\numchapentry%
+ \let\appsecentry\numsecentry%
+ \let\appsubsecentry\numsubsecentry%
+ \let\appsubsubsecentry\numsubsubsecentry%
+ \let\unnchapentry\numchapentry%
+ \let\unnsecentry\numsecentry%
+ \let\unnsubsecentry\numsubsecentry%
+ \let\unnsubsubsecentry\numsubsubsecentry%
+ %
+ % For XeTeX, xdvipdfmx converts strings to UTF-16.
+ % Therefore, the encoding and the language may not be considered.
+ %
+ \indexnofonts
+ \setupdatafile
+ % We can have normal brace characters in the PDF outlines, unlike
+ % Texinfo index files. So set that up.
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+ {\catcode`[=1 \catcode`]=2
+ \catcode`{=\other \catcode`}=\other
+ \gdef\lbracecharliteral[{]%
+ \gdef\rbracecharliteral[}]%
+ ]
+
+ \special{pdf:docview << /PageMode /UseOutlines >> }
+ % ``\special{pdf:tounicode ...}'' is not necessary
+ % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
+ % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
+ % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
+ % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
+%
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \nextsp}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ % do we want to go so far as to use \indexnofonts instead of just
+ % special-casing \var here?
+ \def\var##1{##1}%
+ %
+ \leavevmode\setcolor{\urlcolor}%
+ \special{pdf:bann << /Border [0 0 0]
+ /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
+ \endgroup}
+ \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \special{pdf:bann << /Border [0 0 0]
+ /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
+ \setcolor{\linkcolor}#1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+%
+ %
+ % @image support
+ %
+ % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+ \def\doxeteximage#1#2#3{%
+ \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
+ % others). Let's try in that order, PDF first since if
+ % someone has a scalable image, presumably better to use that than a
+ % bitmap.
+ \let\xeteximgext=\empty
+ \begingroup
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \errmessage{Could not find image file #1 for XeTeX}%
+ \else \gdef\xeteximgext{JPG}%
+ \fi
+ \else \gdef\xeteximgext{jpeg}%
+ \fi
+ \else \gdef\xeteximgext{jpg}%
+ \fi
+ \else \gdef\xeteximgext{png}%
+ \fi
+ \else \gdef\xeteximgext{PDF}%
+ \fi
+ \else \gdef\xeteximgext{pdf}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ \def\xetexpdfext{pdf}%
+ \ifx\xeteximgext\xetexpdfext
+ \XeTeXpdffile "#1".\xeteximgext ""
+ \else
+ \def\xetexpdfext{PDF}%
+ \ifx\xeteximgext\xetexpdfext
+ \XeTeXpdffile "#1".\xeteximgext ""
+ \else
+ \XeTeXpicfile "#1".\xeteximgext ""
+ \fi
+ \fi
+ \ifdim \wd0 >0pt width \xeteximagewidth \fi
+ \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
+ }
+\fi
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Unfortunately, we have to override this for titles and the like, since
+% in those cases "rm" is bold. Sigh.
+\def\rmisbold{\rm\def\curfontstyle{bf}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+% can get a sort of poor man's double spacing by redefining this.
+\def\baselinefactor{1}
+%
+\newdimen\textleading
+\def\setleading#1{%
+ \dimen0 = #1\relax
+ \normalbaselineskip = \baselinefactor\dimen0
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% PDF CMaps. See also LaTeX's t1.cmap.
+%
+% do nothing with this by default.
+\expandafter\let\csname cmapOT1\endcsname\gobble
+\expandafter\let\csname cmapOT1IT\endcsname\gobble
+\expandafter\let\csname cmapOT1TT\endcsname\gobble
+
+% if we are producing pdf, and we have \pdffontattr, then define cmaps.
+% (\pdffontattr was introduced many years ago, but people still run
+% older pdftex's; it's easy to conditionalize, so we do.)
+\ifpdf \ifx\pdffontattr\thisisundefined \else
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1-0)
+%%Title: (TeX-OT1-0 TeX OT1 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+40 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1IT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1IT-0)
+%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1IT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1IT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<25> <26> <0025>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+42 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<23> <0023>
+<24> <00A3>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1IT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1TT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1TT-0)
+%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1TT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1TT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+5 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<21> <26> <0021>
+<28> <5F> <0028>
+<61> <7E> <0061>
+endbfrange
+32 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <2191>
+<0C> <2193>
+<0D> <0027>
+<0E> <00A1>
+<0F> <00BF>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<20> <2423>
+<27> <2019>
+<60> <2018>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1TT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+\fi\fi
+
+
+% Set the font macro #1 to the font named \fontprefix#2.
+% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
+\def\setfont#1#2#3#4#5{%
+ \font#1=\fontprefix#2#3 scaled #4
+ \csname cmap#5\endcsname#1%
+}
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+%
+% (end of cmaps)
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\thisisundefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} % where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Definitions for a main text size of 11pt. (The default in Texinfo.)
+%
+\def\definetextfontsizexi{%
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1095}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}{OT1}
+\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+\setfont\defsl\slshape{10}{\magstep1}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf
+\let\tenttsl=\defttsl \let\tensl=\defsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
+\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
+\setfont\chapsf\sfbshape{17}{1000}{OT1}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+\def\chapecsize{1728}
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
+\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep2}{OT1}
+\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}{OT1}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+\def\sececsize{1440}
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
+\setfont\ssecit\itbshape{10}{1315}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1315}{OT1}
+\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}{OT1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+\def\ssececsize{1200}
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}{OT1}
+\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{1000}{OT1}
+\setfont\reducedit\itshape{10}{1000}{OT1IT}
+\setfont\reducedsl\slshape{10}{1000}{OT1}
+\setfont\reducedsf\sfshape{10}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{1000}{OT1}
+\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+\def\reducedecsize{1000}
+
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts % reset the current fonts
+\rm
+} % end of 11pt text font size definitions, \definetextfontsizexi
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit. This is for the GNU
+% Press printing of the Emacs 22 manual. Maybe other manuals in the
+% future. Used with @smallbook, which sets the leading to 12pt.
+%
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1000}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
+\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+\setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf
+\let\tensl=\defsl \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
+\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+\def\chapecsize{1440}
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}{OT1}
+\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep1}{OT1}
+\setfont\sectt\ttbshape{12}{1000}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
+\setfont\secsf\sfbshape{12}{1000}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}{OT1}
+\font\seci=cmmi12
+\font\secsy=cmsy10 scaled \magstep1
+\def\sececsize{1200}
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}{OT1}
+\setfont\ssecit\itbshape{10}{1000}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1000}{OT1}
+\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
+\setfont\ssecsf\sfbshape{10}{1000}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}{OT1}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+\def\ssececsize{1000}
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}{OT1}
+\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{900}{OT1}
+\setfont\reducedit\itshape{9}{1000}{OT1IT}
+\setfont\reducedsl\slshape{9}{1000}{OT1}
+\setfont\reducedsf\sfshape{9}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{900}{OT1}
+\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+\def\reducedecsize{0900}
+
+\divide\parskip by 2 % reduce space between paragraphs
+\textleading = 12pt % line spacing for 10pt CM
+\textfonts % reset the current fonts
+\rm
+} % end of 10pt text font size definitions, \definetextfontsizex
+
+
+% We provide the user-level command
+% @fonttextsize 10
+% (or 11) to redefine the text font size. pt is assumed.
+%
+\def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
+%
+\parseargdef\fonttextsize{%
+ \def\textsizearg{#1}%
+ %\wlog{doing @fonttextsize \textsizearg}%
+ %
+ % Set \globaldefs so that documents can use this inside @tex, since
+ % makeinfo 4.8 does not support it, but we need it nonetheless.
+ %
+ \begingroup \globaldefs=1
+ \ifx\textsizearg\xword \definetextfontsizex
+ \else \ifx\textsizearg\xiword \definetextfontsizexi
+ \else
+ \errhelp=\EMsimple
+ \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+ \fi\fi
+ \endgroup
+}
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. We don't
+% bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
+%
+\def\resetmathfonts{%
+ \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+ \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+ \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used
+% in, e.g., the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\curfontsize{text}%
+ \def\lsize{reduced}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \def\curfontsize{title}%
+ \def\lsize{chap}\def\lllsize{subsec}%
+ \resetmathfonts \setleading{27pt}}
+\def\titlefont#1{{\titlefonts\rmisbold #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+ \let\tenttsl=\chapttsl
+ \def\curfontsize{chap}%
+ \def\lsize{sec}\def\lllsize{text}%
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\curfontsize{sec}%
+ \def\lsize{subsec}\def\lllsize{reduced}%
+ \resetmathfonts \setleading{17pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\curfontsize{ssec}%
+ \def\lsize{text}\def\lllsize{small}%
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\curfontsize{reduced}%
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \def\curfontsize{small}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+ \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+ \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+ \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+ \let\tenttsl=\smallerttsl
+ \def\curfontsize{smaller}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{9.5pt}}
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
+% Define these just so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+% --karl, 24jan03.
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\definetextfontsizexi
+
+
+\message{markup,}
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
+% define and register \INITMACRO to be called on markup style changes.
+% \INITMACRO can check \currentmarkupstyle for the innermost
+% style and the set of \ifmarkupSTYLE switches for all styles
+% currently in effect.
+\newif\ifmarkupvar
+\newif\ifmarkupsamp
+\newif\ifmarkupkey
+%\newif\ifmarkupfile % @file == @samp.
+%\newif\ifmarkupoption % @option == @samp.
+\newif\ifmarkupcode
+\newif\ifmarkupkbd
+%\newif\ifmarkupenv % @env == @code.
+%\newif\ifmarkupcommand % @command == @code.
+\newif\ifmarkuptex % @tex (and part of @math, for now).
+\newif\ifmarkupexample
+\newif\ifmarkupverb
+\newif\ifmarkupverbatim
+
+\let\currentmarkupstyle\empty
+
+\def\setupmarkupstyle#1{%
+ \csname markup#1true\endcsname
+ \def\currentmarkupstyle{#1}%
+ \markupstylesetup
+}
+
+\let\markupstylesetup\empty
+
+\def\defmarkupstylesetup#1{%
+ \expandafter\def\expandafter\markupstylesetup
+ \expandafter{\markupstylesetup #1}%
+ \def#1%
+}
+
+% Markup style setup for left and right quotes.
+\defmarkupstylesetup\markupsetuplq{%
+ \expandafter\let\expandafter \temp
+ \csname markupsetuplq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
+}
+
+\defmarkupstylesetup\markupsetuprq{%
+ \expandafter\let\expandafter \temp
+ \csname markupsetuprq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
+}
+
+{
+\catcode`\'=\active
+\catcode`\`=\active
+
+\gdef\markupsetuplqdefault{\let`\lq}
+\gdef\markupsetuprqdefault{\let'\rq}
+
+\gdef\markupsetcodequoteleft{\let`\codequoteleft}
+\gdef\markupsetcodequoteright{\let'\codequoteright}
+}
+
+\let\markupsetuplqcode \markupsetcodequoteleft
+\let\markupsetuprqcode \markupsetcodequoteright
+%
+\let\markupsetuplqexample \markupsetcodequoteleft
+\let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqkbd \markupsetcodequoteleft
+\let\markupsetuprqkbd \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
+\let\markupsetuplqverb \markupsetcodequoteleft
+\let\markupsetuprqverb \markupsetcodequoteright
+%
+\let\markupsetuplqverbatim \markupsetcodequoteleft
+\let\markupsetuprqverbatim \markupsetcodequoteright
+
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report. xpdf does work with the regular 0x27.
+%
+\def\codequoteright{%
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
+ \else \char'15 \fi
+}
+%
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+%
+\def\codequoteleft{%
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ % [Knuth] pp. 380,381,391
+ % \relax disables Spanish ligatures ?` and !` of \tt font.
+ \relax`%
+ \else \char'22 \fi
+ \else \char'22 \fi
+}
+
+% Commands to set the quote options.
+%
+\parseargdef\codequoteundirected{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+ \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+ \fi\fi
+}
+
+% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
+\def\noligaturesquoteleft{\relax\lq}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Font commands.
+
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+ \ifusingtt
+ {{\ttsl #2}\let\next=\relax}%
+ {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+ \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
+
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+ \ifx\next,%
+ \else\ifx\next-%
+ \else\ifx\next.%
+ \else\ifx\next\.%
+ \else\ifx\next\comma%
+ \else\ptexslash
+ \fi\fi\fi\fi\fi
+ \aftersmartic
+}
+
+% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
+\def\ttslanted#1{{\ttsl #1}}
+
+% @cite is like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+ \let\saveaftersmartic = \aftersmartic
+ \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+ \smartslanted{#1}%
+}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @b, explicit bold. Also @strong.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\plainfrenchspacing{%
+ \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
+ \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
+ \def\endofsentencespacefactor{1000}% for @. and friends
+ }
+ \def\plainnonfrenchspacing{%
+ \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+ \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+ \def\endofsentencespacefactor{3000}% for @. and friends
+ }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+% @t, explicit typewriter.
+\def\t#1{%
+ {\tt \rawbackslash \plainfrenchspacing #1}%
+ \null
+}
+
+% @samp.
+\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
+
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \plainfrenchspacing
+ #1%
+ }%
+ \null % reset spacefactor to 1000
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% (But see \codedashfinish below.)
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+%
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash. -- rms.
+{
+ \catcode`\-=\active \catcode`\_=\active
+ \catcode`\'=\active \catcode`\`=\active
+ \global\let'=\rq \global\let`=\lq % default definitions
+ %
+ \global\def\code{\begingroup
+ \setupmarkupstyle{code}%
+ % The following should really be moved into \setupmarkupstyle handlers.
+ \catcode\dashChar=\active \catcode\underChar=\active
+ \ifallowcodebreaks
+ \let-\codedash
+ \let_\codeunder
+ \else
+ \let-\normaldash
+ \let_\realunder
+ \fi
+ % Given -foo (with a single dash), we do not want to allow a break
+ % after the hyphen.
+ \global\let\codedashprev=\codedash
+ %
+ \codex
+ }
+ %
+ \gdef\codedash{\futurelet\next\codedashfinish}
+ \gdef\codedashfinish{%
+ \normaldash % always output the dash character itself.
+ %
+ % Now, output a discretionary to allow a line break, unless
+ % (a) the next character is a -, or
+ % (b) the preceding character is a -.
+ % E.g., given --posix, we do not want to allow a break after either -.
+ % Given --foo-bar, we do want to allow a break between the - and the b.
+ \ifx\next\codedash \else
+ \ifx\codedashprev\codedash
+ \else \discretionary{}{}{}\fi
+ \fi
+ % we need the space after the = for the case when \next itself is a
+ % space token; it would get swallowed otherwise. As in @code{- a}.
+ \global\let\codedashprev= \next
+ }
+}
+\def\normaldash{-}
+%
+\def\codex #1{\tclose{#1}\endgroup}
+
+\def\codeunder{%
+ % this is all so @math{@code{var_name}+1} can work. In math mode, _
+ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+ % will therefore expand the active definition of _, which is us
+ % (inside @code that is), therefore an endless loop.
+ \ifusingtt{\ifmmode
+ \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+ \else\normalunderscore \fi
+ \discretionary{}{}{}}%
+ {\_}%
+}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__. This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
+%
+\newif\ifallowcodebreaks \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\keywordtrue
+ \allowcodebreakstrue
+ \else\ifx\txiarg\keywordfalse
+ \allowcodebreaksfalse
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
+ \fi\fi
+}
+
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
+\let\command=\code
+\let\env=\code
+\let\file=\code
+\let\option=\code
+
+% @uref (abbreviation for `urlref') aka @url takes an optional
+% (comma-separated) second argument specifying the text to display and
+% an optional third arg as text to display instead of (rather than in
+% addition to) the url itself. First (mandatory) arg is the url.
+
+% TeX-only option to allow changing PDF output to show only the second
+% arg (if given), and not the url (which is then just the link target).
+\newif\ifurefurlonlylink
+
+% The main macro is \urefbreak, which allows breaking at expected
+% places within the url. (There used to be another version, which
+% didn't support automatic breaking.)
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+%
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}% look for second arg
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ % For pdfTeX and LuaTeX
+ \ifurefurlonlylink
+ % PDF plus option to not display url, show just arg
+ \unhbox0
+ \else
+ % PDF, normally display both arg and url for consistency,
+ % visibility, if the pdf is eventually used to print, etc.
+ \unhbox0\ (\urefcode{#1})%
+ \fi
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
+ \else
+ % For XeTeX
+ \ifurefurlonlylink
+ % PDF plus option to not display url, show just arg
+ \unhbox0
+ \else
+ % PDF, normally display both arg and url for consistency,
+ % visibility, if the pdf is eventually used to print, etc.
+ \unhbox0\ (\urefcode{#1})%
+ \fi
+ \fi
+ \fi
+ \else
+ \urefcode{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+ \catcode`\&=\active \catcode`\.=\active
+ \catcode`\#=\active \catcode`\?=\active
+ \catcode`\/=\active
+}
+{
+ \urefcatcodes
+ %
+ \global\def\urefcode{\begingroup
+ \setupmarkupstyle{code}%
+ \urefcatcodes
+ \let&\urefcodeamp
+ \let.\urefcodedot
+ \let#\urefcodehash
+ \let?\urefcodequest
+ \let/\urefcodeslash
+ \codex
+ }
+ %
+ % By default, they are just regular characters.
+ \global\def&{\normalamp}
+ \global\def.{\normaldot}
+ \global\def#{\normalhash}
+ \global\def?{\normalquest}
+ \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's. The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretchamount{.13em}
+\def\urefpoststretchamount{.1em}
+\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+ \catcode`\/=\active
+ \global\def\urefcodeslashfinish{%
+ \urefprestretch \slashChar
+ % Allow line break only after the final / in a sequence of
+ % slashes, to avoid line break between the slashes in http://.
+ \ifx\next/\else \urefpoststretch \fi
+ }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that. Also allow no breaking at all, for manual control.
+%
+\parseargdef\urefbreakstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\wordnone
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordbefore
+ \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordafter
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \ifx\XeTeXrevision\thisisundefined
+ \let\email=\uref
+ \else
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+ \fi
+\fi
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+ \def\one{#1}\def\three{#3}\def\threex{??}%
+ \ifx\one\xkey\ifx\threex\three \key{#2}%
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge. Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+% \vbox{\hrule\kern-0.4pt
+% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+% \kern-0.4pt\hrule}%
+% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge. If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle. But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+ \nohyphenation
+ \ifmonospace\else\tt\fi
+ #1}\null}
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+ \null % reset \spacefactor=1000
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+ {\plainfrenchspacing #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+ \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode`\_ = \active
+ \gdef\mathunderscore{%
+ \catcode`\_=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \ifmmode\else % only go into math if not in math mode already
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ % make the texinfo accent commands work in math mode
+ \let\"=\ddot
+ \let\'=\acute
+ \let\==\bar
+ \let\^=\hat
+ \let\`=\grave
+ \let\u=\breve
+ \let\v=\check
+ \let\~=\tilde
+ \let\dotaccent=\dot
+ % have to provide another name for sup operator
+ \let\mathopsup=\sup
+ $\expandafter\finishmath\fi
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \catcode`' = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ \let' = \ptexquoteright
+ }
+}
+
+% for @sub and @sup, if in math mode, just do a normal sub/superscript.
+% If in text, use math to place as sub/superscript, but switch
+% into text mode, with smaller fonts. This is a different font than the
+% one used for real math sub/superscripts (8pt vs. 7pt), but let's not
+% fix it (significant additions to font machinery) until someone notices.
+%
+\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
+\def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}%
+%
+\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
+\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+%
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+ \def\inlinefmtname{#1}%
+ \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+%
+% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
+% FMTNAME is tex, else ELSE-TEXT.
+\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
+\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
+ \def\inlinefmtname{#1}%
+ \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
+}
+%
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely. Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored. But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too. We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+%
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+ \def\inlinerawname{#1}%
+ \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+ \endgroup % close group opened by \tex.
+}
+
+% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
+%
+\long\def\inlineifset#1{\doinlineifset #1,\finish}
+\long\def\doinlineifset#1,#2,\finish{%
+ \def\inlinevarname{#1}%
+ \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
+ \else\ignorespaces#2\fi
+}
+
+% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
+%
+\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
+\long\def\doinlineifclear#1,#2,\finish{%
+ \def\inlinevarname{#1}%
+ \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
+}
+
+
+\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}}
+\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}}
+\let\{=\lbracechar
+\let\}=\rbracechar
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+ \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{%
+ \ifx\textnominalsize\xwordpt
+ % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+ % Revert to plain's \scriptsize, which is 7pt.
+ \count255=\the\fam $\fam\count255 \scriptstyle A$%
+ \else
+ % For 11pt, we can use our lllsize.
+ \selectfonts\lllsize A%
+ \fi
+ }%
+ \vss
+ }}%
+ \kern-.15em
+ \TeX
+}
+
+% Some math mode symbols. Define \ensuremath to switch into math mode
+% unless we are already there. Expansion tricks may not be needed here,
+% but safer, and can't hurt.
+\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
+\def\ensuredmath#1{$\relax#1$}
+%
+\def\bullet{\ensuremath\ptexbullet}
+\def\geq{\ensuremath\ge}
+\def\leq{\ensuremath\le}
+\def\minus{\ensuremath-}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em. So do
+% whichever is larger.
+%
+\def\dots{%
+ \leavevmode
+ \setbox0=\hbox{...}% get width of three periods
+ \ifdim\wd0 > 1.5em
+ \dimen0 = \wd0
+ \else
+ \dimen0 = 1.5em
+ \fi
+ \hbox to \dimen0{%
+ \hskip 0pt plus.25fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, they should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
+\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{%
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that. The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math. Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+ % We set the font at each command, rather than predefining it in
+ % \textfonts and the other font-switching commands, so that
+ % installations which never need the symbol don't have to have the
+ % font installed.
+ %
+ % There is only one designed size (nominal 10pt), so we always scale
+ % that to the current nominal size.
+ %
+ % By the way, simply using "at 1em" works for cmr10 and the like, but
+ % does not work for cmbx10 and other extended/shrunken fonts.
+ %
+ \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+ %
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+ \else
+ % regular:
+ \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+ \fi
+ \thiseurofont
+}
+
+% Glyphs from the EC fonts. We don't use \let for the aliases, because
+% sometimes we redefine the original macro, and the alias should reflect
+% the redefinition.
+%
+% Use LaTeX names for the Icelandic letters.
+\def\DH{{\ecfont \char"D0}} % Eth
+\def\dh{{\ecfont \char"F0}} % eth
+\def\TH{{\ecfont \char"DE}} % Thorn
+\def\th{{\ecfont \char"FE}} % thorn
+%
+\def\guillemetleft{{\ecfont \char"13}}
+\def\guillemotleft{\guillemetleft}
+\def\guillemetright{{\ecfont \char"14}}
+\def\guillemotright{\guillemetright}
+\def\guilsinglleft{{\ecfont \char"0E}}
+\def\guilsinglright{{\ecfont \char"0F}}
+\def\quotedblbase{{\ecfont \char"12}}
+\def\quotesinglbase{{\ecfont \char"0D}}
+%
+% This positioning is not perfect (see the ogonek LaTeX package), but
+% we have the precomposed glyphs for the most common cases. We put the
+% tests to use those glyphs in the single \ogonek macro so we have fewer
+% dummy definitions to worry about for index entries, etc.
+%
+% ogonek is also used with other letters in Lithuanian (IOU), but using
+% the precomposed glyphs for those is not so easy since they aren't in
+% the same EC font.
+\def\ogonek#1{{%
+ \def\temp{#1}%
+ \ifx\temp\macrocharA\Aogonek
+ \else\ifx\temp\macrochara\aogonek
+ \else\ifx\temp\macrocharE\Eogonek
+ \else\ifx\temp\macrochare\eogonek
+ \else
+ \ecfont \setbox0=\hbox{#1}%
+ \ifdim\ht0=1ex\accent"0C #1%
+ \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
+ \fi
+ \fi\fi\fi\fi
+ }%
+}
+\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
+\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
+\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
+\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
+%
+% Use the European Computer Modern fonts (cm-super in outline format)
+% for non-CM glyphs. That is ec* for regular text and tc* for the text
+% companion symbols (LaTeX TS1 encoding). Both are part of the ec
+% package and follow the same conventions.
+%
+\def\ecfont{\etcfont{e}}
+\def\tcfont{\etcfont{t}}
+%
+\def\etcfont#1{%
+ % We can't distinguish serif/sans and italic/slanted, but this
+ % is used for crude hacks anyway (like adding French and German
+ % quotes to documents typeset with CM, where we lose kerning), so
+ % hopefully nobody will notice/care.
+ \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
+ \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
+ \ifmonospace
+ % typewriter:
+ \font\thisecfont = #1ctt\ecsize \space at \nominalsize
+ \else
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
+ \else
+ % regular:
+ \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+ \fi
+ \fi
+ \thisecfont
+}
+
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
+% @textdegree - the normal degrees sign.
+%
+\def\textdegree{$^\circ$}
+
+% Laurent Siebenmann reports \Orb undefined with:
+% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\thisisundefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+% Quotes.
+\chardef\quotedblleft="5C
+\chardef\quotedblright=`\"
+\chardef\quoteleft=`\`
+\chardef\quoteright=`\'
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% @setcontentsaftertitlepage used to do an implicit @contents or
+% @shortcontents after @end titlepage, but it is now obsolete.
+\def\setcontentsaftertitlepage{%
+ \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
+ command; move your @contents command if you want the contents
+ after the title page.}}%
+\def\setshortcontentsaftertitlepage{%
+ \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
+ command; move your @shortcontents and @contents commands if you
+ want the contents after the title page.}}%
+
+\parseargdef\shorttitlepage{%
+ \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \let\page = \oldpage
+ \page
+ \null
+ }%
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right. This should be used
+% inside a \vbox, and fonts need to be set appropriately first. Because
+% it is always used for titles, nothing else, we call \rmisbold. \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+%
+\def\raggedtitlesettings{%
+ \rmisbold
+ \hyphenpenalty=10000
+ \parindent=0pt
+ \tolerance=5000
+ \ptexraggedright
+}
+
+% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \vbox{\titlefonts \raggedtitlesettings #1\par}%
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\secfonts\rmisbold \leftline{#1}}%
+ \fi
+}
+
+
+% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make \makeheadline and \makefootline in Plain TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\txipageheight by -12pt
+ \global\advance\vsize by -12pt
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+% @evenheadingmarks top \thischapter <- chapter at the top of a page
+% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
+%
+% The same set of arguments for:
+%
+% @oddheadingmarks
+% @evenfootingmarks
+% @oddfootingmarks
+% @everyheadingmarks
+% @everyfootingmarks
+
+% These define \getoddheadingmarks, \getevenheadingmarks,
+% \getoddfootingmarks, and \getevenfootingmarks, each to one of
+% \gettopheadingmarks, \getbottomheadingmarks.
+%
+\def\evenheadingmarks{\headingmarks{even}{heading}}
+\def\oddheadingmarks{\headingmarks{odd}{heading}}
+\def\evenfootingmarks{\headingmarks{even}{footing}}
+\def\oddfootingmarks{\headingmarks{odd}{footing}}
+\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
+ \headingmarks{odd}{heading}{#1} }
+\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
+ \headingmarks{odd}{footing}{#1} }
+% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
+\def\headingmarks#1#2#3 {%
+ \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
+ \global\expandafter\let\csname get#1#2marks\endcsname \temp
+}
+
+\everyheadingmarks bottom
+\everyfootingmarks bottom
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\parseargdef\headings{\csname HEADINGS#1\endcsname}
+
+\def\headingsoff{% non-global headings elimination
+ \evenheadline={\hfil}\evenfootline={\hfil}%
+ \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff % it's the default
+
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapterheading\hfil\folio}}
+\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapterheading\hfil\folio}}
+\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\thisisundefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemindicate{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil\relax
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. However, if
+ % what follows is an environment such as @example, there will be no
+ % \parskip glue; then the negative vskip we just inserted would
+ % cause the example and the item to crash together. So we use this
+ % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+ % \parskip glue after all. Section titles are handled this way also.
+ %
+ \penalty 10001
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablecheck{table}%
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablecheck{ftable}%
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+ \ifnum \the\catcode`\^^M=\active
+ \endgroup
+ \errmessage{This command won't work in this context; perhaps the problem is
+ that we are \inenvironment\thisenv}%
+ \def\next{\doignore{#1}}%
+ \else
+ \let\next\tablex
+ \fi
+ \next
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ %
+ % Try typesetting the item mark so that if the document erroneously says
+ % something like @itemize @samp (intending @table), there's an error
+ % right away at the @itemize. It's not the best error message in the
+ % world, but it's better than leaving it to the @item. This means if
+ % the user wants an empty mark, they have to say @w{} not just @w.
+ \def\itemcontents{#1}%
+ \setbox0 = \hbox{\itemcontents}%
+ %
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ %
+ \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ %
+ \ifinner\else
+ \vadjust{\penalty 1200}% not good to break after first line of item.
+ \fi
+ % We can be in inner vertical mode in a footnote, although an
+ % @itemize looks awful there.
+ }%
+ \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold. Assignments
+% have to be global since we are inside the implicit group of an
+% alignment entry. \everycr below resets \everytab so we don't have to
+% undo it ourselves.
+\def\headitemfont{\b}% for people to use in the template row; not changeable
+\def\headitem{%
+ \checkenv\multitable
+ \crcr
+ \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
+ \global\everytab={\bf}% can't use \headitemfont since the parsing differs
+ \the\everytab % for the first item
+}%
+%
+% default for tables with no headings.
+\let\headitemcrhook=\relax
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we again encounter the problem the 1sp was intended to solve.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
+ \vskip\parskip
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ % We use \def instead of \let so that if one of the multitable entries
+ % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+ % \endtemplate) expanding \doitemize.
+ \def\item{\crcr}%
+ %
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}% Reset from possible headitem.
+ \global\colcount=0 % Reset the column counter.
+ %
+ % Check for saved footnotes, etc.:
+ \checkinserts
+ %
+ % Perhaps a \nobreak, then reset:
+ \headitemcrhook
+ \global\let\headitemcrhook=\relax
+ }%
+ }%
+ %
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+ \def\multistrut{\strut}% just use the standard line spacing
+ %
+ % Compute \multitablelinespace (if not defined by user) for use in
+ % \multitableparskip calculation. We used define \multistrut based on
+ % this, but (ironically) that caused the spacing to be off.
+ % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+ % Scan in ``verbatim'' mode:
+ \obeylines
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \spaceisspace
+ %
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
+ %
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
+ %
+ \gdef\dodoignore#1{%
+ % #1 contains the command name as a string, e.g., `ifinfo'.
+ %
+ % Define a command to find the next `@end #1'.
+ \long\def\doignoretext##1^^M@end #1{%
+ \doignoretextyyy##1^^M@#1\_STOP_}%
+ %
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+ %
+ % And now expand that command.
+ \doignoretext ^^M%
+ }%
+}
+
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+{ \obeylines%
+ % Ignore anything after the last `@end #1'; this matters in verbatim
+ % environments, where otherwise the newline after an ignored conditional
+ % would result in a blank line in the output.
+ \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
+}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+ \catcode`\-=\active \catcode`\_=\active
+ %
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
+ \catcode`\-=\other \catcode`\_=\other
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\normaldash \let_\normalunderscore
+ }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+% Unfortunately, this has the consequence that when _ is in the *value*
+% of an @set, it does not print properly in the roman fonts (get the cmr
+% dot accent at position 126 instead). No fix comes to mind, and it's
+% been this way since 2003 or earlier, so just ignore it.
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% Like \expandablevalue, but completely expandable (the \message in the
+% definition above operates at the execution level of TeX). Used when
+% writing to auxiliary files, due to the expansion that \write does.
+% If flag is undefined, pass through an unexpanded @value command: maybe it
+% will be set by the time it is read back in.
+%
+% NB flag names containing - or _ may not work here.
+\def\dummyvalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \noexpand\value{#1}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% Used for @value's in index entries to form the sort key: expand the @value
+% if possible, otherwise sort late.
+\def\indexnofontsvalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ ZZZZZZZ
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get the special treatment we need for `@end ifset,' we call
+% \makecond and then redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined. We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+%
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname #2\endcsname\relax
+ #1% If not defined, \let\next as above.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+ \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named IX.
+% It automatically defines \IXindex such that
+% \IXindex ...rest of line... puts an entry in the index IX.
+% It also defines \IXindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is IX.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \expandafter\chardef\csname#1indfile\endcsname=0
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \expandafter\chardef\csname#1indfile\endcsname=0
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+% The default indices:
+\newindex{cp}% concepts,
+\newcodeindex{fn}% functions,
+\newcodeindex{vr}% variables,
+\newcodeindex{tp}% types,
+\newcodeindex{ky}% keys
+\newcodeindex{pg}% and programs.
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ \requireopenindexfile{#3}%
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all index macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is the two-letter name of the index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
+\def\doindexxxx #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
+\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
+
+
+% Used when writing an index entry out to an index file to prevent
+% expansion of Texinfo commands that can appear in an index entry.
+%
+\def\indexdummies{%
+ \escapechar = `\\ % use backslash in output files.
+ \definedummyletter\@%
+ \definedummyletter\ %
+ %
+ % For texindex which always views { and } as separators.
+ \def\{{\lbracechar{}}%
+ \def\}{\rbracechar{}}%
+ %
+ % Do the redefinitions.
+ \definedummies
+}
+
+% Used for the aux and toc files, where @ is the escape character.
+%
+\def\atdummies{%
+ \definedummyletter\@%
+ \definedummyletter\ %
+ \definedummyletter\{%
+ \definedummyletter\}%
+ %
+ % Do the redefinitions.
+ \definedummies
+ \otherbackslash
+}
+
+% \definedummyword defines \#1 as \string\#1\space, thus effectively
+% preventing its expansion. This is used only for control words,
+% not control letters, because the \space would be incorrect for
+% control characters, but is needed to separate the control word
+% from whatever follows.
+%
+% These can be used both for control words that take an argument and
+% those that do not. If it is followed by {arg} in the input, then
+% that will dutifully get written to the index (or wherever).
+%
+% For control letters, we have \definedummyletter, which omits the
+% space.
+%
+\def\definedummyword #1{\def#1{\string#1\space}}%
+\def\definedummyletter#1{\def#1{\string#1}}%
+\let\definedummyaccent\definedummyletter
+
+% Called from \indexdummies and \atdummies, to effectively prevent
+% the expansion of commands.
+%
+\def\definedummies{%
+ %
+ \let\commondummyword\definedummyword
+ \let\commondummyletter\definedummyletter
+ \let\commondummyaccent\definedummyaccent
+ \commondummiesnofonts
+ %
+ \definedummyletter\_%
+ \definedummyletter\-%
+ %
+ % Non-English letters.
+ \definedummyword\AA
+ \definedummyword\AE
+ \definedummyword\DH
+ \definedummyword\L
+ \definedummyword\O
+ \definedummyword\OE
+ \definedummyword\TH
+ \definedummyword\aa
+ \definedummyword\ae
+ \definedummyword\dh
+ \definedummyword\exclamdown
+ \definedummyword\l
+ \definedummyword\o
+ \definedummyword\oe
+ \definedummyword\ordf
+ \definedummyword\ordm
+ \definedummyword\questiondown
+ \definedummyword\ss
+ \definedummyword\th
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword\bf
+ \definedummyword\gtr
+ \definedummyword\hat
+ \definedummyword\less
+ \definedummyword\sf
+ \definedummyword\sl
+ \definedummyword\tclose
+ \definedummyword\tt
+ %
+ \definedummyword\LaTeX
+ \definedummyword\TeX
+ %
+ % Assorted special characters.
+ \definedummyword\atchar
+ \definedummyword\arrow
+ \definedummyword\bullet
+ \definedummyword\comma
+ \definedummyword\copyright
+ \definedummyword\registeredsymbol
+ \definedummyword\dots
+ \definedummyword\enddots
+ \definedummyword\entrybreak
+ \definedummyword\equiv
+ \definedummyword\error
+ \definedummyword\euro
+ \definedummyword\expansion
+ \definedummyword\geq
+ \definedummyword\guillemetleft
+ \definedummyword\guillemetright
+ \definedummyword\guilsinglleft
+ \definedummyword\guilsinglright
+ \definedummyword\lbracechar
+ \definedummyword\leq
+ \definedummyword\mathopsup
+ \definedummyword\minus
+ \definedummyword\ogonek
+ \definedummyword\pounds
+ \definedummyword\point
+ \definedummyword\print
+ \definedummyword\quotedblbase
+ \definedummyword\quotedblleft
+ \definedummyword\quotedblright
+ \definedummyword\quoteleft
+ \definedummyword\quoteright
+ \definedummyword\quotesinglbase
+ \definedummyword\rbracechar
+ \definedummyword\result
+ \definedummyword\sub
+ \definedummyword\sup
+ \definedummyword\textdegree
+ %
+ % We want to disable all macros so that they are not expanded by \write.
+ \macrolist
+ \let\value\dummyvalue
+ %
+ \normalturnoffactive
+}
+
+% \commondummiesnofonts: common to \definedummies and \indexnofonts.
+% Define \commondummyletter, \commondummyaccent and \commondummyword before
+% using. Used for accents, font commands, and various control letters.
+%
+\def\commondummiesnofonts{%
+ % Control letters and accents.
+ \commondummyletter\!%
+ \commondummyaccent\"%
+ \commondummyaccent\'%
+ \commondummyletter\*%
+ \commondummyaccent\,%
+ \commondummyletter\.%
+ \commondummyletter\/%
+ \commondummyletter\:%
+ \commondummyaccent\=%
+ \commondummyletter\?%
+ \commondummyaccent\^%
+ \commondummyaccent\`%
+ \commondummyaccent\~%
+ \commondummyword\u
+ \commondummyword\v
+ \commondummyword\H
+ \commondummyword\dotaccent
+ \commondummyword\ogonek
+ \commondummyword\ringaccent
+ \commondummyword\tieaccent
+ \commondummyword\ubaraccent
+ \commondummyword\udotaccent
+ \commondummyword\dotless
+ %
+ % Texinfo font commands.
+ \commondummyword\b
+ \commondummyword\i
+ \commondummyword\r
+ \commondummyword\sansserif
+ \commondummyword\sc
+ \commondummyword\slanted
+ \commondummyword\t
+ %
+ % Commands that take arguments.
+ \commondummyword\abbr
+ \commondummyword\acronym
+ \commondummyword\anchor
+ \commondummyword\cite
+ \commondummyword\code
+ \commondummyword\command
+ \commondummyword\dfn
+ \commondummyword\dmn
+ \commondummyword\email
+ \commondummyword\emph
+ \commondummyword\env
+ \commondummyword\file
+ \commondummyword\image
+ \commondummyword\indicateurl
+ \commondummyword\inforef
+ \commondummyword\kbd
+ \commondummyword\key
+ \commondummyword\math
+ \commondummyword\option
+ \commondummyword\pxref
+ \commondummyword\ref
+ \commondummyword\samp
+ \commondummyword\strong
+ \commondummyword\tie
+ \commondummyword\U
+ \commondummyword\uref
+ \commondummyword\url
+ \commondummyword\var
+ \commondummyword\verb
+ \commondummyword\w
+ \commondummyword\xref
+}
+
+% For testing: output @{ and @} in index sort strings as \{ and \}.
+\newif\ifusebracesinindexes
+
+\let\indexlbrace\relax
+\let\indexrbrace\relax
+
+{\catcode`\@=0
+\catcode`\\=13
+ @gdef@backslashdisappear{@def\{}}
+}
+
+{
+\catcode`\<=13
+\catcode`\-=13
+\catcode`\`=13
+ \gdef\indexnonalnumdisappear{%
+ \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
+ % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
+ % (Introduced for FSFS 2nd ed.)
+ \let`=\empty
+ \fi
+ %
+ \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
+ \backslashdisappear
+ \fi
+ %
+ \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
+ \def-{}%
+ \fi
+ \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
+ \def<{}%
+ \fi
+ \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
+ \def\@{}%
+ \fi
+ }
+
+ \gdef\indexnonalnumreappear{%
+ \useindexbackslash
+ \let-\normaldash
+ \let<\normalless
+ \def\@{@}%
+ }
+}
+
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+ % Accent commands should become @asis.
+ \def\commondummyaccent##1{\let##1\asis}%
+ % We can just ignore other control letters.
+ \def\commondummyletter##1{\let##1\empty}%
+ % All control words become @asis by default; overrides below.
+ \let\commondummyword\commondummyaccent
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ \def\ { }%
+ \def\@{@}%
+ \def\_{\normalunderscore}%
+ \def\-{}% @- shouldn't affect sorting
+ %
+ \uccode`\1=`\{ \uppercase{\def\{{1}}%
+ \uccode`\1=`\} \uppercase{\def\}{1}}%
+ \let\lbracechar\{%
+ \let\rbracechar\}%
+ %
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\DH{DZZ}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\TH{TH}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\dh{dzz}%
+ \def\exclamdown{!}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ \def\o{o}%
+ \def\questiondown{?}%
+ \def\ss{ss}%
+ \def\th{th}%
+ %
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
+ %
+ % Assorted special characters. \defglyph gives the control sequence a
+ % definition that removes the {} that follows its use.
+ \defglyph\atchar{@}%
+ \defglyph\arrow{->}%
+ \defglyph\bullet{bullet}%
+ \defglyph\comma{,}%
+ \defglyph\copyright{copyright}%
+ \defglyph\dots{...}%
+ \defglyph\enddots{...}%
+ \defglyph\equiv{==}%
+ \defglyph\error{error}%
+ \defglyph\euro{euro}%
+ \defglyph\expansion{==>}%
+ \defglyph\geq{>=}%
+ \defglyph\guillemetleft{<<}%
+ \defglyph\guillemetright{>>}%
+ \defglyph\guilsinglleft{<}%
+ \defglyph\guilsinglright{>}%
+ \defglyph\leq{<=}%
+ \defglyph\lbracechar{\{}%
+ \defglyph\minus{-}%
+ \defglyph\point{.}%
+ \defglyph\pounds{pounds}%
+ \defglyph\print{-|}%
+ \defglyph\quotedblbase{"}%
+ \defglyph\quotedblleft{"}%
+ \defglyph\quotedblright{"}%
+ \defglyph\quoteleft{`}%
+ \defglyph\quoteright{'}%
+ \defglyph\quotesinglbase{,}%
+ \defglyph\rbracechar{\}}%
+ \defglyph\registeredsymbol{R}%
+ \defglyph\result{=>}%
+ \defglyph\textdegree{o}%
+ %
+ % We need to get rid of all macros, leaving only the arguments (if present).
+ % Of course this is not nearly correct, but it is the best we can do for now.
+ % makeinfo does not expand macros in the argument to @deffn, which ends up
+ % writing an index entry, and texindex isn't prepared for an index sort entry
+ % that starts with \.
+ %
+ % Since macro invocations are followed by braces, we can just redefine them
+ % to take a single TeX argument. The case of a macro invocation that
+ % goes to end-of-line is not handled.
+ %
+ \macrolist
+ \let\value\indexnofontsvalue
+}
+\def\defglyph#1#2{\def#1##1{#2}} % see above
+
+
+
+
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+% TODO: Two-level index? Operation index?
+
+% Workhorse for all indexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ \requireopenindexfile{#1}%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \safewhatsit\dosubindwrite
+ }%
+ \fi
+}
+
+% Check if an index file has been opened, and if not, open it.
+\def\requireopenindexfile#1{%
+\ifnum\csname #1indfile\endcsname=0
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \edef\suffix{#1}%
+ % A .fls suffix would conflict with the file extension for the output
+ % of -recorder, so use .f1s instead.
+ \ifx\suffix\indexisfl\def\suffix{f1}\fi
+ % Open the file
+ \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
+ % Using \immediate above here prevents an object entering into the current
+ % box, which could confound checks such as those in \safewhatsit for
+ % preceding skips.
+ \typeout{Writing index file \jobname.\suffix}%
+\fi}
+\def\indexisfl{fl}
+
+% Output \ as {\indexbackslash}, because \ is an escape character in
+% the index files.
+\let\indexbackslash=\relax
+{\catcode`\@=0 \catcode`\\=\active
+ @gdef@useindexbackslash{@def\{{@indexbackslash}}}
+}
+
+% Definition for writing index entry text.
+\def\sortas#1{\ignorespaces}%
+
+% Definition for writing index entry sort key. Should occur at the at
+% the beginning of the index entry, like
+% @cindex @sortas{september} \september
+% The \ignorespaces takes care of following space, but there's no way
+% to remove space before it.
+{
+\catcode`\-=13
+\gdef\indexwritesortas{%
+ \begingroup
+ \indexnonalnumreappear
+ \indexwritesortasxxx}
+\gdef\indexwritesortasxxx#1{%
+ \xdef\indexsortkey{#1}\endgroup}
+}
+
+
+% Write the entry in \toks0 to the index file.
+%
+\def\dosubindwrite{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \fi
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \useindexbackslash % \indexbackslash isn't defined now so it will be output
+ % as is; and it will print as backslash.
+ % The braces around \indexbrace are recognized by texindex.
+ %
+ % Get the string to sort by, by processing the index entry with all
+ % font commands turned off.
+ {\indexnofonts
+ \def\lbracechar{{\indexlbrace}}%
+ \def\rbracechar{{\indexrbrace}}%
+ \let\{=\lbracechar
+ \let\}=\rbracechar
+ \indexnonalnumdisappear
+ \xdef\indexsortkey{}%
+ \let\sortas=\indexwritesortas
+ \edef\temp{\the\toks0}%
+ \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
+ \ifx\indexsortkey\empty
+ \xdef\indexsortkey{\temp}%
+ \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
+ \fi
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
+ }%
+ \temp
+}
+\newbox\dummybox % used above
+
+% Take care of unwanted page breaks/skips around a whatsit:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write or \pdfdest will make \lastskip zero. The result is that
+% sequences like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+\newskip\whatsitskip
+\newcount\whatsitpenalty
+%
+% ..., ready, GO:
+%
+\def\safewhatsit#1{\ifhmode
+ #1%
+ \else
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \whatsitskip = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \whatsitpenalty = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\whatsitskip glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\whatsitskip
+ \fi
+ %
+ #1%
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % If \lastskip was zero, perhaps the last item was a penalty, and
+ % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
+ % to re-insert the same penalty (values >10000 are used for various
+ % signals); since we just inserted a non-discardable item, any
+ % following glue (such as a \parskip) would be a breakpoint. For example:
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\whatsitskip
+ \fi
+\fi}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \plainfrenchspacing
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 12
+ % See comment in \requireopenindexfile.
+ \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
+ \openin 1 \jobname.\indexname s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \typeout{No file \jobname.\indexname s.}%
+ \else
+ \catcode`\\ = 0
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \thisline
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\ttbackslash}%
+ \let\indexlbrace\{ % Likewise, set these sequences for braces
+ \let\indexrbrace\} % used in the sort key.
+ \begindoublecolumns
+ \let\entrywidowpenalty=\indexwidowpenalty
+ %
+ % Read input from the index file line by line.
+ \loopdo
+ \ifeof1
+ \let\firsttoken\relax
+ \else
+ \read 1 to \nextline
+ \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
+ \act
+ \fi
+ \thisline
+ %
+ \ifeof1\else
+ \let\thisline\nextline
+ \repeat
+ %%
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
+\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
+
+\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
+\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
+\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
+\catcode`\$=3
+\gdef\initialglyphs{%
+ % Some changes for non-alphabetic characters. Using the glyphs from the
+ % math fonts looks more consistent than the typewriter font used elsewhere
+ % for these characters.
+ \def\indexbackslash{\math{\backslash}}%
+ \let\\=\indexbackslash
+ %
+ % Can't get bold backslash so don't use bold forward slash
+ \catcode`\/=13
+ \def/{{\secrmnotbold \normalslash}}%
+ \def-{{\normaldash\normaldash}}% en dash `--'
+ \def^{{\chapbf \normalcaret}}%
+ \def~{{\chapbf \normaltilde}}%
+ \def\_{%
+ \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
+ \def|{$\vert$}%
+ \def<{$\less$}%
+ \def>{$\gtr$}%
+ \def+{$\normalplus$}%
+}}
+
+\def\initial{%
+ \bgroup
+ \initialglyphs
+ \initialx
+}
+
+\def\initialx#1{%
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ % The glue before the bonus allows a little bit of space at the
+ % bottom of a column to reduce an increase in inter-line spacing.
+ \nobreak
+ \vskip 0pt plus 5\baselineskip
+ \penalty -300
+ \vskip 0pt plus -5\baselineskip
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus 1\baselineskip
+ \leftline{\secfonts \kern-0.05em \secbf #1}%
+ % \secfonts is inside the argument of \leftline so that the change of
+ % \baselineskip will not affect any glue inserted before the vbox that
+ % \leftline creates.
+ % Do our best not to break after the initial.
+ \nobreak
+ \vskip .33\baselineskip plus .1\baselineskip
+ \egroup % \initialglyphs
+}
+
+\newdimen\entryrightmargin
+\entryrightmargin=0pt
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
+%
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % When reading the text of entry, convert explicit line breaks
+ % from @* into spaces. The user might give these in long section
+ % titles, for instance.
+ \def\*{\unskip\space\ignorespaces}%
+ \def\entrybreak{\hfil\break}% An undocumented command
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\entrybreak{\unskip\space\ignorespaces}%
+\def\doentry{%
+ % Save the text of the entry
+ \global\setbox\boxA=\hbox\bgroup
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+ % Not absorbing as a macro argument reduces the chance of problems
+ % with catcodes occurring.
+}
+{\catcode`\@=11
+\gdef\finishentry#1{%
+ \egroup % end box A
+ \dimen@ = \wd\boxA % Length of text of entry
+ \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
+ % #1 is the page number.
+ %
+ % Get the width of the page numbers, and only use
+ % leaders if they are present.
+ \global\setbox\boxB = \hbox{#1}%
+ \ifdim\wd\boxB = 0pt
+ \null\nobreak\hfill\ %
+ \else
+ %
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ \ifpdf
+ \pdfgettoks#1.%
+ \bgroup\let\domark\relax
+ \hskip\skip\thinshrinkable\the\toksA
+ \egroup
+ % The redefinion of \domark stops marks being added in \pdflink to
+ % preserve coloured links across page boundaries. Otherwise the marks
+ % would get in the way of \lastbox in \insertindexentrybox.
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \hskip\skip\thinshrinkable #1%
+ \else
+ \pdfgettoks#1.%
+ \bgroup\let\domark\relax
+ \hskip\skip\thinshrinkable\the\toksA
+ \egroup
+ \fi
+ \fi
+ \fi
+ \egroup % end \boxA
+ \ifdim\wd\boxB = 0pt
+ \global\setbox\entryindexbox=\vbox{\unhbox\boxA}%
+ \else
+ \global\setbox\entryindexbox=\vbox\bgroup
+ % We want the text of the entries to be aligned to the left, and the
+ % page numbers to be aligned to the right.
+ %
+ \parindent = 0pt
+ \advance\leftskip by 0pt plus 1fil
+ \advance\leftskip by 0pt plus -1fill
+ \rightskip = 0pt plus -1fil
+ \advance\rightskip by 0pt plus 1fill
+ % Cause last line, which could consist of page numbers on their own
+ % if the list of page numbers is long, to be aligned to the right.
+ \parfillskip=0pt plus -1fill
+ %
+ \advance\rightskip by \entryrightmargin
+ % Determine how far we can stretch into the margin.
+ % This allows, e.g., "Appendix H GNU Free Documentation License" to
+ % fit on one line in @letterpaper format.
+ \ifdim\entryrightmargin>2.1em
+ \dimen@i=2.1em
+ \else
+ \dimen@i=0em
+ \fi
+ \advance \parfillskip by 0pt minus 1\dimen@i
+ %
+ \dimen@ii = \hsize
+ \advance\dimen@ii by -1\leftskip
+ \advance\dimen@ii by -1\entryrightmargin
+ \advance\dimen@ii by 1\dimen@i
+ \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
+ \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
+ \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
+ \dimen@ii = \hsize
+ \ifnum\dimen@>\dimen@ii
+ % If the entry is too long, use the whole line
+ \dimen@ = \dimen@ii
+ \fi
+ \advance\leftskip by 0pt plus 1fill % ragged right
+ \advance \dimen@ by 1\rightskip
+ \parshape = 2 0pt \dimen@ 0em \dimen@ii
+ % Ideally we'd add a finite glue at the end of the first line only,
+ % instead of using \parshape with explicit line lengths, but TeX
+ % doesn't seem to provide a way to do such a thing.
+ %
+ \leftskip = 1em
+ \parindent = -1em
+ \fi\fi
+ \indent % start paragraph
+ \unhbox\boxA
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % Word spacing - no stretch
+ \spaceskip=\fontdimen2\font minus \fontdimen4\font
+ %
+ \linepenalty=1000 % Discourage line breaks.
+ \hyphenpenalty=5000 % Discourage hyphenation.
+ %
+ \par % format the paragraph
+ \egroup % The \vbox
+ \fi
+ \endgroup
+ % delay text of entry until after penalty
+ \bgroup\aftergroup\insertindexentrybox
+ \entrywidowpenalty
+}}
+
+\newskip\thinshrinkable
+\skip\thinshrinkable=.15em minus .15em
+
+\newbox\entryindexbox
+\def\insertindexentrybox{%
+ \ourunvbox\entryindexbox
+}
+
+% Use \lastbox to take apart vbox box by box, and add each sub-box
+% to the current vertical list.
+\def\ourunvbox#1{%
+\bgroup % for local binding of \delayedbox
+ % Remove the last box from box #1
+ \global\setbox#1=\vbox{%
+ \unvbox#1%
+ \unskip % remove any glue
+ \unpenalty
+ \global\setbox\interbox=\lastbox
+ }%
+ \setbox\delayedbox=\box\interbox
+ \ifdim\ht#1=0pt\else
+ \ourunvbox#1 % Repeat on what's left of the box
+ \nobreak
+ \fi
+ \box\delayedbox
+\egroup
+}
+\newbox\delayedbox
+\newbox\interbox
+
+% Default is no penalty
+\let\entrywidowpenalty\egroup
+
+% Used from \printindex. \firsttoken should be the first token
+% after the \entry. If it's not another \entry, we are at the last
+% line of a group of index entries, so insert a penalty to discourage
+% widowed index entries.
+\long\def\indexwidowpenalty{%
+ \def\isentry{\entry}%
+ \ifx\firsttoken\isentry
+ \else
+ \penalty 9000
+ \fi
+ \egroup % now comes the box added with \aftergroup
+}
+
+% Like plain.tex's \dotfill, except uses up at least 1 em.
+% The filll stretch here overpowers both the fil and fill stretch to push
+% the page number to the right.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
+
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ #2
+ \else
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \fi
+ \fi
+ \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11 % private names
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+% Use inside an output routine to save \topmark and \firstmark
+\def\savemarks{%
+ \global\savedtopmark=\expandafter{\topmark }%
+ \global\savedfirstmark=\expandafter{\firstmark }%
+}
+\newtoks\savedtopmark
+\newtoks\savedfirstmark
+
+% Set \topmark and \firstmark for next time \output runs.
+% Can't be run from withinside \output (because any material
+% added while an output routine is active, including
+% penalties, is saved for after it finishes). The page so far
+% should be empty, otherwise what's on it will be thrown away.
+\def\restoremarks{%
+ \mark{\the\savedtopmark}%
+ \bgroup\output = {%
+ \setbox\dummybox=\box\PAGE
+ }abc\eject\egroup
+ % "abc" because output routine doesn't fire for a completely empty page.
+ \mark{\the\savedfirstmark}%
+}
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % If not much space left on page, start a new page.
+ \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
+ %
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ \savemarks
+ }%
+ \eject % run that output routine to set \partialpage
+ \restoremarks
+ %
+ % We recover the two marks that the last output routine saved in order
+ % to propagate the information in marks added around a chapter heading,
+ % which could be otherwise be lost by the time the final page is output.
+ %
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+ %
+ % For the benefit of balancing columns
+ \advance\baselineskip by 0pt plus 0.5pt
+}
+
+% The double-column output routine for all double-column pages except
+% the last, which is done by \balancecolumns.
+%
+\def\doublecolumnout{%
+ %
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\txipagewidth{\box0\hfil\box2}%
+}
+
+
+% Finished with with double columns.
+\def\enddoublecolumns{%
+ % The following penalty ensures that the page builder is exercised
+ % _before_ we change the output routine. This is necessary in the
+ % following situation:
+ %
+ % The last section of the index consists only of a single entry.
+ % Before this section, \pagetotal is less than \pagegoal, so no
+ % break occurs before the last section starts. However, the last
+ % section, consisting of \initial and the single \entry, does not
+ % fit on the page and has to be broken off. Without the following
+ % penalty the page builder will not be exercised until \eject
+ % below, and by that time we'll already have changed the output
+ % routine to the \balancecolumns version, so the next-to-last
+ % double-column page will be processed with \balancecolumns, which
+ % is wrong: The two columns will go to the main vertical list, with
+ % the broken-off section in the recent contributions. As soon as
+ % the output routine finishes, TeX starts reconsidering the page
+ % break. The two columns and the broken-off section both fit on the
+ % page, because the two columns now take up only half of the page
+ % goal. When TeX sees \eject from below which follows the final
+ % section, it invokes the new output routine that we've set after
+ % \balancecolumns below; \onepageout will try to fit the two columns
+ % and the final section into the vbox of \txipageheight (see
+ % \pagebody), causing an overfull box.
+ %
+ % Note that glue won't work here, because glue does not exercise the
+ % page builder, unlike penalties (see The TeXbook, pp. 280-281).
+ \penalty0
+ %
+ \output = {%
+ % Split the last of the double-column material.
+ \savemarks
+ \balancecolumns
+ %
+ % Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away.
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ \restoremarks
+ % Leave the double-column material on the current page, no automatic
+ % page break.
+ \box\balancedcolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+\newbox\balancedcolumns
+\setbox\balancedcolumns=\vbox{shouldnt see this}%
+%
+% Only called for the last of the double column material. \doublecolumnout
+% does the others.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \ifdim\dimen@<5\baselineskip
+ % Don't split a short final column in two.
+ \setbox2=\vbox{}%
+ \else
+ \divide\dimen@ by 2 % target to split to
+ \dimen@ii = \dimen@
+ \splittopskip = \topskip
+ % Loop until left column is at least as high as the right column.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht1<\ht3
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ % Now the left column is in box 1, and the right column in box 3.
+ % Check whether the left column has come out higher than the page itself.
+ % (Note that we have doubled \vsize for the double columns, so
+ % the actual height of the page is 0.5\vsize).
+ \ifdim2\ht1>\vsize
+ % Just split the last of the double column material roughly in half.
+ \setbox2=\box0
+ \setbox0 = \vsplit2 to \dimen@ii
+ \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}%
+ \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}%
+ \else
+ % Compare the heights of the two columns.
+ \ifdim4\ht1>5\ht3
+ % Column heights are too different, so don't make their bottoms
+ % flush with each other.
+ \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
+ \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
+ \else
+ % Make column bottoms flush with each other.
+ \setbox2=\vbox to\ht1{\unvbox3\unskip}%
+ \setbox0=\vbox to\ht1{\unvbox1\unskip}%
+ \fi
+ \fi
+ \fi
+ %
+ \global\setbox\balancedcolumns=\vbox{\pagesofar}%
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+ \chapoddpage
+ \null
+ \vskip.3\vsize % move it down on the page a bit
+ \begingroup
+ \noindent \titlefonts\rmisbold #1\par % the text
+ \let\lastnode=\empty % no node to associate with
+ \writetocentry{part}{#1}{}% but put it in the toc
+ \headingsoff % no headline or footline on the part page
+ % This outputs a mark at the end of the page that clears \thischapter
+ % and \thissection, as is done in \startcontents.
+ \let\pchapsepmacro\relax
+ \chapmacro{}{Yomitfromtoc}{}%
+ \chapoddpage
+ \endgroup
+}
+
+% \unnumberedno is an oxymoron. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines these (using marks) as the number+name, number
+% and name of the chapter. Page headings and footings can use
+% these. @section does likewise.
+\def\thischapter{}
+\def\thischapternum{}
+\def\thischaptername{}
+\def\thissection{}
+\def\thissectionnum{}
+\def\thissectionname{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+ % Compute the abs. sec. level:
+ \absseclevel=#2
+ \advance\absseclevel by \secbase
+ % Make sure \absseclevel doesn't fall outside the range:
+ \ifnum \absseclevel < 0
+ \absseclevel = 0
+ \else
+ \ifnum \absseclevel > 3
+ \absseclevel = 3
+ \fi
+ \fi
+ % The heading type:
+ \def\headtype{#1}%
+ \if \headtype U%
+ \ifnum \absseclevel < \unnlevel
+ \chardef\unnlevel = \absseclevel
+ \fi
+ \else
+ % Check for appendix sections:
+ \ifnum \absseclevel = 0
+ \edef\chapheadtype{\headtype}%
+ \else
+ \if \headtype A\if \chapheadtype N%
+ \errmessage{@appendix... within a non-appendix chapter}%
+ \fi\fi
+ \fi
+ % Check for numbered within unnumbered:
+ \ifnum \absseclevel > \unnlevel
+ \def\headtype{U}%
+ \else
+ \chardef\unnlevel = 3
+ \fi
+ \fi
+ % Now print the heading:
+ \if \headtype U%
+ \ifcase\absseclevel
+ \unnumberedzzz{#3}%
+ \or \unnumberedseczzz{#3}%
+ \or \unnumberedsubseczzz{#3}%
+ \or \unnumberedsubsubseczzz{#3}%
+ \fi
+ \else
+ \if \headtype A%
+ \ifcase\absseclevel
+ \appendixzzz{#3}%
+ \or \appendixsectionzzz{#3}%
+ \or \appendixsubseczzz{#3}%
+ \or \appendixsubsubseczzz{#3}%
+ \fi
+ \else
+ \ifcase\absseclevel
+ \chapterzzz{#3}%
+ \or \seczzz{#3}%
+ \or \numberedsubseczzz{#3}%
+ \or \numberedsubsubseczzz{#3}%
+ \fi
+ \fi
+ \fi
+ \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ % \putwordChapter can contain complex things in translations.
+ \toks0=\expandafter{\putwordChapter}%
+ \message{\the\toks0 \space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
+%
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ % \putwordAppendix can contain complex things in translations.
+ \toks0=\expandafter{\putwordAppendix}%
+ \message{\the\toks0 \space \appendixletter}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
+
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+ %
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+ \let\centerparametersmaybe = \centerparameters
+ \unnmhead0{#1}%
+ \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+%
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+%
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+%
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+\def\majorheading{%
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip \nobreak
+ \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+% Parameter controlling skip before chapter headings (if needed)
+\newskip\chapheadingskip
+
+% Define plain chapter starts, and page on/off switching for it.
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+
+% Start a new page
+\def\chappager{\par\vfill\supereject}
+
+% \chapoddpage - start on an odd page for a new chapter
+% Because \domark is called before \chapoddpage, the filler page will
+% get the headings for the next chapter, which is wrong. But we don't
+% care -- we just disable all headings on the filler page.
+\def\chapoddpage{%
+ \chappager
+ \ifodd\pageno \else
+ \begingroup
+ \headingsoff
+ \null
+ \chappager
+ \endgroup
+ \fi
+}
+
+\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% \chapmacro - Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+% Not used for @heading series.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yappendixkeyword{Yappendix}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+%
+\def\chapmacro#1#2#3{%
+ \expandafter\ifx\thisenv\titlepage\else
+ \checkenv{}% chapters, etc., should not start inside an environment.
+ \fi
+ % FIXME: \chapmacro is currently called from inside \titlepage when
+ % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
+ % this should probably be done by \sectionheading with an option to print
+ % in chapter size.
+ %
+ % Insert the first mark before the heading break (see notes for \domark).
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+ \gdef\thissection{}}%
+ %
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{\thischaptername}}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{}}%
+ \else\ifx\temptype\Yappendixkeyword
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\appendixletter}%
+ % \noexpand\putwordAppendix avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
+ \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \else
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\the\chapno}%
+ % \noexpand\putwordChapter avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
+ \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \fi\fi\fi
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert the chapter heading break.
+ \pchapsepmacro
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ {%
+ \chapfonts \rmisbold
+ \let\footnote=\errfootnoteheading % give better error message
+ %
+ % Have to define \lastsection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\lastsection{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
+ \nobreak % Avoid page breaks at the interline glue.
+ \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+}
+
+
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text of the title,
+% #2 is the section level (sec/subsec/subsubsec),
+% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
+% #4 is the section number.
+%
+\def\seckeyword{sec}
+%
+\def\sectionheading#1#2#3#4{%
+ {%
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
+ %
+ % It is ok for the @heading series commands to appear inside an
+ % environment (it's been historically allowed, though the logic is
+ % dubious), but not the others.
+ \ifx\temptype\Yomitfromtockeyword\else
+ \checkenv{}% non-@*heading should not be in an environment.
+ \fi
+ \let\footnote=\errfootnoteheading
+ %
+ % Switch to the right set of fonts.
+ \csname #2fonts\endcsname \rmisbold
+ %
+ % Insert first mark before the heading break (see notes for \domark).
+ \let\prevsectiondefs=\lastsectiondefs
+ \ifx\temptype\Ynothingkeyword
+ \ifx\sectionlevel\seckeyword
+ \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+ \gdef\thissection{\thissectionname}}%
+ \fi
+ \else\ifx\temptype\Yomitfromtockeyword
+ % Don't redefine \thissection.
+ \else\ifx\temptype\Yappendixkeyword
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ % \noexpand\putwordSection avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thissection{\noexpand\putwordSection{}
+ \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \else
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ % \noexpand\putwordSection avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thissection{\noexpand\putwordSection{}
+ \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \fi\fi\fi
+ %
+ % Go into vertical mode. Usually we'll already be there, but we
+ % don't want the following whatsit to end up in a preceding paragraph
+ % if the document didn't happen to have a blank line.
+ \par
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \global\let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ % Only insert the space after the number if we have a section number.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\lastsection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \lastsection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\lastsection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\lastsection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chapmacro.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chapmacro.
+ \donoderef{#3}%
+ %
+ % Interline glue will be inserted when the vbox is completed.
+ % That glue will be a valid breakpoint for the page, since it'll be
+ % preceded by a whatsit (usually from the \donoderef, or from the
+ % \writetocentry if there was no node). We don't want to allow that
+ % break, since then the whatsits could end up on page n while the
+ % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
+ \nobreak
+ %
+ % Output the actual section heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
+ }%
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
+ \nobreak
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.) However, when a paragraph is not started next
+ % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+ % or the negative glue will cause weirdly wrong output, typically
+ % obscuring the section heading with something else.
+ \vskip-\parskip
+ %
+ % This is so the last item on the main vertical list is a known
+ % \penalty > 10000, so \startdefun, etc., can recognize the situation
+ % and do the needful.
+ \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ {\atdummies
+ \edef\temp{%
+ \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+ \temp
+ }%
+ \fi
+ \fi
+ %
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf
+ \global\pdfmakepagedesttrue
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \global\pdfmakepagedesttrue
+ \fi
+ \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care. This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+ \catcode`\"=\active
+ \catcode`\$=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \catcode`\\=\active
+ \catcode`\^=\active
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+ \setupdatafile
+ \activecatcodes
+ \input \tocreadfilename
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \entryrightmargin=\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+% redefined for the two-volume lispref. We always output on
+% \jobname.toc even if this is redefined.
+%
+\def\tocreadfilename{\jobname.toc}
+
+% Normal (long) toc.
+%
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\partentry = \shortpartentry
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Parts, in the main contents. Replace the part number, which doesn't
+% exist, with an empty box. Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+ \penalty-300
+ \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+ \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ % Move the page numbers slightly to the right
+ \advance\entryrightmargin by -0.05em
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @tex ... @end tex escapes into raw TeX temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain @ character.
+
+\envdef\tex{%
+ \setupmarkupstyle{tex}%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \catcode `\`=\other
+ \catcode `\'=\other
+ %
+ % ' is active in math mode (mathcode"8000). So reset it, and all our
+ % other math active characters (just in case), to plain's definitions.
+ \mathactive
+ %
+ % Inverse of the list at the beginning of the file.
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\sp=\ptexsp
+ \let\*=\ptexstar
+ %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
+ \let\t=\ptext
+ \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ \ifnum\lastpenalty<10000
+ % Penalize breaking before the environment, because preceding text
+ % often leads into it.
+ \penalty100
+ \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+\def\afterenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ %
+ % If this cartouche directly follows a sectioning command, we need the
+ % \parskip glue (backspaced over by default) or the cartouche can
+ % collide with the section heading.
+ \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+ %
+ \setbox\groupbox=\vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of def\group.
+}
+\def\Ecartouche{%
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \addgroupbox
+ \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\newdimen\nonfillparindent
+\def\nonfillstart{%
+ \aboveenvbreak
+ \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ % Turn off paragraph indentation but redefine \indent to emulate
+ % the normal \indent.
+ \nonfillparindent=\parindent
+ \parindent = 0pt
+ \let\indent\nonfillindent
+ %
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \let\exdent=\nofillexdent
+}
+
+\begingroup
+\obeyspaces
+% We want to swallow spaces (but not other tokens) after the fake
+% @indent in our nonfill-environments, where spaces are normally
+% active and set to @tie, resulting in them not being ignored after
+% @indent.
+\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
+\gdef\nonfillindentcheck{%
+\ifx\temp %
+\expandafter\nonfillindentgobble%
+\else%
+\leavevmode\nonfillindentbox%
+\fi%
+}%
+\endgroup
+\def\nonfillindentgobble#1{\nonfillindent}
+\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ % end paragraph for sake of leading, in case document has no blank
+ % line. This is redundant with what happens in \aboveenvbreak, but
+ % we need to do it before changing the fonts, and it's inconvenient
+ % to change the fonts afterward.
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it in one command. #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+ \makedispenvdef{#1}{#3}%
+ \makedispenvdef{#2}{#3}%
+}
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvdef{lisp}{example}{%
+ \nonfillstart
+ \tt\setupmarkupstyle{example}%
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenvdef{display}{%
+ \nonfillstart
+ \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenvdef{format}{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \advance\leftskip by 0pt plus 1fill\relax
+ \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @raggedright does more-or-less normal line breaking but no right
+% justification. From plain.tex. Don't stretch around special
+% characters in urls in this environment, since the stretch at the right
+% should be enough.
+\envdef\raggedright{%
+ \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
+ \def\urefprestretchamount{0pt}%
+ \def\urefpoststretchamount{0pt}%
+}
+\let\Eraggedright\par
+
+\envdef\raggedleft{%
+ \parindent=0pt \leftskip0pt plus2em
+ \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+ \hbadness=10000 % Last line will usually be underfull, so turn off
+ % badness reporting.
+}
+\let\Eraggedleft\par
+
+\envdef\raggedcenter{%
+ \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
+ \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+ \hbadness=10000 % Last line will usually be underfull, so turn off
+ % badness reporting.
+}
+\let\Eraggedcenter\par
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\makedispenvdef{quotation}{\quotationstart}
+%
+\def\quotationstart{%
+ \indentedblockstart % same as \indentedblock, but increase right margin too.
+ \ifx\nonarrowing\relax
+ \advance\rightskip by \lispnarrowing
+ \fi
+ \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\thisisundefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallquotation{\Equotation}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
+}
+
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+%
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+ \par
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+ % Don't do the quotes -- if we do, @set txicodequoteundirected and
+ % @set txicodequotebacktick will not have effect on @verb and
+ % @verbatim, and ?` and !` ligatures won't get disabled.
+ %\do\`\do\'%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \setupmarkupstyle{verb}%
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion.
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs. The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group. Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset. Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
+%
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+ \divide\dimen\verbbox by\tabw
+ \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+ \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
+ \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
+ }%
+ }
+\endgroup
+
+% start the verbatim environment.
+\def\setupverbatim{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \tt % easiest (and conventionally used) font for verbatim
+ % The \leavevmode here is for blank lines. Otherwise, we would
+ % never \starttabox and the \egroup would end verbatim mode.
+ \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
+ \tabexpand
+ \setupmarkupstyle{verbatim}%
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count.
+ % Must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+ \input #1
+ \afterenvbreak
+ }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+ \begingroup
+ \parindent = 0pt % paragraph indentation looks wrong on title page
+ \scanexp\copyingtext
+ \endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+\newcount\defunpenalty
+
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
+ \defunpenalty=10003 % Will keep this @deffn together with the
+ % following @def command, see below.
+ \else
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check specifically for penalty 10002, inserted
+ % by \printdefunline, instead of 10000, since the sectioning
+ % commands also insert a nobreak penalty, and we don't want to allow
+ % a break between a section heading and a defun.
+ %
+ % As a further refinement, we avoid "club" headers by signalling
+ % with penalty of 10003 after the very first @deffn in the
+ % sequence (see above), and penalty of 10002 after any following
+ % @def command.
+ \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
+ \fi
+ %
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil\relax
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty\defunpenalty % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remaining is to define \deffnheader.
+%
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \doingtypefnfalse % distinguish typed functions from all else
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
+}
+
+\newif\ifdoingtypefn % doing typed function?
+\newif\ifrettypeownline % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line. This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+%
+\parseargdef\deftypefnnewline{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @txideftypefnnl value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \doingtypefntrue
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+% Types:
+
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ \par
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % Determine if we are typesetting the return type of a typed function
+ % on a line by itself.
+ \rettypeownlinefalse
+ \ifdoingtypefn % doing a typed function specifically?
+ % then check user option for putting return type on its own line:
+ \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+ \rettypeownlinetrue
+ \fi
+ \fi
+ %
+ % How we'll format the category name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape. We'll always have at
+ % least two.
+ \tempnum = 2
+ %
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ %
+ % If doing a return type on its own line, we'll have another line.
+ \ifrettypeownline
+ \advance\tempnum by 1
+ \def\maybeshapeline{0in \hsize}%
+ \else
+ \def\maybeshapeline{}%
+ \fi
+ %
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ %
+ % The final paragraph shape:
+ \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
+ %
+ % Put the category name at the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% text of the return type
+ \ifx\temp\empty\else
+ \tclose{\temp}% typeset the return type
+ \ifrettypeownline
+ % put return type on its own line; prohibit line break following:
+ \hfil\vadjust{\nobreak}\break
+ \else
+ \space % type on same line, so just followed by a space
+ \fi
+ \fi % no return type
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. We used to recommend @var for that, so
+ % leave the code in, but it's strange for @var to lead to typewriter.
+ % Nowadays we recommend @code, since the difference between a ttsl hyphen
+ % and a tt hyphen is pretty tiny. @code also disables ?` !`.
+ \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+ #1%
+ \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
+
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
+}
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
+}
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
+}
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+% these should not use \errmessage; the glibc manual, at least, actually
+% has such constructs (when documenting function pointers).
+\def\badparencount{%
+ \message{Warning: unbalanced parentheses in @def...}%
+ \global\parencount=0
+}
+\def\badbrackcount{%
+ \message{Warning: unbalanced square brackets in @def...}%
+ \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\thisisundefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
+\fi
+
+\let\aftermacroxxx\relax
+\def\aftermacro{\aftermacroxxx}
+
+% alias because \c means cedilla in @tex or @math
+\let\texinfoc=\c
+
+\newcount\savedcatcodeone
+\newcount\savedcatcodetwo
+
+% Used at the time of macro expansion.
+% Argument is macro body with arguments substituted
+\def\scanmacro#1{%
+ \newlinechar`\^^M
+ \def\xeatspaces{\eatspaces}%
+ %
+ % Temporarily undo catcode changes of \printindex. Set catcode of @ to
+ % 0 so that @-commands in macro expansions aren't printed literally when
+ % formatting an index file, where \ is used as the escape character.
+ \savedcatcodeone=\catcode`\@
+ \savedcatcodetwo=\catcode`\\
+ \catcode`\@=0
+ \catcode`\\=\active
+ %
+ % Process the macro body under the current catcode regime.
+ \scantokens{#1@texinfoc}\aftermacro%
+ %
+ \catcode`\@=\savedcatcodeone
+ \catcode`\\=\savedcatcodetwo
+ %
+ % The \texinfoc is to remove the \newlinechar added by \scantokens, and
+ % can be noticed by \parsearg.
+ % The \aftermacro allows a \comment at the end of the macro definition
+ % to duplicate itself past the final \newlinechar added by \scantokens:
+ % this is used in the definition of \group to comment out a newline. We
+ % don't do the same for \c to support Texinfo files with macros that ended
+ % with a @c, which should no longer be necessary.
+ % We avoid surrounding the call to \scantokens with \bgroup and \egroup
+ % to allow macros to open or close groups themselves.
+}
+
+% Used for copying and captions
+\def\scanexp#1{%
+ \expandafter\scanmacro\expandafter{#1}%
+}
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% List of all defined macros in the form
+% \commondummyword\macro1\commondummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+ \toks0 = \expandafter{\macrolist\commondummyword#1}%
+ \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+% \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
+% Non-ASCII encodings make 8-bit characters active, so un-activate
+% them to avoid their expansion. Must do this non-globally, to
+% confine the change to the current group.
+%
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+%
+\def\scanctxt{% used as subroutine
+ \catcode`\"=\other
+ \catcode`\+=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\~=\other
+ \passthroughcharstrue
+}
+
+\def\scanargctxt{% used for copying and captions, not macros.
+ \scanctxt
+ \catcode`\@=\other
+ \catcode`\\=\other
+ \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{% used for @macro definitions
+ \scanctxt
+ \catcode`\ =\other
+ \catcode`\@=\other
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\^^M=\other
+ \usembodybackslash
+}
+
+% Used when scanning braced macro arguments. Note, however, that catcode
+% changes here are ineffectual if the macro invocation was nested inside
+% an argument to another Texinfo command.
+\def\macroargctxt{%
+ \scanctxt
+ \catcode`\ =\active
+ \catcode`\^^M=\other
+ \catcode`\\=\active
+}
+
+\def\macrolineargctxt{% used for whole-line arguments without braces
+ \scanctxt
+ \catcode`\{=\other
+ \catcode`\}=\other
+}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+%
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\margbackslash#1{\char`\#1 }
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0\relax
+ \else
+ \expandafter\parsemargdef \argl;%
+ \if\paramno>256\relax
+ \ifx\eTeXversion\thisisundefined
+ \errhelp = \EMsimple
+ \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+ \fi
+ \fi
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{Macro name \the\macname\space already defined}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ \addtomacrolist{\the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\parseargdef\unmacro{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\commondummyword\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx #1\relax
+ % remove this
+ \else
+ \noexpand\commondummyword \noexpand#1%
+ \fi
+}
+
+% \getargs -- Parse the arguments to a @macro line. Set \macname to
+% the name of the macro, and \argl to the braced argument list.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname#1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+% This made use of the feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+
+% Parse the optional {params} list to @macro or @rmacro.
+% Set \paramno to the number of arguments,
+% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
+% three-param macro.) Define \macarg.BLAH for each BLAH in the params
+% list to some hook where the argument is to be expanded. If there are
+% less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.
+%
+% That gets used by \mbodybackslash (above).
+%
+% If there are 10 or more arguments, a different technique is used: see
+% \parsemmanyargdef.
+%
+\def\parsemargdef#1;{%
+ \paramno=0\def\paramlist{}%
+ \let\hash\relax
+ % \hash is redefined to `#' later to get it into definitions
+ \let\xeatspaces\relax
+ \parsemargdefxxx#1,;,%
+ \ifnum\paramno<10\relax\else
+ \paramno0\relax
+ \parsemmanyargdef@@#1,;,% 10 or more arguments
+ \fi
+}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% \parsemacbody, \parsermacbody
+%
+% Read recursive and nonrecursive macro bodies. (They're different since
+% rec and nonrec macros end differently.)
+%
+% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
+% body to be transformed.
+% Set \macrobody to the body of the macro, and call \defmacro.
+%
+{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
+\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
+{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
+\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
+
+% Make @ a letter, so that we can make private-to-Texinfo macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
+%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
+
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef the body (nothing else will expand because of
+% the catcode regime under which the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, no macro can have more than 256 arguments (else error).
+%
+% In case that there are 10 or more arguments we parse again the arguments
+% list to set new definitions for the \macarg.BLAH macros corresponding to
+% each BLAH argument. It was anyhow needed to parse already once this list
+% in order to count the arguments, and as macros with at most 9 arguments
+% are by far more frequent than macro with 10 or more arguments, defining
+% twice the \macarg.BLAH macros does not cost too much processing power.
+\def\parsemmanyargdef@@#1,{%
+ \if#1;\let\next=\relax
+ \else
+ \let\next=\parsemmanyargdef@@
+ \edef\tempb{\eatspaces{#1}}%
+ \expandafter\def\expandafter\tempa
+ \expandafter{\csname macarg.\tempb\endcsname}%
+ % Note that we need some extra \noexpand\noexpand, this is because we
+ % don't want \the to be expanded in the \parsermacbody as it uses an
+ % \xdef .
+ \expandafter\edef\tempa
+ {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+ \advance\paramno by 1\relax
+ \fi\next}
+
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition. It gets all the arguments' values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+ \def\macargdeflist@{}%
+ \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+ \def\paramlist{#2,\nil@}%
+ \def\macroname{#1}%
+ \begingroup
+ \macroargctxt
+ \def\argvaluelist{#3,\nil@}%
+ \def\@tempa{#3}%
+ \ifx\@tempa\empty
+ \setemptyargvalues@
+ \else
+ \getargvals@@
+ \fi
+}
+\def\getargvals@@{%
+ \ifx\paramlist\nilm@
+ % Some sanity check needed here that \argvaluelist is also empty.
+ \ifx\argvaluelist\nillm@
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Too many arguments in macro `\macroname'!}%
+ \fi
+ \let\next\macargexpandinbody@
+ \else
+ \ifx\argvaluelist\nillm@
+ % No more arguments values passed to macro. Set remaining named-arg
+ % macros to empty.
+ \let\next\setemptyargvalues@
+ \else
+ % pop current arg name into \@tempb
+ \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\paramlist}%
+ % pop current argument value into \@tempc
+ \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\argvaluelist}%
+ % Here \@tempb is the current arg name and \@tempc is the current arg value.
+ % First place the new argument macro definition into \@tempd
+ \expandafter\macname\expandafter{\@tempc}%
+ \expandafter\let\csname macarg.\@tempb\endcsname\relax
+ \expandafter\def\expandafter\@tempe\expandafter{%
+ \csname macarg.\@tempb\endcsname}%
+ \edef\@tempd{\long\def\@tempe{\the\macname}}%
+ \push@\@tempd\macargdeflist@
+ \let\next\getargvals@@
+ \fi
+ \fi
+ \next
+}
+
+\def\push@#1#2{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter{%
+ \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa.
+%
+\def\macvalstoargs@{%
+ % To do this we use the property that token registers that are \the'ed
+ % within an \edef expand only once. So we are going to place all argument
+ % values into respective token registers.
+ %
+ % First we save the token context, and initialize argument numbering.
+ \begingroup
+ \paramno0\relax
+ % Then, for each argument number #N, we place the corresponding argument
+ % value into a new token list register \toks#N
+ \expandafter\putargsintokens@\saveparamlist@,;,%
+ % Then, we expand the body so that argument are replaced by their
+ % values. The trick for values not to be expanded themselves is that they
+ % are within tokens and that tokens expand only once in an \edef .
+ \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+ % Now we restore the token stack pointer to free the token list registers
+ % which we have used, but we make sure that expanded body is saved after
+ % group.
+ \expandafter
+ \endgroup
+ \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+ }
+
+% Define the named-macro outside of this group and then close this group.
+%
+\def\macargexpandinbody@{%
+ \expandafter
+ \endgroup
+ \macargdeflist@
+ % First the replace in body the macro arguments by their values, the result
+ % is in \@tempa .
+ \macvalstoargs@
+ % Then we point at the \norecurse or \gobble (for recursive) macro value
+ % with \@tempb .
+ \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+ % Depending on whether it is recursive or not, we need some tailing
+ % \egroup .
+ \ifx\@tempb\gobble
+ \let\@tempc\relax
+ \else
+ \let\@tempc\egroup
+ \fi
+ % And now we do the real job:
+ \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+ \@tempd
+}
+
+\def\putargsintokens@#1,{%
+ \if#1;\let\next\relax
+ \else
+ \let\next\putargsintokens@
+ % First we allocate the new token list register, and give it a temporary
+ % alias \@tempb .
+ \toksdef\@tempb\the\paramno
+ % Then we place the argument value into that token list register.
+ \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+ \expandafter\@tempb\expandafter{\@tempa}%
+ \advance\paramno by 1\relax
+ \fi
+ \next
+}
+
+% Trailing missing arguments are set to empty.
+%
+\def\setemptyargvalues@{%
+ \ifx\paramlist\nilm@
+ \let\next\macargexpandinbody@
+ \else
+ \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+ \let\next\setemptyargvalues@
+ \fi
+ \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+ \expandafter\def\expandafter\@tempa\expandafter{%
+ \expandafter\def\csname macarg.#1\endcsname{}}%
+ \push@\@tempa\macargdeflist@
+ \def\paramlist{#2}%
+}
+
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+ \def#1{#3}%
+ \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+ \long\def#1{#3}%
+ \long\def#2{#4}%
+}
+
+
+%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
+
+
+% This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
+% \macrobody has the body of the macro in it, with placeholders for
+% its parameters, looking like "\xeatspaces{\hash 1}".
+% \paramno is the number of parameters
+% \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
+% There are four cases: macros of zero, one, up to nine, and many arguments.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in: @include reads the file inside a group.
+%
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifnum\paramno=1
+ \def\xeatspaces##1{##1}%
+ % This removes the pair of braces around the argument. We don't
+ % use \eatspaces, because this can cause ends of lines to be lost
+ % when the argument to \eatspaces is read, leading to line-based
+ % commands like "@itemize" not being read correctly.
+ \else
+ \let\xeatspaces\relax % suppress expansion
+ \fi
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\macrobody}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname @@@\endcsname}%
+ \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
+ \egroup
+ \noexpand\scanmacro{\macrobody}%
+ }%
+ \else % at most 9
+ \ifnum\paramno<10\relax
+ % @MACNAME sets the context for reading the macro argument
+ % @MACNAME@@ gets the argument, processes backslashes and appends a
+ % comma.
+ % @MACNAME@@@ removes braces surrounding the argument list.
+ % @MACNAME@@@@ scans the macro body with arguments substituted.
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup
+ \noexpand\expandafter % This \expandafter skip any spaces after the
+ \noexpand\macroargctxt % macro before we change the catcode of space.
+ \noexpand\expandafter
+ \expandafter\noexpand\csname\the\macname @@\endcsname}%
+ \expandafter\xdef\csname\the\macname @@\endcsname##1{%
+ \noexpand\passargtomacro
+ \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
+ \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname @@@@\endcsname\paramlist{%
+ \egroup\noexpand\scanmacro{\macrobody}}%
+ \else % 10 or more:
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+ \fi
+ \fi}
+
+\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
+@catcode`@_=11 % private names
+@catcode`@!=11 % used as argument separator
+
+% \passargtomacro#1#2 -
+% Call #1 with a list of tokens #2, with any doubled backslashes in #2
+% compressed to one.
+%
+% This implementation works by expansion, and not execution (so we cannot use
+% \def or similar). This reduces the risk of this failing in contexts where
+% complete expansion is done with no execution (for example, in writing out to
+% an auxiliary file for an index entry).
+%
+% State is kept in the input stream: the argument passed to
+% @look_ahead, @gobble_and_check_finish and @add_segment is
+%
+% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
+%
+% where:
+% THE_MACRO - name of the macro we want to call
+% ARG_RESULT - argument list we build to pass to that macro
+% PENDING_BS - either a backslash or nothing
+% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
+
+@gdef@passargtomacro#1#2{%
+ @add_segment #1!{}@relax#2\@_finish\%
+}
+@gdef@_finish{@_finishx} @global@let@_finishx@relax
+
+% #1 - THE_MACRO ARG_RESULT
+% #2 - PENDING_BS
+% #3 - NEXT_TOKEN
+% #4 used to look ahead
+%
+% If the next token is not a backslash, process the rest of the argument;
+% otherwise, remove the next token.
+@gdef@look_ahead#1!#2#3#4{%
+ @ifx#4\%
+ @expandafter@gobble_and_check_finish
+ @else
+ @expandafter@add_segment
+ @fi#1!{#2}#4#4%
+}
+
+% #1 - THE_MACRO ARG_RESULT
+% #2 - PENDING_BS
+% #3 - NEXT_TOKEN
+% #4 should be a backslash, which is gobbled.
+% #5 looks ahead
+%
+% Double backslash found. Add a single backslash, and look ahead.
+@gdef@gobble_and_check_finish#1!#2#3#4#5{%
+ @add_segment#1\!{}#5#5%
+}
+
+@gdef@is_fi{@fi}
+
+% #1 - THE_MACRO ARG_RESULT
+% #2 - PENDING_BS
+% #3 - NEXT_TOKEN
+% #4 is input stream until next backslash
+%
+% Input stream is either at the start of the argument, or just after a
+% backslash sequence, either a lone backslash, or a doubled backslash.
+% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
+% finish; otherwise, append to ARG_RESULT the segment of the argument up until
+% the next backslash. PENDING_BACKSLASH contains a backslash to represent
+% a backslash just before the start of the input stream that has not been
+% added to ARG_RESULT.
+@gdef@add_segment#1!#2#3#4\{%
+@ifx#3@_finish
+ @call_the_macro#1!%
+@else
+ % append the pending backslash to the result, followed by the next segment
+ @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
+ % this @fi is discarded by @look_ahead.
+ % we can't get rid of it with \expandafter because we don't know how
+ % long #4 is.
+}
+
+% #1 - THE_MACRO
+% #2 - ARG_RESULT
+% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
+% conditional.
+@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
+
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \braceorline MAC is used for a one-argument macro MAC. It checks
+% whether the next non-whitespace character is a {. It sets the context
+% for reading the argument (slightly different in the two cases). Then,
+% to read the argument, in the whole-line case, it then calls the regular
+% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
+%
+\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup
+ \macroargctxt
+ \expandafter\passargtomacro
+ \else
+ \macrolineargctxt\expandafter\parsearg
+ \fi \macnamexxx}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Make them active and then expand them all to nothing.
+%
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \addtomacrolist{#1}%
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{%
+ \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references. The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross, , , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
+ \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \lastsection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+ \pdfmkdest{#1}%
+ \iflinks
+ {%
+ \requireauxfile
+ \atdummies % preserve commands, but don't expand them
+ % match definition in \xrdef, \refx, \xrefX.
+ \def\value##1{##1}%
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\lastsection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
+ }%
+ \fi
+}
+
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+%
+\parseargdef\xrefautomaticsectiontitle{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+%
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref{\putwordsee{} \xrefXX}
+\def\xref{\putwordSee{} \xrefXX}
+\def\ref{\xrefXX}
+
+\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
+\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ %
+ % Get args without leading/trailing spaces.
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+ %
+ \def\infofilename{\ignorespaces #4}%
+ \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+ %
+ \def\printedmanual{\ignorespaces #5}%
+ \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
+ %
+ % If the printed reference name (arg #3) was not explicitly given in
+ % the @xref, figure out what we want to use.
+ \ifdim \wd\printedrefnamebox = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+ % Not auto section-title: use node name inside the square brackets.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ % Auto section-title: use chapter/section title inside
+ % the square brackets if we have it.
+ \ifdim \wd\printedmanualbox > 0pt
+ % It is in another manual, so we don't have it; use node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We (should) know the real title if we have the xref values.
+ \def\printedrefname{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % Make link in pdf output.
+ \ifpdf
+ % For pdfTeX and LuaTeX
+ {\indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
+ \getfilename{#4}%
+ %
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \setpdfdestname{#1}%
+ %
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{Top}% no empty targets
+ \fi
+ %
+ \leavevmode
+ \startlink attr{/Border [0 0 0]}%
+ \ifnum\filenamelength>0
+ goto file{\the\filename.pdf} name{\pdfdestname}%
+ \else
+ goto name{\pdfmkpgn{\pdfdestname}}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ % For XeTeX
+ {\indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
+ \getfilename{#4}%
+ %
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \setpdfdestname{#1}%
+ %
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{Top}% no empty targets
+ \fi
+ %
+ \leavevmode
+ \ifnum\filenamelength>0
+ % With default settings,
+ % XeTeX (xdvipdfmx) replaces link destination names with integers.
+ % In this case, the replaced destination names of
+ % remote PDFs are no longer known. In order to avoid a replacement,
+ % you can use xdvipdfmx's command line option `-C 0x0010'.
+ % If you use XeTeX 0.99996+ (TeX Live 2016+),
+ % this command line option is no longer necessary
+ % because we can use the `dvipdfmx:config' special.
+ \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
+ \else
+ \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /GoTo /D (\pdfdestname) >> >>}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \fi
+ \fi
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \def\value##1{##1}%
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ %
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". \iffloat distinguishes them by
+ % \Xthisreftitle being set to a magic string.
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd\printedrefnamebox = 0pt
+ \refx{#1-snt}{}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % If the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd\printedmanualbox > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
+ \else
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox to print the node names, TeX does not insert
+ % empty discretionaries after hyphens, which means that it will not
+ % find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens,
+ % this is a loss. Therefore, we give the text of the node name
+ % again, so it is as if TeX is seeing it for the first time.
+ %
+ \ifdim \wd\printedmanualbox > 0pt
+ % Cross-manual reference with a printed manual name.
+ %
+ \crossmanualxref{\cite{\printedmanual\unskip}}%
+ %
+ \else\ifdim \wd\infofilenamebox > 0pt
+ % Cross-manual reference with only an info filename (arg 4), no
+ % printed manual name (arg 5). This is essentially the same as
+ % the case above; we output the filename, since we have nothing else.
+ %
+ \crossmanualxref{\code{\infofilename\unskip}}%
+ %
+ \else
+ % Reference within this manual.
+ %
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via the macro below so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ % Add a , if xref followed by a space
+ \if\space\noexpand\tokenafterxref ,%
+ \else\ifx\ \tokenafterxref ,% @TAB
+ \else\ifx\*\tokenafterxref ,% @*
+ \else\ifx\ \tokenafterxref ,% @SPACE
+ \else\ifx\
+ \tokenafterxref ,% @NL
+ \else\ifx\tie\tokenafterxref ,% @tie
+ \fi\fi\fi\fi\fi\fi
+ \fi\fi
+ \fi
+ \endlink
+\endgroup}
+
+% Output a cross-manual xref to #1. Used just above (twice).
+%
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+%
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input. By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font). Hopefully it will never happen in practice.
+%
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+%
+\def\crossmanualxref#1{%
+ \setbox\toprefbox = \hbox{Top\kern7sp}%
+ \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+ \ifdim \wd2 > 7sp % nonempty?
+ \ifdim \wd2 = \wd\toprefbox \else % same as Top?
+ \putwordSection{} ``\printedrefname'' \putwordin{}\space
+ \fi
+ \fi
+ #1%
+}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+\def\Yappendix{%
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+
+% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX
+% is output afterwards if non-empty.
+\def\refx#1#2{%
+ \requireauxfile
+ {%
+ \indexnofonts
+ \otherbackslash
+ \def\value##1{##1}%
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname XR#1\endcsname
+ }%
+ \ifx\thisrefX\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ {\toks0 = {#1}% avoid expansion of possibly-complex value
+ \message{\linenumber Undefined cross reference `\the\toks0'.}}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \thisrefX
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file. Define a control
+% sequence for a cross-reference target (we prepend XR to the control sequence
+% name to avoid collisions). The value is the page number. If this is a float
+% type, we have more work to do.
+%
+\def\xrdef#1#2{%
+ {% Expand the node or anchor name to remove control sequences.
+ % \turnoffactive stops 8-bit characters being changed to commands
+ % like @'e. \refx does the same to retrieve the value in the definition.
+ \indexnofonts
+ \turnoffactive
+ \def\value##1{##1}%
+ \xdef\safexrefname{#1}%
+ }%
+ %
+ \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR\safexrefname\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
+ {\safexrefname}}%
+ \fi
+}
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate at the beginning of the file.
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% Used when writing to the aux file, or when using data from it.
+\def\requireauxfile{%
+ \iflinks
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
+ \fi
+ \global\let\requireauxfile=\relax % Only do this once.
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readdatafile{aux}%
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
+\def\setupdatafile{%
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % @ is our escape character in .aux files, and we need braces.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+ \setupdatafile
+ \input\jobname.#1
+\endgroup}
+
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for Info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\gdef\dofootnote{%
+ \insert\footins\bgroup
+ %
+ % Nested footnotes are not supported in TeX, that would take a lot
+ % more work. (\startsavinginserts does not suffice.)
+ \let\footnote=\errfootnotenest
+ %
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \hsize=\txipagewidth
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ %
+ % Invoke rest of plain TeX footnote routine.
+ \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+\def\errfootnotenest{%
+ \errhelp=\EMsimple
+ \errmessage{Nested footnotes not supported in texinfo.tex,
+ even though they work in makeinfo; sorry}
+}
+
+\def\errfootnoteheading{%
+ \errhelp=\EMsimple
+ \errmessage{Footnotes in chapters, sections, etc., are not supported}
+}
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarly, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+%
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\thisisundefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \else \ifx\centersub\centerV
+ % for @center @image, we need a vbox so we can have our vertical space
+ \imagevmodetrue
+ \vbox\bgroup % vbox has better behavior than vtop herev
+ \fi\fi
+ %
+ \ifimagevmode
+ \nobreak\medskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \fi
+ %
+ % Leave vertical mode so that indentation from an enclosing
+ % environment such as @quotation is respected.
+ % However, if we're at the top level, we don't want the
+ % normal paragraph indentation.
+ % On the other hand, if we are in the case of @center @image, we don't
+ % want to start a paragraph, which will create a hsize-width box and
+ % eradicate the centering.
+ \ifx\centersub\centerV\else \noindent \fi
+ %
+ % Output the image.
+ \ifpdf
+ % For pdfTeX and LuaTeX <= 0.80
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ % For epsf.tex
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \else
+ % For XeTeX
+ \doxeteximage{#1}{#2}{#3}%
+ \fi
+ \fi
+ %
+ \ifimagevmode
+ \medskip % space after a standalone image
+ \fi
+ \ifx\centersub\centerV \egroup \fi
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc. We don't actually implement floating yet, we always include the
+% float "here". But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \startsavinginserts
+ %
+ % We can't be used inside a paragraph.
+ \par
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \lastsection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\lastsection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline{\scanexp\thiscaption}%
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ %
+ % Space below caption.
+ \vskip\parskip
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \requireauxfile
+ \atdummies
+ %
+ \ifx\thisshortcaption\empty
+ \def\gtemp{\thiscaption}%
+ \else
+ \def\gtemp{\thisshortcaption}%
+ \fi
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
+ }%
+ \fi
+ \egroup % end of \vtop
+ %
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \lastsection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
+
+\message{localization,}
+
+% For single-language documents, @documentlanguage is usually given very
+% early, just after @documentencoding. Single argument is the language
+% (de) or locale (de_DE) abbreviation.
+%
+{
+ \catcode`\_ = \active
+ \globaldefs=1
+\parseargdef\documentlanguage{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file by the name they passed if it exists.
+ \let_ = \normalunderscore % normal _ character for filename test
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \documentlanguagetrywithoutunderscore #1_\finish
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+ \endgroup % end raw TeX
+}
+%
+% If they passed de_DE, and txi-de_DE.tex doesn't exist,
+% try txi-de.tex.
+%
+\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+}
+}% end of special _ catcode
+%
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? Putting it in the current
+directory should work if nowhere else does.}
+
+% This macro is called from txi-??.tex files; the first argument is the
+% \language name to set (without the "\lang@" prefix), the second and
+% third args are \{left,right}hyphenmin.
+%
+% The language names to pass are determined when the format is built.
+% See the etex.log file created at that time, e.g.,
+% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
+%
+% With TeX Live 2008, etex now includes hyphenation patterns for all
+% available languages. This means we can support hyphenation in
+% Texinfo, at least to some extent. (This still doesn't solve the
+% accented characters problem.)
+%
+\catcode`@=11
+\def\txisetlanguage#1#2#3{%
+ % do not set the language if the name is undefined in the current TeX.
+ \expandafter\ifx\csname lang@#1\endcsname \relax
+ \message{no patterns for #1}%
+ \else
+ \global\language = \csname lang@#1\endcsname
+ \fi
+ % but there is no harm in adjusting the hyphenmin values regardless.
+ \global\lefthyphenmin = #2\relax
+ \global\righthyphenmin = #3\relax
+}
+
+% XeTeX and LuaTeX can handle Unicode natively.
+% Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
+% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
+%
+\newif\iftxinativeunicodecapable
+\newif\iftxiusebytewiseio
+
+\ifx\XeTeXrevision\thisisundefined
+ \ifx\luatexversion\thisisundefined
+ \txinativeunicodecapablefalse
+ \txiusebytewiseiotrue
+ \else
+ \txinativeunicodecapabletrue
+ \txiusebytewiseiofalse
+ \fi
+\else
+ \txinativeunicodecapabletrue
+ \txiusebytewiseiofalse
+\fi
+
+% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
+% for non-UTF-8 (byte-wise) encodings.
+%
+\def\setbytewiseio{%
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \XeTeXdefaultencoding "bytes" % For subsequent files to be read
+ \XeTeXinputencoding "bytes" % For document root file
+ % Unfortunately, there seems to be no corresponding XeTeX command for
+ % output encoding. This is a problem for auxiliary index and TOC files.
+ % The only solution would be perhaps to write out @U{...} sequences in
+ % place of non-ASCII characters.
+ \fi
+
+ \ifx\luatexversion\thisisundefined
+ \else
+ \directlua{
+ local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
+ local function convert_char (char)
+ return utf8_char(byte(char))
+ end
+
+ local function convert_line (line)
+ return gsub(line, ".", convert_char)
+ end
+
+ callback.register("process_input_buffer", convert_line)
+
+ local function convert_line_out (line)
+ local line_out = ""
+ for c in string.utfvalues(line) do
+ line_out = line_out .. string.char(c)
+ end
+ return line_out
+ end
+
+ callback.register("process_output_buffer", convert_line_out)
+ }
+ \fi
+
+ \txiusebytewiseiotrue
+}
+
+
+% Helpers for encodings.
+% Set the catcode of characters 128 through 255 to the specified number.
+%
+\def\setnonasciicharscatcode#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \global\catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+\def\setnonasciicharscatcodenonglobal#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+% @documentencoding sets the definition of non-ASCII characters
+% according to the specified encoding.
+%
+\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
+\def\documentencodingzzz#1{%
+ %
+ % Encoding being declared for the document.
+ \def\declaredencoding{\csname #1.enc\endcsname}%
+ %
+ % Supported encodings: names converted to tokens in order to be able
+ % to compare them with \ifx.
+ \def\ascii{\csname US-ASCII.enc\endcsname}%
+ \def\latnine{\csname ISO-8859-15.enc\endcsname}%
+ \def\latone{\csname ISO-8859-1.enc\endcsname}%
+ \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
+ \def\utfeight{\csname UTF-8.enc\endcsname}%
+ %
+ \ifx \declaredencoding \ascii
+ \asciichardefs
+ %
+ \else \ifx \declaredencoding \lattwo
+ \iftxinativeunicodecapable
+ \setbytewiseio
+ \fi
+ \setnonasciicharscatcode\active
+ \lattwochardefs
+ %
+ \else \ifx \declaredencoding \latone
+ \iftxinativeunicodecapable
+ \setbytewiseio
+ \fi
+ \setnonasciicharscatcode\active
+ \latonechardefs
+ %
+ \else \ifx \declaredencoding \latnine
+ \iftxinativeunicodecapable
+ \setbytewiseio
+ \fi
+ \setnonasciicharscatcode\active
+ \latninechardefs
+ %
+ \else \ifx \declaredencoding \utfeight
+ \iftxinativeunicodecapable
+ % For native Unicode handling (XeTeX and LuaTeX)
+ \nativeunicodechardefs
+ \else
+ % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
+ \setnonasciicharscatcode\active
+ % since we already invoked \utfeightchardefs at the top level
+ % (below), do not re-invoke it, otherwise our check for duplicated
+ % definitions gets triggered. Making non-ascii chars active is
+ % sufficient.
+ \fi
+ %
+ \else
+ \message{Ignoring unknown document encoding: #1.}%
+ %
+ \fi % utfeight
+ \fi % latnine
+ \fi % latone
+ \fi % lattwo
+ \fi % ascii
+ %
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \ifx \declaredencoding \utfeight
+ \else
+ \ifx \declaredencoding \ascii
+ \else
+ \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
+ non-ASCII characters in auxiliary files.}%
+ \fi
+ \fi
+ \fi
+}
+
+% emacs-page
+% A message to be logged when using a character that isn't available
+% the default font encoding (OT1).
+%
+\def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
+
+% Take account of \c (plain) vs. \, (Texinfo) difference.
+\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
+
+% First, make active non-ASCII characters in order for them to be
+% correctly categorized when TeX reads the replacement text of
+% macros containing the character definitions.
+\setnonasciicharscatcode\active
+%
+
+\def\gdefchar#1#2{%
+\gdef#1{%
+ \ifpassthroughchars
+ \string#1%
+ \else
+ #2%
+ \fi
+}}
+
+% Latin1 (ISO-8859-1) character definitions.
+\def\latonechardefs{%
+ \gdefchar^^a0{\tie}
+ \gdefchar^^a1{\exclamdown}
+ \gdefchar^^a2{{\tcfont \char162}} % cent
+ \gdefchar^^a3{\pounds}
+ \gdefchar^^a4{{\tcfont \char164}} % currency
+ \gdefchar^^a5{{\tcfont \char165}} % yen
+ \gdefchar^^a6{{\tcfont \char166}} % broken bar
+ \gdefchar^^a7{\S}
+ \gdefchar^^a8{\"{}}
+ \gdefchar^^a9{\copyright}
+ \gdefchar^^aa{\ordf}
+ \gdefchar^^ab{\guillemetleft}
+ \gdefchar^^ac{\ensuremath\lnot}
+ \gdefchar^^ad{\-}
+ \gdefchar^^ae{\registeredsymbol}
+ \gdefchar^^af{\={}}
+ %
+ \gdefchar^^b0{\textdegree}
+ \gdefchar^^b1{$\pm$}
+ \gdefchar^^b2{$^2$}
+ \gdefchar^^b3{$^3$}
+ \gdefchar^^b4{\'{}}
+ \gdefchar^^b5{$\mu$}
+ \gdefchar^^b6{\P}
+ \gdefchar^^b7{\ensuremath\cdot}
+ \gdefchar^^b8{\cedilla\ }
+ \gdefchar^^b9{$^1$}
+ \gdefchar^^ba{\ordm}
+ \gdefchar^^bb{\guillemetright}
+ \gdefchar^^bc{$1\over4$}
+ \gdefchar^^bd{$1\over2$}
+ \gdefchar^^be{$3\over4$}
+ \gdefchar^^bf{\questiondown}
+ %
+ \gdefchar^^c0{\`A}
+ \gdefchar^^c1{\'A}
+ \gdefchar^^c2{\^A}
+ \gdefchar^^c3{\~A}
+ \gdefchar^^c4{\"A}
+ \gdefchar^^c5{\ringaccent A}
+ \gdefchar^^c6{\AE}
+ \gdefchar^^c7{\cedilla C}
+ \gdefchar^^c8{\`E}
+ \gdefchar^^c9{\'E}
+ \gdefchar^^ca{\^E}
+ \gdefchar^^cb{\"E}
+ \gdefchar^^cc{\`I}
+ \gdefchar^^cd{\'I}
+ \gdefchar^^ce{\^I}
+ \gdefchar^^cf{\"I}
+ %
+ \gdefchar^^d0{\DH}
+ \gdefchar^^d1{\~N}
+ \gdefchar^^d2{\`O}
+ \gdefchar^^d3{\'O}
+ \gdefchar^^d4{\^O}
+ \gdefchar^^d5{\~O}
+ \gdefchar^^d6{\"O}
+ \gdefchar^^d7{$\times$}
+ \gdefchar^^d8{\O}
+ \gdefchar^^d9{\`U}
+ \gdefchar^^da{\'U}
+ \gdefchar^^db{\^U}
+ \gdefchar^^dc{\"U}
+ \gdefchar^^dd{\'Y}
+ \gdefchar^^de{\TH}
+ \gdefchar^^df{\ss}
+ %
+ \gdefchar^^e0{\`a}
+ \gdefchar^^e1{\'a}
+ \gdefchar^^e2{\^a}
+ \gdefchar^^e3{\~a}
+ \gdefchar^^e4{\"a}
+ \gdefchar^^e5{\ringaccent a}
+ \gdefchar^^e6{\ae}
+ \gdefchar^^e7{\cedilla c}
+ \gdefchar^^e8{\`e}
+ \gdefchar^^e9{\'e}
+ \gdefchar^^ea{\^e}
+ \gdefchar^^eb{\"e}
+ \gdefchar^^ec{\`{\dotless i}}
+ \gdefchar^^ed{\'{\dotless i}}
+ \gdefchar^^ee{\^{\dotless i}}
+ \gdefchar^^ef{\"{\dotless i}}
+ %
+ \gdefchar^^f0{\dh}
+ \gdefchar^^f1{\~n}
+ \gdefchar^^f2{\`o}
+ \gdefchar^^f3{\'o}
+ \gdefchar^^f4{\^o}
+ \gdefchar^^f5{\~o}
+ \gdefchar^^f6{\"o}
+ \gdefchar^^f7{$\div$}
+ \gdefchar^^f8{\o}
+ \gdefchar^^f9{\`u}
+ \gdefchar^^fa{\'u}
+ \gdefchar^^fb{\^u}
+ \gdefchar^^fc{\"u}
+ \gdefchar^^fd{\'y}
+ \gdefchar^^fe{\th}
+ \gdefchar^^ff{\"y}
+}
+
+% Latin9 (ISO-8859-15) encoding character definitions.
+\def\latninechardefs{%
+ % Encoding is almost identical to Latin1.
+ \latonechardefs
+ %
+ \gdefchar^^a4{\euro}
+ \gdefchar^^a6{\v S}
+ \gdefchar^^a8{\v s}
+ \gdefchar^^b4{\v Z}
+ \gdefchar^^b8{\v z}
+ \gdefchar^^bc{\OE}
+ \gdefchar^^bd{\oe}
+ \gdefchar^^be{\"Y}
+}
+
+% Latin2 (ISO-8859-2) character definitions.
+\def\lattwochardefs{%
+ \gdefchar^^a0{\tie}
+ \gdefchar^^a1{\ogonek{A}}
+ \gdefchar^^a2{\u{}}
+ \gdefchar^^a3{\L}
+ \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdefchar^^a5{\v L}
+ \gdefchar^^a6{\'S}
+ \gdefchar^^a7{\S}
+ \gdefchar^^a8{\"{}}
+ \gdefchar^^a9{\v S}
+ \gdefchar^^aa{\cedilla S}
+ \gdefchar^^ab{\v T}
+ \gdefchar^^ac{\'Z}
+ \gdefchar^^ad{\-}
+ \gdefchar^^ae{\v Z}
+ \gdefchar^^af{\dotaccent Z}
+ %
+ \gdefchar^^b0{\textdegree}
+ \gdefchar^^b1{\ogonek{a}}
+ \gdefchar^^b2{\ogonek{ }}
+ \gdefchar^^b3{\l}
+ \gdefchar^^b4{\'{}}
+ \gdefchar^^b5{\v l}
+ \gdefchar^^b6{\'s}
+ \gdefchar^^b7{\v{}}
+ \gdefchar^^b8{\cedilla\ }
+ \gdefchar^^b9{\v s}
+ \gdefchar^^ba{\cedilla s}
+ \gdefchar^^bb{\v t}
+ \gdefchar^^bc{\'z}
+ \gdefchar^^bd{\H{}}
+ \gdefchar^^be{\v z}
+ \gdefchar^^bf{\dotaccent z}
+ %
+ \gdefchar^^c0{\'R}
+ \gdefchar^^c1{\'A}
+ \gdefchar^^c2{\^A}
+ \gdefchar^^c3{\u A}
+ \gdefchar^^c4{\"A}
+ \gdefchar^^c5{\'L}
+ \gdefchar^^c6{\'C}
+ \gdefchar^^c7{\cedilla C}
+ \gdefchar^^c8{\v C}
+ \gdefchar^^c9{\'E}
+ \gdefchar^^ca{\ogonek{E}}
+ \gdefchar^^cb{\"E}
+ \gdefchar^^cc{\v E}
+ \gdefchar^^cd{\'I}
+ \gdefchar^^ce{\^I}
+ \gdefchar^^cf{\v D}
+ %
+ \gdefchar^^d0{\DH}
+ \gdefchar^^d1{\'N}
+ \gdefchar^^d2{\v N}
+ \gdefchar^^d3{\'O}
+ \gdefchar^^d4{\^O}
+ \gdefchar^^d5{\H O}
+ \gdefchar^^d6{\"O}
+ \gdefchar^^d7{$\times$}
+ \gdefchar^^d8{\v R}
+ \gdefchar^^d9{\ringaccent U}
+ \gdefchar^^da{\'U}
+ \gdefchar^^db{\H U}
+ \gdefchar^^dc{\"U}
+ \gdefchar^^dd{\'Y}
+ \gdefchar^^de{\cedilla T}
+ \gdefchar^^df{\ss}
+ %
+ \gdefchar^^e0{\'r}
+ \gdefchar^^e1{\'a}
+ \gdefchar^^e2{\^a}
+ \gdefchar^^e3{\u a}
+ \gdefchar^^e4{\"a}
+ \gdefchar^^e5{\'l}
+ \gdefchar^^e6{\'c}
+ \gdefchar^^e7{\cedilla c}
+ \gdefchar^^e8{\v c}
+ \gdefchar^^e9{\'e}
+ \gdefchar^^ea{\ogonek{e}}
+ \gdefchar^^eb{\"e}
+ \gdefchar^^ec{\v e}
+ \gdefchar^^ed{\'{\dotless{i}}}
+ \gdefchar^^ee{\^{\dotless{i}}}
+ \gdefchar^^ef{\v d}
+ %
+ \gdefchar^^f0{\dh}
+ \gdefchar^^f1{\'n}
+ \gdefchar^^f2{\v n}
+ \gdefchar^^f3{\'o}
+ \gdefchar^^f4{\^o}
+ \gdefchar^^f5{\H o}
+ \gdefchar^^f6{\"o}
+ \gdefchar^^f7{$\div$}
+ \gdefchar^^f8{\v r}
+ \gdefchar^^f9{\ringaccent u}
+ \gdefchar^^fa{\'u}
+ \gdefchar^^fb{\H u}
+ \gdefchar^^fc{\"u}
+ \gdefchar^^fd{\'y}
+ \gdefchar^^fe{\cedilla t}
+ \gdefchar^^ff{\dotaccent{}}
+}
+
+% UTF-8 character definitions.
+%
+% This code to support UTF-8 is based on LaTeX's utf8.def, with some
+% changes for Texinfo conventions. It is included here under the GPL by
+% permission from Frank Mittelbach and the LaTeX team.
+%
+\newcount\countUTFx
+\newcount\countUTFy
+\newcount\countUTFz
+
+\gdef\UTFviiiTwoOctets#1#2{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\endcsname}
+%
+\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
+%
+\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
+
+\gdef\UTFviiiDefined#1{%
+ \ifx #1\relax
+ \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
+ \else
+ \expandafter #1%
+ \fi
+}
+
+% Give non-ASCII bytes the active definitions for processing UTF-8 sequences
+\begingroup
+ \catcode`\~13
+ \catcode`\$12
+ \catcode`\"12
+
+ % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
+ % substituting ~ and $ with a character token of that value.
+ \def\UTFviiiLoop{%
+ \global\catcode\countUTFx\active
+ \uccode`\~\countUTFx
+ \uccode`\$\countUTFx
+ \uppercase\expandafter{\UTFviiiTmp}%
+ \advance\countUTFx by 1
+ \ifnum\countUTFx < \countUTFy
+ \expandafter\UTFviiiLoop
+ \fi}
+
+ % For bytes other than the first in a UTF-8 sequence. Not expected to
+ % be expanded except when writing to auxiliary files.
+ \countUTFx = "80
+ \countUTFy = "C2
+ \def\UTFviiiTmp{%
+ \gdef~{%
+ \ifpassthroughchars $\fi}}%
+ \UTFviiiLoop
+
+ \countUTFx = "C2
+ \countUTFy = "E0
+ \def\UTFviiiTmp{%
+ \gdef~{%
+ \ifpassthroughchars $%
+ \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
+ \UTFviiiLoop
+
+ \countUTFx = "E0
+ \countUTFy = "F0
+ \def\UTFviiiTmp{%
+ \gdef~{%
+ \ifpassthroughchars $%
+ \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
+ \UTFviiiLoop
+
+ \countUTFx = "F0
+ \countUTFy = "F4
+ \def\UTFviiiTmp{%
+ \gdef~{%
+ \ifpassthroughchars $%
+ \else\expandafter\UTFviiiFourOctets\expandafter$\fi
+ }}%
+ \UTFviiiLoop
+\endgroup
+
+\def\globallet{\global\let} % save some \expandafter's below
+
+% @U{xxxx} to produce U+xxxx, if we support it.
+\def\U#1{%
+ \expandafter\ifx\csname uni:#1\endcsname \relax
+ \iftxinativeunicodecapable
+ % All Unicode characters can be used if native Unicode handling is
+ % active. However, if the font does not have the glyph,
+ % letters are missing.
+ \begingroup
+ \uccode`\.="#1\relax
+ \uppercase{.}
+ \endgroup
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unicode character U+#1 not supported, sorry}%
+ \fi
+ \else
+ \csname uni:#1\endcsname
+ \fi
+}
+
+% These macros are used here to construct the name of a control
+% sequence to be defined.
+\def\UTFviiiTwoOctetsName#1#2{%
+ \csname u8:#1\string #2\endcsname}%
+\def\UTFviiiThreeOctetsName#1#2#3{%
+ \csname u8:#1\string #2\string #3\endcsname}%
+\def\UTFviiiFourOctetsName#1#2#3#4{%
+ \csname u8:#1\string #2\string #3\string #4\endcsname}%
+
+% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
+% provide a definition macro to replace a Unicode character;
+% this gets used by the @U command
+%
+\begingroup
+ \catcode`\"=12
+ \catcode`\<=12
+ \catcode`\.=12
+ \catcode`\,=12
+ \catcode`\;=12
+ \catcode`\!=12
+ \catcode`\~=13
+ \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
+ \countUTFz = "#1\relax
+ \begingroup
+ \parseXMLCharref
+
+ % Give \u8:... its definition. The sequence of seven \expandafter's
+ % expands after the \gdef three times, e.g.
+ %
+ % 1. \UTFviiTwoOctetsName B1 B2
+ % 2. \csname u8:B1 \string B2 \endcsname
+ % 3. \u8: B1 B2 (a single control sequence token)
+ %
+ \expandafter\expandafter
+ \expandafter\expandafter
+ \expandafter\expandafter
+ \expandafter\gdef \UTFviiiTmp{#2}%
+ %
+ \expandafter\ifx\csname uni:#1\endcsname \relax \else
+ \message{Internal error, already defined: #1}%
+ \fi
+ %
+ % define an additional control sequence for this code point.
+ \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
+ \endgroup}
+ %
+ % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp
+ % to the corresponding UTF-8 sequence.
+ \gdef\parseXMLCharref{%
+ \ifnum\countUTFz < "A0\relax
+ \errhelp = \EMsimple
+ \errmessage{Cannot define Unicode char value < 00A0}%
+ \else\ifnum\countUTFz < "800\relax
+ \parseUTFviiiA,%
+ \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
+ \else\ifnum\countUTFz < "10000\relax
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
+ \else
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiA!%
+ \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
+ \fi\fi\fi
+ }
+
+ % Extract a byte from the end of the UTF-8 representation of \countUTFx.
+ % It must be a non-initial byte in the sequence.
+ % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
+ % of the bytes.
+ \gdef\parseUTFviiiA#1{%
+ \countUTFx = \countUTFz
+ \divide\countUTFz by 64
+ \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
+ \multiply\countUTFz by 64
+
+ % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
+ % in order to get the last five bits.
+ \advance\countUTFx by -\countUTFz
+
+ % Convert this to the byte in the UTF-8 sequence.
+ \advance\countUTFx by 128
+ \uccode `#1\countUTFx
+ \countUTFz = \countUTFy}
+
+ % Used to put a UTF-8 byte sequence into \UTFviiiTmp
+ % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
+ % sequence.
+ % #2 is one of the \UTFviii*OctetsName macros.
+ % #3 is always a full stop (.)
+ % #4 is a template for the other bytes in the sequence. The values for these
+ % bytes is substituted in here with \uppercase using the \uccode's.
+ \gdef\parseUTFviiiB#1#2#3#4{%
+ \advance\countUTFz by "#10\relax
+ \uccode `#3\countUTFz
+ \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
+\endgroup
+
+% For native Unicode handling (XeTeX and LuaTeX),
+% provide a definition macro that sets a catcode to `other' non-globally
+%
+\def\DeclareUnicodeCharacterNativeOther#1#2{%
+ \catcode"#1=\other
+}
+
+% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
+% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
+% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
+% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
+% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
+%
+% Many of our renditions are less than wonderful, and all the missing
+% characters are available somewhere. Loading the necessary fonts
+% awaits user request. We can't truly support Unicode without
+% reimplementing everything that's been done in LaTeX for many years,
+% plus probably using luatex or xetex, and who knows what else.
+% We won't be doing that here in this simple file. But we can try to at
+% least make most of the characters not bomb out.
+%
+\def\unicodechardefs{%
+ \DeclareUnicodeCharacter{00A0}{\tie}%
+ \DeclareUnicodeCharacter{00A1}{\exclamdown}%
+ \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
+ \DeclareUnicodeCharacter{00A3}{\pounds}%
+ \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
+ \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
+ \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
+ \DeclareUnicodeCharacter{00A7}{\S}%
+ \DeclareUnicodeCharacter{00A8}{\"{ }}%
+ \DeclareUnicodeCharacter{00A9}{\copyright}%
+ \DeclareUnicodeCharacter{00AA}{\ordf}%
+ \DeclareUnicodeCharacter{00AB}{\guillemetleft}%
+ \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
+ \DeclareUnicodeCharacter{00AD}{\-}%
+ \DeclareUnicodeCharacter{00AE}{\registeredsymbol}%
+ \DeclareUnicodeCharacter{00AF}{\={ }}%
+ %
+ \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
+ \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
+ \DeclareUnicodeCharacter{00B2}{$^2$}%
+ \DeclareUnicodeCharacter{00B3}{$^3$}%
+ \DeclareUnicodeCharacter{00B4}{\'{ }}%
+ \DeclareUnicodeCharacter{00B5}{$\mu$}%
+ \DeclareUnicodeCharacter{00B6}{\P}%
+ \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
+ \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
+ \DeclareUnicodeCharacter{00B9}{$^1$}%
+ \DeclareUnicodeCharacter{00BA}{\ordm}%
+ \DeclareUnicodeCharacter{00BB}{\guillemetright}%
+ \DeclareUnicodeCharacter{00BC}{$1\over4$}%
+ \DeclareUnicodeCharacter{00BD}{$1\over2$}%
+ \DeclareUnicodeCharacter{00BE}{$3\over4$}%
+ \DeclareUnicodeCharacter{00BF}{\questiondown}%
+ %
+ \DeclareUnicodeCharacter{00C0}{\`A}%
+ \DeclareUnicodeCharacter{00C1}{\'A}%
+ \DeclareUnicodeCharacter{00C2}{\^A}%
+ \DeclareUnicodeCharacter{00C3}{\~A}%
+ \DeclareUnicodeCharacter{00C4}{\"A}%
+ \DeclareUnicodeCharacter{00C5}{\AA}%
+ \DeclareUnicodeCharacter{00C6}{\AE}%
+ \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
+ \DeclareUnicodeCharacter{00C8}{\`E}%
+ \DeclareUnicodeCharacter{00C9}{\'E}%
+ \DeclareUnicodeCharacter{00CA}{\^E}%
+ \DeclareUnicodeCharacter{00CB}{\"E}%
+ \DeclareUnicodeCharacter{00CC}{\`I}%
+ \DeclareUnicodeCharacter{00CD}{\'I}%
+ \DeclareUnicodeCharacter{00CE}{\^I}%
+ \DeclareUnicodeCharacter{00CF}{\"I}%
+ %
+ \DeclareUnicodeCharacter{00D0}{\DH}%
+ \DeclareUnicodeCharacter{00D1}{\~N}%
+ \DeclareUnicodeCharacter{00D2}{\`O}%
+ \DeclareUnicodeCharacter{00D3}{\'O}%
+ \DeclareUnicodeCharacter{00D4}{\^O}%
+ \DeclareUnicodeCharacter{00D5}{\~O}%
+ \DeclareUnicodeCharacter{00D6}{\"O}%
+ \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
+ \DeclareUnicodeCharacter{00D8}{\O}%
+ \DeclareUnicodeCharacter{00D9}{\`U}%
+ \DeclareUnicodeCharacter{00DA}{\'U}%
+ \DeclareUnicodeCharacter{00DB}{\^U}%
+ \DeclareUnicodeCharacter{00DC}{\"U}%
+ \DeclareUnicodeCharacter{00DD}{\'Y}%
+ \DeclareUnicodeCharacter{00DE}{\TH}%
+ \DeclareUnicodeCharacter{00DF}{\ss}%
+ %
+ \DeclareUnicodeCharacter{00E0}{\`a}%
+ \DeclareUnicodeCharacter{00E1}{\'a}%
+ \DeclareUnicodeCharacter{00E2}{\^a}%
+ \DeclareUnicodeCharacter{00E3}{\~a}%
+ \DeclareUnicodeCharacter{00E4}{\"a}%
+ \DeclareUnicodeCharacter{00E5}{\aa}%
+ \DeclareUnicodeCharacter{00E6}{\ae}%
+ \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
+ \DeclareUnicodeCharacter{00E8}{\`e}%
+ \DeclareUnicodeCharacter{00E9}{\'e}%
+ \DeclareUnicodeCharacter{00EA}{\^e}%
+ \DeclareUnicodeCharacter{00EB}{\"e}%
+ \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
+ \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
+ \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
+ \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
+ %
+ \DeclareUnicodeCharacter{00F0}{\dh}%
+ \DeclareUnicodeCharacter{00F1}{\~n}%
+ \DeclareUnicodeCharacter{00F2}{\`o}%
+ \DeclareUnicodeCharacter{00F3}{\'o}%
+ \DeclareUnicodeCharacter{00F4}{\^o}%
+ \DeclareUnicodeCharacter{00F5}{\~o}%
+ \DeclareUnicodeCharacter{00F6}{\"o}%
+ \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
+ \DeclareUnicodeCharacter{00F8}{\o}%
+ \DeclareUnicodeCharacter{00F9}{\`u}%
+ \DeclareUnicodeCharacter{00FA}{\'u}%
+ \DeclareUnicodeCharacter{00FB}{\^u}%
+ \DeclareUnicodeCharacter{00FC}{\"u}%
+ \DeclareUnicodeCharacter{00FD}{\'y}%
+ \DeclareUnicodeCharacter{00FE}{\th}%
+ \DeclareUnicodeCharacter{00FF}{\"y}%
+ %
+ \DeclareUnicodeCharacter{0100}{\=A}%
+ \DeclareUnicodeCharacter{0101}{\=a}%
+ \DeclareUnicodeCharacter{0102}{\u{A}}%
+ \DeclareUnicodeCharacter{0103}{\u{a}}%
+ \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
+ \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
+ \DeclareUnicodeCharacter{0106}{\'C}%
+ \DeclareUnicodeCharacter{0107}{\'c}%
+ \DeclareUnicodeCharacter{0108}{\^C}%
+ \DeclareUnicodeCharacter{0109}{\^c}%
+ \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
+ \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
+ \DeclareUnicodeCharacter{010C}{\v{C}}%
+ \DeclareUnicodeCharacter{010D}{\v{c}}%
+ \DeclareUnicodeCharacter{010E}{\v{D}}%
+ \DeclareUnicodeCharacter{010F}{d'}%
+ %
+ \DeclareUnicodeCharacter{0110}{\DH}%
+ \DeclareUnicodeCharacter{0111}{\dh}%
+ \DeclareUnicodeCharacter{0112}{\=E}%
+ \DeclareUnicodeCharacter{0113}{\=e}%
+ \DeclareUnicodeCharacter{0114}{\u{E}}%
+ \DeclareUnicodeCharacter{0115}{\u{e}}%
+ \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
+ \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
+ \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
+ \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
+ \DeclareUnicodeCharacter{011A}{\v{E}}%
+ \DeclareUnicodeCharacter{011B}{\v{e}}%
+ \DeclareUnicodeCharacter{011C}{\^G}%
+ \DeclareUnicodeCharacter{011D}{\^g}%
+ \DeclareUnicodeCharacter{011E}{\u{G}}%
+ \DeclareUnicodeCharacter{011F}{\u{g}}%
+ %
+ \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
+ \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
+ \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
+ \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
+ \DeclareUnicodeCharacter{0124}{\^H}%
+ \DeclareUnicodeCharacter{0125}{\^h}%
+ \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
+ \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
+ \DeclareUnicodeCharacter{0128}{\~I}%
+ \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
+ \DeclareUnicodeCharacter{012A}{\=I}%
+ \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
+ \DeclareUnicodeCharacter{012C}{\u{I}}%
+ \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
+ \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
+ \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
+ %
+ \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
+ \DeclareUnicodeCharacter{0131}{\dotless{i}}%
+ \DeclareUnicodeCharacter{0132}{IJ}%
+ \DeclareUnicodeCharacter{0133}{ij}%
+ \DeclareUnicodeCharacter{0134}{\^J}%
+ \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
+ \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
+ \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
+ \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
+ \DeclareUnicodeCharacter{0139}{\'L}%
+ \DeclareUnicodeCharacter{013A}{\'l}%
+ \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
+ \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
+ \DeclareUnicodeCharacter{013D}{L'}% should kern
+ \DeclareUnicodeCharacter{013E}{l'}% should kern
+ \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
+ %
+ \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
+ \DeclareUnicodeCharacter{0141}{\L}%
+ \DeclareUnicodeCharacter{0142}{\l}%
+ \DeclareUnicodeCharacter{0143}{\'N}%
+ \DeclareUnicodeCharacter{0144}{\'n}%
+ \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
+ \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
+ \DeclareUnicodeCharacter{0147}{\v{N}}%
+ \DeclareUnicodeCharacter{0148}{\v{n}}%
+ \DeclareUnicodeCharacter{0149}{'n}%
+ \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
+ \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
+ \DeclareUnicodeCharacter{014C}{\=O}%
+ \DeclareUnicodeCharacter{014D}{\=o}%
+ \DeclareUnicodeCharacter{014E}{\u{O}}%
+ \DeclareUnicodeCharacter{014F}{\u{o}}%
+ %
+ \DeclareUnicodeCharacter{0150}{\H{O}}%
+ \DeclareUnicodeCharacter{0151}{\H{o}}%
+ \DeclareUnicodeCharacter{0152}{\OE}%
+ \DeclareUnicodeCharacter{0153}{\oe}%
+ \DeclareUnicodeCharacter{0154}{\'R}%
+ \DeclareUnicodeCharacter{0155}{\'r}%
+ \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
+ \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
+ \DeclareUnicodeCharacter{0158}{\v{R}}%
+ \DeclareUnicodeCharacter{0159}{\v{r}}%
+ \DeclareUnicodeCharacter{015A}{\'S}%
+ \DeclareUnicodeCharacter{015B}{\'s}%
+ \DeclareUnicodeCharacter{015C}{\^S}%
+ \DeclareUnicodeCharacter{015D}{\^s}%
+ \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
+ \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
+ %
+ \DeclareUnicodeCharacter{0160}{\v{S}}%
+ \DeclareUnicodeCharacter{0161}{\v{s}}%
+ \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
+ \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
+ \DeclareUnicodeCharacter{0164}{\v{T}}%
+ \DeclareUnicodeCharacter{0165}{\v{t}}%
+ \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
+ \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
+ \DeclareUnicodeCharacter{0168}{\~U}%
+ \DeclareUnicodeCharacter{0169}{\~u}%
+ \DeclareUnicodeCharacter{016A}{\=U}%
+ \DeclareUnicodeCharacter{016B}{\=u}%
+ \DeclareUnicodeCharacter{016C}{\u{U}}%
+ \DeclareUnicodeCharacter{016D}{\u{u}}%
+ \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
+ \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
+ %
+ \DeclareUnicodeCharacter{0170}{\H{U}}%
+ \DeclareUnicodeCharacter{0171}{\H{u}}%
+ \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
+ \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
+ \DeclareUnicodeCharacter{0174}{\^W}%
+ \DeclareUnicodeCharacter{0175}{\^w}%
+ \DeclareUnicodeCharacter{0176}{\^Y}%
+ \DeclareUnicodeCharacter{0177}{\^y}%
+ \DeclareUnicodeCharacter{0178}{\"Y}%
+ \DeclareUnicodeCharacter{0179}{\'Z}%
+ \DeclareUnicodeCharacter{017A}{\'z}%
+ \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
+ \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
+ \DeclareUnicodeCharacter{017D}{\v{Z}}%
+ \DeclareUnicodeCharacter{017E}{\v{z}}%
+ \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
+ %
+ \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
+ \DeclareUnicodeCharacter{01C5}{D\v{z}}%
+ \DeclareUnicodeCharacter{01C6}{d\v{z}}%
+ \DeclareUnicodeCharacter{01C7}{LJ}%
+ \DeclareUnicodeCharacter{01C8}{Lj}%
+ \DeclareUnicodeCharacter{01C9}{lj}%
+ \DeclareUnicodeCharacter{01CA}{NJ}%
+ \DeclareUnicodeCharacter{01CB}{Nj}%
+ \DeclareUnicodeCharacter{01CC}{nj}%
+ \DeclareUnicodeCharacter{01CD}{\v{A}}%
+ \DeclareUnicodeCharacter{01CE}{\v{a}}%
+ \DeclareUnicodeCharacter{01CF}{\v{I}}%
+ %
+ \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
+ \DeclareUnicodeCharacter{01D1}{\v{O}}%
+ \DeclareUnicodeCharacter{01D2}{\v{o}}%
+ \DeclareUnicodeCharacter{01D3}{\v{U}}%
+ \DeclareUnicodeCharacter{01D4}{\v{u}}%
+ %
+ \DeclareUnicodeCharacter{01E2}{\={\AE}}%
+ \DeclareUnicodeCharacter{01E3}{\={\ae}}%
+ \DeclareUnicodeCharacter{01E6}{\v{G}}%
+ \DeclareUnicodeCharacter{01E7}{\v{g}}%
+ \DeclareUnicodeCharacter{01E8}{\v{K}}%
+ \DeclareUnicodeCharacter{01E9}{\v{k}}%
+ %
+ \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
+ \DeclareUnicodeCharacter{01F1}{DZ}%
+ \DeclareUnicodeCharacter{01F2}{Dz}%
+ \DeclareUnicodeCharacter{01F3}{dz}%
+ \DeclareUnicodeCharacter{01F4}{\'G}%
+ \DeclareUnicodeCharacter{01F5}{\'g}%
+ \DeclareUnicodeCharacter{01F8}{\`N}%
+ \DeclareUnicodeCharacter{01F9}{\`n}%
+ \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
+ \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
+ \DeclareUnicodeCharacter{01FE}{\'{\O}}%
+ \DeclareUnicodeCharacter{01FF}{\'{\o}}%
+ %
+ \DeclareUnicodeCharacter{021E}{\v{H}}%
+ \DeclareUnicodeCharacter{021F}{\v{h}}%
+ %
+ \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
+ \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
+ \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
+ \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
+ \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
+ \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
+ %
+ \DeclareUnicodeCharacter{0232}{\=Y}%
+ \DeclareUnicodeCharacter{0233}{\=y}%
+ \DeclareUnicodeCharacter{0237}{\dotless{j}}%
+ %
+ \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
+ %
+ % Greek letters upper case
+ \DeclareUnicodeCharacter{0391}{{\it A}}%
+ \DeclareUnicodeCharacter{0392}{{\it B}}%
+ \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
+ \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
+ \DeclareUnicodeCharacter{0395}{{\it E}}%
+ \DeclareUnicodeCharacter{0396}{{\it Z}}%
+ \DeclareUnicodeCharacter{0397}{{\it H}}%
+ \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
+ \DeclareUnicodeCharacter{0399}{{\it I}}%
+ \DeclareUnicodeCharacter{039A}{{\it K}}%
+ \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
+ \DeclareUnicodeCharacter{039C}{{\it M}}%
+ \DeclareUnicodeCharacter{039D}{{\it N}}%
+ \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
+ \DeclareUnicodeCharacter{039F}{{\it O}}%
+ \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
+ \DeclareUnicodeCharacter{03A1}{{\it P}}%
+ %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
+ \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
+ \DeclareUnicodeCharacter{03A4}{{\it T}}%
+ \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
+ \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
+ \DeclareUnicodeCharacter{03A7}{{\it X}}%
+ \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
+ \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
+ %
+ % Vowels with accents
+ \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
+ \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
+ \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
+ \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
+ \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
+ \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
+ %
+ % Standalone accent
+ \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
+ %
+ % Greek letters lower case
+ \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
+ \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
+ \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
+ \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
+ \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
+ \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
+ \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
+ \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
+ \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
+ \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
+ \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
+ \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
+ \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
+ \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
+ \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
+ \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
+ \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
+ \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
+ \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
+ \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
+ \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
+ \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
+ \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
+ \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
+ \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
+ %
+ % More Greek vowels with accents
+ \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
+ \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
+ \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
+ \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
+ \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
+ %
+ % Variant Greek letters
+ \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
+ \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
+ \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
+ %
+ \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
+ \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
+ \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
+ \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
+ \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
+ \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
+ \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
+ \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
+ \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
+ \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
+ \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
+ \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
+ %
+ \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
+ \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
+ %
+ \DeclareUnicodeCharacter{1E20}{\=G}%
+ \DeclareUnicodeCharacter{1E21}{\=g}%
+ \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
+ \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
+ \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
+ \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
+ \DeclareUnicodeCharacter{1E26}{\"H}%
+ \DeclareUnicodeCharacter{1E27}{\"h}%
+ %
+ \DeclareUnicodeCharacter{1E30}{\'K}%
+ \DeclareUnicodeCharacter{1E31}{\'k}%
+ \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
+ \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
+ \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
+ \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
+ \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
+ \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
+ \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
+ \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
+ \DeclareUnicodeCharacter{1E3E}{\'M}%
+ \DeclareUnicodeCharacter{1E3F}{\'m}%
+ %
+ \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
+ \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
+ \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
+ \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
+ \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
+ \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
+ \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
+ \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
+ \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
+ \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
+ %
+ \DeclareUnicodeCharacter{1E54}{\'P}%
+ \DeclareUnicodeCharacter{1E55}{\'p}%
+ \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
+ \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
+ \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
+ \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
+ \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
+ \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
+ \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
+ \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
+ %
+ \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
+ \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
+ \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
+ \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
+ \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
+ \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
+ \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
+ \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
+ \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
+ \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
+ %
+ \DeclareUnicodeCharacter{1E7C}{\~V}%
+ \DeclareUnicodeCharacter{1E7D}{\~v}%
+ \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
+ \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
+ %
+ \DeclareUnicodeCharacter{1E80}{\`W}%
+ \DeclareUnicodeCharacter{1E81}{\`w}%
+ \DeclareUnicodeCharacter{1E82}{\'W}%
+ \DeclareUnicodeCharacter{1E83}{\'w}%
+ \DeclareUnicodeCharacter{1E84}{\"W}%
+ \DeclareUnicodeCharacter{1E85}{\"w}%
+ \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
+ \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
+ \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
+ \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
+ \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
+ \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
+ \DeclareUnicodeCharacter{1E8C}{\"X}%
+ \DeclareUnicodeCharacter{1E8D}{\"x}%
+ \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
+ \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
+ %
+ \DeclareUnicodeCharacter{1E90}{\^Z}%
+ \DeclareUnicodeCharacter{1E91}{\^z}%
+ \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
+ \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
+ \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
+ \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
+ \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
+ \DeclareUnicodeCharacter{1E97}{\"t}%
+ \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
+ \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
+ %
+ \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
+ \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
+ %
+ \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
+ \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
+ \DeclareUnicodeCharacter{1EBC}{\~E}%
+ \DeclareUnicodeCharacter{1EBD}{\~e}%
+ %
+ \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
+ \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
+ \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
+ \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
+ %
+ \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
+ \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
+ %
+ \DeclareUnicodeCharacter{1EF2}{\`Y}%
+ \DeclareUnicodeCharacter{1EF3}{\`y}%
+ \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
+ %
+ \DeclareUnicodeCharacter{1EF8}{\~Y}%
+ \DeclareUnicodeCharacter{1EF9}{\~y}%
+ %
+ % Punctuation
+ \DeclareUnicodeCharacter{2013}{--}%
+ \DeclareUnicodeCharacter{2014}{---}%
+ \DeclareUnicodeCharacter{2018}{\quoteleft}%
+ \DeclareUnicodeCharacter{2019}{\quoteright}%
+ \DeclareUnicodeCharacter{201A}{\quotesinglbase}%
+ \DeclareUnicodeCharacter{201C}{\quotedblleft}%
+ \DeclareUnicodeCharacter{201D}{\quotedblright}%
+ \DeclareUnicodeCharacter{201E}{\quotedblbase}%
+ \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
+ \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
+ \DeclareUnicodeCharacter{2022}{\bullet}%
+ \DeclareUnicodeCharacter{202F}{\thinspace}%
+ \DeclareUnicodeCharacter{2026}{\dots}%
+ \DeclareUnicodeCharacter{2039}{\guilsinglleft}%
+ \DeclareUnicodeCharacter{203A}{\guilsinglright}%
+ %
+ \DeclareUnicodeCharacter{20AC}{\euro}%
+ %
+ \DeclareUnicodeCharacter{2192}{\expansion}%
+ \DeclareUnicodeCharacter{21D2}{\result}%
+ %
+ % Mathematical symbols
+ \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
+ \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
+ \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
+ \DeclareUnicodeCharacter{2212}{\minus}%
+ \DeclareUnicodeCharacter{2217}{\ast}%
+ \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
+ \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
+ \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
+ \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
+ \DeclareUnicodeCharacter{2261}{\equiv}%
+ \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
+ \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
+ \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
+ \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
+ %
+ \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
+ \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
+ \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
+ \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
+ \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
+ \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
+ \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
+ \DeclareUnicodeCharacter{2127}{\ensuremath\mho}%
+ \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
+ \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
+ \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
+ \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
+ \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
+ \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
+ \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
+ \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
+ \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
+ \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
+ \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
+ \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
+ \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
+ \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
+ \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
+ \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}%
+ \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
+ \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
+ \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
+ \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
+ \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
+ \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
+ \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
+ \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
+ \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}%
+ \DeclareUnicodeCharacter{2201}{\ensuremath\complement}%
+ \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
+ \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
+ \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
+ \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
+ \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
+ \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
+ \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
+ \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
+ \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
+ \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
+ \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
+ \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
+ \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
+ \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
+ \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
+ \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
+ \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
+ \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
+ \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
+ \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
+ \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
+ \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
+ \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
+ \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
+ \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
+ \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
+ \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
+ \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
+ \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
+ \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
+ \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
+ \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
+ \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
+ \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}%
+ \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}%
+ \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
+ \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
+ \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
+ \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
+ \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
+ \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
+ \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
+ \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
+ \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
+ \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
+ \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
+ \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
+ \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
+ \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
+ \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}%
+ \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}%
+ \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
+ \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
+ \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
+ \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
+ \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
+ \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
+ \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
+ \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
+ \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
+ \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
+ \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
+ \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
+ \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
+ \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
+ %
+ \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}%
+ \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
+ \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
+ \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
+ \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
+ \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}%
+ \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
+ \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
+ \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
+ \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
+ \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
+ \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
+ \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
+ \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
+ \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
+ \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
+ \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
+ \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
+ \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
+ \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
+ \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
+ \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
+ \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
+ \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
+ \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
+ \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
+ \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
+ \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}%
+ \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
+ \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
+ \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
+ %
+ \global\mathchardef\checkmark="1370% actually the square root sign
+ \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
+}% end of \unicodechardefs
+
+% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
+% It makes the setting that replace UTF-8 byte sequence.
+\def\utfeightchardefs{%
+ \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
+ \unicodechardefs
+}
+
+% Whether the active definitions of non-ASCII characters expand to
+% non-active tokens with the same character code. This is used to
+% write characters literally, instead of using active definitions for
+% printing the correct glyphs.
+\newif\ifpassthroughchars
+\passthroughcharsfalse
+
+% For native Unicode handling (XeTeX and LuaTeX),
+% provide a definition macro to replace/pass-through a Unicode character
+%
+\def\DeclareUnicodeCharacterNative#1#2{%
+ \catcode"#1=\active
+ \def\dodeclareunicodecharacternative##1##2##3{%
+ \begingroup
+ \uccode`\~="##2\relax
+ \uppercase{\gdef~}{%
+ \ifpassthroughchars
+ ##1%
+ \else
+ ##3%
+ \fi
+ }
+ \endgroup
+ }
+ \begingroup
+ \uccode`\.="#1\relax
+ \uppercase{\def\UTFNativeTmp{.}}%
+ \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
+ \endgroup
+}
+
+% Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
+% It activates the setting that replaces Unicode characters.
+\def\nativeunicodechardefs{%
+ \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
+ \unicodechardefs
+}
+
+% For native Unicode handling (XeTeX and LuaTeX),
+% make the character token expand
+% to the sequences given in \unicodechardefs for printing.
+\def\DeclareUnicodeCharacterNativeAtU#1#2{%
+ \def\UTFAtUTmp{#2}
+ \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
+}
+
+% @U command definitions for native Unicode handling (XeTeX and LuaTeX).
+\def\nativeunicodechardefsatu{%
+ \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
+ \unicodechardefs
+}
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+ \relax
+}
+
+% define all Unicode characters we know about, for the sake of @U.
+\iftxinativeunicodecapable
+ \nativeunicodechardefsatu
+\else
+ \utfeightchardefs
+\fi
+
+
+% Make non-ASCII characters printable again for compatibility with
+% existing Texinfo documents that may use them, even without declaring a
+% document encoding.
+%
+\setnonasciicharscatcode \other
+
+
+\message{formatting,}
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
+
+% Following George Bush, get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading. The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \txipageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \txipagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ % if we don't reset these, they will remain at "1 true in" of
+ % whatever layout pdftex was dumped with.
+ \pdfhorigin = 1 true in
+ \pdfvorigin = 1 true in
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ % XeTeX does not have \pdfhorigin and \pdfvorigin.
+ \fi
+ \fi
+ %
+ \setleading{\textleading}
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{607.2pt}{6in}% that's 46 lines
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {-.2in}{0in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+ \parskip = 1.5pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.4in}{4.8in}%
+ {-.2in}{-.4in}%
+ {0pt}{14pt}%
+ {9in}{6in}%
+ %
+ \lispnarrowing = 0.25in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{673.2pt}{160mm}% that's 51 lines
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1\relax
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
+% DEL is a comment character, in case @c does not suffice.
+\catcode`\^^? = 14
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Set catcodes for Texinfo file
+
+% Active characters for printing the wanted glyph.
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+%
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
+\chardef\hatchar=`\^
+\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+\let\realunder=_
+
+\catcode`\|=\active \def|{{\tt\char124}}
+
+\chardef \less=`\<
+\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
+\chardef \gtr=`\>
+\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
+\catcode`\+=\active \def+{{\tt \char 43}}
+\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+\catcode`\-=\active \let-=\normaldash
+
+
+% used for headline/footline in the output routine, in case the page
+% breaks in the middle of an @tex block.
+\def\texinfochars{%
+ \let< = \activeless
+ \let> = \activegtr
+ \let~ = \activetilde
+ \let^ = \activehat
+ \markupsetuplqdefault \markupsetuprqdefault
+ \let\b = \strong
+ \let\i = \smartitalic
+ % in principle, all other definitions in \tex have to be undone too.
+}
+
+% Used sometimes to turn off (effectively) the active characters even after
+% parsing them.
+\def\turnoffactive{%
+ \normalturnoffactive
+ \otherbackslash
+}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% In Texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active % @ for escape char from now on.
+
+% Print a typewriter backslash. For math mode, we can't simply use
+% \backslashcurfont: the story here is that in math mode, the \char
+% of \backslashcurfont ends up printing the roman \ from the math symbol
+% font (because \char in math mode uses the \mathcode, and plain.tex
+% sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C). We can't use " for the
+% usual hex value because it has already been made active.
+
+@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
+
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other. We switch back and forth between these.
+@gdef@rawbackslash{@let\=@backslashcurfont}
+@gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'.
+%
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+ @passthroughcharstrue
+ @let-=@normaldash
+ @let"=@normaldoublequote
+ @let$=@normaldollar %$ font-lock fix
+ @let+=@normalplus
+ @let<=@normalless
+ @let>=@normalgreater
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let~=@normaltilde
+ @let\=@ttbackslash
+ @markupsetuplqdefault
+ @markupsetuprqdefault
+ @unsepspaces
+ }
+}
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have @fixbackslash turn them back on.
+@catcode`+=@other @catcode`@_=@other
+
+% \enablebackslashhack - allow file to begin `\input texinfo'
+%
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+% If the file did not have a `\input texinfo', then it is turned off after
+% the first line; otherwise the first `\' in the file would cause an error.
+% This is used on the very last line of this file, texinfo.tex.
+% We also use @c to call @fixbackslash, in case ends of lines are hidden.
+{
+@catcode`@^=7
+@catcode`@^^M=13@gdef@enablebackslashhack{%
+ @global@let\ = @eatinput%
+ @catcode`@^^M=13%
+ @def@c{@fixbackslash@c}%
+ % Definition for the newline at the end of this file.
+ @def ^^M{@let^^M@secondlinenl}%
+ % Definition for a newline in the main Texinfo file.
+ @gdef @secondlinenl{@fixbackslash}%
+}}
+
+{@catcode`@^=7 @catcode`@^^M=13%
+@gdef@eatinput input texinfo#1^^M{@fixbackslash}}
+
+% Emergency active definition of newline, in case an active newline token
+% appears by mistake.
+{@catcode`@^=7 @catcode13=13%
+@gdef@enableemergencynewline{%
+ @gdef^^M{%
+ @par%
+ %<warning: active newline>@par%
+}}}
+
+
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @ttbackslash @fi
+ @catcode13=5 % regular end of line
+ @enableemergencynewline
+ @let@c=@texinfoc
+ % Also turn back on active characters that might appear in the input
+ % file name, in case not using a pre-dumped format.
+ @catcode`+=@active
+ @catcode`@_=@active
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
+ % called at the beginning of every Texinfo file. Not opening texinfo.cnf
+ % directly in this file, texinfo.tex, makes it possible to make a format
+ % file for Texinfo.
+ %
+ @openin 1 texinfo.cnf
+ @ifeof 1 @else @input texinfo.cnf @fi
+ @closein 1
+}
+
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+@def@normaldot{.}
+@def@normalquest{?}
+@def@normalslash{/}
+
+% These look ok in all fonts, so just make them not special.
+% @hashchar{} gets its own user-level command, because of #line.
+@catcode`@& = @other @def@normalamp{&}
+@catcode`@# = @other @def@normalhash{#}
+@catcode`@% = @other @def@normalpercent{%}
+
+@let @hashchar = @normalhash
+
+@c Finally, make ` and ' active, so that txicodequoteundirected and
+@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
+@c don't make ` and ' active, @code will not get them as active chars.
+@c Do this last of all since we use ` in the previous @catcode assignments.
+@catcode`@'=@active
+@catcode`@`=@active
+@markupsetuplqdefault
+@markupsetuprqdefault
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message\\|emacs-page"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
+@enablebackslashhack
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
new file mode 100755
index 0000000..17ee6b1
--- /dev/null
+++ b/build-aux/update-copyright
@@ -0,0 +1,274 @@
+eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
+ & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
+ if 0;
+# Update an FSF copyright year list to include the current year.
+
+my $VERSION = '2016-01-12.23:13'; # UTC
+
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering and Joel E. Denny
+
+# The arguments to this script should be names of files that contain
+# copyright statements to be updated. The copyright holder's name
+# defaults to "Free Software Foundation, Inc." but may be changed to
+# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
+# variable.
+#
+# For example, you might wish to use the update-copyright target rule
+# in maint.mk from gnulib's maintainer-makefile module.
+#
+# Iff a copyright statement is recognized in a file and the final
+# year is not the current year, then the statement is updated for the
+# new year and it is reformatted to:
+#
+# 1. Fit within 72 columns.
+# 2. Convert 2-digit years to 4-digit years by prepending "19".
+# 3. Expand copyright year intervals. (See "Environment variables"
+# below.)
+#
+# A warning is printed for every file for which no copyright
+# statement is recognized.
+#
+# Each file's copyright statement must be formatted correctly in
+# order to be recognized. For example, each of these is fine:
+#
+# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+#
+# # Copyright (C) 1990-2005, 2007-2009 Free Software
+# # Foundation, Inc.
+#
+# /*
+# * Copyright &copy; 90,2005,2007-2009
+# * Free Software Foundation, Inc.
+# */
+#
+# However, the following format is not recognized because the line
+# prefix changes after the first line:
+#
+# ## Copyright (C) 1990-2005, 2007-2009 Free Software
+# # Foundation, Inc.
+#
+# However, any correctly formatted copyright statement following
+# a non-matching copyright statements would be recognized.
+#
+# The exact conditions that a file's copyright statement must meet
+# to be recognized are:
+#
+# 1. It is the first copyright statement that meets all of the
+# following conditions. Subsequent copyright statements are
+# ignored.
+# 2. Its format is "Copyright (C)", then a list of copyright years,
+# and then the name of the copyright holder.
+# 3. The "(C)" takes one of the following forms or is omitted
+# entirely:
+#
+# A. (C)
+# B. (c)
+# C. @copyright{}
+# D. &copy;
+#
+# 4. The "Copyright" appears at the beginning of a line, except that it
+# may be prefixed by any sequence (e.g., a comment) of no more than
+# 5 characters -- including white space.
+# 5. Iff such a prefix is present, the same prefix appears at the
+# beginning of each remaining line within the FSF copyright
+# statement. There is one exception in order to support C-style
+# comments: if the first line's prefix contains nothing but
+# whitespace surrounding a "/*", then the prefix for all subsequent
+# lines is the same as the first line's prefix except with each of
+# "/" and possibly "*" replaced by a " ". The replacement of "*"
+# by " " is consistent throughout all subsequent lines.
+# 6. Blank lines, even if preceded by the prefix, do not appear
+# within the FSF copyright statement.
+# 7. Each copyright year is 2 or 4 digits, and years are separated by
+# commas or dashes. Whitespace may appear after commas.
+#
+# Environment variables:
+#
+# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement
+# is reformatted even if it does not need updating for the new
+# year. If unset or set to 0, only updated FSF copyright
+# statements are reformatted.
+# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive
+# copyright years (such as 90, 1991, 1992-2007, 2008) in a
+# reformatted FSF copyright statement is collapsed to a single
+# interval (such as 1990-2008). If unset or set to 0, all existing
+# copyright year intervals in a reformatted FSF copyright statement
+# are expanded instead.
+# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps
+# to the minimal containing range. For example, convert
+# 2000, 2004-2007, 2009 to 2000-2009.
+# 3. For testing purposes, you can set the assumed current year in
+# UPDATE_COPYRIGHT_YEAR.
+# 4. The default maximum line length for a copyright line is 72.
+# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
+# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
+# than "Free Software Foundation, Inc.".
+
+use strict;
+use warnings;
+
+my $copyright_re = 'Copyright';
+my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
+my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
+$holder ||= 'Free Software Foundation, Inc.';
+my $prefix_max = 5;
+my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
+!$margin || $margin !~ m/^\d+$/
+ and $margin = 72;
+
+my $tab_width = 8;
+
+my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
+if (!$this_year || $this_year !~ m/^\d{4}$/)
+ {
+ my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
+ $this_year = $year + 1900;
+ }
+
+# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead.
+my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n";
+
+my $leading;
+my $prefix;
+my $ws_re;
+my $stmt_re;
+while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
+ {
+ $leading = "$1$2";
+ $prefix = $2;
+ if ($prefix =~ /^(\s*\/)\*(\s*)$/)
+ {
+ $prefix =~ s,/, ,;
+ my $prefix_ws = $prefix;
+ $prefix_ws =~ s/\*/ /; # Only whitespace.
+ if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/)
+ {
+ $prefix = $prefix_ws;
+ }
+ }
+ $ws_re = '[ \t\r\f]'; # \s without \n
+ $ws_re =
+ "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)";
+ my $holder_re = $holder;
+ $holder_re =~ s/\s/$ws_re/g;
+ my $stmt_remainder_re =
+ "(?:$ws_re$circle_c_re)?"
+ . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
+ . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
+ if (/\G$stmt_remainder_re/)
+ {
+ $stmt_re =
+ quotemeta($leading) . "($copyright_re$stmt_remainder_re)";
+ last;
+ }
+ }
+if (defined $stmt_re)
+ {
+ /$stmt_re/ or die; # Should never die.
+ my $stmt = $1;
+ my $final_year_orig = $2;
+
+ # Handle two-digit year numbers like "98" and "99".
+ my $final_year = $final_year_orig;
+ $final_year <= 99
+ and $final_year += 1900;
+
+ if ($final_year != $this_year)
+ {
+ # Update the year.
+ $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
+ }
+ if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
+ {
+ # Normalize all whitespace including newline-prefix sequences.
+ $stmt =~ s/$ws_re/ /g;
+
+ # Put spaces after commas.
+ $stmt =~ s/, ?/, /g;
+
+ # Convert 2-digit to 4-digit years.
+ $stmt =~ s/(\b\d\d\b)/19$1/g;
+
+ # Make the use of intervals consistent.
+ if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
+ {
+ $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
+ }
+ else
+ {
+ $stmt =~
+ s/
+ (\d{4})
+ (?:
+ (,\ |-)
+ ((??{
+ if ($2 eq '-') { '\d{4}'; }
+ elsif (!$3) { $1 + 1; }
+ else { $3 + 1; }
+ }))
+ )+
+ /$1-$3/gx;
+
+ # When it's 2, emit a single range encompassing all year numbers.
+ $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
+ and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
+ }
+
+ # Format within margin.
+ my $stmt_wrapped;
+ my $text_margin = $margin - length($prefix);
+ if ($prefix =~ /^(\t+)/)
+ {
+ $text_margin -= length($1) * ($tab_width - 1);
+ }
+ while (length $stmt)
+ {
+ if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
+ || ($stmt =~ s/^([\S]+)(?: |$)//))
+ {
+ my $line = $1;
+ $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
+ $stmt_wrapped .= $line;
+ }
+ else
+ {
+ # Should be unreachable, but we don't want an infinite
+ # loop if it can be reached.
+ die;
+ }
+ }
+
+ # Replace the old copyright statement.
+ s/$stmt_re/$stmt_wrapped/;
+ }
+ }
+else
+ {
+ print STDERR "$ARGV: warning: copyright statement not found\n";
+ }
+
+# Local variables:
+# mode: perl
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "my $VERSION = '"
+# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "'; # UTC"
+# End:
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
new file mode 100755
index 0000000..d7a8c0d
--- /dev/null
+++ b/build-aux/useless-if-before-free
@@ -0,0 +1,210 @@
+eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
+ & eval 'exec perl -wST "$0" $argv:q'
+ if 0;
+# Detect instances of "if (p) free (p);".
+# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
+
+my $VERSION = '2016-08-01 17:47'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+(my $ME = $0) =~ s|.*/||;
+
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
+
+sub usage ($)
+{
+ my ($exit_code) = @_;
+ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+ if ($exit_code != 0)
+ {
+ print $STREAM "Try '$ME --help' for more information.\n";
+ }
+ else
+ {
+ print $STREAM <<EOF;
+Usage: $ME [OPTIONS] FILE...
+
+Detect any instance in FILE of a useless "if" test before a free call, e.g.,
+"if (p) free (p);". Any such test may be safely removed without affecting
+the semantics of the C code in FILE. Use --name=FOO --name=BAR to also
+detect free-like functions named FOO and BAR.
+
+OPTIONS:
+
+ --list print only the name of each matching FILE (\\0-terminated)
+ --name=N add name N to the list of \'free\'-like functions to detect;
+ may be repeated
+
+ --help display this help and exit
+ --version output version information and exit
+
+Exit status:
+
+ 0 one or more matches
+ 1 no match
+ 2 an error
+
+EXAMPLE:
+
+For example, this command prints all removable "if" tests before "free"
+and "kfree" calls in the linux kernel sources:
+
+ git ls-files -z |xargs -0 $ME --name=kfree
+
+EOF
+ }
+ exit $exit_code;
+}
+
+sub is_NULL ($)
+{
+ my ($expr) = @_;
+ return ($expr eq 'NULL' || $expr eq '0');
+}
+
+{
+ sub EXIT_MATCH {0}
+ sub EXIT_NO_MATCH {1}
+ sub EXIT_ERROR {2}
+ my $err = EXIT_NO_MATCH;
+
+ my $list;
+ my @name = qw(free);
+ GetOptions
+ (
+ help => sub { usage 0 },
+ version => sub { print "$ME version $VERSION\n"; exit },
+ list => \$list,
+ 'name=s@' => \@name,
+ ) or usage 1;
+
+ # Make sure we have the right number of non-option arguments.
+ # Always tell the user why we fail.
+ @ARGV < 1
+ and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR;
+
+ my $or = join '|', @name;
+ my $regexp = qr/(?:$or)/;
+
+ # Set the input record separator.
+ # Note: this makes it impractical to print line numbers.
+ $/ = '"';
+
+ my $found_match = 0;
+ FILE:
+ foreach my $file (@ARGV)
+ {
+ open FH, '<', $file
+ or (warn "$ME: can't open '$file' for reading: $!\n"),
+ $err = EXIT_ERROR, next;
+ while (defined (my $line = <FH>))
+ {
+ # Skip non-matching lines early to save time
+ $line =~ /\bif\b/
+ or next;
+ while ($line =~
+ /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\)
+ # 1 2 3
+ (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;|
+ \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg)
+ {
+ my $all = $1;
+ my ($lhs, $rhs) = ($2, $3);
+ my ($free_opnd, $braced_free_opnd) = ($4, $5);
+ my $non_NULL;
+ if (!defined $rhs) { $non_NULL = $lhs }
+ elsif (is_NULL $rhs) { $non_NULL = $lhs }
+ elsif (is_NULL $lhs) { $non_NULL = $rhs }
+ else { next }
+
+ # Compare the non-NULL part of the "if" expression and the
+ # free'd expression, without regard to white space.
+ $non_NULL =~ tr/ \t//d;
+ my $e2 = defined $free_opnd ? $free_opnd : $braced_free_opnd;
+ $e2 =~ tr/ \t//d;
+ if ($non_NULL eq $e2)
+ {
+ $found_match = 1;
+ $list
+ and (print "$file\0"), next FILE;
+ print "$file: $all\n";
+ }
+ }
+ }
+ }
+ continue
+ {
+ close FH;
+ }
+
+ $found_match && $err == EXIT_NO_MATCH
+ and $err = EXIT_MATCH;
+
+ exit $err;
+}
+
+my $foo = <<'EOF';
+# The above is to *find* them.
+# This adjusts them, removing the unnecessary "if (p)" part.
+
+# FIXME: do something like this as an option (doesn't do braces):
+free=xfree
+git grep -l -z "$free *(" \
+ | xargs -0 useless-if-before-free -l --name="$free" \
+ | xargs -0 perl -0x3b -pi -e \
+ 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s'
+
+# Use the following to remove redundant uses of kfree inside braces.
+# Note that -0777 puts perl in slurp-whole-file mode;
+# but we have plenty of memory, these days...
+free=kfree
+git grep -l -z "$free *(" \
+ | xargs -0 useless-if-before-free -l --name="$free" \
+ | xargs -0 perl -0777 -pi -e \
+ 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms'
+
+Be careful that the result of the above transformation is valid.
+If the matched string is followed by "else", then obviously, it won't be.
+
+When modifying files, refuse to process anything other than a regular file.
+EOF
+
+## Local Variables:
+## mode: perl
+## indent-tabs-mode: nil
+## eval: (add-hook 'write-file-hooks 'time-stamp)
+## time-stamp-start: "my $VERSION = '"
+## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+## time-stamp-time-zone: "UTC0"
+## time-stamp-end: "'; # UTC"
+## End:
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
new file mode 100755
index 0000000..c5c420a
--- /dev/null
+++ b/build-aux/vc-list-files
@@ -0,0 +1,113 @@
+#!/bin/sh
+# List version-controlled file names.
+
+# Print a version string.
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+# List the specified version-controlled files.
+# With no argument, list them all. With a single DIRECTORY argument,
+# list the version-controlled files in that directory.
+
+# If there's an argument, it must be a single, "."-relative directory name.
+# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
+
+postprocess=
+case $1 in
+ --help) cat <<EOF
+Usage: $0 [-C SRCDIR] [DIR...]
+
+Output a list of version-controlled files in DIR (default .), relative to
+SRCDIR (default .). SRCDIR must be the top directory of a checkout.
+
+Options:
+ --help print this help, then exit
+ --version print version number, then exit
+ -C SRCDIR change directory to SRCDIR before generating list
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+ exit ;;
+
+ --version)
+ year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
+ cat <<EOF
+vc-list-files $scriptversion
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+ exit ;;
+
+ -C)
+ test "$2" = . || postprocess="| sed 's|^|$2/|'"
+ cd "$2" || exit 1
+ shift; shift ;;
+esac
+
+test $# = 0 && set .
+
+for dir
+do
+ if test -d .git; then
+ test "x$dir" = x. \
+ && dir= sed_esc= \
+ || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
+ # Ignore git symlinks - either they point into the tree, in which case
+ # we don't need to visit the target twice, or they point somewhere
+ # else (often into a submodule), in which case the content does not
+ # belong to this package.
+ eval exec git ls-tree -r 'HEAD:"$dir"' \
+ \| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess
+ elif test -d .hg; then
+ eval exec hg locate '"$dir/*"' $postprocess
+ elif test -d .bzr; then
+ test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
+ eval exec bzr ls -R --versioned '"$dir"' $postprocess
+ elif test -d CVS; then
+ test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
+ if test -x build-aux/cvsu; then
+ eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
+ elif (cvsu --help) >/dev/null 2>&1; then
+ eval cvsu --find --types=AFGM '"$dir"' $postprocess
+ else
+ eval awk -F/ \''{ \
+ if (!$1 && $3 !~ /^-/) { \
+ f=FILENAME; \
+ if (f ~ /CVS\/Entries$/) \
+ f = substr(f, 1, length(f)-11); \
+ print f $2; \
+ }}'\'' \
+ `find "$dir" -name Entries -print` /dev/null' $postprocess
+ fi
+ elif test -d .svn; then
+ eval exec svn list -R '"$dir"' $postprocess
+ else
+ echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
+ exit 1
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/cfg.mk b/cfg.mk
new file mode 100644
index 0000000..5e0f045
--- /dev/null
+++ b/cfg.mk
@@ -0,0 +1,73 @@
+# Customize maint.mk -*- makefile -*-
+# Copyright (C) 2003-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Use the direct link. This is guaranteed to work immediately, while
+# it can take a while for the faster mirror links to become usable.
+url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
+
+# Used in maint.mk's web-manual rule
+manual_title = Comparing and Merging Files
+
+# Tests not to run as part of "make distcheck".
+local-checks-to-skip = \
+ sc_error_message_period \
+ sc_error_message_uppercase \
+ sc_texinfo_acronym
+
+# Tools used to bootstrap this package, used for "announcement".
+bootstrap-tools = autoconf,automake,gnulib
+
+# Now that we have better tests, make this the default.
+export VERBOSE = yes
+
+old_NEWS_hash = 69329628b612be7ab46517bbf067c85f
+
+# Tell maint.mk's syntax-check rules that diff gets config.h directly or
+# via diff.h or system.h.
+config_h_header = (<config\.h>|"(diff|system)\.h")
+
+update-copyright-env = \
+ UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+ UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
+
+-include $(srcdir)/dist-check.mk
+
+_cf_state_dir ?= .config-state
+_date_time := $(shell date +%F.%T)
+config-compare:
+ diff -u \
+ -I'define VERSION ' \
+ -I'define PACKAGE_VERSION ' \
+ -I'define PACKAGE_STRING ' \
+ $(_cf_state_dir)/latest lib/config.h
+ diff -u \
+ -I'$(PACKAGE_NAME)' \
+ -I'[SD]\["VERSION"\]' \
+ -I'[SD]\["PACKAGE_VERSION"\]' \
+ -I'D\["PACKAGE_STRING"\]' \
+ $(_cf_state_dir)/latest config.status
+
+config-save:
+ $(MAKE) --quiet config-compare > /dev/null 2>&1 \
+ && { echo no change; exit 1; } || :
+ mkdir -p $(_cf_state_dir)/$(_date_time)
+ ln -nsf $(_date_time) $(_cf_state_dir)/latest
+ cp lib/config.h config.status $(_cf_state_dir)/latest
+
+exclude_file_name_regexp--sc_space_tab = ^gl/lib/.*\.c\.diff$$
+
+# Tell gnulib's tight_scope rule that we mark externs with XTERN
+export _gl_TS_extern = extern|XTERN
diff --git a/configure b/configure
new file mode 100755
index 0000000..06e3024
--- /dev/null
+++ b/configure
@@ -0,0 +1,41975 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69.147-5ad35 for GNU diffutils 3.5.
+#
+# Report bugs to <bug-diffutils@gnu.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2015 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+# The user is always right.
+if ${PATH_SEPARATOR+false} :; then
+ 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
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+export as_nl
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null
+then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null
+then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null
+then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+IFS=$as_save_IFS
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null
+then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+
+
+ if test "x$CONFIG_SHELL" != x
+then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno
+then :
+ printf "%s\n" "$0: This script requires a shell more modern than all"
+ printf "%s\n" "$0: the shells that I found on your system."
+ if test ${ZSH_VERSION+y} ; then
+ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and
+$0: bug-diffutils@gnu.org about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ printf "%s\n" "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='GNU diffutils'
+PACKAGE_TARNAME='diffutils'
+PACKAGE_VERSION='3.5'
+PACKAGE_STRING='GNU diffutils 3.5'
+PACKAGE_BUGREPORT='bug-diffutils@gnu.org'
+PACKAGE_URL='http://www.gnu.org/software/diffutils/'
+
+ac_unique_file="src/diff.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_func_list=
+gl_fnmatch_required=POSIX
+gl_getopt_required=POSIX
+gl_getopt_required=POSIX
+gt_needs=
+ac_subst_vars='gltests_LTLIBOBJS
+gltests_LIBOBJS
+gl_LTLIBOBJS
+gl_LIBOBJS
+CONFIG_INCLUDE
+am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+POSUB
+INTLLIBS
+INTL_MACOSX_LIBS
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE
+XGETTEXT_015
+XGETTEXT
+GMSGFMT_015
+MSGFMT_015
+GMSGFMT
+MSGFMT
+GETTEXT_MACRO_VERSION
+USE_NLS
+SRC_VERSION_C
+PR_PROGRAM
+GNULIB_WARN_CFLAGS
+WARN_CFLAGS
+WERROR_CFLAGS
+LIBTESTS_LIBDEPS
+LIBDIFFUTILS_LTLIBDEPS
+LIBDIFFUTILS_LIBDEPS
+abs_aux_dir
+HAVE_SYS_UIO_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
+NEXT_SYS_UIO_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H
+NEXT_SYS_IOCTL_H
+HAVE_SYS_IOCTL_H
+GL_GENERATE_STDALIGN_H_FALSE
+GL_GENERATE_STDALIGN_H_TRUE
+STDALIGN_H
+GL_GENERATE_NETINET_IN_H_FALSE
+GL_GENERATE_NETINET_IN_H_TRUE
+NETINET_IN_H
+HAVE_NETINET_IN_H
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
+NEXT_NETINET_IN_H
+LIB_NANOSLEEP
+LIB_SELECT
+LIBSOCKET
+HAVE_SYS_SELECT_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H
+NEXT_SYS_SELECT_H
+REPLACE_SELECT
+REPLACE_PSELECT
+HAVE_PSELECT
+GNULIB_SELECT
+GNULIB_PSELECT
+INET_PTON_LIB
+LOCALE_TR_UTF8
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
+NEXT_ARPA_INET_H
+HAVE_ARPA_INET_H
+REPLACE_INET_PTON
+REPLACE_INET_NTOP
+HAVE_DECL_INET_PTON
+HAVE_DECL_INET_NTOP
+GNULIB_INET_PTON
+GNULIB_INET_NTOP
+HAVE_WS2TCPIP_H
+HAVE_SYS_SOCKET_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
+NEXT_SYS_SOCKET_H
+HAVE_ACCEPT4
+HAVE_SA_FAMILY_T
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+HAVE_STRUCT_SOCKADDR_STORAGE
+GNULIB_ACCEPT4
+GNULIB_SHUTDOWN
+GNULIB_SETSOCKOPT
+GNULIB_SENDTO
+GNULIB_RECVFROM
+GNULIB_SEND
+GNULIB_RECV
+GNULIB_LISTEN
+GNULIB_GETSOCKOPT
+GNULIB_GETSOCKNAME
+GNULIB_GETPEERNAME
+GNULIB_BIND
+GNULIB_ACCEPT
+GNULIB_CONNECT
+GNULIB_SOCKET
+gltests_WITNESS
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
+NEXT_WCHAR_H
+HAVE_FEATURES_H
+LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE
+LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE
+LIBUNISTRING_UNIWIDTH_H
+LIBUNISTRING_UNITYPES_H
+LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE
+LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE
+LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE
+LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE
+LIBUNISTRING_UNISTR_H
+HAVE_UNISTD_H
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
+NEXT_UNISTD_H
+UNISTD_H_DEFINES_STRUCT_TIMESPEC
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
+TIME_H_DEFINES_STRUCT_TIMESPEC
+NEXT_AS_FIRST_DIRECTIVE_TIME_H
+NEXT_TIME_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H
+NEXT_SYS_WAIT_H
+GNULIB_WAITPID
+WINDOWS_64_BIT_OFF_T
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
+NEXT_SYS_TYPES_H
+HAVE_STRINGS_H
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H
+NEXT_STRINGS_H
+NEXT_AS_FIRST_DIRECTIVE_STRING_H
+NEXT_STRING_H
+HAVE_DECL_STRNCASECMP
+HAVE_STRCASECMP
+HAVE_FFS
+GNULIB_FFS
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
+NEXT_STDLIB_H
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H
+NEXT_STDIO_H
+HAVE__BOOL
+GL_GENERATE_STDBOOL_H_FALSE
+GL_GENERATE_STDBOOL_H_TRUE
+STDBOOL_H
+GL_GENERATE_STDARG_H_FALSE
+GL_GENERATE_STDARG_H_TRUE
+STDARG_H
+NEXT_AS_FIRST_DIRECTIVE_STDARG_H
+NEXT_STDARG_H
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
+NEXT_SIGNAL_H
+REPLACE_RAISE
+REPLACE_PTHREAD_SIGMASK
+HAVE_SIGHANDLER_T
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
+HAVE_STRUCT_SIGACTION_SA_SIGACTION
+HAVE_SIGACTION
+HAVE_SIGINFO_T
+HAVE_SIGSET_T
+HAVE_RAISE
+HAVE_PTHREAD_SIGMASK
+HAVE_POSIX_SIGNALBLOCKING
+GNULIB_SIGACTION
+GNULIB_SIGPROCMASK
+GNULIB_SIGNAL_H_SIGPIPE
+GNULIB_RAISE
+GNULIB_PTHREAD_SIGMASK
+REPLACE_LOCALTIME
+REPLACE_GMTIME
+REPLACE_TIMEGM
+REPLACE_NANOSLEEP
+REPLACE_MKTIME
+REPLACE_LOCALTIME_R
+HAVE_TIMEGM
+HAVE_STRPTIME
+HAVE_NANOSLEEP
+HAVE_DECL_LOCALTIME_R
+GNULIB_TIME_RZ
+GNULIB_TIME_R
+GNULIB_TIMEGM
+GNULIB_STRPTIME
+GNULIB_NANOSLEEP
+GNULIB_MKTIME
+UNDEFINE_STRTOK_R
+REPLACE_STRTOK_R
+REPLACE_STRSIGNAL
+REPLACE_STRNLEN
+REPLACE_STRNDUP
+REPLACE_STRNCAT
+REPLACE_STRERROR_R
+REPLACE_STRERROR
+REPLACE_STRCHRNUL
+REPLACE_STRCASESTR
+REPLACE_STRSTR
+REPLACE_STRDUP
+REPLACE_STPNCPY
+REPLACE_MEMMEM
+REPLACE_MEMCHR
+HAVE_STRVERSCMP
+HAVE_DECL_STRSIGNAL
+HAVE_DECL_STRERROR_R
+HAVE_DECL_STRTOK_R
+HAVE_STRCASESTR
+HAVE_STRSEP
+HAVE_STRPBRK
+HAVE_DECL_STRNLEN
+HAVE_DECL_STRNDUP
+HAVE_DECL_STRDUP
+HAVE_STRCHRNUL
+HAVE_STPNCPY
+HAVE_STPCPY
+HAVE_RAWMEMCHR
+HAVE_DECL_MEMRCHR
+HAVE_MEMPCPY
+HAVE_DECL_MEMMEM
+HAVE_MEMCHR
+HAVE_FFSLL
+HAVE_FFSL
+HAVE_MBSLEN
+GNULIB_STRVERSCMP
+GNULIB_STRSIGNAL
+GNULIB_STRERROR_R
+GNULIB_STRERROR
+GNULIB_MBSTOK_R
+GNULIB_MBSSEP
+GNULIB_MBSSPN
+GNULIB_MBSPBRK
+GNULIB_MBSCSPN
+GNULIB_MBSCASESTR
+GNULIB_MBSPCASECMP
+GNULIB_MBSNCASECMP
+GNULIB_MBSCASECMP
+GNULIB_MBSSTR
+GNULIB_MBSRCHR
+GNULIB_MBSCHR
+GNULIB_MBSNLEN
+GNULIB_MBSLEN
+GNULIB_STRTOK_R
+GNULIB_STRCASESTR
+GNULIB_STRSTR
+GNULIB_STRSEP
+GNULIB_STRPBRK
+GNULIB_STRNLEN
+GNULIB_STRNDUP
+GNULIB_STRNCAT
+GNULIB_STRDUP
+GNULIB_STRCHRNUL
+GNULIB_STPNCPY
+GNULIB_STPCPY
+GNULIB_RAWMEMCHR
+GNULIB_MEMRCHR
+GNULIB_MEMPCPY
+GNULIB_MEMMEM
+GNULIB_MEMCHR
+GNULIB_FFSLL
+GNULIB_FFSL
+LOCALE_FR_UTF8
+LOCALE_ZH_CN
+LOCALE_JA
+REPLACE_WCTOMB
+REPLACE_UNSETENV
+REPLACE_STRTOD
+REPLACE_SETENV
+REPLACE_REALPATH
+REPLACE_REALLOC
+REPLACE_RANDOM_R
+REPLACE_QSORT_R
+REPLACE_PUTENV
+REPLACE_PTSNAME_R
+REPLACE_PTSNAME
+REPLACE_MKSTEMP
+REPLACE_MBTOWC
+REPLACE_MALLOC
+REPLACE_CANONICALIZE_FILE_NAME
+REPLACE_CALLOC
+HAVE_DECL_UNSETENV
+HAVE_UNLOCKPT
+HAVE_SYS_LOADAVG_H
+HAVE_STRUCT_RANDOM_DATA
+HAVE_STRTOULL
+HAVE_STRTOLL
+HAVE_STRTOD
+HAVE_DECL_SETENV
+HAVE_SETENV
+HAVE_SECURE_GETENV
+HAVE_RPMATCH
+HAVE_REALPATH
+HAVE_RANDOM_R
+HAVE_RANDOM_H
+HAVE_RANDOM
+HAVE_PTSNAME_R
+HAVE_PTSNAME
+HAVE_POSIX_OPENPT
+HAVE_MKSTEMPS
+HAVE_MKSTEMP
+HAVE_MKOSTEMPS
+HAVE_MKOSTEMP
+HAVE_MKDTEMP
+HAVE_GRANTPT
+HAVE_GETSUBOPT
+HAVE_DECL_GETLOADAVG
+HAVE_CANONICALIZE_FILE_NAME
+HAVE_ATOLL
+HAVE__EXIT
+GNULIB_WCTOMB
+GNULIB_UNSETENV
+GNULIB_UNLOCKPT
+GNULIB_SYSTEM_POSIX
+GNULIB_STRTOULL
+GNULIB_STRTOLL
+GNULIB_STRTOD
+GNULIB_SETENV
+GNULIB_SECURE_GETENV
+GNULIB_RPMATCH
+GNULIB_REALPATH
+GNULIB_REALLOC_POSIX
+GNULIB_RANDOM_R
+GNULIB_RANDOM
+GNULIB_QSORT_R
+GNULIB_PUTENV
+GNULIB_PTSNAME_R
+GNULIB_PTSNAME
+GNULIB_POSIX_OPENPT
+GNULIB_MKSTEMPS
+GNULIB_MKSTEMP
+GNULIB_MKOSTEMPS
+GNULIB_MKOSTEMP
+GNULIB_MKDTEMP
+GNULIB_MBTOWC
+GNULIB_MALLOC_POSIX
+GNULIB_GRANTPT
+GNULIB_GETSUBOPT
+GNULIB_GETLOADAVG
+GNULIB_CANONICALIZE_FILE_NAME
+GNULIB_CALLOC_POSIX
+GNULIB_ATOLL
+GNULIB__EXIT
+SED
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
+NEXT_LOCALE_H
+HAVE_XLOCALE_H
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
+NEXT_STDDEF_H
+GL_GENERATE_STDDEF_H_FALSE
+GL_GENERATE_STDDEF_H_TRUE
+STDDEF_H
+HAVE_WCHAR_T
+HAVE_MAX_ALIGN_T
+REPLACE_NULL
+REPLACE_STRUCT_LCONV
+REPLACE_DUPLOCALE
+REPLACE_SETLOCALE
+REPLACE_LOCALECONV
+HAVE_DUPLOCALE
+GNULIB_DUPLOCALE
+GNULIB_SETLOCALE
+GNULIB_LOCALECONV
+LOCALCHARSET_TESTS_ENVIRONMENT
+GLIBC21
+HAVE_LANGINFO_YESEXPR
+HAVE_LANGINFO_ERA
+HAVE_LANGINFO_T_FMT_AMPM
+HAVE_LANGINFO_CODESET
+HAVE_LANGINFO_H
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H
+NEXT_LANGINFO_H
+REPLACE_NL_LANGINFO
+HAVE_NL_LANGINFO
+GNULIB_NL_LANGINFO
+REPLACE_TOWLOWER
+REPLACE_ISWCNTRL
+HAVE_WCTYPE_H
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
+NEXT_WCTYPE_H
+HAVE_WINT_T
+HAVE_ISWCNTRL
+REPLACE_ISWBLANK
+HAVE_WCTRANS_T
+HAVE_WCTYPE_T
+HAVE_ISWBLANK
+GNULIB_TOWCTRANS
+GNULIB_WCTRANS
+GNULIB_ISWCTYPE
+GNULIB_WCTYPE
+GNULIB_ISWBLANK
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
+NEXT_INTTYPES_H
+UINT64_MAX_EQ_ULONG_MAX
+UINT32_MAX_LT_UINTMAX_MAX
+PRIPTR_PREFIX
+PRI_MACROS_BROKEN
+INT64_MAX_EQ_LONG_MAX
+INT32_MAX_LT_INTMAX_MAX
+REPLACE_STRTOUMAX
+REPLACE_STRTOIMAX
+HAVE_DECL_STRTOUMAX
+HAVE_DECL_STRTOIMAX
+HAVE_DECL_IMAXDIV
+HAVE_DECL_IMAXABS
+GNULIB_STRTOUMAX
+GNULIB_STRTOIMAX
+GNULIB_IMAXDIV
+GNULIB_IMAXABS
+GL_GENERATE_STDINT_H_FALSE
+GL_GENERATE_STDINT_H_TRUE
+STDINT_H
+WINT_T_SUFFIX
+WCHAR_T_SUFFIX
+SIG_ATOMIC_T_SUFFIX
+SIZE_T_SUFFIX
+PTRDIFF_T_SUFFIX
+HAVE_SIGNED_WINT_T
+HAVE_SIGNED_WCHAR_T
+HAVE_SIGNED_SIG_ATOMIC_T
+BITSIZEOF_WINT_T
+BITSIZEOF_WCHAR_T
+BITSIZEOF_SIG_ATOMIC_T
+BITSIZEOF_SIZE_T
+BITSIZEOF_PTRDIFF_T
+APPLE_UNIVERSAL_BUILD
+HAVE_SYS_BITYPES_H
+HAVE_SYS_INTTYPES_H
+HAVE_STDINT_H
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H
+NEXT_STDINT_H
+HAVE_SYS_TYPES_H
+HAVE_INTTYPES_H
+HAVE_WCHAR_H
+HAVE_UNSIGNED_LONG_LONG_INT
+HAVE_LONG_LONG_INT
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H
+NEXT_ICONV_H
+GL_GENERATE_ICONV_H_FALSE
+GL_GENERATE_ICONV_H_TRUE
+ICONV_H
+REPLACE_ICONV_UTF
+REPLACE_ICONV_OPEN
+REPLACE_ICONV
+ICONV_CONST
+GNULIB_ICONV
+LTLIBICONV
+LIBICONV
+GNU_MAKE_FALSE
+GNU_MAKE_TRUE
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
+NEXT_SYS_TIME_H
+REPLACE_STRUCT_TIMEVAL
+REPLACE_GETTIMEOFDAY
+HAVE_TIMEZONE_T
+HAVE_SYS_TIME_H
+HAVE_STRUCT_TIMEVAL
+HAVE_GETTIMEOFDAY
+GNULIB_GETTIMEOFDAY
+LTLIBINTL
+LIBINTL
+GNULIB_GL_UNISTD_H_GETOPT
+GETOPT_H
+HAVE_GETOPT_H
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
+NEXT_GETOPT_H
+WINDOWS_64_BIT_ST_SIZE
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
+NEXT_SYS_STAT_H
+REPLACE_UTIMENSAT
+REPLACE_STAT
+REPLACE_MKNOD
+REPLACE_MKFIFO
+REPLACE_MKDIR
+REPLACE_LSTAT
+REPLACE_FUTIMENS
+REPLACE_FSTATAT
+REPLACE_FSTAT
+HAVE_UTIMENSAT
+HAVE_MKNODAT
+HAVE_MKNOD
+HAVE_MKFIFOAT
+HAVE_MKFIFO
+HAVE_MKDIRAT
+HAVE_LSTAT
+HAVE_LCHMOD
+HAVE_FUTIMENS
+HAVE_FSTATAT
+HAVE_FCHMODAT
+GNULIB_UTIMENSAT
+GNULIB_STAT
+GNULIB_MKNODAT
+GNULIB_MKNOD
+GNULIB_MKFIFOAT
+GNULIB_MKFIFO
+GNULIB_MKDIRAT
+GNULIB_LSTAT
+GNULIB_LCHMOD
+GNULIB_FUTIMENS
+GNULIB_FSTATAT
+GNULIB_FSTAT
+GNULIB_FCHMODAT
+REPLACE_VSPRINTF
+REPLACE_VSNPRINTF
+REPLACE_VPRINTF
+REPLACE_VFPRINTF
+REPLACE_VDPRINTF
+REPLACE_VASPRINTF
+REPLACE_TMPFILE
+REPLACE_STDIO_WRITE_FUNCS
+REPLACE_STDIO_READ_FUNCS
+REPLACE_SPRINTF
+REPLACE_SNPRINTF
+REPLACE_RENAMEAT
+REPLACE_RENAME
+REPLACE_REMOVE
+REPLACE_PRINTF
+REPLACE_POPEN
+REPLACE_PERROR
+REPLACE_OBSTACK_PRINTF
+REPLACE_GETLINE
+REPLACE_GETDELIM
+REPLACE_FTELLO
+REPLACE_FTELL
+REPLACE_FSEEKO
+REPLACE_FSEEK
+REPLACE_FREOPEN
+REPLACE_FPURGE
+REPLACE_FPRINTF
+REPLACE_FOPEN
+REPLACE_FFLUSH
+REPLACE_FDOPEN
+REPLACE_FCLOSE
+REPLACE_DPRINTF
+HAVE_VDPRINTF
+HAVE_VASPRINTF
+HAVE_RENAMEAT
+HAVE_POPEN
+HAVE_PCLOSE
+HAVE_FTELLO
+HAVE_FSEEKO
+HAVE_DPRINTF
+HAVE_DECL_VSNPRINTF
+HAVE_DECL_SNPRINTF
+HAVE_DECL_OBSTACK_PRINTF
+HAVE_DECL_GETLINE
+HAVE_DECL_GETDELIM
+HAVE_DECL_FTELLO
+HAVE_DECL_FSEEKO
+HAVE_DECL_FPURGE
+GNULIB_VSPRINTF_POSIX
+GNULIB_VSNPRINTF
+GNULIB_VPRINTF_POSIX
+GNULIB_VPRINTF
+GNULIB_VFPRINTF_POSIX
+GNULIB_VFPRINTF
+GNULIB_VDPRINTF
+GNULIB_VSCANF
+GNULIB_VFSCANF
+GNULIB_VASPRINTF
+GNULIB_TMPFILE
+GNULIB_STDIO_H_SIGPIPE
+GNULIB_STDIO_H_NONBLOCKING
+GNULIB_SPRINTF_POSIX
+GNULIB_SNPRINTF
+GNULIB_SCANF
+GNULIB_RENAMEAT
+GNULIB_RENAME
+GNULIB_REMOVE
+GNULIB_PUTS
+GNULIB_PUTCHAR
+GNULIB_PUTC
+GNULIB_PRINTF_POSIX
+GNULIB_PRINTF
+GNULIB_POPEN
+GNULIB_PERROR
+GNULIB_PCLOSE
+GNULIB_OBSTACK_PRINTF_POSIX
+GNULIB_OBSTACK_PRINTF
+GNULIB_GETLINE
+GNULIB_GETDELIM
+GNULIB_GETCHAR
+GNULIB_GETC
+GNULIB_FWRITE
+GNULIB_FTELLO
+GNULIB_FTELL
+GNULIB_FSEEKO
+GNULIB_FSEEK
+GNULIB_FSCANF
+GNULIB_FREOPEN
+GNULIB_FREAD
+GNULIB_FPUTS
+GNULIB_FPUTC
+GNULIB_FPURGE
+GNULIB_FPRINTF_POSIX
+GNULIB_FPRINTF
+GNULIB_FOPEN
+GNULIB_FGETS
+GNULIB_FGETC
+GNULIB_FFLUSH
+GNULIB_FDOPEN
+GNULIB_FCLOSE
+GNULIB_DPRINTF
+GL_GENERATE_FNMATCH_H_FALSE
+GL_GENERATE_FNMATCH_H_TRUE
+FNMATCH_H
+REPLACE_ITOLD
+GL_GENERATE_FLOAT_H_FALSE
+GL_GENERATE_FLOAT_H_TRUE
+FLOAT_H
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
+NEXT_FLOAT_H
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
+NEXT_FCNTL_H
+REPLACE_OPENAT
+REPLACE_OPEN
+REPLACE_FCNTL
+HAVE_OPENAT
+HAVE_FCNTL
+GNULIB_OPENAT
+GNULIB_OPEN
+GNULIB_NONBLOCKING
+GNULIB_FCNTL
+EOVERFLOW_VALUE
+EOVERFLOW_HIDDEN
+ENOLINK_VALUE
+ENOLINK_HIDDEN
+EMULTIHOP_VALUE
+EMULTIHOP_HIDDEN
+GL_GENERATE_ERRNO_H_FALSE
+GL_GENERATE_ERRNO_H_TRUE
+ERRNO_H
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
+NEXT_ERRNO_H
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H
+NEXT_CTYPE_H
+PRAGMA_COLUMNS
+PRAGMA_SYSTEM_HEADER
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE
+INCLUDE_NEXT
+HAVE_ISBLANK
+GNULIB_ISBLANK
+pkglibexecdir
+lispdir
+HAVE_WINSOCK2_H
+REPLACE_IOCTL
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
+SYS_IOCTL_H_HAVE_WINSOCK2_H
+GNULIB_IOCTL
+HAVE_MSVC_INVALID_PARAMETER_HANDLER
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
+UNISTD_H_HAVE_WINSOCK2_H
+REPLACE_WRITE
+REPLACE_USLEEP
+REPLACE_UNLINKAT
+REPLACE_UNLINK
+REPLACE_TTYNAME_R
+REPLACE_SYMLINKAT
+REPLACE_SYMLINK
+REPLACE_SLEEP
+REPLACE_RMDIR
+REPLACE_READLINKAT
+REPLACE_READLINK
+REPLACE_READ
+REPLACE_PWRITE
+REPLACE_PREAD
+REPLACE_LSEEK
+REPLACE_LINKAT
+REPLACE_LINK
+REPLACE_LCHOWN
+REPLACE_ISATTY
+REPLACE_GETPAGESIZE
+REPLACE_GETGROUPS
+REPLACE_GETLOGIN_R
+REPLACE_GETDTABLESIZE
+REPLACE_GETDOMAINNAME
+REPLACE_GETCWD
+REPLACE_FTRUNCATE
+REPLACE_FCHOWNAT
+REPLACE_DUP2
+REPLACE_DUP
+REPLACE_CLOSE
+REPLACE_CHOWN
+HAVE_SYS_PARAM_H
+HAVE_OS_H
+HAVE_DECL_TTYNAME_R
+HAVE_DECL_SETHOSTNAME
+HAVE_DECL_GETUSERSHELL
+HAVE_DECL_GETPAGESIZE
+HAVE_DECL_GETLOGIN_R
+HAVE_DECL_GETDOMAINNAME
+HAVE_DECL_FDATASYNC
+HAVE_DECL_FCHDIR
+HAVE_DECL_ENVIRON
+HAVE_USLEEP
+HAVE_UNLINKAT
+HAVE_SYMLINKAT
+HAVE_SYMLINK
+HAVE_SLEEP
+HAVE_SETHOSTNAME
+HAVE_READLINKAT
+HAVE_READLINK
+HAVE_PWRITE
+HAVE_PREAD
+HAVE_PIPE2
+HAVE_PIPE
+HAVE_LINKAT
+HAVE_LINK
+HAVE_LCHOWN
+HAVE_GROUP_MEMBER
+HAVE_GETPAGESIZE
+HAVE_GETLOGIN
+HAVE_GETHOSTNAME
+HAVE_GETGROUPS
+HAVE_GETDTABLESIZE
+HAVE_FTRUNCATE
+HAVE_FSYNC
+HAVE_FDATASYNC
+HAVE_FCHOWNAT
+HAVE_FCHDIR
+HAVE_FACCESSAT
+HAVE_EUIDACCESS
+HAVE_DUP3
+HAVE_DUP2
+HAVE_CHOWN
+GNULIB_WRITE
+GNULIB_USLEEP
+GNULIB_UNLINKAT
+GNULIB_UNLINK
+GNULIB_UNISTD_H_SIGPIPE
+GNULIB_UNISTD_H_NONBLOCKING
+GNULIB_TTYNAME_R
+GNULIB_SYMLINKAT
+GNULIB_SYMLINK
+GNULIB_SLEEP
+GNULIB_SETHOSTNAME
+GNULIB_RMDIR
+GNULIB_READLINKAT
+GNULIB_READLINK
+GNULIB_READ
+GNULIB_PWRITE
+GNULIB_PREAD
+GNULIB_PIPE2
+GNULIB_PIPE
+GNULIB_LSEEK
+GNULIB_LINKAT
+GNULIB_LINK
+GNULIB_LCHOWN
+GNULIB_ISATTY
+GNULIB_GROUP_MEMBER
+GNULIB_GETUSERSHELL
+GNULIB_GETPAGESIZE
+GNULIB_GETLOGIN_R
+GNULIB_GETLOGIN
+GNULIB_GETHOSTNAME
+GNULIB_GETGROUPS
+GNULIB_GETDTABLESIZE
+GNULIB_GETDOMAINNAME
+GNULIB_GETCWD
+GNULIB_FTRUNCATE
+GNULIB_FSYNC
+GNULIB_FDATASYNC
+GNULIB_FCHOWNAT
+GNULIB_FCHDIR
+GNULIB_FACCESSAT
+GNULIB_EUIDACCESS
+GNULIB_ENVIRON
+GNULIB_DUP3
+GNULIB_DUP2
+GNULIB_DUP
+GNULIB_CLOSE
+GNULIB_CHOWN
+GNULIB_CHDIR
+LIB_CLOCK_GETTIME
+LTLIBCSTACK
+LIBCSTACK
+LIBSIGSEGV_PREFIX
+LTLIBSIGSEGV
+LIBSIGSEGV
+HAVE_LIBSIGSEGV
+LOCALE_FR
+REPLACE_WCSWIDTH
+REPLACE_WCWIDTH
+REPLACE_WCSNRTOMBS
+REPLACE_WCSRTOMBS
+REPLACE_WCRTOMB
+REPLACE_MBSNRTOWCS
+REPLACE_MBSRTOWCS
+REPLACE_MBRLEN
+REPLACE_MBRTOWC
+REPLACE_MBSINIT
+REPLACE_WCTOB
+REPLACE_BTOWC
+REPLACE_MBSTATE_T
+HAVE_DECL_WCWIDTH
+HAVE_DECL_WCTOB
+HAVE_WCSWIDTH
+HAVE_WCSTOK
+HAVE_WCSSTR
+HAVE_WCSPBRK
+HAVE_WCSSPN
+HAVE_WCSCSPN
+HAVE_WCSRCHR
+HAVE_WCSCHR
+HAVE_WCSDUP
+HAVE_WCSXFRM
+HAVE_WCSCOLL
+HAVE_WCSNCASECMP
+HAVE_WCSCASECMP
+HAVE_WCSNCMP
+HAVE_WCSCMP
+HAVE_WCSNCAT
+HAVE_WCSCAT
+HAVE_WCPNCPY
+HAVE_WCSNCPY
+HAVE_WCPCPY
+HAVE_WCSCPY
+HAVE_WCSNLEN
+HAVE_WCSLEN
+HAVE_WMEMSET
+HAVE_WMEMMOVE
+HAVE_WMEMCPY
+HAVE_WMEMCMP
+HAVE_WMEMCHR
+HAVE_WCSNRTOMBS
+HAVE_WCSRTOMBS
+HAVE_WCRTOMB
+HAVE_MBSNRTOWCS
+HAVE_MBSRTOWCS
+HAVE_MBRLEN
+HAVE_MBRTOWC
+HAVE_MBSINIT
+HAVE_BTOWC
+GNULIB_WCSWIDTH
+GNULIB_WCSTOK
+GNULIB_WCSSTR
+GNULIB_WCSPBRK
+GNULIB_WCSSPN
+GNULIB_WCSCSPN
+GNULIB_WCSRCHR
+GNULIB_WCSCHR
+GNULIB_WCSDUP
+GNULIB_WCSXFRM
+GNULIB_WCSCOLL
+GNULIB_WCSNCASECMP
+GNULIB_WCSCASECMP
+GNULIB_WCSNCMP
+GNULIB_WCSCMP
+GNULIB_WCSNCAT
+GNULIB_WCSCAT
+GNULIB_WCPNCPY
+GNULIB_WCSNCPY
+GNULIB_WCPCPY
+GNULIB_WCSCPY
+GNULIB_WCSNLEN
+GNULIB_WCSLEN
+GNULIB_WMEMSET
+GNULIB_WMEMMOVE
+GNULIB_WMEMCPY
+GNULIB_WMEMCMP
+GNULIB_WMEMCHR
+GNULIB_WCWIDTH
+GNULIB_WCSNRTOMBS
+GNULIB_WCSRTOMBS
+GNULIB_WCRTOMB
+GNULIB_MBSNRTOWCS
+GNULIB_MBSRTOWCS
+GNULIB_MBRLEN
+GNULIB_MBRTOWC
+GNULIB_MBSINIT
+GNULIB_WCTOB
+GNULIB_BTOWC
+GL_GENERATE_ALLOCA_H_FALSE
+GL_GENERATE_ALLOCA_H_TRUE
+ALLOCA_H
+ALLOCA
+GL_COND_LIBTOOL_FALSE
+GL_COND_LIBTOOL_TRUE
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+ARFLAGS
+ac_ct_AR
+AR
+EGREP
+GREP
+CPP
+RANLIB
+HELP2MAN
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+SET_MAKE
+AWK
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+mkdir_p
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL
+am__quote'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+enable_largefile
+with_gnu_ld
+enable_rpath
+with_libsigsegv_prefix
+with_libiconv_prefix
+with_included_regex
+with_packager
+with_packager_version
+with_packager_bug_reports
+enable_gcc_warnings
+enable_nls
+with_libintl_prefix
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir runstatedir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures GNU diffutils 3.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/diffutils]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of GNU diffutils 3.5:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --disable-largefile omit support for large files
+ --disable-rpath do not hardcode runtime library paths
+ --enable-gcc-warnings turn on lots of GCC warnings (for developers)
+ --disable-nls do not use Native Language Support
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib
+ --without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir
+ --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
+ --without-libiconv-prefix don't search for libiconv in includedir and libdir
+ --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).
+ --with-packager String identifying the packager of this software
+ --with-packager-version Packager-specific version information
+ --with-packager-bug-reports
+ Packager info for bug reports (URL/e-mail/...)
+ --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
+ --without-libintl-prefix don't search for libintl in includedir and libdir
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <bug-diffutils@gnu.org>.
+GNU diffutils home page: <http://www.gnu.org/software/diffutils/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+GNU diffutils configure 3.5
+generated by GNU Autoconf 2.69.147-5ad35
+
+Copyright (C) 2015 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext
+then :
+ ac_retval=0
+else
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }
+then :
+ ac_retval=0
+else
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }
+then :
+ ac_retval=0
+else
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below. */
+
+#include <limits.h>
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main (void)
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
+# executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then :
+ ac_retval=0
+else
+ printf "%s\n" "$as_me: program exited with status $ac_status" >&5
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ # Initialize each $ac_[]_AC_LANG_ABBREV[]_decl_warn_flag once.
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+printf %s "checking whether $as_decl_name is declared... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_save_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag="$ac_c_decl_warn_flag$ac_c_werror_flag"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ ac_c_werror_flag=$ac_save_werror_flag
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main (void)
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+printf %s "checking for $2.$3... " >&6; }
+if eval test \${$4+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main (void)
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main (void)
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by GNU diffutils $as_me 3.5, which was
+generated by GNU Autoconf 2.69.147-5ad35. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ printf "%s\n" "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Sanitize IFS.
+ IFS=" "" $as_nl"
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ printf "%s\n" "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ printf "%s\n" "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ printf "%s\n" "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ printf "%s\n" "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ printf "%s\n" "$as_me: caught signal $ac_signal"
+ printf "%s\n" "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+printf "%s\n" "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+as_fn_append ac_header_list " sys/types.h"
+as_fn_append ac_header_list " sys/stat.h"
+as_fn_append ac_header_list " strings.h"
+as_fn_append ac_header_list " inttypes.h"
+as_fn_append ac_header_list " stdint.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_func_list " btowc"
+as_fn_append ac_func_list " setrlimit"
+as_fn_append ac_header_list " ucontext.h"
+as_fn_append ac_func_list " sigaltstack"
+as_fn_append ac_func_list " readlinkat"
+as_fn_append ac_func_list " _set_invalid_parameter_handler"
+as_fn_append ac_header_list " sys/socket.h"
+as_fn_append ac_func_list " strerror_r"
+as_fn_append ac_func_list " fcntl"
+as_fn_append ac_func_list " symlink"
+as_fn_append ac_func_list " mempcpy"
+as_fn_append ac_func_list " isblank"
+as_fn_append ac_func_list " iswctype"
+as_fn_append ac_func_list " mbsrtowcs"
+as_fn_append ac_func_list " wmemchr"
+as_fn_append ac_func_list " wmemcpy"
+as_fn_append ac_func_list " wmempcpy"
+as_fn_append ac_header_list " wctype.h"
+gl_fnmatch_required=GNU
+as_fn_append ac_func_list " getdtablesize"
+gl_getopt_required=GNU
+as_fn_append ac_header_list " getopt.h"
+as_fn_append ac_func_list " gettimeofday"
+as_fn_append ac_func_list " nanotime"
+as_fn_append ac_header_list " sys/time.h"
+as_fn_append ac_header_list " iconv.h"
+as_fn_append ac_header_list " wchar.h"
+as_fn_append ac_func_list " iswcntrl"
+as_fn_append ac_func_list " iswblank"
+as_fn_append ac_header_list " langinfo.h"
+as_fn_append ac_header_list " xlocale.h"
+as_fn_append ac_func_list " lstat"
+as_fn_append ac_func_list " mbsinit"
+as_fn_append ac_func_list " mbrtowc"
+as_fn_append ac_func_list " mbslen"
+as_fn_append ac_header_list " sys/mman.h"
+as_fn_append ac_func_list " mprotect"
+as_fn_append ac_func_list " mkstemp"
+as_fn_append ac_func_list " tzset"
+as_fn_append ac_func_list " nl_langinfo"
+as_fn_append ac_header_list " sys/param.h"
+as_fn_append ac_func_list " readlink"
+as_fn_append ac_header_list " malloc.h"
+as_fn_append ac_func_list " secure_getenv"
+as_fn_append ac_func_list " getuid"
+as_fn_append ac_func_list " geteuid"
+as_fn_append ac_func_list " getgid"
+as_fn_append ac_func_list " getegid"
+as_fn_append ac_func_list " setenv"
+as_fn_append ac_func_list " sigaction"
+as_fn_append ac_func_list " siginterrupt"
+as_fn_append ac_func_list " __xpg_strerror_r"
+as_fn_append ac_func_list " strndup"
+as_fn_append ac_func_list " strptime"
+as_fn_append ac_func_list " strtoumax"
+as_fn_append ac_header_list " sys/wait.h"
+as_fn_append ac_func_list " localtime_r"
+as_fn_append ac_func_list " timegm"
+as_fn_append ac_func_list " vasnprintf"
+as_fn_append ac_header_list " features.h"
+as_fn_append ac_func_list " snprintf"
+as_fn_append ac_func_list " wcrtomb"
+as_fn_append ac_func_list " wcwidth"
+as_fn_append ac_header_list " arpa/inet.h"
+as_fn_append ac_func_list " ftruncate"
+as_fn_append ac_header_list " netdb.h"
+as_fn_append ac_header_list " netinet/in.h"
+as_fn_append ac_func_list " newlocale"
+as_fn_append ac_header_list " sys/select.h"
+as_fn_append ac_func_list " pipe"
+as_fn_append ac_func_list " sleep"
+as_fn_append ac_func_list " catgets"
+as_fn_append ac_header_list " sys/ioctl.h"
+as_fn_append ac_func_list " shutdown"
+as_fn_append ac_header_list " sys/uio.h"
+as_fn_append ac_func_list " wctob"
+as_fn_append ac_func_list " sigprocmask"
+as_fn_append ac_func_list " strcasecoll"
+as_fn_append ac_func_list " stricoll"
+as_fn_append ac_header_list " vfork.h"
+as_fn_append ac_func_list " fork"
+as_fn_append ac_func_list " vfork"
+gt_needs="$gt_needs need-ngettext"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux
+do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.99a'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test ${ac_cv_path_install+y}
+then :
+ printf %s "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+ ./ | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test ${ac_cv_path_install+y}; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+printf %s "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test ${ac_cv_path_mkdir+y}
+then :
+ printf %s "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir ('*'coreutils) '* | \
+ 'BusyBox '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test ${ac_cv_path_mkdir+y}; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ SET_MAKE=
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# Check whether --enable-silent-rules was given.
+if test ${enable_silent_rules+y}
+then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if printf "%s\n" 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+mkdir_p='$(MKDIR_P)'
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='diffutils'
+ VERSION='3.5'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test ${enable_silent_rules+y}
+then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=0;;
+esac
+am_make=${MAKE-make}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if printf "%s\n" 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+ # make --enable-silent-rules the default.
+
+ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin"
+
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion -version; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+printf %s "checking whether the C compiler works... " >&6; }
+ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+printf %s "checking for C compiler default output file name... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+printf "%s\n" "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+printf %s "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+printf "%s\n" "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main (void)
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+printf %s "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" = maybe && test "x$build" != "x$host"; then
+ cross_compiling=yes
+elif test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+printf "%s\n" "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+printf %s "checking for suffix of object files... " >&6; }
+if test ${ac_cv_objext+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+printf "%s\n" "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+y}
+ac_save_CFLAGS=$CFLAGS
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_prog_cc_c11=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+
+int
+main (void)
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ v1.i = 2;
+ v1.w.k = 5;
+ _Static_assert (&v1.i == &v1.w.k, "Anonymous union alignment botch");
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_c11" in
+ x)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; } ;;
+ xno)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; } ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
+ CC=$CC$ac_prog_cc_stdc_options
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c11" != xno
+then :
+ ac_prog_cc_stdc=c11
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+int
+main (void)
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; } ;;
+ xno)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; } ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
+ CC=$CC$ac_prog_cc_stdc_options
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno
+then :
+ ac_prog_cc_stdc=c99
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main (void)
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; } ;;
+ xno)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; } ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
+ CC=$CC$ac_prog_cc_stdc_options
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno
+then :
+ ac_prog_cc_stdc=c89
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+else
+ ac_prog_cc_stdc=no
+ ac_cv_prog_cc_stdc=no
+fi
+
+fi
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+DEPDIR=.deps
+
+ac_config_commands="$ac_config_commands depfiles"
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+printf "%s\n" "${_am_result}" >&6; }
+
+# Check whether --enable-dependency-tracking was given.
+if test ${enable_dependency_tracking+y}
+then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+
+HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+ for ac_header in $ac_header_list
+do :
+ as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+
+printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h
+
+printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h
+
+printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
+
+
+ ac_fn_c_check_header_compile "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes
+then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+ if test "$MINIX" = yes; then
+
+printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+printf "%s\n" "#define _MINIX 1" >>confdefs.h
+
+
+printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h
+
+ fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test ${ac_cv_safe_to_define___extensions__+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h
+
+ printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+ printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h
+
+ printf "%s\n" "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
+
+ printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
+printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; }
+if test ${ac_cv_should_define__xopen_source+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_should_define__xopen_source=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <wchar.h>
+ mbstate_t x;
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_should_define__xopen_source=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
+printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; }
+ test $ac_cv_should_define__xopen_source = yes &&
+ printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+printf %s "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test ${ac_cv_prog_CPP+y}
+then :
+ printf %s "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"
+then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"
+then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok
+then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+printf "%s\n" "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"
+then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"
+then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok
+then :
+
+else
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+printf %s "checking for grep that handles long lines and -e... " >&6; }
+if test ${ac_cv_path_GREP+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in grep ggrep
+ do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ printf %s 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ printf "%s\n" 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+printf "%s\n" "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+printf %s "checking for egrep... " >&6; }
+if test ${ac_cv_path_EGREP+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in egrep
+ do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ printf %s 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ printf "%s\n" 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+printf "%s\n" "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
+printf %s "checking for Minix Amsterdam compiler... " >&6; }
+if test ${gl_cv_c_amsterdam_compiler+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef __ACK__
+Amsterdam
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Amsterdam" >/dev/null 2>&1
+then :
+ gl_cv_c_amsterdam_compiler=yes
+else
+ gl_cv_c_amsterdam_compiler=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
+printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; }
+
+ 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
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar lib "link -lib"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AR+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar lib "link -lib"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AR+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+printf "%s\n" "$ac_ct_AR" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+printf %s "checking the archiver ($AR) interface... " >&6; }
+if test ${am_cv_ar_interface+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ am_cv_ar_interface=ar
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+ (eval $am_ar_try) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=ar
+ else
+ am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+ (eval $am_ar_try) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=lib
+ else
+ am_cv_ar_interface=unknown
+ fi
+ fi
+ rm -f conftest.lib libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+printf "%s\n" "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+ ;;
+lib)
+ # Microsoft lib, so override with the ar-lib wrapper script.
+ # FIXME: It is wrong to rewrite AR.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__AR in this case,
+ # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+ # similar.
+ AR="$am_aux_dir/ar-lib $AR"
+ ;;
+unknown)
+ as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+ ;;
+esac
+
+ fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AR+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AR+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+printf "%s\n" "$ac_ct_AR" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="ar"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cr'
+ fi
+
+
+
+ if test -z "$RANLIB"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ RANLIB=':'
+ else
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ fi
+ fi
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+printf %s "checking build system type... " >&6; }
+if test ${ac_cv_build+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+printf "%s\n" "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+printf %s "checking host system type... " >&6; }
+if test ${ac_cv_host+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+printf "%s\n" "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+ # IEEE behaviour is the default on all CPUs except Alpha and SH
+ # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
+ # and the GCC 4.1.2 manual).
+ case "$host_cpu" in
+ alpha*)
+ # On Alpha systems, a compiler option provides the behaviour.
+ # See the ieee(3) manual page, also available at
+ # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
+ if test -n "$GCC"; then
+ # GCC has the option -mieee.
+ # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
+ CPPFLAGS="$CPPFLAGS -mieee"
+ else
+ # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+ # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
+ CPPFLAGS="$CPPFLAGS -ieee"
+ fi
+ ;;
+ sh*)
+ if test -n "$GCC"; then
+ # GCC has the option -mieee.
+ CPPFLAGS="$CPPFLAGS -mieee"
+ fi
+ ;;
+ esac
+
+# Check whether --enable-largefile was given.
+if test ${enable_largefile+y}
+then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+printf %s "checking for special C compiler options needed for large files... " >&6; }
+if test ${ac_cv_sys_largefile_CC+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test ${ac_cv_sys_file_offset_bits+y}
+then :
+ printf %s "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#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 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+printf %s "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test ${ac_cv_sys_large_files+y}
+then :
+ printf %s "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#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 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+printf "%s\n" "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+
+
+printf "%s\n" "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
+
+fi
+
+
+
+
+ # Pre-early section.
+
+
+
+
+ # Code from module absolute-header:
+ # Code from module accept:
+ # Code from module accept-tests:
+ # Code from module alloca:
+ # Code from module alloca-opt:
+ # Code from module alloca-opt-tests:
+ # Code from module allocator:
+ # Code from module announce-gen:
+ # Code from module areadlink:
+ # Code from module areadlink-tests:
+ # Code from module argmatch:
+ # Code from module argmatch-tests:
+ # Code from module arpa_inet:
+ # Code from module arpa_inet-tests:
+ # Code from module assure:
+ # Code from module binary-io:
+ # Code from module binary-io-tests:
+ # Code from module bind:
+ # Code from module bind-tests:
+ # Code from module bitrotate:
+ # Code from module bitrotate-tests:
+ # Code from module btowc:
+ # Code from module btowc-tests:
+ # Code from module c-ctype:
+ # Code from module c-ctype-tests:
+ # Code from module c-stack:
+ # Code from module c-stack-tests:
+ # Code from module c-strcase:
+ # Code from module c-strcase-tests:
+ # Code from module c-strcaseeq:
+ # Code from module careadlinkat:
+ # Code from module clock-time:
+ # Code from module close:
+ # Code from module close-tests:
+ # Code from module config-h:
+ # Code from module configmake:
+ # Code from module connect:
+ # Code from module connect-tests:
+ # Code from module ctype:
+ # Code from module ctype-tests:
+ # Code from module diffseq:
+ # Code from module dirname:
+ # Code from module dirname-lgpl:
+ # Code from module dirname-tests:
+ # Code from module do-release-commit-and-tag:
+ # Code from module dosname:
+ # Code from module double-slash-root:
+ # Code from module dtotimespec:
+ # Code from module dup2:
+ # Code from module dup2-tests:
+ # Code from module environ:
+ # Code from module environ-tests:
+ # Code from module errno:
+ # Code from module errno-tests:
+ # Code from module error:
+ # Code from module exclude:
+ # Code from module exclude-tests:
+ # Code from module exitfail:
+ # Code from module extensions:
+ # Code from module extern-inline:
+ # Code from module fcntl:
+ # Code from module fcntl-h:
+ # Code from module fcntl-h-tests:
+ # Code from module fcntl-tests:
+ # Code from module fd-hook:
+ # Code from module fdl:
+ # Code from module fdopen:
+ # Code from module fdopen-tests:
+ # Code from module fgetc-tests:
+ # Code from module file-type:
+ # Code from module filename:
+ # Code from module filenamecat:
+ # Code from module filenamecat-lgpl:
+ # Code from module filenamecat-tests:
+ # Code from module flexmember:
+ # Code from module float:
+ # Code from module float-tests:
+ # Code from module fnmatch:
+ # Code from module fnmatch-gnu:
+ # Code from module fnmatch-tests:
+ # Code from module fpieee:
+
+ # Code from module fpucw:
+ # Code from module fputc-tests:
+ # Code from module fread-tests:
+ # Code from module freopen:
+ # Code from module freopen-safer:
+ # Code from module freopen-safer-tests:
+ # Code from module freopen-tests:
+ # Code from module fstat:
+ # Code from module fstat-tests:
+ # Code from module ftruncate:
+ # Code from module ftruncate-tests:
+ # Code from module fwrite-tests:
+ # Code from module gendocs:
+ # Code from module getcwd-lgpl:
+ # Code from module getcwd-lgpl-tests:
+ # Code from module getdtablesize:
+ # Code from module getdtablesize-tests:
+ # Code from module getopt:
+ # Code from module getopt-gnu:
+ # Code from module getopt-posix:
+ # Code from module getopt-posix-tests:
+ # Code from module getpagesize:
+ # Code from module gettext-h:
+ # Code from module gettime:
+ # Code from module gettimeofday:
+ # Code from module gettimeofday-tests:
+ # Code from module git-version-gen:
+ # Code from module gitlog-to-changelog:
+ # Code from module gnu-make:
+ # Code from module gnu-web-doc-update:
+ # Code from module gnumakefile:
+ # Code from module gnupload:
+ # Code from module gperf:
+ # Code from module hard-locale:
+ # Code from module hash:
+ # Code from module hash-pjw:
+ # Code from module hash-tests:
+ # Code from module havelib:
+ # Code from module iconv:
+ # Code from module iconv-h:
+ # Code from module iconv-h-tests:
+ # Code from module iconv-tests:
+ # Code from module iconv_open:
+ # Code from module ignore-value:
+ # Code from module ignore-value-tests:
+ # Code from module include_next:
+ # Code from module inet_pton:
+ # Code from module inet_pton-tests:
+ # Code from module inline:
+ # Code from module intprops:
+ # Code from module intprops-tests:
+ # Code from module inttostr:
+ # Code from module inttostr-tests:
+ # Code from module inttypes:
+ # Code from module inttypes-incomplete:
+ # Code from module inttypes-tests:
+ # Code from module ioctl:
+ # Code from module ioctl-tests:
+ # Code from module isblank:
+ # Code from module isblank-tests:
+ # Code from module iswblank:
+ # Code from module iswblank-tests:
+ # Code from module langinfo:
+ # Code from module langinfo-tests:
+ # Code from module largefile:
+
+ # Code from module libsigsegv:
+ # Code from module listen:
+ # Code from module listen-tests:
+ # Code from module localcharset:
+ # Code from module locale:
+ # Code from module locale-tests:
+ # Code from module localeconv:
+ # Code from module localeconv-tests:
+ # Code from module lstat:
+ # Code from module lstat-tests:
+ # Code from module maintainer-makefile:
+ # Code from module malloc-posix:
+ # Code from module malloca:
+ # Code from module malloca-tests:
+ # Code from module manywarnings:
+ # Code from module mbchar:
+ # Code from module mbiter:
+ # Code from module mbrtowc:
+ # Code from module mbrtowc-tests:
+ # Code from module mbscasecmp:
+ # Code from module mbscasecmp-tests:
+ # Code from module mbsinit:
+ # Code from module mbsinit-tests:
+ # Code from module mbslen:
+ # Code from module mbsrtowcs:
+ # Code from module mbsrtowcs-tests:
+ # Code from module mbsstr:
+ # Code from module mbsstr-tests:
+ # Code from module mbtowc:
+ # Code from module mbuiter:
+ # Code from module memchr:
+ # Code from module memchr-tests:
+ # Code from module mkstemp:
+ # Code from module mktime:
+ # Code from module mktime-internal:
+ # Code from module msvc-inval:
+ # Code from module msvc-nothrow:
+ # Code from module multiarch:
+ # Code from module nanosleep:
+ # Code from module nanosleep-tests:
+ # Code from module netinet_in:
+ # Code from module netinet_in-tests:
+ # Code from module nl_langinfo:
+ # Code from module nl_langinfo-tests:
+ # Code from module nocrash:
+ # Code from module open:
+ # Code from module open-tests:
+ # Code from module pathmax:
+ # Code from module pathmax-tests:
+ # Code from module perror:
+ # Code from module perror-tests:
+ # Code from module pipe-posix:
+ # Code from module pipe-posix-tests:
+ # Code from module progname:
+ # Code from module propername:
+ # Code from module putenv:
+ # Code from module quote:
+ # Code from module quotearg:
+ # Code from module quotearg-simple:
+ # Code from module quotearg-simple-tests:
+ # Code from module raise:
+ # Code from module raise-tests:
+ # Code from module rawmemchr:
+ # Code from module rawmemchr-tests:
+ # Code from module readlink:
+ # Code from module readlink-tests:
+ # Code from module readme-release:
+ # Code from module regex:
+ # Code from module regex-tests:
+ # Code from module same-inode:
+ # Code from module secure_getenv:
+ # Code from module select:
+ # Code from module select-tests:
+ # Code from module setenv:
+ # Code from module setenv-tests:
+ # Code from module setlocale:
+ # Code from module setlocale-tests:
+ # Code from module setsockopt:
+ # Code from module setsockopt-tests:
+ # Code from module sh-quote:
+ # Code from module sh-quote-tests:
+ # Code from module sigaction:
+ # Code from module sigaction-tests:
+ # Code from module signal:
+ # Code from module signal-h:
+ # Code from module signal-h-tests:
+ # Code from module sigprocmask:
+ # Code from module sigprocmask-tests:
+ # Code from module size_max:
+ # Code from module sleep:
+ # Code from module sleep-tests:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/unused-parameter:
+ # Code from module snippet/warn-on-use:
+ # Code from module snprintf:
+ # Code from module snprintf-tests:
+ # Code from module socket:
+ # Code from module socketlib:
+ # Code from module sockets:
+ # Code from module sockets-tests:
+ # Code from module socklen:
+ # Code from module ssize_t:
+ # Code from module stat:
+ # Code from module stat-macros:
+ # Code from module stat-tests:
+ # Code from module stat-time:
+ # Code from module stat-time-tests:
+ # Code from module stdalign:
+ # Code from module stdalign-tests:
+ # Code from module stdarg:
+
+
+
+ # Code from module stdbool:
+ # Code from module stdbool-tests:
+ # Code from module stddef:
+ # Code from module stddef-tests:
+ # Code from module stdint:
+ # Code from module stdint-tests:
+ # Code from module stdio:
+ # Code from module stdio-tests:
+ # Code from module stdlib:
+ # Code from module stdlib-tests:
+ # Code from module strcase:
+ # Code from module streq:
+ # Code from module strerror:
+ # Code from module strerror-override:
+ # Code from module strerror-tests:
+ # Code from module strerror_r-posix:
+ # Code from module strerror_r-posix-tests:
+ # Code from module strftime:
+ # Code from module strftime-tests:
+ # Code from module striconv:
+ # Code from module striconv-tests:
+ # Code from module string:
+ # Code from module string-tests:
+ # Code from module strings:
+ # Code from module strings-tests:
+ # Code from module strndup:
+ # Code from module strnlen:
+ # Code from module strnlen-tests:
+ # Code from module strnlen1:
+ # Code from module strptime:
+ # Code from module strtoull:
+ # Code from module strtoull-tests:
+ # Code from module strtoumax:
+ # Code from module strtoumax-tests:
+ # Code from module symlink:
+ # Code from module symlink-tests:
+ # Code from module sys_ioctl:
+ # Code from module sys_ioctl-tests:
+ # Code from module sys_select:
+ # Code from module sys_select-tests:
+ # Code from module sys_socket:
+ # Code from module sys_socket-tests:
+ # Code from module sys_stat:
+ # Code from module sys_stat-tests:
+ # Code from module sys_time:
+ # Code from module sys_time-tests:
+ # Code from module sys_types:
+ # Code from module sys_types-tests:
+ # Code from module sys_uio:
+ # Code from module sys_uio-tests:
+ # Code from module sys_wait:
+ # Code from module sys_wait-tests:
+ # Code from module system-quote:
+ # Code from module tempname:
+ # Code from module test-framework-sh:
+ # Code from module test-framework-sh-tests:
+ # Code from module time:
+ # Code from module time-tests:
+ # Code from module time_r:
+ # Code from module time_rz:
+ # Code from module timegm:
+ # Code from module timespec:
+ # Code from module timespec-add:
+ # Code from module timespec-sub:
+ # Code from module timespec-tests:
+ # Code from module trim:
+ # Code from module unistd:
+ # Code from module unistd-tests:
+ # Code from module unistr/base:
+ # Code from module unistr/u8-mbtoucr:
+ # Code from module unistr/u8-mbtoucr-tests:
+ # Code from module unistr/u8-uctomb:
+ # Code from module unistr/u8-uctomb-tests:
+ # Code from module unitypes:
+ # Code from module uniwidth/base:
+ # Code from module uniwidth/width:
+ # Code from module uniwidth/width-tests:
+ # Code from module unlocked-io:
+ # Code from module unsetenv:
+ # Code from module unsetenv-tests:
+ # Code from module update-copyright:
+ # Code from module update-copyright-tests:
+ # Code from module useless-if-before-free:
+ # Code from module vararrays:
+ # Code from module vasnprintf:
+ # Code from module vasnprintf-tests:
+ # Code from module vasprintf:
+ # Code from module vasprintf-tests:
+ # Code from module vc-list-files:
+ # Code from module vc-list-files-tests:
+ # Code from module verify:
+ # Code from module verify-tests:
+ # Code from module version-etc:
+ # Code from module version-etc-fsf:
+ # Code from module version-etc-tests:
+ # Code from module warnings:
+ # Code from module wchar:
+ # Code from module wchar-tests:
+ # Code from module wcrtomb:
+ # Code from module wcrtomb-tests:
+ # Code from module wctob:
+ # Code from module wctomb:
+ # Code from module wctype-h:
+ # Code from module wctype-h-tests:
+ # Code from module wcwidth:
+ # Code from module wcwidth-tests:
+ # Code from module xalloc:
+ # Code from module xalloc-die:
+ # Code from module xalloc-die-tests:
+ # Code from module xalloc-oversized:
+ # Code from module xfreopen:
+ # Code from module xreadlink:
+ # Code from module xsize:
+ # Code from module xstriconv:
+ # Code from module xstrndup:
+ # Code from module xstrtol:
+ # Code from module xstrtol-tests:
+ # Code from module xstrtoumax:
+ # Code from module xstrtoumax-tests:
+ # Code from module xvasprintf:
+ # Code from module xvasprintf-tests:
+
+
+
+
+
+
+
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes
+then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+printf %s "checking for working alloca.h... " >&6; }
+if test ${ac_cv_working_alloca_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main (void)
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_working_alloca_h=yes
+else
+ ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+printf "%s\n" "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+printf %s "checking for alloca... " >&6; }
+if test ${ac_cv_func_alloca_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test $ac_cv_working_alloca_h = yes; then
+ ac_cv_func_alloca_works=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stddef.h>
+#ifndef alloca
+# ifdef __GNUC__
+# define alloca __builtin_alloca
+# elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+# endif
+#endif
+
+int
+main (void)
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_func_alloca_works=yes
+else
+ ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+printf "%s\n" "$ac_cv_func_alloca_works" >&6; }
+fi
+
+if test $ac_cv_func_alloca_works = yes; then
+
+printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+ # 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.
+
+
+
+
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+printf %s "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if test ${ac_cv_os_cray+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1
+then :
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+printf "%s\n" "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+ break
+fi
+
+ done
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+printf %s "checking stack direction for C alloca... " >&6; }
+if test ${ac_cv_c_stack_direction+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+printf "%s\n" "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+
+ GNULIB_BTOWC=0;
+ GNULIB_WCTOB=0;
+ GNULIB_MBSINIT=0;
+ GNULIB_MBRTOWC=0;
+ GNULIB_MBRLEN=0;
+ GNULIB_MBSRTOWCS=0;
+ GNULIB_MBSNRTOWCS=0;
+ GNULIB_WCRTOMB=0;
+ GNULIB_WCSRTOMBS=0;
+ GNULIB_WCSNRTOMBS=0;
+ GNULIB_WCWIDTH=0;
+ GNULIB_WMEMCHR=0;
+ GNULIB_WMEMCMP=0;
+ GNULIB_WMEMCPY=0;
+ GNULIB_WMEMMOVE=0;
+ GNULIB_WMEMSET=0;
+ GNULIB_WCSLEN=0;
+ GNULIB_WCSNLEN=0;
+ GNULIB_WCSCPY=0;
+ GNULIB_WCPCPY=0;
+ GNULIB_WCSNCPY=0;
+ GNULIB_WCPNCPY=0;
+ GNULIB_WCSCAT=0;
+ GNULIB_WCSNCAT=0;
+ GNULIB_WCSCMP=0;
+ GNULIB_WCSNCMP=0;
+ GNULIB_WCSCASECMP=0;
+ GNULIB_WCSNCASECMP=0;
+ GNULIB_WCSCOLL=0;
+ GNULIB_WCSXFRM=0;
+ GNULIB_WCSDUP=0;
+ GNULIB_WCSCHR=0;
+ GNULIB_WCSRCHR=0;
+ GNULIB_WCSCSPN=0;
+ GNULIB_WCSSPN=0;
+ GNULIB_WCSPBRK=0;
+ GNULIB_WCSSTR=0;
+ GNULIB_WCSTOK=0;
+ GNULIB_WCSWIDTH=0;
+ HAVE_BTOWC=1;
+ HAVE_MBSINIT=1;
+ HAVE_MBRTOWC=1;
+ HAVE_MBRLEN=1;
+ HAVE_MBSRTOWCS=1;
+ HAVE_MBSNRTOWCS=1;
+ HAVE_WCRTOMB=1;
+ HAVE_WCSRTOMBS=1;
+ HAVE_WCSNRTOMBS=1;
+ HAVE_WMEMCHR=1;
+ HAVE_WMEMCMP=1;
+ HAVE_WMEMCPY=1;
+ HAVE_WMEMMOVE=1;
+ HAVE_WMEMSET=1;
+ HAVE_WCSLEN=1;
+ HAVE_WCSNLEN=1;
+ HAVE_WCSCPY=1;
+ HAVE_WCPCPY=1;
+ HAVE_WCSNCPY=1;
+ HAVE_WCPNCPY=1;
+ HAVE_WCSCAT=1;
+ HAVE_WCSNCAT=1;
+ HAVE_WCSCMP=1;
+ HAVE_WCSNCMP=1;
+ HAVE_WCSCASECMP=1;
+ HAVE_WCSNCASECMP=1;
+ HAVE_WCSCOLL=1;
+ HAVE_WCSXFRM=1;
+ HAVE_WCSDUP=1;
+ HAVE_WCSCHR=1;
+ HAVE_WCSRCHR=1;
+ HAVE_WCSCSPN=1;
+ HAVE_WCSSPN=1;
+ HAVE_WCSPBRK=1;
+ HAVE_WCSSTR=1;
+ HAVE_WCSTOK=1;
+ HAVE_WCSWIDTH=1;
+ HAVE_DECL_WCTOB=1;
+ HAVE_DECL_WCWIDTH=1;
+ REPLACE_MBSTATE_T=0;
+ REPLACE_BTOWC=0;
+ REPLACE_WCTOB=0;
+ REPLACE_MBSINIT=0;
+ REPLACE_MBRTOWC=0;
+ REPLACE_MBRLEN=0;
+ REPLACE_MBSRTOWCS=0;
+ REPLACE_MBSNRTOWCS=0;
+ REPLACE_WCRTOMB=0;
+ REPLACE_WCSRTOMBS=0;
+ REPLACE_WCSNRTOMBS=0;
+ REPLACE_WCWIDTH=0;
+ REPLACE_WCSWIDTH=0;
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
+printf %s "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
+if test ${gl_cv_header_wchar_h_correct_inline+y}
+then :
+ printf %s "(cached) " >&6
+else
+ gl_cv_header_wchar_h_correct_inline=yes
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+extern int zero (void);
+int main () { return zero(); }
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ mv conftest.$ac_objext conftest1.$ac_objext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int zero (void) { return 0; }
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ mv conftest.$ac_objext conftest2.$ac_objext
+ if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
+ :
+ else
+ gl_cv_header_wchar_h_correct_inline=no
+ fi
+ fi
+ fi
+ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
+printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; }
+ if test $gl_cv_header_wchar_h_correct_inline = no; then
+ as_fn_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
+ <http://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." "$LINENO" 5
+ fi
+
+
+
+
+ for ac_func in $ac_func_list
+do :
+ as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
+printf %s "checking for nl_langinfo and CODESET... " >&6; }
+if test ${am_cv_langinfo_codeset+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main (void)
+{
+char* cs = nl_langinfo(CODESET); return !cs;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ am_cv_langinfo_codeset=yes
+else
+ am_cv_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
+printf "%s\n" "$am_cv_langinfo_codeset" >&6; }
+ if test $am_cv_langinfo_codeset = yes; then
+
+printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
+
+ fi
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+
+
+
+
+
+
+
+ case "$host_os" in
+ sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems
+ FAULT_YIELDS_SIGBUS=1 ;;
+ hpux*) # HP-UX
+ FAULT_YIELDS_SIGBUS=1 ;;
+ macos* | darwin*) # Mac OS X
+ FAULT_YIELDS_SIGBUS=1 ;;
+ gnu*) # Hurd
+ FAULT_YIELDS_SIGBUS=1 ;;
+ *)
+ FAULT_YIELDS_SIGBUS=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS
+_ACEOF
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5
+printf %s "checking for working C stack overflow detection... " >&6; }
+if test ${ac_cv_sys_stack_overflow_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ ac_cv_sys_stack_overflow_works=cross-compiling
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <unistd.h>
+ #include <signal.h>
+ #if HAVE_SETRLIMIT
+ # include <sys/types.h>
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
+ #ifndef SIGSTKSZ
+ # define SIGSTKSZ 16384
+ #endif
+
+ static union
+ {
+ char buffer[2 * SIGSTKSZ];
+ long double ld;
+ long u;
+ void *p;
+ } alternate_signal_stack;
+
+ static void
+ segv_handler (int signo)
+ {
+ _exit (0);
+ }
+
+ static int
+ c_stack_action ()
+ {
+ stack_t st;
+ struct sigaction act;
+ int r;
+
+ st.ss_flags = 0;
+ /* Use the midpoint to avoid Irix sigaltstack bug. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
+ st.ss_size = SIGSTKSZ;
+ r = sigaltstack (&st, 0);
+ if (r != 0)
+ return 1;
+
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
+ act.sa_handler = segv_handler;
+ #if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, 0) < 0)
+ return 2;
+ #endif
+ if (sigaction (SIGSEGV, &act, 0) < 0)
+ return 3;
+ return 0;
+ }
+ static volatile int *
+ recurse_1 (volatile int n, volatile int *p)
+ {
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+ }
+ static int
+ recurse (volatile int n)
+ {
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+ }
+ int
+ main ()
+ {
+ int result;
+ #if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly
+ to the user's machine. On some Linux 2.2.x systems, there
+ is no stack limit for user processes at all. We don't want
+ to kill such systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+ #endif
+
+ result = c_stack_action ();
+ if (result != 0)
+ return result;
+ return recurse (0);
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_sys_stack_overflow_works=yes
+else
+ ac_cv_sys_stack_overflow_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5
+printf "%s\n" "$ac_cv_sys_stack_overflow_works" >&6; }
+
+ if test $ac_cv_sys_stack_overflow_works = yes; then
+
+printf "%s\n" "#define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5
+printf %s "checking for correct stack_t interpretation... " >&6; }
+if test ${gl_cv_sigaltstack_low_base+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_sigaltstack_low_base=cross-compiling
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+#ifndef SIGSTKSZ
+# define SIGSTKSZ 16384
+#endif
+volatile char *stack_lower_bound;
+volatile char *stack_upper_bound;
+static void check_stack_location (volatile char *addr)
+{
+ if (addr >= stack_lower_bound && addr <= stack_upper_bound)
+ exit (0);
+ else
+ exit (1);
+}
+static void stackoverflow_handler (int sig)
+{
+ char dummy;
+ check_stack_location (&dummy);
+}
+int main ()
+{
+ char mystack[2 * SIGSTKSZ];
+ stack_t altstack;
+ struct sigaction action;
+ /* Install the alternate stack. */
+ altstack.ss_sp = mystack + SIGSTKSZ;
+ altstack.ss_size = SIGSTKSZ;
+ stack_lower_bound = (char *) altstack.ss_sp;
+ stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1;
+ altstack.ss_flags = 0; /* no SS_DISABLE */
+ if (sigaltstack (&altstack, NULL) < 0)
+ exit (2);
+ /* Install the SIGSEGV handler. */
+ sigemptyset (&action.sa_mask);
+ action.sa_handler = &stackoverflow_handler;
+ action.sa_flags = SA_ONSTACK;
+ if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0)
+ exit(3);
+ /* Provoke a SIGSEGV. */
+ raise (SIGSEGV);
+ exit (4);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_sigaltstack_low_base=yes
+else
+ gl_cv_sigaltstack_low_base=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5
+printf "%s\n" "$gl_cv_sigaltstack_low_base" >&6; }
+ if test "$gl_cv_sigaltstack_low_base" = no; then
+
+printf "%s\n" "#define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h
+
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5
+printf %s "checking for precise C stack overflow detection... " >&6; }
+if test ${ac_cv_sys_xsi_stack_overflow_heuristic+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <unistd.h>
+ #include <signal.h>
+ #if HAVE_UCONTEXT_H
+ # include <ucontext.h>
+ #endif
+ #if HAVE_SETRLIMIT
+ # include <sys/types.h>
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
+ #ifndef SIGSTKSZ
+ # define SIGSTKSZ 16384
+ #endif
+
+ static union
+ {
+ char buffer[2 * SIGSTKSZ];
+ long double ld;
+ long u;
+ void *p;
+ } alternate_signal_stack;
+
+ #if STACK_DIRECTION
+ # define find_stack_direction(ptr) STACK_DIRECTION
+ #else
+ static int
+ find_stack_direction (char const *addr)
+ {
+ char dummy;
+ return (! addr ? find_stack_direction (&dummy)
+ : addr < &dummy ? 1 : -1);
+ }
+ #endif
+
+ static void
+ segv_handler (int signo, siginfo_t *info, void *context)
+ {
+ if (0 < info->si_code)
+ {
+ /* For XSI heuristics to work, we need uc_stack to describe
+ the interrupted stack (as on Solaris), and not the
+ currently executing stack (as on Linux). */
+ ucontext_t const *user_context = context;
+ char const *stack_min = user_context->uc_stack.ss_sp;
+ size_t stack_size = user_context->uc_stack.ss_size;
+ char const *faulting_address = info->si_addr;
+ size_t s = faulting_address - stack_min;
+ size_t page_size = sysconf (_SC_PAGESIZE);
+ if (find_stack_direction (0) < 0)
+ s += page_size;
+ if (s < stack_size + page_size)
+ _exit (0);
+ _exit (4);
+ }
+ _exit (5);
+ }
+
+ static int
+ c_stack_action ()
+ {
+ stack_t st;
+ struct sigaction act;
+ int r;
+
+ st.ss_flags = 0;
+ /* Use the midpoint to avoid Irix sigaltstack bug. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
+ st.ss_size = SIGSTKSZ;
+ r = sigaltstack (&st, 0);
+ if (r != 0)
+ return 1;
+
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
+ act.sa_sigaction = segv_handler;
+ #if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, 0) < 0)
+ return 2;
+ #endif
+ if (sigaction (SIGSEGV, &act, 0) < 0)
+ return 3;
+ return 0;
+ }
+ static volatile int *
+ recurse_1 (volatile int n, volatile int *p)
+ {
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+ }
+ static int
+ recurse (volatile int n)
+ {
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+ }
+ int
+ main ()
+ {
+ int result;
+ #if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly
+ to the user's machine. On some Linux 2.2.x systems, there
+ is no stack limit for user processes at all. We don't want
+ to kill such systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+ #endif
+
+ result = c_stack_action ();
+ if (result != 0)
+ return result;
+ return recurse (0);
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_sys_xsi_stack_overflow_heuristic=yes
+else
+ ac_cv_sys_xsi_stack_overflow_heuristic=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5
+printf "%s\n" "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; }
+
+ if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
+
+printf "%s\n" "#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h
+
+ fi
+ fi
+
+ 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"
+
+
+
+# Check whether --with-gnu-ld was given.
+if test ${with_gnu_ld+y}
+then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+# 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
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+printf %s "checking for ld used by $CC... " >&6; }
+ 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 "$with_gnu_ld" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+printf %s "checking for GNU ld... " >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+printf %s "checking for non-GNU ld... " >&6; }
+fi
+if test ${acl_cv_path_LD+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test -z "$LD"; then
+ 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"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+printf "%s\n" "$LD" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+printf %s "checking if the linker ($LD) is GNU ld... " >&6; }
+if test ${acl_cv_prog_gnu_ld+y}
+then :
+ printf %s "(cached) " >&6
+else
+ # 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
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
+printf %s "checking for shared library run path origin... " >&6; }
+if test ${acl_cv_rpath+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+printf "%s\n" "$acl_cv_rpath" >&6; }
+ 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"
+ # Check whether --enable-rpath was given.
+if test ${enable_rpath+y}
+then :
+ enableval=$enable_rpath; :
+else
+ enable_rpath=yes
+fi
+
+
+
+
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ case "$host_os" in
+ solaris*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
+printf %s "checking for 64-bit host... " >&6; }
+if test ${gl_cv_solaris_64bit+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef _LP64
+sixtyfour bits
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "sixtyfour bits" >/dev/null 2>&1
+then :
+ gl_cv_solaris_64bit=yes
+else
+ gl_cv_solaris_64bit=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
+printf "%s\n" "$gl_cv_solaris_64bit" >&6; }
+ if test $gl_cv_solaris_64bit = yes; then
+ acl_libdirstem=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libsigsegv-prefix was given.
+if test ${with_libsigsegv_prefix+y}
+then :
+ withval=$with_libsigsegv_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+
+fi
+
+ LIBSIGSEGV=
+ LTLIBSIGSEGV=
+ INCSIGSEGV=
+ LIBSIGSEGV_PREFIX=
+ HAVE_LIBSIGSEGV=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='sigsegv '
+ 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"
+ 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" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value"
+ else
+ :
+ fi
+ else
+ 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
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ else
+ 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
+ if test "$acl_hardcode_direct" = yes; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ 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
+ haveit=
+ for x in $LDFLAGS $LIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ else
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a"
+ else
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name"
+ fi
+ fi
+ 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" = 'sigsegv'; then
+ LIBSIGSEGV_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" = 'sigsegv'; then
+ LIBSIGSEGV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ 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 $INCSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ 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
+ INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; 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 $LIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ 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
+ 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*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep"
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCSIGSEGV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5
+printf %s "checking for libsigsegv... " >&6; }
+if test ${ac_cv_libsigsegv+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ ac_save_LIBS="$LIBS"
+ case " $LIBSIGSEGV" in
+ *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;;
+ *) LIBS="$LIBSIGSEGV $LIBS" ;;
+ esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sigsegv.h>
+int
+main (void)
+{
+sigsegv_deinstall_handler();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_libsigsegv=yes
+else
+ ac_cv_libsigsegv='no, consider installing GNU libsigsegv'
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ac_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5
+printf "%s\n" "$ac_cv_libsigsegv" >&6; }
+ if test "$ac_cv_libsigsegv" = yes; then
+ HAVE_LIBSIGSEGV=yes
+
+printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5
+printf %s "checking how to link with libsigsegv... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5
+printf "%s\n" "$LIBSIGSEGV" >&6; }
+ else
+ HAVE_LIBSIGSEGV=no
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBSIGSEGV=
+ LTLIBSIGSEGV=
+ LIBSIGSEGV_PREFIX=
+ fi
+
+
+
+
+
+
+
+ gl_cv_lib_sigsegv="$ac_cv_libsigsegv"
+
+
+
+# The Clang compiler raises a warning for an undeclared identifier that matches
+# a compiler builtin function. All extant Clang versions are affected, as of
+# Clang 3.6.0. Test a builtin known to every version. This problem affects the
+# C and Objective C languages, but Clang does report an error under C++ and
+# Objective C++.
+#
+# Passing -fno-builtin to the compiler would suppress this problem. That
+# strategy would have the advantage of being insensitive to stray warnings, but
+# it would make tests less realistic.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how $CC reports undeclared, standard C functions" >&5
+printf %s "checking how $CC reports undeclared, standard C functions... " >&6; }
+if test ${ac_cv_c_decl_report+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+(void) strchr;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ if test -s conftest.err
+then :
+ # For AC_CHECK_DECL to react to warnings, the compiler must be silent on
+ # valid AC_CHECK_DECL input. No library function is consistently available
+ # on freestanding implementations, so test against a dummy declaration.
+ # Include always-available headers on the off chance that they somehow
+ # elicit warnings.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <float.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+extern void ac_decl (int, char *);
+int
+main (void)
+{
+#ifdef __cplusplus
+ (void) ac_decl ((int) 0, (char *) 0);
+ (void) ac_decl;
+#else
+ (void) ac_decl;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ if test -s conftest.err
+then :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot detect from compiler exit status or warnings
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ ac_cv_c_decl_report=warning
+fi
+else
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compile a simple declaration test
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "compiler does not report undeclared identifiers
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+else
+ ac_cv_c_decl_report=error
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_decl_report" >&5
+printf "%s\n" "$ac_cv_c_decl_report" >&6; }
+
+case $ac_cv_c_decl_report in
+ warning) ac_c_decl_warn_flag=yes ;;
+ *) ac_c_decl_warn_flag= ;;
+esac
+
+
+
+
+ GNULIB_CHDIR=0;
+ GNULIB_CHOWN=0;
+ GNULIB_CLOSE=0;
+ GNULIB_DUP=0;
+ GNULIB_DUP2=0;
+ GNULIB_DUP3=0;
+ GNULIB_ENVIRON=0;
+ GNULIB_EUIDACCESS=0;
+ GNULIB_FACCESSAT=0;
+ GNULIB_FCHDIR=0;
+ GNULIB_FCHOWNAT=0;
+ GNULIB_FDATASYNC=0;
+ GNULIB_FSYNC=0;
+ GNULIB_FTRUNCATE=0;
+ GNULIB_GETCWD=0;
+ GNULIB_GETDOMAINNAME=0;
+ GNULIB_GETDTABLESIZE=0;
+ GNULIB_GETGROUPS=0;
+ GNULIB_GETHOSTNAME=0;
+ GNULIB_GETLOGIN=0;
+ GNULIB_GETLOGIN_R=0;
+ GNULIB_GETPAGESIZE=0;
+ GNULIB_GETUSERSHELL=0;
+ GNULIB_GROUP_MEMBER=0;
+ GNULIB_ISATTY=0;
+ GNULIB_LCHOWN=0;
+ GNULIB_LINK=0;
+ GNULIB_LINKAT=0;
+ GNULIB_LSEEK=0;
+ GNULIB_PIPE=0;
+ GNULIB_PIPE2=0;
+ GNULIB_PREAD=0;
+ GNULIB_PWRITE=0;
+ GNULIB_READ=0;
+ GNULIB_READLINK=0;
+ GNULIB_READLINKAT=0;
+ GNULIB_RMDIR=0;
+ GNULIB_SETHOSTNAME=0;
+ GNULIB_SLEEP=0;
+ GNULIB_SYMLINK=0;
+ GNULIB_SYMLINKAT=0;
+ GNULIB_TTYNAME_R=0;
+ GNULIB_UNISTD_H_NONBLOCKING=0;
+ GNULIB_UNISTD_H_SIGPIPE=0;
+ GNULIB_UNLINK=0;
+ GNULIB_UNLINKAT=0;
+ GNULIB_USLEEP=0;
+ GNULIB_WRITE=0;
+ HAVE_CHOWN=1;
+ HAVE_DUP2=1;
+ HAVE_DUP3=1;
+ HAVE_EUIDACCESS=1;
+ HAVE_FACCESSAT=1;
+ HAVE_FCHDIR=1;
+ HAVE_FCHOWNAT=1;
+ HAVE_FDATASYNC=1;
+ HAVE_FSYNC=1;
+ HAVE_FTRUNCATE=1;
+ HAVE_GETDTABLESIZE=1;
+ HAVE_GETGROUPS=1;
+ HAVE_GETHOSTNAME=1;
+ HAVE_GETLOGIN=1;
+ HAVE_GETPAGESIZE=1;
+ HAVE_GROUP_MEMBER=1;
+ HAVE_LCHOWN=1;
+ HAVE_LINK=1;
+ HAVE_LINKAT=1;
+ HAVE_PIPE=1;
+ HAVE_PIPE2=1;
+ HAVE_PREAD=1;
+ HAVE_PWRITE=1;
+ HAVE_READLINK=1;
+ HAVE_READLINKAT=1;
+ HAVE_SETHOSTNAME=1;
+ HAVE_SLEEP=1;
+ HAVE_SYMLINK=1;
+ HAVE_SYMLINKAT=1;
+ HAVE_UNLINKAT=1;
+ HAVE_USLEEP=1;
+ HAVE_DECL_ENVIRON=1;
+ HAVE_DECL_FCHDIR=1;
+ HAVE_DECL_FDATASYNC=1;
+ HAVE_DECL_GETDOMAINNAME=1;
+ HAVE_DECL_GETLOGIN_R=1;
+ HAVE_DECL_GETPAGESIZE=1;
+ HAVE_DECL_GETUSERSHELL=1;
+ HAVE_DECL_SETHOSTNAME=1;
+ HAVE_DECL_TTYNAME_R=1;
+ HAVE_OS_H=0;
+ HAVE_SYS_PARAM_H=0;
+ REPLACE_CHOWN=0;
+ REPLACE_CLOSE=0;
+ REPLACE_DUP=0;
+ REPLACE_DUP2=0;
+ REPLACE_FCHOWNAT=0;
+ REPLACE_FTRUNCATE=0;
+ REPLACE_GETCWD=0;
+ REPLACE_GETDOMAINNAME=0;
+ REPLACE_GETDTABLESIZE=0;
+ REPLACE_GETLOGIN_R=0;
+ REPLACE_GETGROUPS=0;
+ REPLACE_GETPAGESIZE=0;
+ REPLACE_ISATTY=0;
+ REPLACE_LCHOWN=0;
+ REPLACE_LINK=0;
+ REPLACE_LINKAT=0;
+ REPLACE_LSEEK=0;
+ REPLACE_PREAD=0;
+ REPLACE_PWRITE=0;
+ REPLACE_READ=0;
+ REPLACE_READLINK=0;
+ REPLACE_READLINKAT=0;
+ REPLACE_RMDIR=0;
+ REPLACE_SLEEP=0;
+ REPLACE_SYMLINK=0;
+ REPLACE_SYMLINKAT=0;
+ REPLACE_TTYNAME_R=0;
+ REPLACE_UNLINK=0;
+ REPLACE_UNLINKAT=0;
+ REPLACE_USLEEP=0;
+ REPLACE_WRITE=0;
+ UNISTD_H_HAVE_WINSOCK2_H=0;
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+
+
+
+
+
+
+ if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+
+printf "%s\n" "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
+
+ else
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+ fi
+
+
+
+ GNULIB_IOCTL=0;
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=0;
+ SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+
+ REPLACE_IOCTL=0;
+
+
+
+
+ GNULIB_ISBLANK=0;
+ HAVE_ISBLANK=1;
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
+printf %s "checking whether the preprocessor supports include_next... " >&6; }
+if test ${gl_cv_have_include_next+y}
+then :
+ printf %s "(cached) " >&6
+else
+ rm -rf conftestd1a conftestd1b conftestd2
+ mkdir conftestd1a conftestd1b conftestd2
+ 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"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <conftest.h>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_have_include_next=yes
+else
+ CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <conftest.h>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_have_include_next=buggy
+else
+ gl_cv_have_include_next=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$gl_save_CPPFLAGS"
+ rm -rf conftestd1a conftestd1b conftestd2
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
+printf "%s\n" "$gl_cv_have_include_next" >&6; }
+ 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
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
+printf %s "checking whether system header files limit the line length... " >&6; }
+if test ${gl_cv_pragma_columns+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef __TANDEM
+choke me
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "choke me" >/dev/null 2>&1
+then :
+ gl_cv_pragma_columns=yes
+else
+ gl_cv_pragma_columns=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
+printf "%s\n" "$gl_cv_pragma_columns" >&6; }
+ if test $gl_cv_pragma_columns = yes; then
+ PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+ else
+ PRAGMA_COLUMNS=
+ fi
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
+printf %s "checking whether // is distinct from /... " >&6; }
+if test ${gl_cv_double_slash_root+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
+printf "%s\n" "$gl_cv_double_slash_root" >&6; }
+ if test "$gl_cv_double_slash_root" = yes; then
+
+printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
+printf %s "checking if environ is properly declared... " >&6; }
+ if test ${gt_cv_var_environ_declaration+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
+
+ extern struct { int foo; } environ;
+int
+main (void)
+{
+environ.foo = 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_var_environ_declaration=no
+else
+ gt_cv_var_environ_declaration=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
+printf "%s\n" "$gt_cv_var_environ_declaration" >&6; }
+ if test $gt_cv_var_environ_declaration = yes; then
+
+printf "%s\n" "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
+
+ fi
+
+
+ if test $gt_cv_var_environ_declaration != yes; then
+ HAVE_DECL_ENVIRON=0
+ fi
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
+printf %s "checking for complete errno.h... " >&6; }
+if test ${gl_cv_header_errno_h_complete+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "booboo" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_complete=no
+else
+ gl_cv_header_errno_h_complete=yes
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
+printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; }
+ if test $gl_cv_header_errno_h_complete = yes; then
+ ERRNO_H=''
+ else
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_errno_h='<'errno.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
+printf %s "checking absolute name of <errno.h>... " >&6; }
+if test ${gl_cv_next_errno_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'errno.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_errno_h
+ gl_cv_next_errno_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
+printf "%s\n" "$gl_cv_next_errno_h" >&6; }
+ fi
+ NEXT_ERRNO_H=$gl_cv_next_errno_h
+
+ 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='<'errno.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_errno_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
+
+
+
+
+ ERRNO_H='errno.h'
+ fi
+
+ if test -n "$ERRNO_H"; then
+ GL_GENERATE_ERRNO_H_TRUE=
+ GL_GENERATE_ERRNO_H_FALSE='#'
+else
+ GL_GENERATE_ERRNO_H_TRUE='#'
+ GL_GENERATE_ERRNO_H_FALSE=
+fi
+
+
+ if test -n "$ERRNO_H"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
+printf %s "checking for EMULTIHOP value... " >&6; }
+if test ${gl_cv_header_errno_h_EMULTIHOP+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#ifdef EMULTIHOP
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_EMULTIHOP=yes
+else
+ gl_cv_header_errno_h_EMULTIHOP=no
+fi
+rm -rf conftest*
+
+ if test $gl_cv_header_errno_h_EMULTIHOP = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EMULTIHOP
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_EMULTIHOP=hidden
+fi
+rm -rf conftest*
+
+ if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
+ if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
+#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>
+"
+then :
+
+fi
+
+ fi
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
+printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
+ case $gl_cv_header_errno_h_EMULTIHOP in
+ yes | no)
+ EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
+ ;;
+ *)
+ EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
+ ;;
+ esac
+
+
+ fi
+
+
+ if test -n "$ERRNO_H"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
+printf %s "checking for ENOLINK value... " >&6; }
+if test ${gl_cv_header_errno_h_ENOLINK+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#ifdef ENOLINK
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_ENOLINK=yes
+else
+ gl_cv_header_errno_h_ENOLINK=no
+fi
+rm -rf conftest*
+
+ if test $gl_cv_header_errno_h_ENOLINK = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ENOLINK
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_ENOLINK=hidden
+fi
+rm -rf conftest*
+
+ if test $gl_cv_header_errno_h_ENOLINK = hidden; then
+ if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
+#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>
+"
+then :
+
+fi
+
+ fi
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
+printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; }
+ case $gl_cv_header_errno_h_ENOLINK in
+ yes | no)
+ ENOLINK_HIDDEN=0; ENOLINK_VALUE=
+ ;;
+ *)
+ ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
+ ;;
+ esac
+
+
+ fi
+
+
+ if test -n "$ERRNO_H"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
+printf %s "checking for EOVERFLOW value... " >&6; }
+if test ${gl_cv_header_errno_h_EOVERFLOW+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_EOVERFLOW=yes
+else
+ gl_cv_header_errno_h_EOVERFLOW=no
+fi
+rm -rf conftest*
+
+ if test $gl_cv_header_errno_h_EOVERFLOW = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_header_errno_h_EOVERFLOW=hidden
+fi
+rm -rf conftest*
+
+ if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
+ if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
+#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>
+"
+then :
+
+fi
+
+ fi
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
+printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
+ case $gl_cv_header_errno_h_EOVERFLOW in
+ yes | no)
+ EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
+ ;;
+ *)
+ EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
+ ;;
+ esac
+
+
+ fi
+
+
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+printf %s "checking whether strerror_r returns char *... " >&6; }
+if test ${ac_cv_func_strerror_r_char_p+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main (void)
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+
+ XGETTEXT_EXTRA_OPTIONS=
+
+
+
+
+
+ GNULIB_FCNTL=0;
+ GNULIB_NONBLOCKING=0;
+ GNULIB_OPEN=0;
+ GNULIB_OPENAT=0;
+ HAVE_FCNTL=1;
+ HAVE_OPENAT=1;
+ REPLACE_FCNTL=0;
+ REPLACE_OPEN=0;
+ REPLACE_OPENAT=0;
+
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
+printf %s "checking for working fcntl.h... " >&6; }
+if test ${gl_cv_header_working_fcntl_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_header_working_fcntl_h=cross-compiling
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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>
+ #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
+main (void)
+{
+
+ 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;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_header_working_fcntl_h=yes
+else
+ 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
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
+printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; }
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_O_NOATIME $ac_val
+_ACEOF
+
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_O_NOFOLLOW $ac_val
+_ACEOF
+
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes
+then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes
+then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
+printf %s "checking for mbstate_t... " >&6; }
+if test ${ac_cv_type_mbstate_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int
+main (void)
+{
+mbstate_t x; return sizeof x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_type_mbstate_t=yes
+else
+ ac_cv_type_mbstate_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
+printf "%s\n" "$ac_cv_type_mbstate_t" >&6; }
+ if test $ac_cv_type_mbstate_t = yes; then
+
+printf "%s\n" "#define HAVE_MBSTATE_T 1" >>confdefs.h
+
+ else
+
+printf "%s\n" "#define mbstate_t int" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GNULIB_DPRINTF=0;
+ GNULIB_FCLOSE=0;
+ GNULIB_FDOPEN=0;
+ GNULIB_FFLUSH=0;
+ GNULIB_FGETC=0;
+ GNULIB_FGETS=0;
+ GNULIB_FOPEN=0;
+ GNULIB_FPRINTF=0;
+ GNULIB_FPRINTF_POSIX=0;
+ GNULIB_FPURGE=0;
+ GNULIB_FPUTC=0;
+ GNULIB_FPUTS=0;
+ GNULIB_FREAD=0;
+ GNULIB_FREOPEN=0;
+ GNULIB_FSCANF=0;
+ GNULIB_FSEEK=0;
+ GNULIB_FSEEKO=0;
+ GNULIB_FTELL=0;
+ GNULIB_FTELLO=0;
+ GNULIB_FWRITE=0;
+ GNULIB_GETC=0;
+ GNULIB_GETCHAR=0;
+ GNULIB_GETDELIM=0;
+ GNULIB_GETLINE=0;
+ GNULIB_OBSTACK_PRINTF=0;
+ GNULIB_OBSTACK_PRINTF_POSIX=0;
+ GNULIB_PCLOSE=0;
+ GNULIB_PERROR=0;
+ GNULIB_POPEN=0;
+ GNULIB_PRINTF=0;
+ GNULIB_PRINTF_POSIX=0;
+ GNULIB_PUTC=0;
+ GNULIB_PUTCHAR=0;
+ GNULIB_PUTS=0;
+ GNULIB_REMOVE=0;
+ GNULIB_RENAME=0;
+ GNULIB_RENAMEAT=0;
+ GNULIB_SCANF=0;
+ GNULIB_SNPRINTF=0;
+ GNULIB_SPRINTF_POSIX=0;
+ GNULIB_STDIO_H_NONBLOCKING=0;
+ GNULIB_STDIO_H_SIGPIPE=0;
+ GNULIB_TMPFILE=0;
+ GNULIB_VASPRINTF=0;
+ GNULIB_VFSCANF=0;
+ GNULIB_VSCANF=0;
+ GNULIB_VDPRINTF=0;
+ GNULIB_VFPRINTF=0;
+ GNULIB_VFPRINTF_POSIX=0;
+ GNULIB_VPRINTF=0;
+ GNULIB_VPRINTF_POSIX=0;
+ GNULIB_VSNPRINTF=0;
+ GNULIB_VSPRINTF_POSIX=0;
+ HAVE_DECL_FPURGE=1;
+ HAVE_DECL_FSEEKO=1;
+ HAVE_DECL_FTELLO=1;
+ HAVE_DECL_GETDELIM=1;
+ HAVE_DECL_GETLINE=1;
+ HAVE_DECL_OBSTACK_PRINTF=1;
+ HAVE_DECL_SNPRINTF=1;
+ HAVE_DECL_VSNPRINTF=1;
+ HAVE_DPRINTF=1;
+ HAVE_FSEEKO=1;
+ HAVE_FTELLO=1;
+ HAVE_PCLOSE=1;
+ HAVE_POPEN=1;
+ HAVE_RENAMEAT=1;
+ HAVE_VASPRINTF=1;
+ HAVE_VDPRINTF=1;
+ REPLACE_DPRINTF=0;
+ REPLACE_FCLOSE=0;
+ REPLACE_FDOPEN=0;
+ REPLACE_FFLUSH=0;
+ REPLACE_FOPEN=0;
+ REPLACE_FPRINTF=0;
+ REPLACE_FPURGE=0;
+ REPLACE_FREOPEN=0;
+ REPLACE_FSEEK=0;
+ REPLACE_FSEEKO=0;
+ REPLACE_FTELL=0;
+ REPLACE_FTELLO=0;
+ REPLACE_GETDELIM=0;
+ REPLACE_GETLINE=0;
+ REPLACE_OBSTACK_PRINTF=0;
+ REPLACE_PERROR=0;
+ REPLACE_POPEN=0;
+ REPLACE_PRINTF=0;
+ REPLACE_REMOVE=0;
+ REPLACE_RENAME=0;
+ REPLACE_RENAMEAT=0;
+ REPLACE_SNPRINTF=0;
+ REPLACE_SPRINTF=0;
+ REPLACE_STDIO_READ_FUNCS=0;
+ REPLACE_STDIO_WRITE_FUNCS=0;
+ REPLACE_TMPFILE=0;
+ REPLACE_VASPRINTF=0;
+ REPLACE_VDPRINTF=0;
+ REPLACE_VFPRINTF=0;
+ REPLACE_VPRINTF=0;
+ REPLACE_VSNPRINTF=0;
+ REPLACE_VSPRINTF=0;
+
+
+ GNULIB_FCHMODAT=0;
+ GNULIB_FSTAT=0;
+ GNULIB_FSTATAT=0;
+ GNULIB_FUTIMENS=0;
+ GNULIB_LCHMOD=0;
+ GNULIB_LSTAT=0;
+ GNULIB_MKDIRAT=0;
+ GNULIB_MKFIFO=0;
+ GNULIB_MKFIFOAT=0;
+ GNULIB_MKNOD=0;
+ GNULIB_MKNODAT=0;
+ GNULIB_STAT=0;
+ GNULIB_UTIMENSAT=0;
+ HAVE_FCHMODAT=1;
+ HAVE_FSTATAT=1;
+ HAVE_FUTIMENS=1;
+ HAVE_LCHMOD=1;
+ HAVE_LSTAT=1;
+ HAVE_MKDIRAT=1;
+ HAVE_MKFIFO=1;
+ HAVE_MKFIFOAT=1;
+ HAVE_MKNOD=1;
+ HAVE_MKNODAT=1;
+ HAVE_UTIMENSAT=1;
+ REPLACE_FSTAT=0;
+ REPLACE_FSTATAT=0;
+ REPLACE_FUTIMENS=0;
+ REPLACE_LSTAT=0;
+ REPLACE_MKDIR=0;
+ REPLACE_MKFIFO=0;
+ REPLACE_MKNOD=0;
+ REPLACE_STAT=0;
+ REPLACE_UTIMENSAT=0;
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
+printf %s "checking whether stat file-mode macros are broken... " >&6; }
+if test ${ac_cv_header_stat_broken+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#endif
+
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
+
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_header_stat_broken=no
+else
+ ac_cv_header_stat_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+printf "%s\n" "$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
+
+printf "%s\n" "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+
+fi
+
+
+
+ case "$host_os" in
+ mingw*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
+printf %s "checking for 64-bit off_t... " >&6; }
+if test ${gl_cv_type_off_t_64+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_type_off_t_64=yes
+else
+ gl_cv_type_off_t_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
+printf "%s\n" "$gl_cv_type_off_t_64" >&6; }
+ if test $gl_cv_type_off_t_64 = no; then
+ WINDOWS_64_BIT_OFF_T=1
+ else
+ WINDOWS_64_BIT_OFF_T=0
+ fi
+ WINDOWS_64_BIT_ST_SIZE=1
+ ;;
+ *)
+ WINDOWS_64_BIT_OFF_T=0
+ WINDOWS_64_BIT_ST_SIZE=0
+ ;;
+ esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
+printf %s "checking absolute name of <sys/stat.h>... " >&6; }
+if test ${gl_cv_next_sys_stat_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_stat_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/stat.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_stat_h
+ gl_cv_next_sys_stat_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
+printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; }
+ fi
+ NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
+
+ 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='<'sys/stat.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_stat_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+
+printf "%s\n" "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_type_nlink_t" = xyes
+then :
+
+else
+
+printf "%s\n" "#define nlink_t int" >>confdefs.h
+
+fi
+
+
+
+ for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getdtablesize" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_getopt_h='<'getopt.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
+printf %s "checking absolute name of <getopt.h>... " >&6; }
+if test ${gl_cv_next_getopt_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_getopt_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'getopt.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_getopt_h
+ gl_cv_next_getopt_h='"'$gl_header'"'
+ else
+ gl_cv_next_getopt_h='<'getopt.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
+printf "%s\n" "$gl_cv_next_getopt_h" >&6; }
+ fi
+ NEXT_GETOPT_H=$gl_cv_next_getopt_h
+
+ 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='<'getopt.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_getopt_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+
+
+ gl_replace_getopt=
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ for ac_header in getopt.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
+if test "x$ac_cv_header_getopt_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_H 1
+_ACEOF
+
+else
+ gl_replace_getopt=yes
+fi
+done
+
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ for ac_func in getopt_long_only
+do :
+ ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
+if test "x$ac_cv_func_getopt_long_only" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_LONG_ONLY 1
+_ACEOF
+
+else
+ gl_replace_getopt=yes
+fi
+done
+
+ fi
+
+ if test -z "$gl_replace_getopt"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
+printf %s "checking whether getopt is POSIX compatible... " >&6; }
+if test ${gl_cv_func_getopt_posix+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $cross_compiling = no; then
+ if test "$cross_compiling" = yes
+then :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getopt_posix=maybe
+else
+ gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ if test $gl_cv_func_getopt_posix = maybe; then
+ if test "$cross_compiling" = yes
+then :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getopt_posix=maybe
+else
+ gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ if test "$cross_compiling" = yes
+then :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getopt_posix=yes
+else
+ gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ 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
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
+printf "%s\n" "$gl_cv_func_getopt_posix" >&6; }
+ 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
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
+printf %s "checking for working GNU getopt function... " >&6; }
+if test ${gl_cv_func_getopt_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else
+ # 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.
+ 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
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_getopt_gnu="guessing no"
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X. */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens. */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+ EXC_BAD_ACCESS. */
+static void *
+mach_exception_thread (void *arg)
+{
+ /* Buffer for a message to be received. */
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+ mach_msg_return_t retval;
+ /* Wait for a message on the exception port. */
+ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+ our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (retval != MACH_MSG_SUCCESS)
+ abort ();
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+ mach_port_t self = mach_task_self ();
+ /* Allocate a port on which the thread shall listen for exceptions. */
+ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+ == KERN_SUCCESS) {
+ /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+ MACH_MSG_TYPE_MAKE_SEND)
+ == KERN_SUCCESS) {
+ /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
+ for us. */
+ exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+ /* Create the thread listening on the exception port. */
+ pthread_attr_t attr;
+ pthread_t thread;
+ if (pthread_attr_init (&attr) == 0
+ && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+ && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+ pthread_attr_destroy (&attr);
+ /* Replace the exception port info for these exceptions with our own.
+ Note that we replace the exception port for the entire task, not only
+ for a particular thread. This has the effect that when our exception
+ port gets the message, the thread specific exception port has already
+ been asked, and we don't need to bother about it.
+ See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ task_set_exception_ports (self, mask, our_exception_port,
+ EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+ }
+ }
+ }
+}
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+ switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ case EXCEPTION_STACK_OVERFLOW:
+ case EXCEPTION_GUARD_PAGE:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exit (1);
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+ SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems. */
+#include <signal.h>
+#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
+
+
+int
+main (void)
+{
+
+ 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getopt_gnu=yes
+else
+ gl_cv_func_getopt_gnu=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ case $gl_had_POSIXLY_CORRECT in
+ exported) ;;
+ yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;;
+ *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;;
+ esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
+printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; }
+ if test "$gl_cv_func_getopt_gnu" != yes; then
+ gl_replace_getopt=yes
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
+printf %s "checking for working GNU getopt_long function... " >&6; }
+if test ${gl_cv_func_getopt_long_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+
+int
+main (void)
+{
+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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getopt_long_gnu=yes
+else
+ gl_cv_func_getopt_long_gnu=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5
+printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; }
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
+ fi
+ fi
+
+
+
+
+
+
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+
+ if test $REPLACE_GETOPT = 1; then
+
+ GETOPT_H=getopt.h
+
+printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+
+
+
+ fi
+
+ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getenv" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETENV $ac_have_decl
+_ACEOF
+
+:
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+printf %s "checking for C/C++ restrict keyword... " >&6; }
+if test ${ac_cv_c_restrict+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_c_restrict=no
+ # The order here caters to the fact that C++ does not require restrict.
+ for ac_kw in __restrict __restrict__ _Restrict restrict; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+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
+main (void)
+{
+int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_restrict" != no && break
+ done
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+printf "%s\n" "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) printf "%s\n" "#define restrict /**/" >>confdefs.h
+ ;;
+ *) cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+
+ GNULIB_GETTIMEOFDAY=0;
+ HAVE_GETTIMEOFDAY=1;
+ HAVE_STRUCT_TIMEVAL=1;
+ HAVE_SYS_TIME_H=1;
+ HAVE_TIMEZONE_T=0;
+ REPLACE_GETTIMEOFDAY=0;
+ REPLACE_STRUCT_TIMEVAL=0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_time_h='<'sys/time.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
+printf %s "checking absolute name of <sys/time.h>... " >&6; }
+if test ${gl_cv_next_sys_time_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_time_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/time.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_time_h
+ gl_cv_next_sys_time_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_time_h='<'sys/time.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
+printf "%s\n" "$gl_cv_next_sys_time_h" >&6; }
+ fi
+ NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
+
+ 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='<'sys/time.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_time_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
+
+
+
+
+
+ if test $ac_cv_header_sys_time_h != yes; then
+ HAVE_SYS_TIME_H=0
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
+printf %s "checking for struct timeval... " >&6; }
+if test ${gl_cv_sys_struct_timeval+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+
+int
+main (void)
+{
+static struct timeval x; x.tv_sec = x.tv_usec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_timeval=yes
+else
+ gl_cv_sys_struct_timeval=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
+printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; }
+ if test $gl_cv_sys_struct_timeval != yes; then
+ HAVE_STRUCT_TIMEVAL=0
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
+printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; }
+if test ${gl_cv_sys_struct_timeval_tv_sec+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+
+int
+main (void)
+{
+static struct timeval x;
+ typedef int verify_tv_sec_type[
+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+ ];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_timeval_tv_sec=yes
+else
+ gl_cv_sys_struct_timeval_tv_sec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
+printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
+ if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+ REPLACE_STRUCT_TIMEVAL=1
+ fi
+ fi
+
+
+ for gl_func in gettimeofday; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix was given.
+if test ${with_libiconv_prefix+y}
+then :
+ withval=$with_libiconv_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+
+fi
+
+ LIBICONV=
+ LTLIBICONV=
+ INCICONV=
+ LIBICONV_PREFIX=
+ HAVE_LIBICONV=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='iconv '
+ 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"
+ 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" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+ else
+ :
+ fi
+ else
+ 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
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ 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
+ if test "$acl_hardcode_direct" = yes; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ 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
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
+ fi
+ fi
+ 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" = 'iconv'; then
+ LIBICONV_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" = 'iconv'; then
+ LIBICONV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ 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 $INCICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ 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
+ INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; 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 $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ 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
+ 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*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+
+ GNULIB_ICONV=0;
+ ICONV_CONST=;
+ REPLACE_ICONV=0;
+ REPLACE_ICONV_OPEN=0;
+ REPLACE_ICONV_UTF=0;
+ ICONV_H='';
+ if test -n "$ICONV_H"; then
+ GL_GENERATE_ICONV_H_TRUE=
+ GL_GENERATE_ICONV_H_FALSE='#'
+else
+ GL_GENERATE_ICONV_H_TRUE='#'
+ GL_GENERATE_ICONV_H_FALSE=
+fi
+
+
+
+
+
+
+
+ am_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCICONV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+printf %s "checking for iconv... " >&6; }
+if test ${am_cv_func_iconv+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
+printf "%s\n" "$am_cv_func_iconv" >&6; }
+ if test "$am_cv_func_iconv" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+printf %s "checking for working iconv... " >&6; }
+if test ${am_cv_func_iconv_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main (void)
+{
+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 ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ ICONV_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,
+ &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 ICONV_CONST char input[] = "\263";
+ char buf[10];
+ ICONV_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,
+ &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 ICONV_CONST char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ &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 ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ ICONV_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,
+ &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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ am_cv_func_iconv_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ test "$am_cv_func_iconv_works" = no || break
+ done
+ LIBS="$am_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+printf "%s\n" "$am_cv_func_iconv_works" >&6; }
+ 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
+
+printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h
+
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+printf %s "checking how to link with libiconv... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+printf "%s\n" "$LIBICONV" >&6; }
+ else
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+
+
+
+ if test "$am_cv_func_iconv" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
+printf %s "checking for iconv declaration... " >&6; }
+ if test ${am_cv_proto_iconv+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ am_cv_proto_iconv_arg1=""
+else
+ am_cv_proto_iconv_arg1="const"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 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);"
+fi
+
+ am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
+ $am_cv_proto_iconv" >&5
+printf "%s\n" "
+ $am_cv_proto_iconv" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+_ACEOF
+
+
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+
+ fi
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+printf %s "checking for inline... " >&6; }
+if test ${ac_cv_c_inline+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+printf "%s\n" "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes
+then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+printf %s "checking for unsigned long long int... " >&6; }
+if test ${ac_cv_type_unsigned_long_long_int+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main (void)
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else
+ ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; }
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+printf %s "checking for long long int... " >&6; }
+if test ${ac_cv_type_long_long_int+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_type_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+ if test $ac_cv_type_long_long_int = yes; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #ifndef LLONG_MAX
+ # define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ # define LLONG_MAX (HALF - 1 + HALF)
+ #endif
+int
+main (void)
+{
+long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+printf "%s\n" "$ac_cv_type_long_long_int" >&6; }
+ if test $ac_cv_type_long_long_int = yes; then
+
+printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+
+ gl_cv_c_multiarch=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64)
+ 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
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $gl_cv_c_multiarch = yes; then
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+
+
+
+
+
+ if test $ac_cv_type_long_long_int = yes; then
+ HAVE_LONG_LONG_INT=1
+ else
+ HAVE_LONG_LONG_INT=0
+ fi
+
+
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+ HAVE_UNSIGNED_LONG_LONG_INT=1
+ else
+ HAVE_UNSIGNED_LONG_LONG_INT=0
+ fi
+
+
+
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+
+
+ if test $ac_cv_header_inttypes_h = yes; then
+ HAVE_INTTYPES_H=1
+ else
+ HAVE_INTTYPES_H=0
+ fi
+
+
+ if test $ac_cv_header_sys_types_h = yes; then
+ HAVE_SYS_TYPES_H=1
+ else
+ HAVE_SYS_TYPES_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdint_h='<'stdint.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
+printf %s "checking absolute name of <stdint.h>... " >&6; }
+if test ${gl_cv_next_stdint_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_stdint_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdint.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdint_h
+ gl_cv_next_stdint_h='"'$gl_header'"'
+ else
+ gl_cv_next_stdint_h='<'stdint.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
+printf "%s\n" "$gl_cv_next_stdint_h" >&6; }
+ fi
+ NEXT_STDINT_H=$gl_cv_next_stdint_h
+
+ 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='<'stdint.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdint_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_stdint_h = yes; then
+ HAVE_STDINT_H=1
+ else
+ HAVE_STDINT_H=0
+ fi
+
+
+ if test $ac_cv_header_stdint_h = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
+printf %s "checking whether stdint.h conforms to C99... " >&6; }
+if test ${gl_cv_header_working_stdint_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ gl_cv_header_working_stdint_h=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#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
+
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+
+#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;
+
+#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. */
+ 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;
+};
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_header_working_stdint_h=yes
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#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>
+
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+
+#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
+ };
+
+int
+main (void)
+{
+
+ 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_header_working_stdint_h=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
+printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; }
+ fi
+ if test "$gl_cv_header_working_stdint_h" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
+printf %s "checking whether stdint.h predates C++11... " >&6; }
+if test ${gl_cv_header_stdint_predates_cxx11_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ gl_cv_header_stdint_predates_cxx11_h=yes
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_stdint_predates_cxx11_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
+printf "%s\n" "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
+
+ if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
+
+printf "%s\n" "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
+
+
+printf "%s\n" "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
+
+ fi
+ STDINT_H=
+ else
+ for ac_header in sys/inttypes.h sys/bitypes.h
+do :
+ as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_header_sys_inttypes_h = yes; then
+ HAVE_SYS_INTTYPES_H=1
+ else
+ HAVE_SYS_INTTYPES_H=0
+ fi
+
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ else
+ HAVE_SYS_BITYPES_H=0
+ fi
+
+
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+
+ for gltype in ptrdiff_t size_t ; do
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+printf %s "checking for bit size of $gltype... " >&6; }
+if eval test \${gl_cv_bitsizeof_${gltype}+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+#include <limits.h>"
+then :
+
+else
+ result=unknown
+fi
+
+ eval gl_cv_bitsizeof_${gltype}=\$result
+
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
+
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+
+
+ fi
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+printf %s "checking for bit size of $gltype... " >&6; }
+if eval test \${gl_cv_bitsizeof_${gltype}+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+#include <limits.h>"
+then :
+
+else
+ result=unknown
+fi
+
+ eval gl_cv_bitsizeof_${gltype}=\$result
+
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
+
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+
+
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
+printf %s "checking whether $gltype is signed... " >&6; }
+if eval test \${gl_cv_type_${gltype}_signed+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ result=yes
+else
+ result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval gl_cv_type_${gltype}_signed=\$result
+
+fi
+eval ac_res=\$gl_cv_type_${gltype}_signed
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval result=\$gl_cv_type_${gltype}_signed
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ if test "$result" = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGNED_${GLTYPE} 1
+_ACEOF
+
+ eval HAVE_SIGNED_${GLTYPE}=1
+ else
+ eval HAVE_SIGNED_${GLTYPE}=0
+ fi
+ done
+
+
+ gl_cv_type_ptrdiff_t_signed=yes
+ gl_cv_type_size_t_signed=no
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+
+ for gltype in ptrdiff_t size_t ; do
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+printf %s "checking for $gltype integer literal suffix... " >&6; }
+if eval test \${gl_cv_type_${gltype}_suffix+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+ extern $gltype foo;
+ extern $gltype1 foo;
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+ done
+
+
+ fi
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+printf %s "checking for $gltype integer literal suffix... " >&6; }
+if eval test \${gl_cv_type_${gltype}_suffix+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+ extern $gltype foo;
+ extern $gltype1 foo;
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+ done
+
+
+
+ if test $BITSIZEOF_WINT_T -lt 32; then
+ BITSIZEOF_WINT_T=32
+ fi
+
+ STDINT_H=stdint.h
+ fi
+
+ if test -n "$STDINT_H"; then
+ GL_GENERATE_STDINT_H_TRUE=
+ GL_GENERATE_STDINT_H_FALSE='#'
+else
+ GL_GENERATE_STDINT_H_TRUE='#'
+ GL_GENERATE_STDINT_H_FALSE=
+fi
+
+
+
+ GNULIB_IMAXABS=0;
+ GNULIB_IMAXDIV=0;
+ GNULIB_STRTOIMAX=0;
+ GNULIB_STRTOUMAX=0;
+ HAVE_DECL_IMAXABS=1;
+ HAVE_DECL_IMAXDIV=1;
+ HAVE_DECL_STRTOIMAX=1;
+ HAVE_DECL_STRTOUMAX=1;
+ REPLACE_STRTOIMAX=0;
+ REPLACE_STRTOUMAX=0;
+ INT32_MAX_LT_INTMAX_MAX=1;
+ INT64_MAX_EQ_LONG_MAX='defined _LP64';
+ PRI_MACROS_BROKEN=0;
+ PRIPTR_PREFIX=__PRIPTR_PREFIX;
+ UINT32_MAX_LT_UINTMAX_MAX=1;
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_inttypes_h='<'inttypes.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
+printf %s "checking absolute name of <inttypes.h>... " >&6; }
+if test ${gl_cv_next_inttypes_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_inttypes_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <inttypes.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'inttypes.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_inttypes_h
+ gl_cv_next_inttypes_h='"'$gl_header'"'
+ else
+ gl_cv_next_inttypes_h='<'inttypes.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
+printf "%s\n" "$gl_cv_next_inttypes_h" >&6; }
+ fi
+ NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
+
+ 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='<'inttypes.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_inttypes_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+ for gl_func in imaxabs imaxdiv strtoimax strtoumax; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <inttypes.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+ for ac_header in inttypes.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_inttypes_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_header_inttypes_h = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
+printf %s "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
+if test ${gt_cv_inttypes_pri_broken+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_inttypes_pri_broken=no
+else
+ gt_cv_inttypes_pri_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
+printf "%s\n" "$gt_cv_inttypes_pri_broken" >&6; }
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define PRI_MACROS_BROKEN 1
+_ACEOF
+
+ PRI_MACROS_BROKEN=1
+ else
+ PRI_MACROS_BROKEN=0
+ fi
+
+
+
+ GNULIB_ISWBLANK=0;
+ GNULIB_WCTYPE=0;
+ GNULIB_ISWCTYPE=0;
+ GNULIB_WCTRANS=0;
+ GNULIB_TOWCTRANS=0;
+ HAVE_ISWBLANK=1;
+ HAVE_WCTYPE_T=1;
+ HAVE_WCTRANS_T=1;
+ REPLACE_ISWBLANK=0;
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
+printf %s "checking for wint_t... " >&6; }
+if test ${gt_cv_c_wint_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+ wint_t foo = (wchar_t)'\0';
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_c_wint_t=yes
+else
+ gt_cv_c_wint_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
+printf "%s\n" "$gt_cv_c_wint_t" >&6; }
+ if test $gt_cv_c_wint_t = yes; then
+
+printf "%s\n" "#define HAVE_WINT_T 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+ if test $ac_cv_func_iswcntrl = yes; then
+ HAVE_ISWCNTRL=1
+ else
+ HAVE_ISWCNTRL=0
+ fi
+
+
+
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_wctype_h='<'wctype.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
+printf %s "checking absolute name of <wctype.h>... " >&6; }
+if test ${gl_cv_next_wctype_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_wctype_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wctype.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'wctype.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_wctype_h
+ gl_cv_next_wctype_h='"'$gl_header'"'
+ else
+ gl_cv_next_wctype_h='<'wctype.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
+printf "%s\n" "$gl_cv_next_wctype_h" >&6; }
+ fi
+ NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+
+ 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='<'wctype.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_wctype_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_wctype_h = yes; then
+ if test $ac_cv_func_iswcntrl = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
+printf %s "checking whether iswcntrl works... " >&6; }
+if test ${gl_cv_func_iswcntrl_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #if __GNU_LIBRARY__ == 1
+ Linux libc5 i18n is broken.
+ #endif
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_iswcntrl_works="guessing yes"
+else
+ gl_cv_func_iswcntrl_works="guessing no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_iswcntrl_works=yes
+else
+ gl_cv_func_iswcntrl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
+printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; }
+ fi
+ HAVE_WCTYPE_H=1
+ else
+ HAVE_WCTYPE_H=0
+ fi
+
+
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ :
+ fi
+
+ if test $REPLACE_ISWCNTRL = 1; then
+ REPLACE_TOWLOWER=1
+ else
+ for ac_func in towlower
+do :
+ ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
+if test "x$ac_cv_func_towlower" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TOWLOWER 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_towlower = yes; then
+ REPLACE_TOWLOWER=0
+ else
+ ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+
+"
+if test "x$ac_cv_have_decl_towlower" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TOWLOWER $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_towlower = yes; then
+ REPLACE_TOWLOWER=1
+ else
+ REPLACE_TOWLOWER=0
+ fi
+ fi
+ fi
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+ :
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
+printf %s "checking for wctype_t... " >&6; }
+if test ${gl_cv_type_wctype_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ wctype_t a;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_type_wctype_t=yes
+else
+ gl_cv_type_wctype_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
+printf "%s\n" "$gl_cv_type_wctype_t" >&6; }
+ if test $gl_cv_type_wctype_t = no; then
+ HAVE_WCTYPE_T=0
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
+printf %s "checking for wctrans_t... " >&6; }
+if test ${gl_cv_type_wctrans_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ wctrans_t a;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_type_wctrans_t=yes
+else
+ gl_cv_type_wctrans_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
+printf "%s\n" "$gl_cv_type_wctrans_t" >&6; }
+ if test $gl_cv_type_wctrans_t = no; then
+ HAVE_WCTRANS_T=0
+ fi
+
+
+ for gl_func in wctype iswctype wctrans towctrans ; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+ GNULIB_NL_LANGINFO=0;
+ HAVE_NL_LANGINFO=1;
+ REPLACE_NL_LANGINFO=0;
+
+
+
+ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getc_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
+_ACEOF
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5
+printf %s "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; }
+if test ${ac_cv_gnu_library_2_1+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky" >/dev/null 2>&1
+then :
+ ac_cv_gnu_library_2_1=yes
+else
+ ac_cv_gnu_library_2_1=no
+fi
+rm -rf conftest*
+
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
+printf "%s\n" "$ac_cv_gnu_library_2_1" >&6; }
+
+ GLIBC21="$ac_cv_gnu_library_2_1"
+
+
+
+ GNULIB_LOCALECONV=0;
+ GNULIB_SETLOCALE=0;
+ GNULIB_DUPLOCALE=0;
+ HAVE_DUPLOCALE=1;
+ REPLACE_LOCALECONV=0;
+ REPLACE_SETLOCALE=0;
+ REPLACE_DUPLOCALE=0;
+ REPLACE_STRUCT_LCONV=0;
+
+
+ REPLACE_NULL=0;
+ HAVE_MAX_ALIGN_T=1;
+ HAVE_WCHAR_T=1;
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
+printf %s "checking for wchar_t... " >&6; }
+if test ${gt_cv_c_wchar_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_c_wchar_t=yes
+else
+ gt_cv_c_wchar_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
+printf "%s\n" "$gt_cv_c_wchar_t" >&6; }
+ if test $gt_cv_c_wchar_t = yes; then
+
+printf "%s\n" "#define HAVE_WCHAR_T 1" >>confdefs.h
+
+ fi
+
+
+
+
+ STDDEF_H=
+ ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
+
+"
+if test "x$ac_cv_type_max_align_t" = xyes
+then :
+
+else
+ HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
+fi
+
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ STDDEF_H=stddef.h
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
+printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if test ${gl_cv_decl_null_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ int test[2 * (sizeof NULL == sizeof (void *)) -1];
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_decl_null_works=yes
+else
+ gl_cv_decl_null_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
+printf "%s\n" "$gl_cv_decl_null_works" >&6; }
+ if test $gl_cv_decl_null_works = no; then
+ REPLACE_NULL=1
+ STDDEF_H=stddef.h
+ fi
+
+ if test -n "$STDDEF_H"; then
+ GL_GENERATE_STDDEF_H_TRUE=
+ GL_GENERATE_STDDEF_H_FALSE='#'
+else
+ GL_GENERATE_STDDEF_H_TRUE='#'
+ GL_GENERATE_STDDEF_H_FALSE=
+fi
+
+ if test -n "$STDDEF_H"; then
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stddef_h='<'stddef.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
+printf %s "checking absolute name of <stddef.h>... " >&6; }
+if test ${gl_cv_next_stddef_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stddef.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stddef_h
+ gl_cv_next_stddef_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
+printf "%s\n" "$gl_cv_next_stddef_h" >&6; }
+ fi
+ NEXT_STDDEF_H=$gl_cv_next_stddef_h
+
+ 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='<'stddef.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stddef_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+
+
+
+
+ fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+printf %s "checking whether lstat correctly handles trailing slash... " >&6; }
+if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y}
+then :
+ printf %s "(cached) " >&6
+else
+ rm -f conftest.sym conftest.file
+ echo >conftest.file
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ *-gnu*)
+ # Guess yes on glibc systems.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ *)
+ # If we don't know, assume the worst.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_lstat_dereferences_slashed_symlink=yes
+else
+ gl_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.sym conftest.file
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
+printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *yes)
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+ ;;
+ esac
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+printf %s "checking for a sed that does not truncate output... " >&6; }
+if test ${ac_cv_path_SED+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in sed gsed
+ do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ printf %s 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ printf "%s\n" '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+printf "%s\n" "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+
+ GNULIB__EXIT=0;
+ GNULIB_ATOLL=0;
+ GNULIB_CALLOC_POSIX=0;
+ GNULIB_CANONICALIZE_FILE_NAME=0;
+ GNULIB_GETLOADAVG=0;
+ GNULIB_GETSUBOPT=0;
+ GNULIB_GRANTPT=0;
+ GNULIB_MALLOC_POSIX=0;
+ GNULIB_MBTOWC=0;
+ GNULIB_MKDTEMP=0;
+ GNULIB_MKOSTEMP=0;
+ GNULIB_MKOSTEMPS=0;
+ GNULIB_MKSTEMP=0;
+ GNULIB_MKSTEMPS=0;
+ GNULIB_POSIX_OPENPT=0;
+ GNULIB_PTSNAME=0;
+ GNULIB_PTSNAME_R=0;
+ GNULIB_PUTENV=0;
+ GNULIB_QSORT_R=0;
+ GNULIB_RANDOM=0;
+ GNULIB_RANDOM_R=0;
+ GNULIB_REALLOC_POSIX=0;
+ GNULIB_REALPATH=0;
+ GNULIB_RPMATCH=0;
+ GNULIB_SECURE_GETENV=0;
+ GNULIB_SETENV=0;
+ GNULIB_STRTOD=0;
+ GNULIB_STRTOLL=0;
+ GNULIB_STRTOULL=0;
+ GNULIB_SYSTEM_POSIX=0;
+ GNULIB_UNLOCKPT=0;
+ GNULIB_UNSETENV=0;
+ GNULIB_WCTOMB=0;
+ HAVE__EXIT=1;
+ HAVE_ATOLL=1;
+ HAVE_CANONICALIZE_FILE_NAME=1;
+ HAVE_DECL_GETLOADAVG=1;
+ HAVE_GETSUBOPT=1;
+ HAVE_GRANTPT=1;
+ HAVE_MKDTEMP=1;
+ HAVE_MKOSTEMP=1;
+ HAVE_MKOSTEMPS=1;
+ HAVE_MKSTEMP=1;
+ HAVE_MKSTEMPS=1;
+ HAVE_POSIX_OPENPT=1;
+ HAVE_PTSNAME=1;
+ HAVE_PTSNAME_R=1;
+ HAVE_RANDOM=1;
+ HAVE_RANDOM_H=1;
+ HAVE_RANDOM_R=1;
+ HAVE_REALPATH=1;
+ HAVE_RPMATCH=1;
+ HAVE_SECURE_GETENV=1;
+ HAVE_SETENV=1;
+ HAVE_DECL_SETENV=1;
+ HAVE_STRTOD=1;
+ HAVE_STRTOLL=1;
+ HAVE_STRTOULL=1;
+ HAVE_STRUCT_RANDOM_DATA=1;
+ HAVE_SYS_LOADAVG_H=0;
+ HAVE_UNLOCKPT=1;
+ HAVE_DECL_UNSETENV=1;
+ REPLACE_CALLOC=0;
+ REPLACE_CANONICALIZE_FILE_NAME=0;
+ REPLACE_MALLOC=0;
+ REPLACE_MBTOWC=0;
+ REPLACE_MKSTEMP=0;
+ REPLACE_PTSNAME=0;
+ REPLACE_PTSNAME_R=0;
+ REPLACE_PUTENV=0;
+ REPLACE_QSORT_R=0;
+ REPLACE_RANDOM_R=0;
+ REPLACE_REALLOC=0;
+ REPLACE_REALPATH=0;
+ REPLACE_SETENV=0;
+ REPLACE_STRTOD=0;
+ REPLACE_UNSETENV=0;
+ REPLACE_WCTOMB=0;
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
+printf %s "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
+if test ${gl_cv_func_malloc_posix+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ choke me
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_malloc_posix=yes
+else
+ gl_cv_func_malloc_posix=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
+printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
+
+# Autoupdate added the following line to ensure that your configure
+# script's behavior did not change. It is probably safe to remove.
+
+
+
+ for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+done
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+printf %s "checking for GNU libc compatible malloc... " >&6; }
+if test ${ac_cv_func_malloc_0_nonnull+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* \
+ | hpux* | solaris* | cygwin* | mingw*)
+ ac_cv_func_malloc_0_nonnull=yes ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_malloc_0_nonnull=no ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+ char *malloc ();
+ #endif
+
+int
+main (void)
+{
+char *p = malloc (0);
+ int result = !p;
+ free (p);
+ return result;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_func_malloc_0_nonnull=yes
+else
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; }
+ if test $ac_cv_func_malloc_0_nonnull = yes
+then :
+ gl_cv_func_malloc_0_nonnull=1
+else
+ gl_cv_func_malloc_0_nonnull=0
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
+_ACEOF
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+ LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+ GNULIB_FFSL=0;
+ GNULIB_FFSLL=0;
+ GNULIB_MEMCHR=0;
+ GNULIB_MEMMEM=0;
+ GNULIB_MEMPCPY=0;
+ GNULIB_MEMRCHR=0;
+ GNULIB_RAWMEMCHR=0;
+ GNULIB_STPCPY=0;
+ GNULIB_STPNCPY=0;
+ GNULIB_STRCHRNUL=0;
+ GNULIB_STRDUP=0;
+ GNULIB_STRNCAT=0;
+ GNULIB_STRNDUP=0;
+ GNULIB_STRNLEN=0;
+ GNULIB_STRPBRK=0;
+ GNULIB_STRSEP=0;
+ GNULIB_STRSTR=0;
+ GNULIB_STRCASESTR=0;
+ GNULIB_STRTOK_R=0;
+ GNULIB_MBSLEN=0;
+ GNULIB_MBSNLEN=0;
+ GNULIB_MBSCHR=0;
+ GNULIB_MBSRCHR=0;
+ GNULIB_MBSSTR=0;
+ GNULIB_MBSCASECMP=0;
+ GNULIB_MBSNCASECMP=0;
+ GNULIB_MBSPCASECMP=0;
+ GNULIB_MBSCASESTR=0;
+ GNULIB_MBSCSPN=0;
+ GNULIB_MBSPBRK=0;
+ GNULIB_MBSSPN=0;
+ GNULIB_MBSSEP=0;
+ GNULIB_MBSTOK_R=0;
+ GNULIB_STRERROR=0;
+ GNULIB_STRERROR_R=0;
+ GNULIB_STRSIGNAL=0;
+ GNULIB_STRVERSCMP=0;
+ HAVE_MBSLEN=0;
+ HAVE_FFSL=1;
+ HAVE_FFSLL=1;
+ HAVE_MEMCHR=1;
+ HAVE_DECL_MEMMEM=1;
+ HAVE_MEMPCPY=1;
+ HAVE_DECL_MEMRCHR=1;
+ HAVE_RAWMEMCHR=1;
+ HAVE_STPCPY=1;
+ HAVE_STPNCPY=1;
+ HAVE_STRCHRNUL=1;
+ HAVE_DECL_STRDUP=1;
+ HAVE_DECL_STRNDUP=1;
+ HAVE_DECL_STRNLEN=1;
+ HAVE_STRPBRK=1;
+ HAVE_STRSEP=1;
+ HAVE_STRCASESTR=1;
+ HAVE_DECL_STRTOK_R=1;
+ HAVE_DECL_STRERROR_R=1;
+ HAVE_DECL_STRSIGNAL=1;
+ HAVE_STRVERSCMP=1;
+ REPLACE_MEMCHR=0;
+ REPLACE_MEMMEM=0;
+ REPLACE_STPNCPY=0;
+ REPLACE_STRDUP=0;
+ REPLACE_STRSTR=0;
+ REPLACE_STRCASESTR=0;
+ REPLACE_STRCHRNUL=0;
+ REPLACE_STRERROR=0;
+ REPLACE_STRERROR_R=0;
+ REPLACE_STRNCAT=0;
+ REPLACE_STRNDUP=0;
+ REPLACE_STRNLEN=0;
+ REPLACE_STRSIGNAL=0;
+ REPLACE_STRTOK_R=0;
+ UNDEFINE_STRTOK_R=0;
+
+
+
+
+
+
+
+
+
+
+
+ # 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_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+ gl_have_mmap=yes
+else
+ gl_have_mmap=no
+fi
+
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+printf %s "checking for MAP_ANONYMOUS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ if test $gl_have_mmap_anonymous != yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+
+printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
+
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+printf "%s\n" "$gl_have_mmap_anonymous" >&6; }
+ if test $gl_have_mmap_anonymous = yes; then
+
+printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+
+ if test $HAVE_MEMCHR = 1; then
+ # Detect platform-specific bugs in some versions of glibc:
+ # memchr should not dereference anything with length 0
+ # http://bugzilla.redhat.com/499689
+ # memchr should not dereference overestimated length after a match
+ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # http://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # Assume that memchr works on platforms that lack mprotect.
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
+printf %s "checking whether memchr works... " >&6; }
+if test ${gl_cv_func_memchr_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_memchr_works="guessing no"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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
+main (void)
+{
+
+ 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)
+ {
+ 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;
+ }
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_memchr_works=yes
+else
+ gl_cv_func_memchr_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
+printf "%s\n" "$gl_cv_func_memchr_works" >&6; }
+ if test "$gl_cv_func_memchr_works" != yes; then
+ REPLACE_MEMCHR=1
+ fi
+ fi
+
+
+
+
+ GNULIB_MKTIME=0;
+ GNULIB_NANOSLEEP=0;
+ GNULIB_STRPTIME=0;
+ GNULIB_TIMEGM=0;
+ GNULIB_TIME_R=0;
+ GNULIB_TIME_RZ=0;
+ HAVE_DECL_LOCALTIME_R=1;
+ HAVE_NANOSLEEP=1;
+ HAVE_STRPTIME=1;
+ HAVE_TIMEGM=1;
+ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
+ REPLACE_MKTIME=GNULIB_PORTCHECK;
+ REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
+ REPLACE_TIMEGM=GNULIB_PORTCHECK;
+
+ : ${GNULIB_GETTIMEOFDAY=0};
+ REPLACE_GMTIME=0;
+ REPLACE_LOCALTIME=0;
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5
+printf %s "checking whether time_t is signed... " >&6; }
+if test ${gl_cv_time_t_is_signed+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+ char time_t_signed[(time_t) -1 < 0 ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_time_t_is_signed=yes
+else
+ gl_cv_time_t_is_signed=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5
+printf "%s\n" "$gl_cv_time_t_is_signed" >&6; }
+ if test $gl_cv_time_t_is_signed = yes; then
+
+printf "%s\n" "#define TIME_T_IS_SIGNED 1" >>confdefs.h
+
+ fi
+
+ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
+if test "x$ac_cv_have_decl_alarm" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ALARM $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
+printf %s "checking for promoted mode_t type... " >&6; }
+if test ${gl_cv_promoted_mode_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main (void)
+{
+typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_promoted_mode_t='int'
+else
+ gl_cv_promoted_mode_t='mode_t'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
+printf "%s\n" "$gl_cv_promoted_mode_t" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
+_ACEOF
+
+
+
+
+
+ GNULIB_PTHREAD_SIGMASK=0;
+ GNULIB_RAISE=0;
+ GNULIB_SIGNAL_H_SIGPIPE=0;
+ GNULIB_SIGPROCMASK=0;
+ GNULIB_SIGACTION=0;
+ HAVE_POSIX_SIGNALBLOCKING=1;
+ HAVE_PTHREAD_SIGMASK=1;
+ HAVE_RAISE=1;
+ HAVE_SIGSET_T=1;
+ HAVE_SIGINFO_T=1;
+ HAVE_SIGACTION=1;
+ HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
+
+ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+
+ HAVE_SIGHANDLER_T=1;
+ REPLACE_PTHREAD_SIGMASK=0;
+ REPLACE_RAISE=0;
+
+
+ ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
+ #include <signal.h>
+ /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
+ #include <sys/types.h>
+
+"
+if test "x$ac_cv_type_sigset_t" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGSET_T 1
+_ACEOF
+
+gl_cv_type_sigset_t=yes
+else
+ gl_cv_type_sigset_t=no
+fi
+
+ if test $gl_cv_type_sigset_t != yes; then
+ HAVE_SIGSET_T=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_setenv" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SETENV $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+
+
+
+
+
+ for ac_header in search.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
+if test "x$ac_cv_header_search_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEARCH_H 1
+_ACEOF
+
+fi
+done
+
+ for ac_func in tsearch
+do :
+ ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
+if test "x$ac_cv_func_tsearch" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TSEARCH 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+printf %s "checking for uid_t in sys/types.h... " >&6; }
+if test ${ac_cv_type_uid_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1
+then :
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+printf "%s\n" "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+printf "%s\n" "#define uid_t int" >>confdefs.h
+
+
+printf "%s\n" "#define gid_t int" >>confdefs.h
+
+fi
+
+:
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+printf %s "checking for stdbool.h that conforms to C99... " >&6; }
+if test ${ac_cv_header_stdbool_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdbool.h>
+
+ #if __cplusplus < 201103
+ #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; } 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
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main (void)
+{
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! 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);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+printf "%s\n" "$ac_cv_header_stdbool_h" >&6; }
+ ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+
+
+ GNULIB_FFS=0;
+ HAVE_FFS=1;
+ HAVE_STRCASECMP=1;
+ HAVE_DECL_STRNCASECMP=1;
+
+
+ REPLACE_STRERROR_0=0
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
+printf %s "checking whether strerror(0) succeeds... " >&6; }
+if test ${gl_cv_func_strerror_0_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_strerror_0_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+ #include <errno.h>
+
+int
+main (void)
+{
+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;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_strerror_0_works=yes
+else
+ gl_cv_func_strerror_0_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
+printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; }
+ case "$gl_cv_func_strerror_0_works" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR_0=1
+
+printf "%s\n" "#define REPLACE_STRERROR_0 1" >>confdefs.h
+
+ ;;
+ esac
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_strerror_r = yes; then
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
+printf %s "checking for strerror_r with POSIX signature... " >&6; }
+if test ${gl_cv_func_strerror_r_posix_signature+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+ int strerror_r (int, char *, size_t);
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_strerror_r_posix_signature=yes
+else
+ gl_cv_func_strerror_r_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; }
+ if test $gl_cv_func_strerror_r_posix_signature = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
+printf %s "checking whether strerror_r works... " >&6; }
+if test ${gl_cv_func_strerror_r_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+
+ case "$host_os" in
+ # Guess no on AIX.
+ aix*) gl_cv_func_strerror_r_works="guessing no";;
+ # Guess no on HP-UX.
+ hpux*) gl_cv_func_strerror_r_works="guessing no";;
+ # Guess no on BSD variants.
+ *bsd*) gl_cv_func_strerror_r_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_strerror_r_works="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+ #include <string.h>
+
+int
+main (void)
+{
+int result = 0;
+ char buf[79];
+ if (strerror_r (EACCES, buf, 0) < 0)
+ result |= 1;
+ errno = 0;
+ if (strerror_r (EACCES, buf, sizeof buf) != 0)
+ result |= 2;
+ strcpy (buf, "Unknown");
+ if (strerror_r (0, buf, sizeof buf) != 0)
+ result |= 4;
+ if (errno)
+ result |= 8;
+ if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
+ result |= 0x10;
+ errno = 0;
+ *buf = 0;
+ if (strerror_r (-3, buf, sizeof buf) < 0)
+ result |= 0x20;
+ if (errno)
+ result |= 0x40;
+ if (!*buf)
+ result |= 0x80;
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_strerror_r_works=yes
+else
+ gl_cv_func_strerror_r_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
+printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; }
+ else
+
+ if test $ac_cv_func___xpg_strerror_r = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
+printf %s "checking whether __xpg_strerror_r works... " >&6; }
+if test ${gl_cv_func_strerror_r_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_strerror_r_works="guessing no"
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+ #include <string.h>
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int __xpg_strerror_r(int, char *, size_t);
+
+int
+main (void)
+{
+int result = 0;
+ char buf[256] = "^";
+ char copy[256];
+ char *str = strerror (-1);
+ strcpy (copy, str);
+ if (__xpg_strerror_r (-2, buf, 1) == 0)
+ result |= 1;
+ if (*buf)
+ result |= 2;
+ __xpg_strerror_r (-2, buf, 256);
+ if (strcmp (str, copy))
+ result |= 4;
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_strerror_r_works=yes
+else
+ gl_cv_func_strerror_r_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
+printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; }
+ fi
+ fi
+ fi
+ fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if test ${ac_cv_struct_tm+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main (void)
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+printf "%s\n" "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
+#include <$ac_cv_struct_tm>
+
+"
+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM_TM_ZONE 1
+_ACEOF
+
+
+fi
+
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
+
+printf "%s\n" "#define HAVE_TM_ZONE 1" >>confdefs.h
+
+else
+ ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
+"
+if test "x$ac_cv_have_decl_tzname" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TZNAME $ac_have_decl
+_ACEOF
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+printf %s "checking for tzname... " >&6; }
+if test ${ac_cv_var_tzname+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+#if !HAVE_DECL_TZNAME
+extern char *tzname[];
+#endif
+
+int
+main (void)
+{
+return tzname[0][0];
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_var_tzname=yes
+else
+ ac_cv_var_tzname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
+printf "%s\n" "$ac_cv_var_tzname" >&6; }
+ if test $ac_cv_var_tzname = yes; then
+
+printf "%s\n" "#define HAVE_TZNAME 1" >>confdefs.h
+
+ fi
+fi
+
+
+ ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
+"
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes
+then :
+
+printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_string_h='<'string.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
+printf %s "checking absolute name of <string.h>... " >&6; }
+if test ${gl_cv_next_string_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'string.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_string_h
+ gl_cv_next_string_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
+printf "%s\n" "$gl_cv_next_string_h" >&6; }
+ fi
+ NEXT_STRING_H=$gl_cv_next_string_h
+
+ 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='<'string.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_string_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
+
+
+
+
+
+
+ for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_strings_h='<'strings.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <strings.h>" >&5
+printf %s "checking absolute name of <strings.h>... " >&6; }
+if test ${gl_cv_next_strings_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_strings_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <strings.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'strings.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_strings_h
+ gl_cv_next_strings_h='"'$gl_header'"'
+ else
+ gl_cv_next_strings_h='<'strings.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5
+printf "%s\n" "$gl_cv_next_strings_h" >&6; }
+ fi
+ NEXT_STRINGS_H=$gl_cv_next_strings_h
+
+ 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='<'strings.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_strings_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_strings_h = yes; then
+ HAVE_STRINGS_H=1
+ else
+ HAVE_STRINGS_H=0
+ fi
+
+
+
+ for gl_func in ffs strcasecmp strncasecmp; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
+ <strings.h>. */
+ #include <sys/types.h>
+ #include <strings.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strndup" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNDUP $ac_have_decl
+_ACEOF
+
+
+
+ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strnlen" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNLEN $ac_have_decl
+_ACEOF
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strtoumax" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRTOUMAX $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_types_h='<'sys/types.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
+printf %s "checking absolute name of <sys/types.h>... " >&6; }
+if test ${gl_cv_next_sys_types_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/types.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_types_h
+ gl_cv_next_sys_types_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
+printf "%s\n" "$gl_cv_next_sys_types_h" >&6; }
+ fi
+ NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
+
+ 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='<'sys/types.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_types_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+ GNULIB_WAITPID=0;
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
+printf %s "checking for struct timespec in <time.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_time_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_timespec_in_time_h=yes
+else
+ gl_cv_sys_struct_timespec_in_time_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
+
+ 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
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
+printf %s "checking for struct timespec in <sys/time.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_timespec_in_sys_time_h=yes
+else
+ gl_cv_sys_struct_timespec_in_sys_time_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
+printf %s "checking for struct timespec in <pthread.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_pthread_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_timespec_in_pthread_h=yes
+else
+ gl_cv_sys_struct_timespec_in_pthread_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
+printf %s "checking for struct timespec in <unistd.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_unistd_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_timespec_in_unistd_h=yes
+else
+ gl_cv_sys_struct_timespec_in_unistd_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
+ fi
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_time_h='<'time.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
+printf %s "checking absolute name of <time.h>... " >&6; }
+if test ${gl_cv_next_time_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'time.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_time_h
+ gl_cv_next_time_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
+printf "%s\n" "$gl_cv_next_time_h" >&6; }
+ fi
+ NEXT_TIME_H=$gl_cv_next_time_h
+
+ 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='<'time.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_time_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+
+
+ if test "$HAVE_LIBUNISTRING" = yes; then
+ LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"`
+ LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"`
+ LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+ fi
+
+ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_feof_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_ferror_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fflush_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fgets_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fputc_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fputs_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fread_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getchar_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_putc_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_putchar_unlocked" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_unsetenv" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UNSETENV $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+ if test $ac_cv_header_features_h = yes; then
+ HAVE_FEATURES_H=1
+ else
+ HAVE_FEATURES_H=0
+ fi
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
+printf %s "checking for inttypes.h... " >&6; }
+if test ${gl_cv_header_inttypes_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <inttypes.h>
+
+int
+main (void)
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_inttypes_h=yes
+else
+ gl_cv_header_inttypes_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5
+printf "%s\n" "$gl_cv_header_inttypes_h" >&6; }
+ if test $gl_cv_header_inttypes_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+_ACEOF
+
+ fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
+printf %s "checking for stdint.h... " >&6; }
+if test ${gl_cv_header_stdint_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <stdint.h>
+int
+main (void)
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_stdint_h=yes
+else
+ gl_cv_header_stdint_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5
+printf "%s\n" "$gl_cv_header_stdint_h" >&6; }
+ if test $gl_cv_header_stdint_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+_ACEOF
+
+ fi
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
+printf %s "checking for intmax_t... " >&6; }
+if test ${gt_cv_c_intmax_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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
+
+int
+main (void)
+{
+intmax_t x = -1; return !x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_c_intmax_t=yes
+else
+ gt_cv_c_intmax_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5
+printf "%s\n" "$gt_cv_c_intmax_t" >&6; }
+ if test $gt_cv_c_intmax_t = yes; then
+
+printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h
+
+ else
+
+ test $ac_cv_type_long_long_int = yes \
+ && ac_type='long long' \
+ || ac_type='long'
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t $ac_type
+_ACEOF
+
+ fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
+printf %s "checking where to find the exponent in a 'double'... " >&6; }
+if test ${gl_cv_cc_double_expbit0+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined arm || defined __arm || defined __arm__
+ mixed_endianness
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "mixed_endianness" >/dev/null 2>&1
+then :
+ gl_cv_cc_double_expbit0="unknown"
+else
+
+ :
+if test ${ac_cv_c_bigendian+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main (void)
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main (void)
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main (void)
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main (void)
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes
+then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main (void)
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+:
+ case $ac_cv_c_bigendian in #(
+ yes)
+ gl_cv_cc_double_expbit0="word 0 bit 20";; #(
+ no)
+ gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
+ universal)
+
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ gl_cv_cc_double_expbit0="unknown" ;;
+ esac
+
+
+fi
+rm -rf conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_cc_double_expbit0=`cat conftest.out`
+else
+ gl_cv_cc_double_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; }
+ 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 //'`
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_WORD $word
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_BIT $bit
+_ACEOF
+
+ ;;
+ esac
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5
+printf %s "checking whether snprintf returns a byte count as in C99... " >&6; }
+if test ${gl_cv_func_snprintf_retval_c99+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_retval_c99="guessing no";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_snprintf_retval_c99=yes
+else
+ gl_cv_func_snprintf_retval_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5
+printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; }
+
+
+
+
+
+
+ for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
+do :
+ as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
+"
+if test "x$ac_cv_have_decl__snprintf" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF $ac_have_decl
+_ACEOF
+
+
+
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+
+printf "%s\n" "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
+
+ ;;
+ esac
+
+
+
+
+
+
+ GNULIB_SOCKET=0;
+ GNULIB_CONNECT=0;
+ GNULIB_ACCEPT=0;
+ GNULIB_BIND=0;
+ GNULIB_GETPEERNAME=0;
+ GNULIB_GETSOCKNAME=0;
+ GNULIB_GETSOCKOPT=0;
+ GNULIB_LISTEN=0;
+ GNULIB_RECV=0;
+ GNULIB_SEND=0;
+ GNULIB_RECVFROM=0;
+ GNULIB_SENDTO=0;
+ GNULIB_SETSOCKOPT=0;
+ GNULIB_SHUTDOWN=0;
+ GNULIB_ACCEPT4=0;
+ HAVE_STRUCT_SOCKADDR_STORAGE=1;
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+
+ HAVE_SA_FAMILY_T=1;
+ HAVE_ACCEPT4=1;
+
+
+ if test $ac_cv_header_sys_socket_h = no; then
+ for ac_header in ws2tcpip.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
+if test "x$ac_cv_header_ws2tcpip_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WS2TCPIP_H 1
+_ACEOF
+
+fi
+done
+
+ fi
+
+
+
+
+
+ case "$host_os" in
+ osf*)
+
+printf "%s\n" "#define _POSIX_PII_SOCKET 1" >>confdefs.h
+
+ ;;
+ esac
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
+printf %s "checking whether <sys/socket.h> is self-contained... " >&6; }
+if test ${gl_cv_header_sys_socket_h_selfcontained+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_sys_socket_h_selfcontained=yes
+else
+ gl_cv_header_sys_socket_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+ if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+ for ac_func in shutdown
+do :
+ ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
+if test "x$ac_cv_func_shutdown" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SHUTDOWN 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_shutdown = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
+printf %s "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
+if test ${gl_cv_header_sys_socket_h_shut+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+int
+main (void)
+{
+int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_sys_socket_h_shut=yes
+else
+ gl_cv_header_sys_socket_h_shut=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
+printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; }
+ if test $gl_cv_header_sys_socket_h_shut = no; then
+ SYS_SOCKET_H='sys/socket.h'
+ fi
+ fi
+ fi
+ # We need to check for ws2tcpip.h now.
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
+printf %s "checking absolute name of <sys/socket.h>... " >&6; }
+if test ${gl_cv_next_sys_socket_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_socket_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/socket.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_socket_h
+ gl_cv_next_sys_socket_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
+printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; }
+ fi
+ NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
+
+ 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='<'sys/socket.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_socket_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_SYS_SOCKET_H=1
+ HAVE_WS2TCPIP_H=0
+ else
+ HAVE_SYS_SOCKET_H=0
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
+ /* 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 "x$ac_cv_type_struct_sockaddr_storage" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_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 "x$ac_cv_type_sa_family_t" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SA_FAMILY_T 1
+_ACEOF
+
+
+fi
+
+ 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_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #ifdef HAVE_WS2TCPIP_H
+ #include <ws2tcpip.h>
+ #endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+_ACEOF
+
+
+else
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
+fi
+
+ fi
+ if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+ SYS_SOCKET_H='sys/socket.h'
+ fi
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+
+
+ for gl_func in socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Some systems require prerequisite headers. */
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+ GNULIB_INET_NTOP=0;
+ GNULIB_INET_PTON=0;
+ HAVE_DECL_INET_NTOP=1;
+ HAVE_DECL_INET_PTON=1;
+ REPLACE_INET_NTOP=0;
+ REPLACE_INET_PTON=0;
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
+printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
+if test ${gl_cv_func_getcwd_null+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_getcwd_null="guessing no";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <stdlib.h>
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# else /* on Windows with MSVC */
+# include <direct.h>
+# endif
+# ifndef getcwd
+ char *getcwd ();
+# endif
+
+int
+main (void)
+{
+
+#if (defined _WIN32 || 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] != '/')
+ return 3;
+ if (f[1] != '\0')
+ return 4;
+ free (f);
+ return 0;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getcwd_null=yes
+else
+ gl_cv_func_getcwd_null=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
+printf "%s\n" "$gl_cv_func_getcwd_null" >&6; }
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
+printf %s "checking for getcwd with POSIX signature... " >&6; }
+if test ${gl_cv_func_getcwd_posix_signature+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main (void)
+{
+extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ char *getcwd (char *, size_t);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_getcwd_posix_signature=yes
+else
+ gl_cv_func_getcwd_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; }
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
+printf %s "checking for IPv4 sockets... " >&6; }
+ if test ${gl_cv_socket_ipv4+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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
+main (void)
+{
+int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_socket_ipv4=yes
+else
+ gl_cv_socket_ipv4=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
+printf "%s\n" "$gl_cv_socket_ipv4" >&6; }
+ if test $gl_cv_socket_ipv4 = yes; then
+
+printf "%s\n" "#define HAVE_IPV4 1" >>confdefs.h
+
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
+printf %s "checking for IPv6 sockets... " >&6; }
+ if test ${gl_cv_socket_ipv6+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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
+main (void)
+{
+int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_socket_ipv6=yes
+else
+ gl_cv_socket_ipv6=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
+printf "%s\n" "$gl_cv_socket_ipv6" >&6; }
+ if test $gl_cv_socket_ipv6 = yes; then
+
+printf "%s\n" "#define HAVE_IPV6 1" >>confdefs.h
+
+ fi
+
+
+
+
+ GNULIB_PSELECT=0;
+ GNULIB_SELECT=0;
+ HAVE_PSELECT=1;
+ REPLACE_PSELECT=0;
+ REPLACE_SELECT=0;
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
+printf %s "checking whether <sys/select.h> is self-contained... " >&6; }
+if test ${gl_cv_header_sys_select_h_selfcontained+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main (void)
+{
+struct timeval b;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_sys_select_h_selfcontained=yes
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main (void)
+{
+int memset; int bzero;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main (void)
+{
+
+ #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);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; }
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
+printf %s "checking absolute name of <sys/select.h>... " >&6; }
+if test ${gl_cv_next_sys_select_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_select_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/select.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_select_h
+ gl_cv_next_sys_select_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
+printf "%s\n" "$gl_cv_next_sys_select_h" >&6; }
+ fi
+ NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h
+
+ 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='<'sys/select.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_select_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_select_h = yes; then
+ HAVE_SYS_SELECT_H=1
+ else
+ HAVE_SYS_SELECT_H=0
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+
+
+ for gl_func in pselect select; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* 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>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+ LIBSOCKET=
+ if test $HAVE_WINSOCK2_H = 1; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5
+printf %s "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; }
+if test ${gl_cv_func_wsastartup+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+int
+main (void)
+{
+
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_func_wsastartup=yes
+else
+ gl_cv_func_wsastartup=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5
+printf "%s\n" "$gl_cv_func_wsastartup" >&6; }
+ if test "$gl_cv_func_wsastartup" = "yes"; then
+
+printf "%s\n" "#define WINDOWS_SOCKETS 1" >>confdefs.h
+
+ LIBSOCKET='-lws2_32'
+ fi
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
+printf %s "checking for library containing setsockopt... " >&6; }
+if test ${gl_cv_lib_socket+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_cv_lib_socket=
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else
+ gl_save_LIBS="$LIBS"
+ LIBS="$gl_save_LIBS -lsocket"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_lib_socket="-lsocket"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnetwork"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_lib_socket="-lnetwork"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnet"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_lib_socket="-lnet"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ fi
+ LIBS="$gl_save_LIBS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$gl_cv_lib_socket"; then
+ gl_cv_lib_socket="none needed"
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5
+printf "%s\n" "$gl_cv_lib_socket" >&6; }
+ if test "$gl_cv_lib_socket" != "none needed"; then
+ LIBSOCKET="$gl_cv_lib_socket"
+ fi
+ fi
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ REPLACE_SELECT=1
+ else
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5
+printf %s "checking whether select supports a 0 argument... " >&6; }
+if test ${gl_cv_func_select_supports0+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ 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
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_select_supports0=yes
+else
+ gl_cv_func_select_supports0=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5
+printf "%s\n" "$gl_cv_func_select_supports0" >&6; }
+ case "$gl_cv_func_select_supports0" in
+ *yes) ;;
+ *) REPLACE_SELECT=1 ;;
+ esac
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5
+printf %s "checking whether select detects invalid fds... " >&6; }
+if test ${gl_cv_func_select_detects_ebadf+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_select_detects_ebadf="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+
+int
+main (void)
+{
+
+ 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_select_detects_ebadf=yes
+else
+ gl_cv_func_select_detects_ebadf=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5
+printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; }
+ case $gl_cv_func_select_detects_ebadf in
+ *yes) ;;
+ *) REPLACE_SELECT=1 ;;
+ esac
+ fi
+
+ LIB_SELECT="$LIBSOCKET"
+ if test $REPLACE_SELECT = 1; then
+ case "$host_os" in
+ mingw*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+int
+main ()
+{
+ MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else
+ LIB_SELECT="$LIB_SELECT -luser32"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+ esac
+ fi
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_strerror_r = no; then
+ HAVE_DECL_STRERROR_R=0
+ fi
+
+ if test $ac_cv_func_strerror_r = yes; then
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ if test $gl_cv_func_strerror_r_posix_signature = yes; then
+ case "$gl_cv_func_strerror_r_works" in
+ *no) REPLACE_STRERROR_R=1 ;;
+ esac
+ else
+ REPLACE_STRERROR_R=1
+ fi
+ else
+ REPLACE_STRERROR_R=1
+ fi
+ fi
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_snprintf" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNPRINTF $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if false; then
+ GL_COND_LIBTOOL_TRUE=
+ GL_COND_LIBTOOL_FALSE='#'
+else
+ GL_COND_LIBTOOL_TRUE='#'
+ GL_COND_LIBTOOL_FALSE=
+fi
+
+ gl_cond_libtool=false
+ gl_libdeps=
+ gl_ltlibdeps=
+ gl_m4_base='m4'
+
+
+
+
+
+
+
+
+
+ gl_source_base='lib'
+
+
+ if test $ac_cv_func_alloca_works = no; then
+ :
+ fi
+
+ # Define an additional variable used in the Makefile substitution.
+ if test $ac_cv_working_alloca_h = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
+printf %s "checking for alloca as a compiler built-in... " >&6; }
+if test ${gl_cv_rpl_alloca+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+ Need own alloca
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Need own alloca" >/dev/null 2>&1
+then :
+ gl_cv_rpl_alloca=yes
+else
+ gl_cv_rpl_alloca=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
+printf "%s\n" "$gl_cv_rpl_alloca" >&6; }
+ if test $gl_cv_rpl_alloca = yes; then
+
+printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h
+
+ ALLOCA_H=alloca.h
+ else
+ ALLOCA_H=
+ fi
+ else
+ ALLOCA_H=alloca.h
+ fi
+
+ if test -n "$ALLOCA_H"; then
+ GL_GENERATE_ALLOCA_H_TRUE=
+ GL_GENERATE_ALLOCA_H_FALSE='#'
+else
+ GL_GENERATE_ALLOCA_H_TRUE='#'
+ GL_GENERATE_ALLOCA_H_FALSE=
+fi
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_btowc = no; then
+ HAVE_BTOWC=0
+ else
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
+printf %s "checking whether btowc(0) is correct... " >&6; }
+if test ${gl_cv_func_btowc_nul+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_nul="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+ if (btowc ('\0') != 0)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_btowc_nul=yes
+else
+ gl_cv_func_btowc_nul=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
+printf "%s\n" "$gl_cv_func_btowc_nul" >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
+printf %s "checking whether btowc(EOF) is correct... " >&6; }
+if test ${gl_cv_func_btowc_eof+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on IRIX.
+ irix*) gl_cv_func_btowc_eof="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_eof="guessing yes" ;;
+ esac
+ if test $LOCALE_FR != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (btowc (EOF) != WEOF)
+ return 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_btowc_eof=yes
+else
+ gl_cv_func_btowc_eof=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
+printf "%s\n" "$gl_cv_func_btowc_eof" >&6; }
+
+ 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
+
+ if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_BTOWC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
+
+
+
+
+
+
+
+ # for STACK_DIRECTION
+
+
+
+ ac_fn_c_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include <signal.h>
+"
+if test "x$ac_cv_have_decl_sigaltstack" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SIGALTSTACK $ac_have_decl
+_ACEOF
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include <signal.h>
+"
+if test "x$ac_cv_type_stack_t" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STACK_T 1
+_ACEOF
+
+
+fi
+
+
+ if test "$gl_cv_lib_sigsegv" = yes \
+ && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then
+ LIBCSTACK=$LIBSIGSEGV
+
+ LTLIBCSTACK=$LTLIBSIGSEGV
+
+ fi
+
+
+
+
+
+
+ # 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=
+
+ gl_saved_libs=$LIBS
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+printf %s "checking for library containing clock_gettime... " >&6; }
+if test ${ac_cv_search_clock_gettime+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main (void)
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4
+do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test ${ac_cv_search_clock_gettime+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_clock_gettime+y}
+then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+printf "%s\n" "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_clock_gettime" = "none required" ||
+ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
+fi
+
+ for ac_func in clock_gettime clock_settime
+do :
+ as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ LIBS=$gl_saved_libs
+
+
+
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+ if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+ REPLACE_CLOSE=1
+ fi
+
+
+
+ if test $REPLACE_CLOSE = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_CLOSE=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
+
+
+
+
+
+ if test "x$datarootdir" = x; then
+ datarootdir='${datadir}'
+
+ fi
+ if test "x$docdir" = x; then
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+
+ fi
+ if test "x$htmldir" = x; then
+ htmldir='${docdir}'
+
+ fi
+ if test "x$dvidir" = x; then
+ dvidir='${docdir}'
+
+ fi
+ if test "x$pdfdir" = x; then
+ pdfdir='${docdir}'
+
+ fi
+ if test "x$psdir" = x; then
+ psdir='${docdir}'
+
+ fi
+ if test "x$lispdir" = x; then
+ lispdir='${datarootdir}/emacs/site-lisp'
+
+ fi
+ if test "x$localedir" = x; then
+ localedir='${datarootdir}/locale'
+
+ fi
+ if test "x$runstatedir" = x; then
+ runstatedir='${localstatedir}/run'
+
+ fi
+
+ pkglibexecdir='${libexecdir}/${PACKAGE}'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_ctype_h='<'ctype.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
+printf %s "checking absolute name of <ctype.h>... " >&6; }
+if test ${gl_cv_next_ctype_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'ctype.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_ctype_h
+ gl_cv_next_ctype_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
+printf "%s\n" "$gl_cv_next_ctype_h" >&6; }
+ fi
+ NEXT_CTYPE_H=$gl_cv_next_ctype_h
+
+ 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='<'ctype.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_ctype_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
+
+
+
+
+
+
+ for gl_func in isblank; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_DIRNAME 1
+_ACEOF
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
+printf %s "checking whether // is distinct from /... " >&6; }
+if test ${gl_cv_double_slash_root+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
+printf "%s\n" "$gl_cv_double_slash_root" >&6; }
+ if test "$gl_cv_double_slash_root" = yes; then
+
+printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h
+
+
+ if test $HAVE_DUP2 = 1; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
+printf %s "checking whether dup2 works... " >&6; }
+if test ${gl_cv_func_dup2_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ 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
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+
+int
+main (void)
+{
+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;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_dup2_works=yes
+else
+ gl_cv_func_dup2_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
+printf "%s\n" "$gl_cv_func_dup2_works" >&6; }
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ for ac_func in setdtablesize
+do :
+ ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
+if test "x$ac_cv_func_setdtablesize" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SETDTABLESIZE 1
+_ACEOF
+
+fi
+done
+
+ ;;
+ esac
+ fi
+
+
+ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
+
+
+ fi
+
+
+
+
+
+ GNULIB_DUP2=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_DUP2 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+ GNULIB_ENVIRON=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+printf %s "checking for error_at_line... " >&6; }
+if test ${ac_cv_lib_error_at_line+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <error.h>
+int
+main (void)
+{
+error_at_line (0, 0, "", 0, "an error occurred");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_lib_error_at_line=yes
+else
+ ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+printf "%s\n" "$ac_cv_lib_error_at_line" >&6; }
+
+ if test $ac_cv_lib_error_at_line = no; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
+
+
+
+ :
+
+ fi
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
+
+
+
+
+
+
+
+ if test $ac_cv_func_fcntl = no; then
+
+
+
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
+printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; }
+if test ${gl_cv_func_fcntl_f_dupfd_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ 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
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+
+int
+main (void)
+{
+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;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_fcntl_f_dupfd_works=yes
+else
+ gl_cv_func_fcntl_f_dupfd_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
+printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
+ case $gl_cv_func_fcntl_f_dupfd_works in
+ *yes) ;;
+ *)
+
+
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+
+
+printf "%s\n" "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
+ ;;
+ esac
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
+printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
+if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <fcntl.h>
+#ifndef F_DUPFD_CLOEXEC
+choke me
+#endif
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_fcntl_f_dupfd_cloexec=yes
+else
+ gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ gl_cv_func_fcntl_f_dupfd_cloexec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
+printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
+ if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
+
+
+
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+
+ fi
+ fi
+
+
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_FCNTL=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_fcntl_h='<'fcntl.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
+printf %s "checking absolute name of <fcntl.h>... " >&6; }
+if test ${gl_cv_next_fcntl_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'fcntl.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_fcntl_h
+ gl_cv_next_fcntl_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
+printf "%s\n" "$gl_cv_next_fcntl_h" >&6; }
+ fi
+ NEXT_FCNTL_H=$gl_cv_next_fcntl_h
+
+ 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='<'fcntl.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_fcntl_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+ for gl_func in fcntl openat; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FILENAMECAT 1
+_ACEOF
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
+printf %s "checking for flexible array member... " >&6; }
+if test ${ac_cv_c_flexmember+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include <stdio.h>
+ #include <stddef.h>
+ struct s { int n; double d[]; };
+int
+main (void)
+{
+int m = getchar ();
+ struct s *p = malloc (offsetof (struct s, d)
+ + m * sizeof (double));
+ p->d[0] = 0.0;
+ return p->d != (double *) NULL;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_flexmember=yes
+else
+ ac_cv_c_flexmember=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
+printf "%s\n" "$ac_cv_c_flexmember" >&6; }
+ if test $ac_cv_c_flexmember = yes; then
+
+printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
+
+ else
+ printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
+
+ fi
+
+
+
+
+ FLOAT_H=
+ REPLACE_FLOAT_LDBL=0
+ case "$host_os" in
+ aix* | beos* | openbsd* | mirbsd* | irix*)
+ FLOAT_H=float.h
+ ;;
+ freebsd*)
+ case "$host_cpu" in
+ i[34567]86 )
+ FLOAT_H=float.h
+ ;;
+ x86_64 )
+ # On x86_64 systems, the C compiler may still be generating
+ # 32-bit code.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ yes
+ #endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+
+else
+ FLOAT_H=float.h
+fi
+rm -rf conftest*
+
+ ;;
+ esac
+ ;;
+ linux*)
+ case "$host_cpu" in
+ powerpc*)
+ FLOAT_H=float.h
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_os" in
+ aix* | freebsd* | linux*)
+ if test -n "$FLOAT_H"; then
+ REPLACE_FLOAT_LDBL=1
+ fi
+ ;;
+ esac
+
+ REPLACE_ITOLD=0
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
+printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; }
+if test ${gl_cv_func_itold_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ case "$host" in
+ sparc*-*-linux*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __LP64__ || defined __arch64__
+ yes
+ #endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1
+then :
+ gl_cv_func_itold_works="guessing no"
+else
+ gl_cv_func_itold_works="guessing yes"
+fi
+rm -rf conftest*
+
+ ;;
+ *) gl_cv_func_itold_works="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int i = -1;
+volatile long double ld;
+int main ()
+{
+ ld += i * 1.0L;
+ if (ld > 0)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_itold_works=yes
+else
+ gl_cv_func_itold_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
+printf "%s\n" "$gl_cv_func_itold_works" >&6; }
+ case "$gl_cv_func_itold_works" in
+ *no)
+ REPLACE_ITOLD=1
+ FLOAT_H=float.h
+ ;;
+ esac
+
+ if test -n "$FLOAT_H"; then
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_float_h='<'float.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
+printf %s "checking absolute name of <float.h>... " >&6; }
+if test ${gl_cv_next_float_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <float.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'float.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_float_h
+ gl_cv_next_float_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
+printf "%s\n" "$gl_cv_next_float_h" >&6; }
+ fi
+ NEXT_FLOAT_H=$gl_cv_next_float_h
+
+ 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='<'float.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_float_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
+
+
+
+
+ fi
+
+ if test -n "$FLOAT_H"; then
+ GL_GENERATE_FLOAT_H_TRUE=
+ GL_GENERATE_FLOAT_H_FALSE='#'
+else
+ GL_GENERATE_FLOAT_H_TRUE='#'
+ GL_GENERATE_FLOAT_H_FALSE=
+fi
+
+
+
+ if test $REPLACE_FLOAT_LDBL = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
+
+ fi
+ if test $REPLACE_ITOLD = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
+
+ fi
+
+
+
+
+
+ FNMATCH_H=
+ gl_fnmatch_required_lowercase=`
+ echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
+ `
+ gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
+printf %s "checking for working $gl_fnmatch_required fnmatch... " >&6; }
+if eval test \${$gl_fnmatch_cache_var+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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
+ if test "$cross_compiling" = yes
+then :
+ eval "$gl_fnmatch_cache_var=\"guessing no\""
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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;
+ }
+
+int
+main (void)
+{
+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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ eval "$gl_fnmatch_cache_var=yes"
+else
+ eval "$gl_fnmatch_cache_var=no"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+eval ac_res=\$$gl_fnmatch_cache_var
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
+ if test "$gl_fnmatch_result" = yes; then
+ rm -f "$gl_source_base/fnmatch.h"
+ else
+ FNMATCH_H=fnmatch.h
+ fi
+
+ if test -n "$FNMATCH_H"; then
+ GL_GENERATE_FNMATCH_H_TRUE=
+ GL_GENERATE_FNMATCH_H_FALSE='#'
+else
+ GL_GENERATE_FNMATCH_H_TRUE='#'
+ GL_GENERATE_FNMATCH_H_FALSE=
+fi
+
+
+ if test -n "$FNMATCH_H"; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch
+_ACEOF
+
+
+ ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
+"
+if test "x$ac_cv_have_decl_isblank" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISBLANK $ac_have_decl
+_ACEOF
+
+
+
+
+ fi
+
+
+
+
+
+ if test -n "$FNMATCH_H"; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch
+_ACEOF
+
+
+ ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
+"
+if test "x$ac_cv_have_decl_isblank" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISBLANK $ac_have_decl
+_ACEOF
+
+
+
+
+ fi
+
+
+
+ case "$host_os" in
+ mingw* | pw* | os2*)
+ REPLACE_FREOPEN=1
+ ;;
+ esac
+
+ if test $REPLACE_FREOPEN = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_FREOPEN=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FREOPEN 1" >>confdefs.h
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FREOPEN_SAFER 1
+_ACEOF
+
+
+
+
+
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_FSTAT=1
+ fi
+
+
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+ REPLACE_FSTAT=1
+ fi
+
+
+
+ if test $REPLACE_FSTAT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_FSTAT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_getdtablesize = yes &&
+ test $ac_cv_have_decl_getdtablesize = yes; then
+ # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
+ # up to an unchangeable hard limit; all other platforms correctly
+ # require setrlimit before getdtablesize() can report a larger value.
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
+printf %s "checking whether getdtablesize works... " >&6; }
+if test ${gl_cv_func_getdtablesize_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ 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
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <unistd.h>
+int
+main (void)
+{
+int size = getdtablesize();
+ if (dup2 (0, getdtablesize()) != -1)
+ return 1;
+ if (size != getdtablesize())
+ return 2;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_getdtablesize_works=yes
+else
+ gl_cv_func_getdtablesize_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
+printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; }
+ case "$gl_cv_func_getdtablesize_works" in
+ *yes) ;;
+ *) REPLACE_GETDTABLESIZE=1 ;;
+ esac
+ else
+ HAVE_GETDTABLESIZE=0
+ fi
+
+ if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_GETDTABLESIZE=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test $REPLACE_GETOPT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+
+
+
+
+ GNULIB_GL_UNISTD_H_GETOPT=1
+ fi
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h
+
+
+
+
+
+
+
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+
+ if test $REPLACE_GETOPT = 1; then
+
+ GETOPT_H=getopt.h
+
+printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+
+
+
+ fi
+
+ if test $REPLACE_GETOPT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+
+
+
+
+ GNULIB_GL_UNISTD_H_GETOPT=1
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ gl_gettimeofday_timezone=void
+ if test $ac_cv_func_gettimeofday != yes; then
+ HAVE_GETTIMEOFDAY=0
+ else
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
+printf %s "checking whether gettimeofday clobbers localtime buffer... " >&6; }
+if test ${gl_cv_func_gettimeofday_clobber+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ # When cross-compiling:
+ case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdlib.h>
+
+int
+main (void)
+{
+
+ time_t t = 0;
+ struct tm *lt;
+ struct tm saved_lt;
+ struct timeval tv;
+ lt = localtime (&t);
+ saved_lt = *lt;
+ gettimeofday (&tv, NULL);
+ return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_gettimeofday_clobber=no
+else
+ gl_cv_func_gettimeofday_clobber=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
+printf "%s\n" "$gl_cv_func_gettimeofday_clobber" >&6; }
+
+ case "$gl_cv_func_gettimeofday_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
+
+ REPLACE_GMTIME=1
+ REPLACE_LOCALTIME=1
+
+
+printf "%s\n" "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
+
+ ;;
+ esac
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
+printf %s "checking for gettimeofday with POSIX signature... " >&6; }
+if test ${gl_cv_func_gettimeofday_posix_signature+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+ struct timeval c;
+ int gettimeofday (struct timeval *restrict, void *restrict);
+
+int
+main (void)
+{
+/* 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);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_gettimeofday_posix_signature=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_gettimeofday_posix_signature=almost
+else
+ gl_cv_func_gettimeofday_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; }
+ 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
+ if test $REPLACE_STRUCT_TIMEVAL = 1; then
+ REPLACE_GETTIMEOFDAY=1
+ fi
+
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
+_ACEOF
+
+
+ if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+
+
+ for ac_header in sys/timeb.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_timeb_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMEB_H 1
+_ACEOF
+
+fi
+done
+
+ for ac_func in _ftime
+do :
+ ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
+if test "x$ac_cv_func__ftime" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__FTIME 1
+_ACEOF
+
+fi
+done
+
+
+ fi
+
+
+
+
+
+ GNULIB_GETTIMEOFDAY=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
+
+
+
+
+ if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
+ GNU_MAKE_TRUE=
+ GNU_MAKE_FALSE='#'
+else
+ GNU_MAKE_TRUE='#'
+ GNU_MAKE_FALSE=
+fi
+
+
+ # Autoconf 2.61a.99 and earlier don't support linking a file only
+ # in VPATH builds. But since GNUmakefile is for maintainer use
+ # only, it does not matter if we skip the link with older autoconf.
+ # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+ # builds, so use a shell variable to bypass this.
+ GNUmakefile=GNUmakefile
+ ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
+
+
+ :
+
+
+
+
+
+
+
+ GNULIB_ICONV=1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_iconv_h='<'iconv.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <iconv.h>" >&5
+printf %s "checking absolute name of <iconv.h>... " >&6; }
+if test ${gl_cv_next_iconv_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_iconv_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <iconv.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'iconv.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_iconv_h
+ gl_cv_next_iconv_h='"'$gl_header'"'
+ else
+ gl_cv_next_iconv_h='<'iconv.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5
+printf "%s\n" "$gl_cv_next_iconv_h" >&6; }
+ fi
+ NEXT_ICONV_H=$gl_cv_next_iconv_h
+
+ 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='<'iconv.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_iconv_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+ if test "$am_cv_func_iconv" = yes; then
+
+
+ ICONV_H='iconv.h'
+ if test -n "$ICONV_H"; then
+ GL_GENERATE_ICONV_H_TRUE=
+ GL_GENERATE_ICONV_H_FALSE='#'
+else
+ GL_GENERATE_ICONV_H_TRUE='#'
+ GL_GENERATE_ICONV_H_FALSE=
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <iconv.h>
+ #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+ gnu_iconv
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "gnu_iconv" >/dev/null 2>&1
+then :
+ gl_func_iconv_gnu=yes
+else
+ gl_func_iconv_gnu=no
+fi
+rm -rf conftest*
+
+ if test $gl_func_iconv_gnu = no; then
+ iconv_flavor=
+ case "$host_os" in
+ aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
+ irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
+ hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
+ osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
+ solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
+ esac
+ if test -n "$iconv_flavor"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ICONV_FLAVOR $iconv_flavor
+_ACEOF
+
+
+
+
+ ICONV_H='iconv.h'
+ if test -n "$ICONV_H"; then
+ GL_GENERATE_ICONV_H_TRUE=
+ GL_GENERATE_ICONV_H_FALSE='#'
+else
+ GL_GENERATE_ICONV_H_TRUE='#'
+ GL_GENERATE_ICONV_H_FALSE=
+fi
+
+
+ REPLACE_ICONV_OPEN=1
+
+ fi
+ fi
+
+ fi
+
+ if test $REPLACE_ICONV_OPEN = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext"
+
+ fi
+ if test $REPLACE_ICONV = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext"
+
+ fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5
+printf %s "checking whether the compiler generally respects inline... " >&6; }
+if test ${gl_cv_c_inline_effective+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test $ac_cv_c_inline = no; then
+ gl_cv_c_inline_effective=no
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+#ifdef __NO_INLINE__
+ #error "inline is not effective"
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_c_inline_effective=yes
+else
+ gl_cv_c_inline_effective=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5
+printf "%s\n" "$gl_cv_c_inline_effective" >&6; }
+ if test $gl_cv_c_inline_effective = yes; then
+
+printf "%s\n" "#define HAVE_INLINE 1" >>confdefs.h
+
+ fi
+
+
+
+
+ :
+
+ :
+ :
+ :
+ :
+
+
+
+
+
+
+ PRIPTR_PREFIX=
+ if test -n "$STDINT_H"; then
+ PRIPTR_PREFIX='"l"'
+ else
+ 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
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ PRIPTR_PREFIX='"'$glpfx'"'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
+printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
+if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* 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 defined INT32_MAX && defined INTMAX_MAX
+ #define CONDITION (INT32_MAX < INTMAX_MAX)
+ #elif HAVE_LONG_LONG_INT
+ #define CONDITION (sizeof (int) < sizeof (long long int))
+ #else
+ #define CONDITION 0
+ #endif
+ int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
+else
+ gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
+printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
+ if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
+ INT32_MAX_LT_INTMAX_MAX=1;
+ else
+ INT32_MAX_LT_INTMAX_MAX=0;
+ fi
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
+printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; }
+if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* 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 defined INT64_MAX
+ #define CONDITION (INT64_MAX == LONG_MAX)
+ #elif HAVE_LONG_LONG_INT
+ #define CONDITION (sizeof (long long int) == sizeof (long int))
+ #else
+ #define CONDITION 0
+ #endif
+ int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
+else
+ gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
+printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
+ if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
+ INT64_MAX_EQ_LONG_MAX=1;
+ else
+ INT64_MAX_EQ_LONG_MAX=0;
+ fi
+
+
+ else
+ INT64_MAX_EQ_LONG_MAX=-1
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
+printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
+if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* 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 defined UINT32_MAX && defined UINTMAX_MAX
+ #define CONDITION (UINT32_MAX < UINTMAX_MAX)
+ #elif HAVE_LONG_LONG_INT
+ #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
+ #else
+ #define CONDITION 0
+ #endif
+ int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
+else
+ gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
+printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
+ if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
+ UINT32_MAX_LT_UINTMAX_MAX=1;
+ else
+ UINT32_MAX_LT_UINTMAX_MAX=0;
+ fi
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
+printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
+if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* 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 defined UINT64_MAX
+ #define CONDITION (UINT64_MAX == ULONG_MAX)
+ #elif HAVE_LONG_LONG_INT
+ #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
+ #else
+ #define CONDITION 0
+ #endif
+ int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
+else
+ gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
+printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
+ if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
+ UINT64_MAX_EQ_ULONG_MAX=1;
+ else
+ UINT64_MAX_EQ_ULONG_MAX=0;
+ fi
+
+
+ else
+ UINT64_MAX_EQ_ULONG_MAX=-1
+ fi
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_isblank = no; then
+ HAVE_ISBLANK=0
+ fi
+
+ if test $HAVE_ISBLANK = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_ISBLANK=1
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
+
+"
+if test "x$ac_cv_have_decl_iswblank" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISWBLANK $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_func_iswblank = no; then
+ HAVE_ISWBLANK=0
+ if test $ac_cv_have_decl_iswblank = yes; then
+ REPLACE_ISWBLANK=1
+ fi
+ fi
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ :
+ else
+ if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+ :
+ fi
+ fi
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ :
+ else
+ if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext"
+
+ fi
+ fi
+
+
+
+
+
+ GNULIB_ISWBLANK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_langinfo_h='<'langinfo.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5
+printf %s "checking absolute name of <langinfo.h>... " >&6; }
+if test ${gl_cv_next_langinfo_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_langinfo_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'langinfo.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_langinfo_h
+ gl_cv_next_langinfo_h='"'$gl_header'"'
+ else
+ gl_cv_next_langinfo_h='<'langinfo.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5
+printf "%s\n" "$gl_cv_next_langinfo_h" >&6; }
+ fi
+ NEXT_LANGINFO_H=$gl_cv_next_langinfo_h
+
+ 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='<'langinfo.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_langinfo_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive
+
+
+
+
+
+ HAVE_LANGINFO_CODESET=0
+ HAVE_LANGINFO_T_FMT_AMPM=0
+ HAVE_LANGINFO_ERA=0
+ HAVE_LANGINFO_YESEXPR=0
+
+ if test $ac_cv_header_langinfo_h = yes; then
+ HAVE_LANGINFO_H=1
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5
+printf %s "checking whether langinfo.h defines CODESET... " >&6; }
+if test ${gl_cv_header_langinfo_codeset+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = CODESET;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_langinfo_codeset=yes
+else
+ gl_cv_header_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5
+printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; }
+ if test $gl_cv_header_langinfo_codeset = yes; then
+ HAVE_LANGINFO_CODESET=1
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5
+printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; }
+if test ${gl_cv_header_langinfo_t_fmt_ampm+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = T_FMT_AMPM;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_langinfo_t_fmt_ampm=yes
+else
+ gl_cv_header_langinfo_t_fmt_ampm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5
+printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; }
+ if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
+ HAVE_LANGINFO_T_FMT_AMPM=1
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5
+printf %s "checking whether langinfo.h defines ERA... " >&6; }
+if test ${gl_cv_header_langinfo_era+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = ERA;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_langinfo_era=yes
+else
+ gl_cv_header_langinfo_era=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5
+printf "%s\n" "$gl_cv_header_langinfo_era" >&6; }
+ if test $gl_cv_header_langinfo_era = yes; then
+ HAVE_LANGINFO_ERA=1
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5
+printf %s "checking whether langinfo.h defines YESEXPR... " >&6; }
+if test ${gl_cv_header_langinfo_yesexpr+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = YESEXPR;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_langinfo_yesexpr=yes
+else
+ gl_cv_header_langinfo_yesexpr=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5
+printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; }
+ if test $gl_cv_header_langinfo_yesexpr = yes; then
+ HAVE_LANGINFO_YESEXPR=1
+ fi
+ else
+ HAVE_LANGINFO_H=0
+ fi
+
+
+
+
+
+
+
+ for gl_func in nl_langinfo; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libsigsegv-prefix was given.
+if test ${with_libsigsegv_prefix+y}
+then :
+ withval=$with_libsigsegv_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+
+fi
+
+ LIBSIGSEGV=
+ LTLIBSIGSEGV=
+ INCSIGSEGV=
+ LIBSIGSEGV_PREFIX=
+ HAVE_LIBSIGSEGV=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='sigsegv '
+ 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"
+ 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" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value"
+ else
+ :
+ fi
+ else
+ 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
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ else
+ 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
+ if test "$acl_hardcode_direct" = yes; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ 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
+ haveit=
+ for x in $LDFLAGS $LIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+ else
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a"
+ else
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name"
+ fi
+ fi
+ 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" = 'sigsegv'; then
+ LIBSIGSEGV_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" = 'sigsegv'; then
+ LIBSIGSEGV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ 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 $INCSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ 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
+ INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; 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 $LIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBSIGSEGV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ 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
+ 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*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep"
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCSIGSEGV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5
+printf %s "checking for libsigsegv... " >&6; }
+if test ${ac_cv_libsigsegv+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ ac_save_LIBS="$LIBS"
+ case " $LIBSIGSEGV" in
+ *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;;
+ *) LIBS="$LIBSIGSEGV $LIBS" ;;
+ esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sigsegv.h>
+int
+main (void)
+{
+sigsegv_deinstall_handler();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_libsigsegv=yes
+else
+ ac_cv_libsigsegv='no, consider installing GNU libsigsegv'
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ac_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5
+printf "%s\n" "$ac_cv_libsigsegv" >&6; }
+ if test "$ac_cv_libsigsegv" = yes; then
+ HAVE_LIBSIGSEGV=yes
+
+printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5
+printf %s "checking how to link with libsigsegv... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5
+printf "%s\n" "$LIBSIGSEGV" >&6; }
+ else
+ HAVE_LIBSIGSEGV=no
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBSIGSEGV=
+ LTLIBSIGSEGV=
+ LIBSIGSEGV_PREFIX=
+ fi
+
+
+
+
+
+
+
+ gl_cv_lib_sigsegv="$ac_cv_libsigsegv"
+
+
+
+
+
+
+
+
+
+ LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+
+
+
+
+
+
+
+
+
+ case "$host_os" in
+ solaris*)
+
+printf "%s\n" "#define _LCONV_C99 1" >>confdefs.h
+
+ ;;
+ esac
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
+printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; }
+if test ${gl_cv_header_locale_h_posix2001+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+ int x = LC_MESSAGES;
+ int y = sizeof (((struct lconv *) 0)->decimal_point);
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_locale_h_posix2001=yes
+else
+ gl_cv_header_locale_h_posix2001=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
+printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; }
+
+
+ if test $ac_cv_header_xlocale_h = yes; then
+ HAVE_XLOCALE_H=1
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
+printf %s "checking whether locale.h defines locale_t... " >&6; }
+if test ${gl_cv_header_locale_has_locale_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+ locale_t x;
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_locale_has_locale_t=yes
+else
+ gl_cv_header_locale_has_locale_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
+printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; }
+ 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
+ else
+ HAVE_XLOCALE_H=0
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
+printf %s "checking whether struct lconv is properly defined... " >&6; }
+if test ${gl_cv_sys_struct_lconv_ok+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+ struct lconv l;
+ int x = sizeof (l.decimal_point);
+ int y = sizeof (l.int_p_cs_precedes);
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_sys_struct_lconv_ok=yes
+else
+ gl_cv_sys_struct_lconv_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
+printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; }
+ if test $gl_cv_sys_struct_lconv_ok = no; then
+ REPLACE_STRUCT_LCONV=1
+ fi
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_locale_h='<'locale.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
+printf %s "checking absolute name of <locale.h>... " >&6; }
+if test ${gl_cv_next_locale_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'locale.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_locale_h
+ gl_cv_next_locale_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
+printf "%s\n" "$gl_cv_next_locale_h" >&6; }
+ fi
+ NEXT_LOCALE_H=$gl_cv_next_locale_h
+
+ 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='<'locale.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_locale_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
+
+
+
+
+
+
+ for gl_func in setlocale duplocale; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+/* Some systems provide declarations in a non-standard header. */
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+ if test $REPLACE_STRUCT_LCONV = 1; then
+ REPLACE_LOCALECONV=1
+ fi
+
+ if test $REPLACE_LOCALECONV = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext"
+
+
+ ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
+_ACEOF
+
+
+fi
+
+
+ fi
+
+
+
+
+
+ GNULIB_LOCALECONV=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h
+
+
+
+
+
+
+ if test $ac_cv_func_lstat = yes; then
+
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *no)
+ REPLACE_LSTAT=1
+ ;;
+ esac
+ else
+ HAVE_LSTAT=0
+ fi
+
+ if test $REPLACE_LSTAT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_LSTAT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test $gl_cv_func_malloc_posix = yes; then
+
+printf "%s\n" "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
+
+ else
+ REPLACE_MALLOC=1
+ fi
+
+ if test $REPLACE_MALLOC = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_MALLOC_POSIX=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ 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
+
+
+
+ if test $ac_cv_func_mbrtowc = no; then
+ HAVE_MBRTOWC=0
+ ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_mbrtowc" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBRTOWC $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_mbrtowc = yes; then
+ REPLACE_MBRTOWC=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBRTOWC=1
+ else
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
+printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
+if test ${gl_cv_func_mbrtowc_null_arg1+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_null_arg1=yes
+else
+ gl_cv_func_mbrtowc_null_arg1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; }
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
+printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; }
+if test ${gl_cv_func_mbrtowc_null_arg2+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_null_arg2=yes
+else
+ gl_cv_func_mbrtowc_null_arg2=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; }
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
+printf %s "checking whether mbrtowc has a correct return value... " >&6; }
+if test ${gl_cv_func_mbrtowc_retval+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+ || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_retval=yes
+else
+ if test $? != 77; then
+ gl_cv_func_mbrtowc_retval=no
+ fi
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; }
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
+printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
+if test ${gl_cv_func_mbrtowc_nul_retval+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_nul_retval=yes
+else
+ gl_cv_func_mbrtowc_nul_retval=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; }
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
+printf %s "checking whether mbrtowc works on empty input... " >&6; }
+if test ${gl_cv_func_mbrtowc_empty_input+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu*)
+ gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ esac
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <wchar.h>
+ static wchar_t wc;
+ static mbstate_t mbs;
+ int
+ main (void)
+ {
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_empty_input=yes
+else
+ gl_cv_func_mbrtowc_empty_input=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; }
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
+printf %s "checking whether the C locale is free of encoding errors... " >&6; }
+if test ${gl_cv_C_locale_sans_EILSEQ+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_cv_C_locale_sans_EILSEQ="guessing no"
+
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #include <locale.h>
+ #include <wchar.h>
+
+int
+main (void)
+{
+
+ int i;
+ char *locale = setlocale (LC_ALL, "C");
+ if (! locale)
+ return 1;
+ 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 1;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_C_locale_sans_EILSEQ=yes
+else
+ gl_cv_C_locale_sans_EILSEQ=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5
+printf "%s\n" "$gl_cv_C_locale_sans_EILSEQ" >&6; }
+
+ case "$gl_cv_func_mbrtowc_null_arg1" in
+ *yes) ;;
+ *)
+printf "%s\n" "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_null_arg2" in
+ *yes) ;;
+ *)
+printf "%s\n" "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_retval" in
+ *yes) ;;
+ *)
+printf "%s\n" "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_nul_retval" in
+ *yes) ;;
+ *)
+printf "%s\n" "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_empty_input" in
+ *yes) ;;
+ *)
+printf "%s\n" "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case $gl_cv_C_locale_sans_EILSEQ in
+ *yes) ;;
+ *)
+printf "%s\n" "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ fi
+ fi
+
+ if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_MBRTOWC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ GNULIB_MBSCASECMP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ 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
+
+
+
+ if test $ac_cv_func_mbsinit = no; then
+ HAVE_MBSINIT=0
+ ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_mbsinit" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBSINIT $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_mbsinit = yes; then
+ REPLACE_MBSINIT=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBSINIT=1
+ else
+ case "$host_os" in
+ mingw*) REPLACE_MBSINIT=1 ;;
+ esac
+ fi
+ fi
+
+ if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_MBSINIT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
+
+
+
+
+
+
+ if test $ac_cv_func_mbslen = yes; then
+ HAVE_MBSLEN=1
+ else
+ HAVE_MBSLEN=0
+ fi
+
+
+
+
+
+
+ GNULIB_MBSLEN=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ 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
+
+
+
+ if test $ac_cv_func_mbsrtowcs = no; then
+ HAVE_MBSRTOWCS=0
+ ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_mbsrtowcs" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBSRTOWCS $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_mbsrtowcs = yes; then
+ REPLACE_MBSRTOWCS=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBSRTOWCS=1
+ else
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
+printf %s "checking whether mbsrtowcs works... " >&6; }
+if test ${gl_cv_func_mbsrtowcs_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbsrtowcs_works=yes
+else
+ gl_cv_func_mbsrtowcs_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
+printf "%s\n" "$gl_cv_func_mbsrtowcs_works" >&6; }
+
+ case "$gl_cv_func_mbsrtowcs_works" in
+ *yes) ;;
+ *) REPLACE_MBSRTOWCS=1 ;;
+ esac
+ fi
+ fi
+
+ if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_MBSRTOWCS=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ GNULIB_MBSSTR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h
+
+
+
+
+
+
+ if false; then
+ REPLACE_MBTOWC=1
+ fi
+
+ if test $REPLACE_MBTOWC = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_MBTOWC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
+
+
+
+
+
+ :
+
+
+ if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
+
+
+ for ac_header in bp-sym.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
+if test "x$ac_cv_header_bp_sym_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BP_SYM_H 1
+_ACEOF
+
+fi
+done
+
+
+ fi
+
+
+
+
+
+ GNULIB_MEMCHR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
+
+
+
+
+
+
+
+ if test $ac_cv_func_mkstemp = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5
+printf %s "checking for working mkstemp... " >&6; }
+if test ${gl_cv_func_working_mkstemp+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ mkdir conftest.mkstemp
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_working_mkstemp="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+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;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_working_mkstemp=yes
+else
+ gl_cv_func_working_mkstemp=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -rf conftest.mkstemp
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5
+printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; }
+ case "$gl_cv_func_working_mkstemp" in
+ *yes) ;;
+ *)
+ REPLACE_MKSTEMP=1
+ ;;
+ esac
+ else
+ HAVE_MKSTEMP=0
+ fi
+
+ if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext"
+
+
+
+ fi
+
+
+
+
+
+ GNULIB_MKSTEMP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime=no
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
+printf %s "checking for working mktime... " >&6; }
+if test ${gl_cv_func_working_mktime+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_working_mktime=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Test program from Paul Eggert and Tony Leneis. */
+#include <limits.h>
+#include <stdlib.h>
+#include <time.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_DECL_ALARM
+# include <signal.h>
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests. */
+#undef putenv
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable. */
+static char *tz_strings[] = {
+ (char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static int
+spring_forward_gap ()
+{
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (time_t now)
+{
+ struct tm *lt;
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ return 0;
+ }
+ return 1;
+}
+
+static int
+year_2050_test ()
+{
+ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+ ignoring leap seconds. */
+ unsigned long int answer = 2527315200UL;
+
+ struct tm tm;
+ time_t t;
+ tm.tm_year = 2050 - 1900;
+ tm.tm_mon = 2 - 1;
+ tm.tm_mday = 1;
+ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ t = mktime (&tm);
+
+ /* Check that the result is either a failure, or close enough
+ to the correct answer that we can assume the discrepancy is
+ due to leap seconds. */
+ return (t == (time_t) -1
+ || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+int
+main ()
+{
+ int result = 0;
+ time_t t, delta;
+ int i, j;
+ int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
+
+#if HAVE_DECL_ALARM
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (60);
+#endif
+
+ time_t_max = (! TIME_T_IS_SIGNED
+ ? (time_t) -1
+ : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
+ * 2 + 1));
+ time_t_min = (! TIME_T_IS_SIGNED
+ ? (time_t) 0
+ : time_t_signed_magnitude
+ ? ~ (time_t) 0
+ : ~ time_t_max);
+
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
+ if (! mktime_test (t))
+ result |= 1;
+ if ((result & 2) == 0
+ && ! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ result |= 2;
+
+ for (j = 1; (result & 4) == 0; j <<= 1)
+ {
+ if (! bigtime_test (j))
+ result |= 4;
+ if (INT_MAX / 2 < j)
+ break;
+ }
+ if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
+ result |= 8;
+ }
+ if (! irix_6_4_bug ())
+ result |= 16;
+ if (! spring_forward_gap ())
+ result |= 32;
+ if (! year_2050_test ())
+ result |= 64;
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_working_mktime=yes
+else
+ gl_cv_func_working_mktime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5
+printf "%s\n" "$gl_cv_func_working_mktime" >&6; }
+
+ if test $gl_cv_func_working_mktime = no; then
+ REPLACE_MKTIME=1
+ else
+ REPLACE_MKTIME=0
+ fi
+
+ if test $REPLACE_MKTIME = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_MKTIME=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MKTIME 1" >>confdefs.h
+
+
+
+
+
+ if test $REPLACE_MKTIME = 0; then
+ ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal"
+if test "x$ac_cv_func___mktime_internal" = xyes
+then :
+
+printf "%s\n" "#define mktime_internal __mktime_internal" >>confdefs.h
+
+
+else
+ REPLACE_MKTIME=1
+
+fi
+
+ fi
+
+ if test $REPLACE_MKTIME = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
+
+ :
+ fi
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
+
+ fi
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test $ac_cv_func_nl_langinfo = yes; then
+ # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5
+printf %s "checking whether YESEXPR works... " >&6; }
+if test ${gl_cv_func_nl_langinfo_yesexpr_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+
+ 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
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+
+int
+main (void)
+{
+return !*nl_langinfo(YESEXPR);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_nl_langinfo_yesexpr_works=yes
+else
+ gl_cv_func_nl_langinfo_yesexpr_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5
+printf "%s\n" "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; }
+ case $gl_cv_func_nl_langinfo_yesexpr_works in
+ *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
+ *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS
+_ACEOF
+
+ if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
+ :
+ else
+ REPLACE_NL_LANGINFO=1
+
+printf "%s\n" "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
+
+ fi
+ else
+ HAVE_NL_LANGINFO=0
+ fi
+
+ if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_NL_LANGINFO=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
+
+
+
+
+
+ case "$host_os" in
+ mingw* | pw*)
+ REPLACE_OPEN=1
+ ;;
+ *)
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
+printf %s "checking whether open recognizes a trailing slash... " >&6; }
+if test ${gl_cv_func_open_slash+y}
+then :
+ printf %s "(cached) " >&6
+else
+ # 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
+ if test "$cross_compiling" = yes
+then :
+
+ 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
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_open_slash=yes
+else
+ gl_cv_func_open_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.sl conftest.tmp conftest.lnk
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
+printf "%s\n" "$gl_cv_func_open_slash" >&6; }
+ case "$gl_cv_func_open_slash" in
+ *no)
+
+printf "%s\n" "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+
+ REPLACE_OPEN=1
+ ;;
+ esac
+ ;;
+ esac
+
+
+
+ if test $REPLACE_OPEN = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
+
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_OPEN=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_OPEN 1" >>confdefs.h
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
+"
+if test "x$ac_cv_have_decl_program_invocation_name" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
+_ACEOF
+
+ ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
+"
+if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
+_ACEOF
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'"
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'"
+
+
+ :
+
+
+ :
+
+
+
+
+
+ for ac_func in raise
+do :
+ ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise"
+if test "x$ac_cv_func_raise" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RAISE 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_raise = no; then
+ HAVE_RAISE=0
+ else
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_RAISE=1
+ fi
+
+
+
+
+ if test $gl_cv_type_sigset_t = yes; then
+ ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
+if test "x$ac_cv_func_sigprocmask" = xyes
+then :
+ gl_cv_func_sigprocmask=1
+fi
+
+ fi
+ if test -z "$gl_cv_func_sigprocmask"; then
+ HAVE_POSIX_SIGNALBLOCKING=0
+ fi
+
+ if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+ :
+ fi
+
+ fi
+
+ if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_RAISE=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_RAISE 1" >>confdefs.h
+
+
+
+
+
+
+
+ for ac_func in rawmemchr
+do :
+ ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
+if test "x$ac_cv_func_rawmemchr" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RAWMEMCHR 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_rawmemchr = no; then
+ HAVE_RAWMEMCHR=0
+ fi
+
+ if test $HAVE_RAWMEMCHR = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_RAWMEMCHR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
+
+
+
+
+
+
+ if test $ac_cv_func_readlink = no; then
+ HAVE_READLINK=0
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
+printf %s "checking whether readlink signature is correct... " >&6; }
+if test ${gl_cv_decl_readlink_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+ /* Cause compilation failure if original declaration has wrong type. */
+ ssize_t readlink (const char *, char *, size_t);
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_decl_readlink_works=yes
+else
+ gl_cv_decl_readlink_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
+printf "%s\n" "$gl_cv_decl_readlink_works" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
+printf %s "checking whether readlink handles trailing slash correctly... " >&6; }
+if test ${gl_cv_func_readlink_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ # We have readlink, so assume ln -s works.
+ ln -s conftest.no-such conftest.link
+ ln -s conftest.link conftest.lnk2
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_readlink_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+
+int
+main (void)
+{
+char buf[20];
+ return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_readlink_works=yes
+else
+ gl_cv_func_readlink_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.link conftest.lnk2
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
+printf "%s\n" "$gl_cv_func_readlink_works" >&6; }
+ case "$gl_cv_func_readlink_works" in
+ *yes)
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
+ fi
+ ;;
+ *)
+
+printf "%s\n" "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
+
+ REPLACE_READLINK=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_READLINK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_READLINK 1" >>confdefs.h
+
+
+
+
+
+# Check whether --with-included-regex was given.
+if test ${with_included_regex+y}
+then :
+ withval=$with_included_regex;
+fi
+
+
+ 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.
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5
+printf %s "checking for working re_compile_pattern... " >&6; }
+if test ${gl_cv_func_re_compile_pattern_working+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_re_compile_pattern_working=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#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
+main (void)
+{
+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"))
+ {
+ {
+ /* http://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
+ <http://www.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;
+ /* This should fail, but succeeds for glibc-2.5. */
+ else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+
+ /* 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;
+
+ /* 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;
+
+ /* 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;
+
+ /* 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;
+ /* This should match, but does not for glibc-2.2.1. */
+ else if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 8;
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+
+ /* 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;
+
+ /* Catch a bug reported by Vin Shelton in
+ http://lists.gnu.org/archive/html/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;
+
+ /* REG_STARTEND was added to glibc on 2004-01-15.
+ Reject older versions. */
+ if (! REG_STARTEND)
+ result |= 64;
+
+#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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_re_compile_pattern_working=yes
+else
+ gl_cv_func_re_compile_pattern_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5
+printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; }
+ case $gl_cv_func_re_compile_pattern_working in #(
+ yes) ac_use_included_regex=no;; #(
+ no) ac_use_included_regex=yes;;
+ esac
+ ;;
+ *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5
+ ;;
+ esac
+
+ if test $ac_use_included_regex = yes; then
+
+printf "%s\n" "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h
+
+
+printf "%s\n" "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h
+
+
+printf "%s\n" "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h
+
+
+printf "%s\n" "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h
+
+
+printf "%s\n" "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h
+
+
+printf "%s\n" "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h
+
+
+printf "%s\n" "#define re_search rpl_re_search" >>confdefs.h
+
+
+printf "%s\n" "#define re_search_2 rpl_re_search_2" >>confdefs.h
+
+
+printf "%s\n" "#define re_match rpl_re_match" >>confdefs.h
+
+
+printf "%s\n" "#define re_match_2 rpl_re_match_2" >>confdefs.h
+
+
+printf "%s\n" "#define re_set_registers rpl_re_set_registers" >>confdefs.h
+
+
+printf "%s\n" "#define re_comp rpl_re_comp" >>confdefs.h
+
+
+printf "%s\n" "#define re_exec rpl_re_exec" >>confdefs.h
+
+
+printf "%s\n" "#define regcomp rpl_regcomp" >>confdefs.h
+
+
+printf "%s\n" "#define regexec rpl_regexec" >>confdefs.h
+
+
+printf "%s\n" "#define regerror rpl_regerror" >>confdefs.h
+
+
+printf "%s\n" "#define regfree rpl_regfree" >>confdefs.h
+
+ fi
+
+ if test $ac_use_included_regex = yes; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext"
+
+
+
+
+
+
+
+
+ for ac_header in libintl.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
+if test "x$ac_cv_header_libintl_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINTL_H 1
+_ACEOF
+
+fi
+done
+
+
+ ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
+"
+if test "x$ac_cv_have_decl_isblank" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISBLANK $ac_have_decl
+_ACEOF
+
+
+ fi
+
+
+
+
+
+ if test $ac_cv_func_secure_getenv = no; then
+ HAVE_SECURE_GETENV=0
+ fi
+
+ if test $HAVE_SECURE_GETENV = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext"
+
+
+ for ac_func in __secure_getenv
+do :
+ ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv"
+if test "x$ac_cv_func___secure_getenv" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE___SECURE_GETENV 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func___secure_getenv = no; then
+ for ac_func in issetugid
+do :
+ ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid"
+if test "x$ac_cv_func_issetugid" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ISSETUGID 1
+_ACEOF
+
+fi
+done
+
+ fi
+
+
+ fi
+
+
+
+
+
+ GNULIB_SECURE_GETENV=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h
+
+
+
+
+
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
+printf %s "checking whether setenv validates arguments... " >&6; }
+if test ${gl_cv_func_setenv_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_setenv_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+
+int
+main (void)
+{
+
+ 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_setenv_works=yes
+else
+ gl_cv_func_setenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
+printf "%s\n" "$gl_cv_func_setenv_works" >&6; }
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_SETENV=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETENV 1" >>confdefs.h
+
+
+
+
+
+
+ if test $ac_cv_func_sigaction = yes; then
+ ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h>
+"
+if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1
+_ACEOF
+
+
+fi
+
+ if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
+ HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
+ fi
+ else
+ HAVE_SIGACTION=0
+ fi
+
+ if test $HAVE_SIGACTION = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext"
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_siginfo_t" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGINFO_T 1
+_ACEOF
+
+
+fi
+
+ if test $ac_cv_type_siginfo_t = no; then
+ HAVE_SIGINFO_T=0
+ fi
+
+ fi
+
+
+
+
+
+ GNULIB_SIGACTION=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_signal_h='<'signal.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
+printf %s "checking absolute name of <signal.h>... " >&6; }
+if test ${gl_cv_next_signal_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <signal.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'signal.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_signal_h
+ gl_cv_next_signal_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
+printf "%s\n" "$gl_cv_next_signal_h" >&6; }
+ fi
+ NEXT_SIGNAL_H=$gl_cv_next_signal_h
+
+ 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='<'signal.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_signal_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
+
+
+
+
+
+# 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_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes
+then :
+
+else
+ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
+fi
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_sighandler_t" = xyes
+then :
+
+else
+ HAVE_SIGHANDLER_T=0
+fi
+
+
+
+ for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <signal.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+ if test $gl_cv_type_sigset_t = yes; then
+ ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
+if test "x$ac_cv_func_sigprocmask" = xyes
+then :
+ gl_cv_func_sigprocmask=1
+fi
+
+ fi
+ if test -z "$gl_cv_func_sigprocmask"; then
+ HAVE_POSIX_SIGNALBLOCKING=0
+ fi
+
+ if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_SIGPROCMASK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h
+
+
+
+
+ for ac_header in stdint.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H 1
+_ACEOF
+
+fi
+done
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
+printf %s "checking for SIZE_MAX... " >&6; }
+if test ${gl_cv_size_max+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_cv_size_max=
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Found it" >/dev/null 2>&1
+then :
+ gl_cv_size_max=yes
+fi
+rm -rf conftest*
+
+ if test -z "$gl_cv_size_max"; then
+ if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include <stddef.h>
+#include <limits.h>"
+then :
+
+else
+ size_t_bits_minus_1=
+fi
+
+ if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include <stddef.h>"
+then :
+
+else
+ fits_in_uint=
+fi
+
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ if test $fits_in_uint = 1; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ fits_in_uint=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ 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
+ gl_cv_size_max='((size_t)~(size_t)0)'
+ fi
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
+printf "%s\n" "$gl_cv_size_max" >&6; }
+ if test "$gl_cv_size_max" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define SIZE_MAX $gl_cv_size_max
+_ACEOF
+
+ fi
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
+printf %s "checking for ssize_t... " >&6; }
+if test ${gt_cv_ssize_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main (void)
+{
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_ssize_t=yes
+else
+ gt_cv_ssize_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
+printf "%s\n" "$gt_cv_ssize_t" >&6; }
+ if test $gt_cv_ssize_t = no; then
+
+printf "%s\n" "#define ssize_t int" >>confdefs.h
+
+ fi
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5
+printf %s "checking whether stat handles trailing slashes on directories... " >&6; }
+if test ${gl_cv_func_stat_dir_slash+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case $host_os in
+ mingw*) gl_cv_func_stat_dir_slash="guessing no";;
+ *) gl_cv_func_stat_dir_slash="guessing yes";;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+
+int
+main (void)
+{
+struct stat st; return stat (".", &st) != stat ("./", &st);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_stat_dir_slash=yes
+else
+ gl_cv_func_stat_dir_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5
+printf "%s\n" "$gl_cv_func_stat_dir_slash" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
+printf %s "checking whether stat handles trailing slashes on files... " >&6; }
+if test ${gl_cv_func_stat_file_slash+y}
+then :
+ printf %s "(cached) " >&6
+else
+ 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
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_stat_file_slash="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+
+int
+main (void)
+{
+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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_stat_file_slash=yes
+else
+ gl_cv_func_stat_file_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.tmp conftest.lnk
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
+printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; }
+ case $gl_cv_func_stat_dir_slash in
+ *no) REPLACE_STAT=1
+
+printf "%s\n" "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h
+;;
+ esac
+ case $gl_cv_func_stat_file_slash in
+ *no) REPLACE_STAT=1
+
+printf "%s\n" "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
+;;
+ esac
+
+ if test $REPLACE_STAT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_STAT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STAT 1" >>confdefs.h
+
+
+
+
+
+
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+_ACEOF
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
+printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
+if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #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;
+
+int
+main (void)
+{
+
+ st.st_atim = ts;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
+else
+ ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
+printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+
+printf "%s\n" "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
+
+ fi
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+fi
+
+fi
+
+fi
+
+
+
+
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+fi
+
+fi
+
+
+
+ STDARG_H=''
+ NEXT_STDARG_H='<stdarg.h>'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
+printf %s "checking for va_copy... " >&6; }
+ if test ${gl_cv_func_va_copy+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+int
+main (void)
+{
+
+#ifndef va_copy
+void (*func) (va_list, va_list) = va_copy;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_va_copy=yes
+else
+ gl_cv_func_va_copy=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5
+printf "%s\n" "$gl_cv_func_va_copy" >&6; }
+ if test $gl_cv_func_va_copy = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined _AIX && !defined __GNUC__
+ AIX vaccine
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "vaccine" >/dev/null 2>&1
+then :
+ gl_aixcc=yes
+else
+ gl_aixcc=no
+fi
+rm -rf conftest*
+
+ if test $gl_aixcc = yes; then
+ STDARG_H=stdarg.h
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdarg_h='<'stdarg.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5
+printf %s "checking absolute name of <stdarg.h>... " >&6; }
+if test ${gl_cv_next_stdarg_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdarg.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdarg_h
+ gl_cv_next_stdarg_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5
+printf "%s\n" "$gl_cv_next_stdarg_h" >&6; }
+ fi
+ NEXT_STDARG_H=$gl_cv_next_stdarg_h
+
+ 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='<'stdarg.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdarg_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive
+
+
+
+
+ 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
+
+ saved_as_echo_n="$as_echo_n"
+ as_echo_n=':'
+ if test ${gl_cv_func___va_copy+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+int
+main (void)
+{
+
+#ifndef __va_copy
+error, bail out
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func___va_copy=yes
+else
+ gl_cv_func___va_copy=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ as_echo_n="$saved_as_echo_n"
+
+ if test $gl_cv_func___va_copy = yes; then
+
+printf "%s\n" "#define va_copy __va_copy" >>confdefs.h
+
+ else
+
+
+printf "%s\n" "#define va_copy gl_va_copy" >>confdefs.h
+
+ fi
+ fi
+ fi
+
+ if test -n "$STDARG_H"; then
+ GL_GENERATE_STDARG_H_TRUE=
+ GL_GENERATE_STDARG_H_FALSE='#'
+else
+ GL_GENERATE_STDARG_H_TRUE='#'
+ GL_GENERATE_STDARG_H_FALSE=
+fi
+
+
+
+
+
+
+ # Define two additional variables used in the Makefile substitution.
+
+ if test "$ac_cv_header_stdbool_h" = yes; then
+ STDBOOL_H=''
+ else
+ STDBOOL_H='stdbool.h'
+ fi
+
+ if test -n "$STDBOOL_H"; then
+ GL_GENERATE_STDBOOL_H_TRUE=
+ GL_GENERATE_STDBOOL_H_FALSE='#'
+else
+ GL_GENERATE_STDBOOL_H_TRUE='#'
+ GL_GENERATE_STDBOOL_H_FALSE=
+fi
+
+
+ if test "$ac_cv_type__Bool" = yes; then
+ HAVE__BOOL=1
+ else
+ HAVE__BOOL=0
+ fi
+
+
+
+
+
+ STDDEF_H=
+ ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
+
+"
+if test "x$ac_cv_type_max_align_t" = xyes
+then :
+
+else
+ HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
+fi
+
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ STDDEF_H=stddef.h
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
+printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if test ${gl_cv_decl_null_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ int test[2 * (sizeof NULL == sizeof (void *)) -1];
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_decl_null_works=yes
+else
+ gl_cv_decl_null_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
+printf "%s\n" "$gl_cv_decl_null_works" >&6; }
+ if test $gl_cv_decl_null_works = no; then
+ REPLACE_NULL=1
+ STDDEF_H=stddef.h
+ fi
+
+ if test -n "$STDDEF_H"; then
+ GL_GENERATE_STDDEF_H_TRUE=
+ GL_GENERATE_STDDEF_H_FALSE='#'
+else
+ GL_GENERATE_STDDEF_H_TRUE='#'
+ GL_GENERATE_STDDEF_H_FALSE=
+fi
+
+ if test -n "$STDDEF_H"; then
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stddef_h='<'stddef.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
+printf %s "checking absolute name of <stddef.h>... " >&6; }
+if test ${gl_cv_next_stddef_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stddef.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stddef_h
+ gl_cv_next_stddef_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
+printf "%s\n" "$gl_cv_next_stddef_h" >&6; }
+ fi
+ NEXT_STDDEF_H=$gl_cv_next_stddef_h
+
+ 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='<'stddef.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stddef_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+
+
+
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdio_h='<'stdio.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
+printf %s "checking absolute name of <stdio.h>... " >&6; }
+if test ${gl_cv_next_stdio_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdio.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdio_h
+ gl_cv_next_stdio_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
+printf "%s\n" "$gl_cv_next_stdio_h" >&6; }
+ fi
+ NEXT_STDIO_H=$gl_cv_next_stdio_h
+
+ 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='<'stdio.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdio_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
+printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; }
+if test ${gl_cv_func_printf_attribute_flavor+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #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 __WIN32__) && ! defined __CYGWIN__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
+ #endif
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_printf_attribute_flavor=system
+else
+ gl_cv_func_printf_attribute_flavor=gnu
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
+printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; }
+ if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
+
+printf "%s\n" "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
+
+ fi
+
+ GNULIB_FSCANF=1
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FSCANF 1
+_ACEOF
+
+
+ GNULIB_SCANF=1
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_SCANF 1
+_ACEOF
+
+
+ GNULIB_FGETC=1
+ GNULIB_GETC=1
+ GNULIB_GETCHAR=1
+ GNULIB_FGETS=1
+ GNULIB_FREAD=1
+
+
+ GNULIB_FPRINTF=1
+ GNULIB_PRINTF=1
+ GNULIB_VFPRINTF=1
+ GNULIB_VPRINTF=1
+ GNULIB_FPUTC=1
+ GNULIB_PUTC=1
+ GNULIB_PUTCHAR=1
+ GNULIB_FPUTS=1
+ GNULIB_PUTS=1
+ GNULIB_FWRITE=1
+
+
+
+
+ for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdlib_h='<'stdlib.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
+printf %s "checking absolute name of <stdlib.h>... " >&6; }
+if test ${gl_cv_next_stdlib_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdlib.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdlib_h
+ gl_cv_next_stdlib_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
+printf "%s\n" "$gl_cv_next_stdlib_h" >&6; }
+ fi
+ NEXT_STDLIB_H=$gl_cv_next_stdlib_h
+
+ 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='<'stdlib.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdlib_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
+
+
+
+
+
+
+ for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+ for ac_func in strcasecmp
+do :
+ ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
+if test "x$ac_cv_func_strcasecmp" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRCASECMP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strcasecmp = no; then
+ HAVE_STRCASECMP=0
+ fi
+
+
+
+ for ac_func in strncasecmp
+do :
+ ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp"
+if test "x$ac_cv_func_strncasecmp" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRNCASECMP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strncasecmp = yes; then
+ HAVE_STRNCASECMP=1
+ else
+ HAVE_STRNCASECMP=0
+ fi
+ ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strncasecmp" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCASECMP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_strncasecmp = no; then
+ HAVE_DECL_STRNCASECMP=0
+ fi
+
+
+ if test $HAVE_STRCASECMP = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext"
+
+
+ :
+
+ fi
+ if test $HAVE_STRNCASECMP = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+
+
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
+printf %s "checking for working strerror function... " >&6; }
+if test ${gl_cv_func_working_strerror+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_working_strerror="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+int
+main (void)
+{
+if (!*strerror (-2)) return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_working_strerror=yes
+else
+ gl_cv_func_working_strerror=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
+printf "%s\n" "$gl_cv_func_working_strerror" >&6; }
+ case "$gl_cv_func_working_strerror" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR=1
+ ;;
+ esac
+
+ case "$gl_cv_func_strerror_r_works" in
+ *no) REPLACE_STRERROR=1 ;;
+ esac
+
+ else
+ REPLACE_STRERROR=1
+ fi
+
+ if test $REPLACE_STRERROR = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
+
+ fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_STRERROR 1
+_ACEOF
+
+
+
+
+
+
+
+ GNULIB_STRERROR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
+
+
+
+
+
+ if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+ fi
+
+
+ # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
+
+
+
+
+
+
+
+printf "%s\n" "#define my_strftime nstrftime" >>confdefs.h
+
+
+
+ if test $gl_cond_libtool = false; then
+ gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
+ gl_libdeps="$gl_libdeps $LIBICONV"
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+ 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'.
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5
+printf %s "checking for working strndup... " >&6; }
+if test ${gl_cv_func_strndup_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+
+ case $host_os in
+ aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";;
+ *) gl_cv_func_strndup_works="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <string.h>
+ #include <stdlib.h>
+int
+main (void)
+{
+
+#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;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_strndup_works=yes
+else
+ gl_cv_func_strndup_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5
+printf "%s\n" "$gl_cv_func_strndup_works" >&6; }
+ case $gl_cv_func_strndup_works in
+ *no) REPLACE_STRNDUP=1 ;;
+ esac
+ else
+ HAVE_STRNDUP=0
+ fi
+
+ if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_STRNDUP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_strnlen = no; then
+ HAVE_DECL_STRNLEN=0
+ else
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+printf %s "checking for working strnlen... " >&6; }
+if test ${ac_cv_func_strnlen_working+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ # Guess no on AIX systems, yes otherwise.
+ case "$host_os" in
+ aix*) ac_cv_func_strnlen_working=no;;
+ *) ac_cv_func_strnlen_working=yes;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+
+#define S "foobar"
+#define S_LEN (sizeof S - 1)
+
+ /* At least one implementation is buggy: that of AIX 4.3 would
+ give strnlen (S, 1) == 3. */
+
+ int i;
+ for (i = 0; i < S_LEN + 1; ++i)
+ {
+ int expected = i <= S_LEN ? i : S_LEN;
+ if (strnlen (S, i) != expected)
+ return 1;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_func_strnlen_working=yes
+else
+ ac_cv_func_strnlen_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
+printf "%s\n" "$ac_cv_func_strnlen_working" >&6; }
+test $ac_cv_func_strnlen_working = no && :
+
+
+ if test $ac_cv_func_strnlen_working = no; then
+ REPLACE_STRNLEN=1
+ fi
+ fi
+
+ if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+ GNULIB_STRNLEN=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
+
+
+
+
+
+
+
+ if test $ac_cv_func_strptime != yes; then
+ HAVE_STRPTIME=0
+ fi
+
+ if test $HAVE_STRPTIME = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strptime.$ac_objext"
+
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_STRPTIME=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRPTIME 1" >>confdefs.h
+
+
+
+
+
+
+ if test "$ac_cv_type_unsigned_long_long_int" = yes; then
+ for ac_func in strtoull
+do :
+ ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull"
+if test "x$ac_cv_func_strtoull" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRTOULL 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strtoull = no; then
+ HAVE_STRTOULL=0
+ fi
+ fi
+
+ if test $HAVE_STRTOULL = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_STRTOULL=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRTOULL 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test "$ac_cv_have_decl_strtoumax" = yes; then
+ if test "$ac_cv_func_strtoumax" != yes; then
+ # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
+ REPLACE_STRTOUMAX=1
+ fi
+ else
+ HAVE_DECL_STRTOUMAX=0
+ fi
+
+ if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext"
+
+
+ ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strtoull" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRTOULL $ac_have_decl
+_ACEOF
+
+
+
+ fi
+
+
+
+
+
+ GNULIB_STRTOUMAX=1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
+printf %s "checking absolute name of <sys/stat.h>... " >&6; }
+if test ${gl_cv_next_sys_stat_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_stat_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/stat.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_stat_h
+ gl_cv_next_sys_stat_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
+printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; }
+ fi
+ NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
+
+ 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='<'sys/stat.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_stat_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+
+printf "%s\n" "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_type_nlink_t" = xyes
+then :
+
+else
+
+printf "%s\n" "#define nlink_t int" >>confdefs.h
+
+fi
+
+
+
+ for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5
+printf %s "checking absolute name of <sys/wait.h>... " >&6; }
+if test ${gl_cv_next_sys_wait_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_wait_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/wait.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/wait.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_wait_h
+ gl_cv_next_sys_wait_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5
+printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; }
+ fi
+ NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h
+
+ 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='<'sys/wait.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_wait_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+ for gl_func in waitpid; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/wait.h>
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include <time.h>
+"
+if test "x$ac_cv_have_decl_localtime_r" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_LOCALTIME_R $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
+ fi
+
+
+ if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
+printf %s "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
+if test ${gl_cv_time_r_posix+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+int
+main (void)
+{
+/* We don't need to append 'restrict's to the argument types,
+ even though the POSIX signature has the 'restrict's,
+ since C99 says they can't affect type compatibility. */
+ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+ if (ptr) return 0;
+ /* Check the return type is a pointer.
+ On HP-UX 10 it is 'int'. */
+ *localtime_r (0, 0);
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_time_r_posix=yes
+else
+ gl_cv_time_r_posix=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
+printf "%s\n" "$gl_cv_time_r_posix" >&6; }
+ if test $gl_cv_time_r_posix = yes; then
+ REPLACE_LOCALTIME_R=0
+ else
+ REPLACE_LOCALTIME_R=1
+ fi
+ else
+ HAVE_LOCALTIME_R=0
+ fi
+
+ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_TIME_R=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include <time.h>
+"
+if test "x$ac_cv_type_timezone_t" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TIMEZONE_T 1
+_ACEOF
+
+
+fi
+
+ if test "$ac_cv_type_timezone_t" = yes; then
+ HAVE_TIMEZONE_T=1
+ fi
+
+ if test "$HAVE_TIMEZONE_T" = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_TIME_RZ=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_TIME_RZ 1" >>confdefs.h
+
+
+
+
+
+
+ REPLACE_TIMEGM=0
+
+ if test $ac_cv_func_timegm = yes; then
+ if test $gl_cv_func_working_mktime = no; then
+ # Assume that timegm is buggy if mktime is.
+ REPLACE_TIMEGM=1
+ fi
+ else
+ HAVE_TIMEGM=0
+ fi
+
+ if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_TIMEGM=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_TIMEGM 1" >>confdefs.h
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_unistd_h='<'unistd.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
+printf %s "checking absolute name of <unistd.h>... " >&6; }
+if test ${gl_cv_next_unistd_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_unistd_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'unistd.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_unistd_h
+ gl_cv_next_unistd_h='"'$gl_header'"'
+ else
+ gl_cv_next_unistd_h='<'unistd.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
+printf "%s\n" "$gl_cv_next_unistd_h" >&6; }
+ fi
+ NEXT_UNISTD_H=$gl_cv_next_unistd_h
+
+ 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='<'unistd.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_unistd_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_unistd_h = yes; then
+ HAVE_UNISTD_H=1
+ else
+ HAVE_UNISTD_H=0
+ fi
+
+
+
+
+
+
+
+ for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __WIN32__) && ! defined __CYGWIN__
+# include <io.h>
+# endif
+#endif
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+ if { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+
+
+
+ test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
+ }
+ }
+ }
+
+
+
+
+ }
+ }; then
+ LIBUNISTRING_UNISTR_H='unistr.h'
+ else
+ LIBUNISTRING_UNISTR_H=
+ fi
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_UNISTR_U8_MBTOUCR 1
+_ACEOF
+
+
+
+
+ if { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+
+
+
+ test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
+ }
+ }
+ }
+
+
+
+
+ }
+ }; then
+ LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE=
+ LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#'
+else
+ LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#'
+ LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE=
+fi
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_UNISTR_U8_UCTOMB 1
+_ACEOF
+
+
+
+
+ if { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+
+
+
+ test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
+ }
+ }
+ }
+
+
+
+
+ }
+ }; then
+ LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE=
+ LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#'
+else
+ LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#'
+ LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE=
+fi
+
+
+
+
+ if { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+
+
+
+ test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
+ }
+ }
+ }
+
+
+
+
+ }
+ }; then
+ LIBUNISTRING_UNITYPES_H='unitypes.h'
+ else
+ LIBUNISTRING_UNITYPES_H=
+ fi
+
+
+
+
+ if { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+
+
+
+ test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
+ }
+ }
+ }
+
+
+
+
+ }
+ }; then
+ LIBUNISTRING_UNIWIDTH_H='uniwidth.h'
+ else
+ LIBUNISTRING_UNIWIDTH_H=
+ fi
+
+
+
+
+ if { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+
+
+
+ test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6
+ }
+ }
+ }
+
+
+
+
+ }
+ }; then
+ LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE=
+ LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#'
+else
+ LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#'
+ LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE=
+fi
+
+
+
+
+printf "%s\n" "#define USE_UNLOCKED_IO 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ for ac_func in unsetenv
+do :
+ ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
+if test "x$ac_cv_func_unsetenv" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UNSETENV 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
+printf %s "checking for unsetenv() return type... " >&6; }
+if test ${gt_cv_func_unsetenv_ret+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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);
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gt_cv_func_unsetenv_ret='int'
+else
+ gt_cv_func_unsetenv_ret='void'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
+printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; }
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+
+printf "%s\n" "#define VOID_UNSETENV 1" >>confdefs.h
+
+ REPLACE_UNSETENV=1
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
+printf %s "checking whether unsetenv obeys POSIX... " >&6; }
+if test ${gl_cv_func_unsetenv_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_unsetenv_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+
+int
+main (void)
+{
+
+ 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_unsetenv_works=yes
+else
+ gl_cv_func_unsetenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
+printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; }
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
+
+
+
+
+
+ fi
+
+
+
+
+
+ GNULIB_UNSETENV=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5
+printf %s "checking for variable-length arrays... " >&6; }
+if test ${ac_cv_c_vararrays+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC_NO_VLA__
+ defined
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "defined" >/dev/null 2>&1
+then :
+ ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Test for VLA support. This test is partly inspired
+ from examples in the C standard. Use at least two VLA
+ functions to detect the GCC 3.4.3 bug described in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
+ */
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ extern int n;
+ int B[100];
+ int fvla (int m, int C[m][m]);
+
+ int
+ simple (int count, int all[static count])
+ {
+ return all[count - 1];
+ }
+
+ int
+ fvla (int m, int C[m][m])
+ {
+ typedef int VLA[m][m];
+ VLA x;
+ int D[m];
+ static int (*q)[m] = &B;
+ int (*s)[n] = q;
+ return C && &x[0][0] == &D[0] && &D[0] == s[0];
+ }
+ #endif
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_vararrays=yes
+else
+ ac_cv_c_vararrays=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5
+printf "%s\n" "$ac_cv_c_vararrays" >&6; }
+ if test "$ac_cv_c_vararrays" = yes; then
+
+printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h
+
+ elif test "$ac_cv_c_vararrays" = no; then
+
+printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h
+
+ fi
+
+
+
+ if test $ac_cv_func_vasnprintf = no; then
+
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
+
+ if test $ac_cv_func_vasnprintf = yes; then
+
+printf "%s\n" "#define REPLACE_VASNPRINTF 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes
+then :
+
+else
+
+printf "%s\n" "#define ptrdiff_t long" >>confdefs.h
+
+
+fi
+
+
+
+
+
+
+
+ fi
+
+
+ for ac_func in vasprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VASPRINTF 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_vasprintf = no; then
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext"
+
+
+ if test $ac_cv_func_vasprintf = yes; then
+ REPLACE_VASPRINTF=1
+ else
+ HAVE_VASPRINTF=0
+ fi
+
+
+
+
+
+
+
+
+ fi
+
+
+
+
+
+
+ GNULIB_VASPRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
+
+
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format"
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format"
+
+
+# Check whether --with-packager was given.
+if test ${with_packager+y}
+then :
+ withval=$with_packager; case $withval in
+ yes|no) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_PACKAGER "$withval"
+_ACEOF
+ ;;
+ esac
+
+fi
+
+
+
+# Check whether --with-packager-version was given.
+if test ${with_packager_version+y}
+then :
+ withval=$with_packager_version; case $withval in
+ yes|no) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_PACKAGER_VERSION "$withval"
+_ACEOF
+ ;;
+ esac
+
+fi
+
+
+
+# Check whether --with-packager-bug-reports was given.
+if test ${with_packager_bug_reports+y}
+then :
+ withval=$with_packager_bug_reports; case $withval in
+ yes|no) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_PACKAGER_BUG_REPORTS "$withval"
+_ACEOF
+ ;;
+ esac
+
+fi
+
+
+ if test "X$with_packager" = "X" && \
+ test "X$with_packager_version$with_packager_bug_reports" != "X"
+ then
+ as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_wchar_h='<'wchar.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
+printf %s "checking absolute name of <wchar.h>... " >&6; }
+if test ${gl_cv_next_wchar_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_wchar_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wchar.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'wchar.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_wchar_h
+ gl_cv_next_wchar_h='"'$gl_header'"'
+ else
+ gl_cv_next_wchar_h='<'wchar.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
+printf "%s\n" "$gl_cv_next_wchar_h" >&6; }
+ fi
+ NEXT_WCHAR_H=$gl_cv_next_wchar_h
+
+ 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='<'wchar.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_wchar_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+
+
+
+
+
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+
+
+
+ for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth ; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ 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
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ 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
+
+
+
+ if test $ac_cv_func_wcrtomb = no; then
+ HAVE_WCRTOMB=0
+ ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_wcrtomb" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_WCRTOMB $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_wcrtomb = yes; then
+ REPLACE_WCRTOMB=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_WCRTOMB=1
+ else
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5
+printf %s "checking whether wcrtomb return value is correct... " >&6; }
+if test ${gl_cv_func_wcrtomb_retval+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX 4, OSF/1 and Solaris.
+ aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
+ esac
+ if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.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;
+ }
+ 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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_wcrtomb_retval=yes
+else
+ gl_cv_func_wcrtomb_retval=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5
+printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; }
+ case "$gl_cv_func_wcrtomb_retval" in
+ *yes) ;;
+ *) REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ fi
+
+ if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ GNULIB_WCRTOMB=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_iswcntrl = yes; then
+ HAVE_ISWCNTRL=1
+ else
+ HAVE_ISWCNTRL=0
+ fi
+
+
+
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_wctype_h='<'wctype.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
+printf %s "checking absolute name of <wctype.h>... " >&6; }
+if test ${gl_cv_next_wctype_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_wctype_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wctype.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'wctype.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_wctype_h
+ gl_cv_next_wctype_h='"'$gl_header'"'
+ else
+ gl_cv_next_wctype_h='<'wctype.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
+printf "%s\n" "$gl_cv_next_wctype_h" >&6; }
+ fi
+ NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+
+ 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='<'wctype.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_wctype_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_wctype_h = yes; then
+ if test $ac_cv_func_iswcntrl = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
+printf %s "checking whether iswcntrl works... " >&6; }
+if test ${gl_cv_func_iswcntrl_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #if __GNU_LIBRARY__ == 1
+ Linux libc5 i18n is broken.
+ #endif
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_iswcntrl_works="guessing yes"
+else
+ gl_cv_func_iswcntrl_works="guessing no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_iswcntrl_works=yes
+else
+ gl_cv_func_iswcntrl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
+printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; }
+ fi
+ HAVE_WCTYPE_H=1
+ else
+ HAVE_WCTYPE_H=0
+ fi
+
+
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ :
+ fi
+
+ if test $REPLACE_ISWCNTRL = 1; then
+ REPLACE_TOWLOWER=1
+ else
+ for ac_func in towlower
+do :
+ ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
+if test "x$ac_cv_func_towlower" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TOWLOWER 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_towlower = yes; then
+ REPLACE_TOWLOWER=0
+ else
+ ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+
+"
+if test "x$ac_cv_have_decl_towlower" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TOWLOWER $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_towlower = yes; then
+ REPLACE_TOWLOWER=1
+ else
+ REPLACE_TOWLOWER=0
+ fi
+ fi
+ fi
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+ :
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
+printf %s "checking for wctype_t... " >&6; }
+if test ${gl_cv_type_wctype_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ wctype_t a;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_type_wctype_t=yes
+else
+ gl_cv_type_wctype_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
+printf "%s\n" "$gl_cv_type_wctype_t" >&6; }
+ if test $gl_cv_type_wctype_t = no; then
+ HAVE_WCTYPE_T=0
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
+printf %s "checking for wctrans_t... " >&6; }
+if test ${gl_cv_type_wctrans_t+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ wctrans_t a;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_type_wctrans_t=yes
+else
+ gl_cv_type_wctrans_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
+printf "%s\n" "$gl_cv_type_wctrans_t" >&6; }
+ if test $gl_cv_type_wctrans_t = no; then
+ HAVE_WCTRANS_T=0
+ fi
+
+
+ for gl_func in wctype iswctype wctrans towctrans ; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" "
+/* AIX 3.2.5 declares wcwidth in <string.h>. */
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_wcwidth" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_WCWIDTH $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_wcwidth != yes; then
+ HAVE_DECL_WCWIDTH=0
+ fi
+
+ if test $ac_cv_func_wcwidth = yes; then
+ HAVE_WCWIDTH=1
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5
+printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; }
+if test ${gl_cv_func_wcwidth_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ case "$host_os" in
+ # Guess yes on glibc and AIX 7 systems.
+ *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";;
+ *) gl_cv_func_wcwidth_works="guessing no";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+/* AIX 3.2.5 declares wcwidth in <string.h>. */
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+#if !HAVE_DECL_WCWIDTH
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int wcwidth (int);
+#endif
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL)
+ {
+ if (wcwidth (0x0301) > 0)
+ result |= 1;
+ if (wcwidth (0x05B0) > 0)
+ result |= 2;
+ if (wcwidth (0x200B) > 0)
+ result |= 4;
+ if (wcwidth (0xFF1A) == 0)
+ result |= 8;
+ }
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_wcwidth_works=yes
+else
+ gl_cv_func_wcwidth_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5
+printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; }
+ case "$gl_cv_func_wcwidth_works" in
+ *yes) ;;
+ *no) REPLACE_WCWIDTH=1 ;;
+ esac
+ else
+ HAVE_WCWIDTH=0
+ fi
+
+ if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_WCWIDTH=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h
+
+
+
+ :
+
+
+ for ac_header in stdint.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H 1
+_ACEOF
+
+fi
+done
+
+
+
+
+ :
+
+
+
+ :
+
+ :
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format"
+
+ # End of code from modules
+
+
+
+
+
+
+
+
+
+ gltests_libdeps=
+ gltests_ltlibdeps=
+
+
+
+
+
+
+
+
+
+ gl_source_base='gnulib-tests'
+ 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
+
+ gl_module_indicator_condition=$gltests_WITNESS
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_ACCEPT" != 1; then
+ if test "$GNULIB_ACCEPT" = 0; then
+ GNULIB_ACCEPT=$gl_module_indicator_condition
+ else
+ GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_ACCEPT 1" >>confdefs.h
+
+
+
+
+
+
+
+ if test $ac_cv_header_arpa_inet_h = yes; then
+ HAVE_ARPA_INET_H=1
+ else
+ HAVE_ARPA_INET_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
+printf %s "checking absolute name of <arpa/inet.h>... " >&6; }
+if test ${gl_cv_next_arpa_inet_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_arpa_inet_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <arpa/inet.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'arpa/inet.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_arpa_inet_h
+ gl_cv_next_arpa_inet_h='"'$gl_header'"'
+ else
+ gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
+printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; }
+ fi
+ NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
+
+ 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='<'arpa/inet.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+ for gl_func in inet_ntop inet_pton; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* On some systems, this header is not self-consistent. */
+#if !(defined __GLIBC__ || defined __UCLIBC__)
+# include <sys/socket.h>
+#endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
+#include <arpa/inet.h>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_BIND" != 1; then
+ if test "$GNULIB_BIND" = 0; then
+ GNULIB_BIND=$gl_module_indicator_condition
+ else
+ GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_BIND 1" >>confdefs.h
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5
+printf %s "checking for a turkish Unicode locale... " >&6; }
+if test ${gt_cv_locale_tr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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, 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. But BeOS does not
+ implement the Turkish upper-/lowercase mappings. Therefore, let this
+ program return 1 on BeOS. */
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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 tr_TR 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 eighth month, the second
+ character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
+ two bytes long, with UTF-8 encoding. */
+ t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 4
+ || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
+ return 1;
+ /* Check whether the upper-/lowercase mappings are as expected for
+ Turkish. */
+ if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
+ || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
+ return 1;
+ return 0;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=Turkish_Turkey.65001
+ else
+ # None found.
+ gt_cv_locale_tr_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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr_TR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr_TR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_tr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ else
+ gt_cv_locale_tr_utf8=none
+ fi
+ rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; }
+ LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_CONNECT" != 1; then
+ if test "$GNULIB_CONNECT" = 0; then
+ GNULIB_CONNECT=$gl_module_indicator_condition
+ else
+ GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_CONNECT 1" >>confdefs.h
+
+
+
+
+
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_FDOPEN=1
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5
+printf %s "checking whether fdopen sets errno... " >&6; }
+if test ${gl_cv_func_fdopen_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ mingw*) gl_cv_func_fdopen_works="guessing no" ;;
+ *) gl_cv_func_fdopen_works="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <errno.h>
+int
+main (void)
+{
+ FILE *fp;
+ errno = 0;
+ fp = fdopen (-1, "r");
+ if (fp == NULL && errno == 0)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_fdopen_works=yes
+else
+ gl_cv_func_fdopen_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5
+printf "%s\n" "$gl_cv_func_fdopen_works" >&6; }
+ case "$gl_cv_func_fdopen_works" in
+ *no) REPLACE_FDOPEN=1 ;;
+ esac
+ fi
+
+ if test $REPLACE_FDOPEN = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext"
+
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_FDOPEN" != 1; then
+ if test "$GNULIB_FDOPEN" = 0; then
+ GNULIB_FDOPEN=$gl_module_indicator_condition
+ else
+ GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h
+
+
+
+
+
+
+ if test $ac_cv_func_ftruncate = yes; then
+
+
+ case "$host_os" in
+ mingw*)
+ REPLACE_FTRUNCATE=1
+ ;;
+ esac
+
+ else
+ HAVE_FTRUNCATE=0
+ fi
+
+ if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS ftruncate.$ac_objext"
+
+
+ for ac_func in chsize
+do :
+ ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize"
+if test "x$ac_cv_func_chsize" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CHSIZE 1
+_ACEOF
+
+fi
+done
+
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_FTRUNCATE" != 1; then
+ if test "$GNULIB_FTRUNCATE" = 0; then
+ GNULIB_FTRUNCATE=$gl_module_indicator_condition
+ else
+ GNULIB_FTRUNCATE="($GNULIB_FTRUNCATE || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+ *yes,yes) ;;
+ *)
+ REPLACE_GETCWD=1
+ ;;
+ esac
+
+ if test $REPLACE_GETCWD = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_GETCWD" != 1; then
+ if test "$GNULIB_GETCWD" = 0; then
+ GNULIB_GETCWD=$gl_module_indicator_condition
+ else
+ GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
+
+
+
+
+
+
+ for ac_func in getpagesize
+do :
+ ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_getpagesize = no; then
+ HAVE_GETPAGESIZE=0
+ for ac_header in OS.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default"
+if test "x$ac_cv_header_OS_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OS_H 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_header_OS_h = yes; then
+ HAVE_OS_H=1
+ fi
+ for ac_header in sys/param.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_param_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_PARAM_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+ ac_fn_c_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getpagesize" = xyes
+then :
+
+else
+ HAVE_DECL_GETPAGESIZE=0
+fi
+
+
+ if test $REPLACE_GETPAGESIZE = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_GETPAGESIZE" != 1; then
+ if test "$GNULIB_GETPAGESIZE" = 0; then
+ GNULIB_GETPAGESIZE=$gl_module_indicator_condition
+ else
+ GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+ HAVE_INET_PTON=1
+ INET_PTON_LIB=
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+ if test $HAVE_WINSOCK2_H = 1; then
+ ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <ws2tcpip.h>
+"
+if test "x$ac_cv_have_decl_inet_pton" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_PTON $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_inet_pton = yes; then
+ REPLACE_INET_PTON=1
+ INET_PTON_LIB="-lws2_32"
+ else
+ HAVE_DECL_INET_PTON=0
+ HAVE_INET_PTON=0
+ fi
+ else
+ gl_save_LIBS=$LIBS
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
+printf %s "checking for library containing inet_pton... " >&6; }
+if test ${ac_cv_search_inet_pton+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_pton ();
+int
+main (void)
+{
+return inet_pton ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl resolv
+do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_search_inet_pton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test ${ac_cv_search_inet_pton+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_inet_pton+y}
+then :
+
+else
+ ac_cv_search_inet_pton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
+printf "%s\n" "$ac_cv_search_inet_pton" >&6; }
+ac_res=$ac_cv_search_inet_pton
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ for ac_func in inet_pton
+do :
+ ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_PTON 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_inet_pton = no; then
+ HAVE_INET_PTON=0
+ fi
+
+fi
+
+ LIBS=$gl_save_LIBS
+
+ if test "$ac_cv_search_inet_pton" != "no" \
+ && test "$ac_cv_search_inet_pton" != "none required"; then
+ INET_PTON_LIB="$ac_cv_search_inet_pton"
+ fi
+
+
+ ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+
+"
+if test "x$ac_cv_have_decl_inet_pton" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_PTON $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_inet_pton = no; then
+ HAVE_DECL_INET_PTON=0
+ fi
+ fi
+
+
+ if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext"
+
+
+
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_INET_PTON" != 1; then
+ if test "$GNULIB_INET_PTON" = 0; then
+ GNULIB_INET_PTON=$gl_module_indicator_condition
+ else
+ GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+printf %s "checking whether byte ordering is bigendian... " >&6; }
+if test ${ac_cv_c_bigendian+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main (void)
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main (void)
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main (void)
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main (void)
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes
+then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main (void)
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+printf "%s\n" "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+
+
+ HAVE_IOCTL=1
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_IOCTL=0
+ else
+ for ac_func in ioctl
+do :
+ ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl"
+if test "x$ac_cv_func_ioctl" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_IOCTL 1
+_ACEOF
+
+fi
+done
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5
+printf %s "checking for ioctl with POSIX signature... " >&6; }
+if test ${gl_cv_func_ioctl_posix_signature+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/ioctl.h>
+int
+main (void)
+{
+extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int ioctl (int, int, ...);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_func_ioctl_posix_signature=yes
+else
+ gl_cv_func_ioctl_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; }
+ if test $gl_cv_func_ioctl_posix_signature != yes; then
+ REPLACE_IOCTL=1
+ fi
+ fi
+
+ if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_IOCTL" != 1; then
+ if test "$GNULIB_IOCTL" = 0; then
+ GNULIB_IOCTL=$gl_module_indicator_condition
+ else
+ GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_IOCTL 1" >>confdefs.h
+
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_LISTEN" != 1; then
+ if test "$GNULIB_LISTEN" = 0; then
+ GNULIB_LISTEN=$gl_module_indicator_condition
+ else
+ GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_LISTEN 1" >>confdefs.h
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+ LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5
+printf %s "checking for a turkish Unicode locale... " >&6; }
+if test ${gt_cv_locale_tr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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, 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. But BeOS does not
+ implement the Turkish upper-/lowercase mappings. Therefore, let this
+ program return 1 on BeOS. */
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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 tr_TR 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 eighth month, the second
+ character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
+ two bytes long, with UTF-8 encoding. */
+ t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 4
+ || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
+ return 1;
+ /* Check whether the upper-/lowercase mappings are as expected for
+ Turkish. */
+ if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
+ || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
+ return 1;
+ return 0;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=Turkish_Turkey.65001
+ else
+ # None found.
+ gt_cv_locale_tr_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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr_TR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr_TR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_tr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ else
+ gt_cv_locale_tr_utf8=none
+ fi
+ rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; }
+ LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+ LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+ # 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_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+ gl_have_mmap=yes
+else
+ gl_have_mmap=no
+fi
+
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+printf %s "checking for MAP_ANONYMOUS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ if test $gl_have_mmap_anonymous != yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+
+printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
+
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+printf "%s\n" "$gl_have_mmap_anonymous" >&6; }
+ if test $gl_have_mmap_anonymous = yes; then
+
+printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ 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=
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
+printf %s "checking for library containing nanosleep... " >&6; }
+if test ${ac_cv_search_nanosleep+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nanosleep ();
+int
+main (void)
+{
+return nanosleep ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4
+do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_search_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test ${ac_cv_search_nanosleep+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_nanosleep+y}
+then :
+
+else
+ ac_cv_search_nanosleep=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
+printf "%s\n" "$ac_cv_search_nanosleep" >&6; }
+ac_res=$ac_cv_search_nanosleep
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_nanosleep" = "none required" ||
+ LIB_NANOSLEEP=$ac_cv_search_nanosleep
+fi
+
+ if test "x$ac_cv_search_nanosleep" != xno; then
+
+
+ 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
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5
+printf %s "checking for working nanosleep... " >&6; }
+if test ${gl_cv_func_nanosleep+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in linux*) # Guess it halfway works when the kernel is Linux.
+ gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
+ *) # If we don't know, assume the worst.
+ gl_cv_func_nanosleep='guessing no' ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <errno.h>
+ #include <limits.h>
+ #include <signal.h>
+ #if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #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)))
+
+ static void
+ check_for_SIGALRM (int sig)
+ {
+ if (sig != SIGALRM)
+ _exit (1);
+ }
+
+ int
+ main ()
+ {
+ static struct timespec ts_sleep;
+ static struct timespec ts_remaining;
+ static struct sigaction act;
+ /* Test for major problems first. */
+ if (! nanosleep)
+ return 2;
+ act.sa_handler = check_for_SIGALRM;
+ sigemptyset (&act.sa_mask);
+ sigaction (SIGALRM, &act, NULL);
+ ts_sleep.tv_sec = 0;
+ ts_sleep.tv_nsec = 1;
+ 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;
+ return 0;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_nanosleep=yes
+else
+ case $? in 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;;
+ esac
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5
+printf "%s\n" "$gl_cv_func_nanosleep" >&6; }
+ case "$gl_cv_func_nanosleep" in
+ *yes)
+ REPLACE_NANOSLEEP=0
+ ;;
+ *)
+ REPLACE_NANOSLEEP=1
+ case "$gl_cv_func_nanosleep" in
+ *"mishandles large arguments"*)
+
+printf "%s\n" "#define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h
+
+ ;;
+ *)
+ # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP.
+ for ac_lib in $LIBSOCKET; do
+ case " $LIB_NANOSLEEP " in
+ *" $ac_lib "*) ;;
+ *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";;
+ esac
+ done
+ ;;
+ esac
+ ;;
+ esac
+ else
+ HAVE_NANOSLEEP=0
+ fi
+ LIBS=$nanosleep_save_libs
+
+ if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS nanosleep.$ac_objext"
+
+
+
+ :
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_NANOSLEEP" != 1; then
+ if test "$GNULIB_NANOSLEEP" = 0; then
+ GNULIB_NANOSLEEP=$gl_module_indicator_condition
+ else
+ GNULIB_NANOSLEEP="($GNULIB_NANOSLEEP || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
+printf %s "checking whether <netinet/in.h> is self-contained... " >&6; }
+if test ${gl_cv_header_netinet_in_h_selfcontained+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netinet/in.h>
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_netinet_in_h_selfcontained=yes
+else
+ gl_cv_header_netinet_in_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
+ if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+ NETINET_IN_H=''
+ else
+ NETINET_IN_H='netinet/in.h'
+ for ac_header in netinet/in.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_in_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINET_IN_H 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
+printf %s "checking absolute name of <netinet/in.h>... " >&6; }
+if test ${gl_cv_next_netinet_in_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_netinet_in_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netinet/in.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'netinet/in.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_netinet_in_h
+ gl_cv_next_netinet_in_h='"'$gl_header'"'
+ else
+ gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
+printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; }
+ fi
+ NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
+
+ 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='<'netinet/in.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_netinet_in_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_netinet_in_h = yes; then
+ HAVE_NETINET_IN_H=1
+ else
+ HAVE_NETINET_IN_H=0
+ fi
+
+ fi
+
+ if test -n "$NETINET_IN_H"; then
+ GL_GENERATE_NETINET_IN_H_TRUE=
+ GL_GENERATE_NETINET_IN_H_FALSE='#'
+else
+ GL_GENERATE_NETINET_IN_H_TRUE='#'
+ GL_GENERATE_NETINET_IN_H_FALSE=
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+
+
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
+ REPLACE_PERROR=1
+ fi
+ case ${gl_cv_func_strerror_r_works-unset} in
+ unset|*yes)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5
+printf %s "checking whether perror matches strerror... " >&6; }
+if test ${gl_cv_func_perror_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_perror_works="guessing no"
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+
+int
+main (void)
+{
+char *str = strerror (-1);
+ if (!getenv("CONFTEST_OUTPUT")) return 0;
+ if (!str) str = "";
+ puts (str);
+ errno = -1;
+ perror ("");
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+ && cmp conftest.txt1 conftest.txt2 >/dev/null; then
+ gl_cv_func_perror_works=yes
+ else
+ gl_cv_func_perror_works=no
+ fi
+ rm -rf conftest.txt1 conftest.txt2
+else
+ gl_cv_func_perror_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5
+printf "%s\n" "$gl_cv_func_perror_works" >&6; }
+ if test "$gl_cv_func_perror_works" != yes; then
+ REPLACE_PERROR=1
+ fi
+ ;;
+ *)
+ REPLACE_PERROR=1
+ ;;
+ esac
+
+ if test $REPLACE_PERROR = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_PERROR" != 1; then
+ if test "$GNULIB_PERROR" = 0; then
+ GNULIB_PERROR=$gl_module_indicator_condition
+ else
+ GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PERROR 1" >>confdefs.h
+
+
+
+
+
+
+
+ if test $ac_cv_func_pipe != yes; then
+ HAVE_PIPE=0
+ fi
+
+ if test $HAVE_PIPE = 0; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS pipe.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_PIPE" != 1; then
+ if test "$GNULIB_PIPE" = 0; then
+ GNULIB_PIPE=$gl_module_indicator_condition
+ else
+ GNULIB_PIPE="($GNULIB_PIPE || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PIPE 1" >>confdefs.h
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5
+printf %s "checking for putenv compatible with GNU and SVID... " >&6; }
+if test ${gl_cv_func_svid_putenv+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_svid_putenv="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+
+ /* Put it in env. */
+ if (putenv ("CONFTEST_putenv=val"))
+ return 1;
+
+ /* Try to remove it. */
+ if (putenv ("CONFTEST_putenv"))
+ return 2;
+
+ /* Make sure it was deleted. */
+ if (getenv ("CONFTEST_putenv") != 0)
+ return 3;
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_svid_putenv=yes
+else
+ gl_cv_func_svid_putenv=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5
+printf "%s\n" "$gl_cv_func_svid_putenv" >&6; }
+ case "$gl_cv_func_svid_putenv" in
+ *yes) ;;
+ *)
+ REPLACE_PUTENV=1
+ ;;
+ esac
+
+ if test $REPLACE_PUTENV = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext"
+
+
+ ac_fn_c_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl__putenv" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__PUTENV $ac_have_decl
+_ACEOF
+
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_PUTENV" != 1; then
+ if test "$GNULIB_PUTENV" = 0; then
+ GNULIB_PUTENV=$gl_module_indicator_condition
+ else
+ GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PUTENV 1" >>confdefs.h
+
+
+
+
+
+
+ # 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_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+ gl_have_mmap=yes
+else
+ gl_have_mmap=no
+fi
+
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+printf %s "checking for MAP_ANONYMOUS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ if test $gl_have_mmap_anonymous != yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+
+printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
+
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+printf "%s\n" "$gl_have_mmap_anonymous" >&6; }
+ if test $gl_have_mmap_anonymous = yes; then
+
+printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+
+ # 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_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+ gl_have_mmap=yes
+else
+ gl_have_mmap=no
+fi
+
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+printf %s "checking for MAP_ANONYMOUS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ if test $gl_have_mmap_anonymous != yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+
+printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
+
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+printf "%s\n" "$gl_have_mmap_anonymous" >&6; }
+ if test $gl_have_mmap_anonymous = yes; then
+
+printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ REPLACE_SELECT=1
+ else
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5
+printf %s "checking whether select supports a 0 argument... " >&6; }
+if test ${gl_cv_func_select_supports0+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ 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
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_select_supports0=yes
+else
+ gl_cv_func_select_supports0=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5
+printf "%s\n" "$gl_cv_func_select_supports0" >&6; }
+ case "$gl_cv_func_select_supports0" in
+ *yes) ;;
+ *) REPLACE_SELECT=1 ;;
+ esac
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5
+printf %s "checking whether select detects invalid fds... " >&6; }
+if test ${gl_cv_func_select_detects_ebadf+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_select_detects_ebadf="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+
+int
+main (void)
+{
+
+ 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_select_detects_ebadf=yes
+else
+ gl_cv_func_select_detects_ebadf=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5
+printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; }
+ case $gl_cv_func_select_detects_ebadf in
+ *yes) ;;
+ *) REPLACE_SELECT=1 ;;
+ esac
+ fi
+
+ LIB_SELECT="$LIBSOCKET"
+ if test $REPLACE_SELECT = 1; then
+ case "$host_os" in
+ mingw*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+int
+main ()
+{
+ MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else
+ LIB_SELECT="$LIB_SELECT -luser32"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+ esac
+ fi
+
+
+ if test $REPLACE_SELECT = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS select.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_SELECT" != 1; then
+ if test "$GNULIB_SELECT" = 0; then
+ GNULIB_SELECT=$gl_module_indicator_condition
+ else
+ GNULIB_SELECT="($GNULIB_SELECT || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SELECT 1" >>confdefs.h
+
+
+
+
+
+
+
+ case "$host_os" in
+ mingw*) REPLACE_SETLOCALE=1 ;;
+ cygwin*)
+ case `uname -r` in
+ 1.5.*) REPLACE_SETLOCALE=1 ;;
+ esac
+ ;;
+ esac
+
+ if test $REPLACE_SETLOCALE = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_SETLOCALE" != 1; then
+ if test "$GNULIB_SETLOCALE" = 0; then
+ GNULIB_SETLOCALE=$gl_module_indicator_condition
+ else
+ GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+ LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_SETSOCKOPT" != 1; then
+ if test "$GNULIB_SETSOCKOPT" = 0; then
+ GNULIB_SETSOCKOPT=$gl_module_indicator_condition
+ else
+ GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include <unistd.h>
+"
+if test "x$ac_cv_have_decl_sleep" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SLEEP $ac_have_decl
+_ACEOF
+
+
+ if test $ac_cv_have_decl_sleep != yes; then
+ HAVE_SLEEP=0
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5
+printf %s "checking for working sleep... " >&6; }
+if test ${gl_cv_func_sleep_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_sleep_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+static void
+handle_alarm (int sig)
+{
+ if (sig != SIGALRM)
+ _exit (2);
+}
+
+int
+main (void)
+{
+
+ /* 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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_sleep_works=yes
+else
+ gl_cv_func_sleep_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5
+printf "%s\n" "$gl_cv_func_sleep_works" >&6; }
+ case "$gl_cv_func_sleep_works" in
+ *yes) ;;
+ *)
+ REPLACE_SLEEP=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_SLEEP" != 1; then
+ if test "$GNULIB_SLEEP" = 0; then
+ GNULIB_SLEEP=$gl_module_indicator_condition
+ else
+ GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SLEEP 1" >>confdefs.h
+
+
+
+
+
+
+ gl_cv_func_snprintf_usable=no
+ for ac_func in snprintf
+do :
+ ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SNPRINTF 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_snprintf = yes; then
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5
+printf %s "checking whether snprintf respects a size of 1... " >&6; }
+if test ${gl_cv_func_snprintf_size1+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+ gl_cv_func_snprintf_size1="guessing yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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';
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_snprintf_size1=yes
+else
+ gl_cv_func_snprintf_size1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5
+printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; }
+
+ case "$gl_cv_func_snprintf_size1" in
+ *yes)
+
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
+printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
+if test ${gl_cv_func_printf_positions+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes
+then :
+
+ 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";;
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_printf_positions=yes
+else
+ gl_cv_func_printf_positions=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5
+printf "%s\n" "$gl_cv_func_printf_positions" >&6; }
+
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_snprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_snprintf_usable = no; then
+
+
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS snprintf.$ac_objext"
+
+ if test $ac_cv_func_snprintf = yes; then
+ REPLACE_SNPRINTF=1
+ fi
+ :
+
+ fi
+
+ if test $ac_cv_have_decl_snprintf = no; then
+ HAVE_DECL_SNPRINTF=0
+ fi
+
+
+
+
+
+
+ if test "$GNULIB_SNPRINTF" != 1; then
+ if test "$GNULIB_SNPRINTF" = 0; then
+ GNULIB_SNPRINTF=$gl_module_indicator_condition
+ else
+ GNULIB_SNPRINTF="($GNULIB_SNPRINTF || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_SNPRINTF $gl_module_indicator_condition
+_ACEOF
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext"
+
+ fi
+ # When this module is used, sockets may actually occur as file descriptors,
+ # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
+
+
+
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+ fi
+
+
+
+
+
+ if test "$GNULIB_SOCKET" != 1; then
+ if test "$GNULIB_SOCKET" = 0; then
+ GNULIB_SOCKET=$gl_module_indicator_condition
+ else
+ GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SOCKET 1" >>confdefs.h
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_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>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_type_socklen_t" = xyes
+then :
+
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
+printf %s "checking for socklen_t equivalent... " >&6; }
+ if test ${gl_cv_socklen_t_equiv+y}
+then :
+ printf %s "(cached) " >&6
+else
+ # 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
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/socket.h>
+
+ int getpeername (int, $arg2 *, $t *);
+int
+main (void)
+{
+$t len;
+ getpeername (0, 0, &len);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_socklen_t_equiv="$t"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+
+fi
+
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
+printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define socklen_t $gl_cv_socklen_t_equiv
+_ACEOF
+
+fi
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
+printf %s "checking for working stdalign.h... " >&6; }
+if test ${gl_cv_header_working_stdalign_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdalign.h>
+ #include <stddef.h>
+
+ /* Test that alignof yields a result consistent with offsetof.
+ This catches GCC bug 52023
+ <http://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) \
+ || (defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
+ || __ICC || 0x5110 <= __SUNPRO_C \
+ || 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
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_working_stdalign_h=yes
+else
+ gl_cv_header_working_stdalign_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
+printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; }
+
+ if test $gl_cv_header_working_stdalign_h = yes; then
+ STDALIGN_H=''
+ else
+ STDALIGN_H='stdalign.h'
+ fi
+
+
+ if test -n "$STDALIGN_H"; then
+ GL_GENERATE_STDALIGN_H_TRUE=
+ GL_GENERATE_STDALIGN_H_FALSE='#'
+else
+ GL_GENERATE_STDALIGN_H_TRUE='#'
+ GL_GENERATE_STDALIGN_H_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_strerror_r = no; then
+ HAVE_DECL_STRERROR_R=0
+ fi
+
+ if test $ac_cv_func_strerror_r = yes; then
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ if test $gl_cv_func_strerror_r_posix_signature = yes; then
+ case "$gl_cv_func_strerror_r_works" in
+ *no) REPLACE_STRERROR_R=1 ;;
+ esac
+ else
+ REPLACE_STRERROR_R=1
+ fi
+ else
+ REPLACE_STRERROR_R=1
+ fi
+ fi
+
+ if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext"
+
+
+
+
+
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_STRERROR_R" != 1; then
+ if test "$GNULIB_STRERROR_R" = 0; then
+ GNULIB_STRERROR_R=$gl_module_indicator_condition
+ else
+ GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
+
+
+
+
+
+
+ # 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_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+ gl_have_mmap=yes
+else
+ gl_have_mmap=no
+fi
+
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+printf %s "checking for MAP_ANONYMOUS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ if test $gl_have_mmap_anonymous != yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+
+printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
+
+ gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
+
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+printf "%s\n" "$gl_have_mmap_anonymous" >&6; }
+ if test $gl_have_mmap_anonymous = yes; then
+
+printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+
+ if test $ac_cv_func_symlink = no; then
+ HAVE_SYMLINK=0
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5
+printf %s "checking whether symlink handles trailing slash correctly... " >&6; }
+if test ${gl_cv_func_symlink_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_symlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_symlink_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+
+int
+main (void)
+{
+int result = 0;
+ if (!symlink ("a", "conftest.link/"))
+ result |= 1;
+ if (symlink ("conftest.f", "conftest.lnk2"))
+ result |= 2;
+ else if (!symlink ("a", "conftest.lnk2/"))
+ result |= 4;
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_symlink_works=yes
+else
+ gl_cv_func_symlink_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.f conftest.link conftest.lnk2
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
+printf "%s\n" "$gl_cv_func_symlink_works" >&6; }
+ case "$gl_cv_func_symlink_works" in
+ *yes) ;;
+ *)
+ REPLACE_SYMLINK=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext"
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_SYMLINK" != 1; then
+ if test "$GNULIB_SYMLINK" = 0; then
+ GNULIB_SYMLINK=$gl_module_indicator_condition
+ else
+ GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h
+
+
+
+
+
+
+
+ if test $ac_cv_header_sys_ioctl_h = yes; then
+ HAVE_SYS_IOCTL_H=1
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/ioctl.h> declares ioctl" >&5
+printf %s "checking whether <sys/ioctl.h> declares ioctl... " >&6; }
+if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/ioctl.h>
+
+int
+main (void)
+{
+(void) ioctl;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_decl_ioctl_in_sys_ioctl_h=yes
+else
+ gl_cv_decl_ioctl_in_sys_ioctl_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5
+printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; }
+ else
+ HAVE_SYS_IOCTL_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/ioctl.h>" >&5
+printf %s "checking absolute name of <sys/ioctl.h>... " >&6; }
+if test ${gl_cv_next_sys_ioctl_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_ioctl_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/ioctl.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/ioctl.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_ioctl_h
+ gl_cv_next_sys_ioctl_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5
+printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; }
+ fi
+ NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h
+
+ 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='<'sys/ioctl.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive
+
+
+
+
+
+
+ for gl_func in ioctl; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/ioctl.h>
+/* Some platforms declare ioctl in the wrong header. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <unistd.h>
+#endif
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
+printf %s "checking whether <sys/select.h> is self-contained... " >&6; }
+if test ${gl_cv_header_sys_select_h_selfcontained+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main (void)
+{
+struct timeval b;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_header_sys_select_h_selfcontained=yes
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main (void)
+{
+int memset; int bzero;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main (void)
+{
+
+ #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);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; }
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
+printf %s "checking absolute name of <sys/select.h>... " >&6; }
+if test ${gl_cv_next_sys_select_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_select_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/select.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_select_h
+ gl_cv_next_sys_select_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
+printf "%s\n" "$gl_cv_next_sys_select_h" >&6; }
+ fi
+ NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h
+
+ 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='<'sys/select.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_select_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_select_h = yes; then
+ HAVE_SYS_SELECT_H=1
+ else
+ HAVE_SYS_SELECT_H=0
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+done
+
+ 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
+
+
+
+
+ for gl_func in pselect select; do
+ as_gl_Symbol=`printf "%s\n" "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+printf %s "checking whether $gl_func is declared without a macro... " >&6; }
+if eval test \${$as_gl_Symbol+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* 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>
+
+int
+main (void)
+{
+#undef $gl_func
+ (void) $gl_func;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_gl_Symbol=yes"
+else
+ eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test \"x\$"$as_gl_Symbol"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+ eval ac_cv_have_decl_$gl_func=yes
+fi
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_uio_h='<'sys/uio.h'>'
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
+printf %s "checking absolute name of <sys/uio.h>... " >&6; }
+if test ${gl_cv_next_sys_uio_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_uio_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/uio.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/uio.h' \
+ | 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
+ }'
+
+ gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_uio_h
+ gl_cv_next_sys_uio_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_uio_h='<'sys/uio.h'>'
+ fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
+printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; }
+ fi
+ NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
+
+ 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='<'sys/uio.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_uio_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_uio_h = yes; then
+ HAVE_SYS_UIO_H=1
+ else
+ HAVE_SYS_UIO_H=0
+ fi
+
+
+
+ abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+
+ abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 __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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+ LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+
+ if test $ac_cv_func_wctob = no; then
+ HAVE_WCTOB=0
+ HAVE_DECL_WCTOB=0
+ else
+ HAVE_WCTOB=1
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5
+printf %s "checking whether wctob works... " >&6; }
+if test ${gl_cv_func_wctob_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris <= 9 and Cygwin.
+ solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
+ gl_cv_func_wctob_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wctob_works="guessing yes" ;;
+ esac
+ case "$host_os" in
+ cygwin*)
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+register long global __asm__ ("%ebx");
+
+int main ()
+{
+ setlocale (LC_ALL, "en_US.UTF-8");
+
+ global = 0x12345678;
+ if (wctob (0x00FC) != -1)
+ return 1;
+ if (global != 0x12345678)
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ :
+else
+ gl_cv_func_wctob_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ ;;
+ esac
+ if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then
+ if test "$cross_compiling" = yes
+then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ wchar_t wc;
+
+ if (mbtowc (&wc, "\374", 1) == 1)
+ if (wctob (wc) != (unsigned char) '\374')
+ return 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ gl_cv_func_wctob_works=yes
+else
+ gl_cv_func_wctob_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5
+printf "%s\n" "$gl_cv_func_wctob_works" >&6; }
+ case "$gl_cv_func_wctob_works" in
+ *yes) ;;
+ *) REPLACE_WCTOB=1 ;;
+ esac
+ if test $REPLACE_WCTOB = 0; then
+
+ ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_wctob" = xyes
+then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_WCTOB $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_wctob != yes; then
+ HAVE_DECL_WCTOB=0
+ fi
+ fi
+ fi
+
+ if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_WCTOB" != 1; then
+ if test "$GNULIB_WCTOB" = 0; then
+ GNULIB_WCTOB=$gl_module_indicator_condition
+ else
+ GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCTOB 1" >>confdefs.h
+
+
+
+
+
+
+ if false; then
+ REPLACE_WCTOMB=1
+ fi
+
+ if test $REPLACE_WCTOMB = 1; then
+
+
+
+
+
+
+
+
+ gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+ if test "$GNULIB_WCTOMB" != 1; then
+ if test "$GNULIB_WCTOMB" = 0; then
+ GNULIB_WCTOMB=$gl_module_indicator_condition
+ else
+ GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)"
+ fi
+ fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LIBDIFFUTILS_LIBDEPS="$gl_libdeps"
+
+ LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps"
+
+ LIBTESTS_LIBDEPS="$gltests_libdeps"
+
+
+
+# Check whether --enable-gcc-warnings was given.
+if test ${enable_gcc_warnings+y}
+then :
+ enableval=$enable_gcc_warnings; case $enableval in
+ yes|no) ;;
+ *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;;
+ esac
+ gl_gcc_warnings=$enableval
+else
+ if test -d "$srcdir"/.git; then
+ gl_gcc_warnings=yes
+ else
+ gl_gcc_warnings=no
+ fi
+
+fi
+
+
+if test "$gl_gcc_warnings" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5
+printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; }
+if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Werror__Wunknown_warning_option=yes
+else
+ gl_cv_warn_c__Werror__Wunknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5
+printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; }
+if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes
+then :
+ gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'
+else
+ gl_unknown_warnings_are_errors=
+fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5
+printf %s "checking whether C compiler handles -Werror... " >&6; }
+if test ${gl_cv_warn_c__Werror+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Werror=yes
+else
+ gl_cv_warn_c__Werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5
+printf "%s\n" "$gl_cv_warn_c__Werror" >&6; }
+if test "x$gl_cv_warn_c__Werror" = xyes
+then :
+ as_fn_append WERROR_CFLAGS " -Werror"
+fi
+
+
+
+
+ nw=
+ # This, $nw, is the list of warnings we disable.
+ nw="$nw -Wdeclaration-after-statement" # too useful to forbid
+ nw="$nw -Waggregate-return" # anachronistic
+ nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
+ nw="$nw -Wc++-compat" # We don't care about C++ compilers
+ nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
+ nw="$nw -Wtraditional" # Warns on #elif which we use often
+ nw="$nw -Wcast-qual" # Too many warnings for now
+ nw="$nw -Wconversion" # Too many warnings for now
+ nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
+ nw="$nw -Wsign-conversion" # Too many warnings for now
+ nw="$nw -Wtraditional-conversion" # Too many warnings for now
+ nw="$nw -Wunreachable-code" # Too many warnings for now
+ nw="$nw -Wpadded" # Our structs are not padded
+ nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
+ nw="$nw -Wlogical-op" # any use of fwrite provokes this
+ nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
+ nw="$nw -Wvla" # warnings in gettext.h
+ nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
+ nw="$nw -Wswitch-enum" # Too many warnings for now
+ nw="$nw -Wswitch-default" # Too many warnings for now
+ nw="$nw -Wstack-protector" # not worth working around
+ # things I might fix soon:
+ nw="$nw -Wfloat-equal" # sort.c, seq.c
+ nw="$nw -Wmissing-format-attribute" # copy.c
+ nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
+ nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
+ nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c
+ nw="$nw -Wformat-extra-args" # sdiff.c
+ # ?? -Wstrict-overflow
+
+
+
+ if test -n "$GCC"; then
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5
+printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; }
+ if test ${gl_cv_cc_nomfi_supported+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_cc_nomfi_supported=yes
+else
+ gl_cv_cc_nomfi_supported=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
+printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; }
+
+ if test "$gl_cv_cc_nomfi_supported" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5
+printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; }
+ if test ${gl_cv_cc_nomfi_needed+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -W -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+void f (void)
+ {
+ typedef struct { int a; int b; } s_t;
+ s_t s1 = { 0, };
+ }
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_cc_nomfi_needed=no
+else
+ gl_cv_cc_nomfi_needed=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
+printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; }
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5
+printf %s "checking whether -Wuninitialized is supported... " >&6; }
+ if test ${gl_cv_cc_uninitialized_supported+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror -Wuninitialized"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ gl_cv_cc_uninitialized_supported=yes
+else
+ gl_cv_cc_uninitialized_supported=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5
+printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
+
+ fi
+
+ # List all gcc warning categories.
+ # To compare this list to your installed GCC's, run this Bash command:
+ #
+ # comm -3 \
+ # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
+ # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort |
+ # grep -v -x -f <(
+ # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec))
+
+ gl_manywarn_set=
+ for gl_manywarn_item in \
+ -W \
+ -Wabi \
+ -Waddress \
+ -Waggressive-loop-optimizations \
+ -Wall \
+ -Wattributes \
+ -Wbad-function-cast \
+ -Wbool-compare \
+ -Wbuiltin-macro-redefined \
+ -Wcast-align \
+ -Wchar-subscripts \
+ -Wchkp \
+ -Wclobbered \
+ -Wcomment \
+ -Wcomments \
+ -Wcoverage-mismatch \
+ -Wcpp \
+ -Wdate-time \
+ -Wdeprecated \
+ -Wdeprecated-declarations \
+ -Wdesignated-init \
+ -Wdisabled-optimization \
+ -Wdiscarded-array-qualifiers \
+ -Wdiscarded-qualifiers \
+ -Wdiv-by-zero \
+ -Wdouble-promotion \
+ -Wduplicated-cond \
+ -Wempty-body \
+ -Wendif-labels \
+ -Wenum-compare \
+ -Wextra \
+ -Wformat-contains-nul \
+ -Wformat-extra-args \
+ -Wformat-nonliteral \
+ -Wformat-security \
+ -Wformat-signedness \
+ -Wformat-y2k \
+ -Wformat-zero-length \
+ -Wframe-address \
+ -Wfree-nonheap-object \
+ -Whsa \
+ -Wignored-attributes \
+ -Wignored-qualifiers \
+ -Wimplicit \
+ -Wimplicit-function-declaration \
+ -Wimplicit-int \
+ -Wincompatible-pointer-types \
+ -Winit-self \
+ -Winline \
+ -Wint-conversion \
+ -Wint-to-pointer-cast \
+ -Winvalid-memory-model \
+ -Winvalid-pch \
+ -Wjump-misses-init \
+ -Wlogical-not-parentheses \
+ -Wlogical-op \
+ -Wmain \
+ -Wmaybe-uninitialized \
+ -Wmemset-transposed-args \
+ -Wmisleading-indentation \
+ -Wmissing-braces \
+ -Wmissing-declarations \
+ -Wmissing-field-initializers \
+ -Wmissing-include-dirs \
+ -Wmissing-parameter-type \
+ -Wmissing-prototypes \
+ -Wmultichar \
+ -Wnarrowing \
+ -Wnested-externs \
+ -Wnonnull \
+ -Wnonnull-compare \
+ -Wnull-dereference \
+ -Wodr \
+ -Wold-style-declaration \
+ -Wold-style-definition \
+ -Wopenmp-simd \
+ -Woverflow \
+ -Woverlength-strings \
+ -Woverride-init \
+ -Wpacked \
+ -Wpacked-bitfield-compat \
+ -Wparentheses \
+ -Wpointer-arith \
+ -Wpointer-sign \
+ -Wpointer-to-int-cast \
+ -Wpragmas \
+ -Wreturn-local-addr \
+ -Wreturn-type \
+ -Wscalar-storage-order \
+ -Wsequence-point \
+ -Wshadow \
+ -Wshift-count-negative \
+ -Wshift-count-overflow \
+ -Wshift-negative-value \
+ -Wsizeof-array-argument \
+ -Wsizeof-pointer-memaccess \
+ -Wstack-protector \
+ -Wstrict-aliasing \
+ -Wstrict-overflow \
+ -Wstrict-prototypes \
+ -Wsuggest-attribute=const \
+ -Wsuggest-attribute=format \
+ -Wsuggest-attribute=noreturn \
+ -Wsuggest-attribute=pure \
+ -Wsuggest-final-methods \
+ -Wsuggest-final-types \
+ -Wswitch \
+ -Wswitch-bool \
+ -Wswitch-default \
+ -Wsync-nand \
+ -Wsystem-headers \
+ -Wtautological-compare \
+ -Wtrampolines \
+ -Wtrigraphs \
+ -Wtype-limits \
+ -Wuninitialized \
+ -Wunknown-pragmas \
+ -Wunsafe-loop-optimizations \
+ -Wunused \
+ -Wunused-but-set-parameter \
+ -Wunused-but-set-variable \
+ -Wunused-function \
+ -Wunused-label \
+ -Wunused-local-typedefs \
+ -Wunused-macros \
+ -Wunused-parameter \
+ -Wunused-result \
+ -Wunused-value \
+ -Wunused-variable \
+ -Wvarargs \
+ -Wvariadic-macros \
+ -Wvector-operation-performance \
+ -Wvla \
+ -Wvolatile-register-var \
+ -Wwrite-strings \
+ \
+ ; do
+ gl_manywarn_set="$gl_manywarn_set $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_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
+ gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
+ gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
+ gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
+
+ # 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_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
+ gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
+ ;;
+ esac
+ fi
+
+ # Disable specific options as needed.
+ if test "$gl_cv_cc_nomfi_needed" = yes; then
+ gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+ fi
+
+ if test "$gl_cv_cc_uninitialized_supported" = no; then
+ gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
+ fi
+
+ ws=$gl_manywarn_set
+
+
+ gl_warn_set=
+ set x $ws; shift
+ for gl_warn_item
+ do
+ case " $nw " in
+ *" $gl_warn_item "*)
+ ;;
+ *)
+ gl_warn_set="$gl_warn_set $gl_warn_item"
+ ;;
+ esac
+ done
+ ws=$gl_warn_set
+
+ for w in $ws; do
+
+as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | $as_tr_sh`
+gl_positive="$w"
+case $gl_positive in
+ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5
+printf %s "checking whether C compiler handles $w... " >&6; }
+if eval test \${$as_gl_Warn+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ eval "$as_gl_Warn=yes"
+else
+ eval "$as_gl_Warn=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+eval ac_res=\$$as_gl_Warn
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_gl_Warn"\" = x"yes"
+then :
+ as_fn_append WARN_CFLAGS " $w"
+fi
+
+
+ done
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-missing-field-initializers" >&5
+printf %s "checking whether C compiler handles -Wno-missing-field-initializers... " >&6; }
+if test ${gl_cv_warn_c__Wno_missing_field_initializers+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Wno_missing_field_initializers=yes
+else
+ gl_cv_warn_c__Wno_missing_field_initializers=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; }
+if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers"
+fi
+
+ # We need this one
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5
+printf %s "checking whether C compiler handles -Wno-sign-compare... " >&6; }
+if test ${gl_cv_warn_c__Wno_sign_compare+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Wno_sign_compare=yes
+else
+ gl_cv_warn_c__Wno_sign_compare=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_sign_compare" >&6; }
+if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -Wno-sign-compare"
+fi
+
+ # Too many warnings for now
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5
+printf %s "checking whether C compiler handles -Wno-pointer-sign... " >&6; }
+if test ${gl_cv_warn_c__Wno_pointer_sign+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Wno_pointer_sign=yes
+else
+ gl_cv_warn_c__Wno_pointer_sign=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_pointer_sign" >&6; }
+if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -Wno-pointer-sign"
+fi
+
+ # Too many warnings for now
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5
+printf %s "checking whether C compiler handles -Wno-unused-parameter... " >&6; }
+if test ${gl_cv_warn_c__Wno_unused_parameter+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Wno_unused_parameter=yes
+else
+ gl_cv_warn_c__Wno_unused_parameter=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_unused_parameter" >&6; }
+if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -Wno-unused-parameter"
+fi
+
+ # Too many warnings for now
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5
+printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; }
+if test ${gl_cv_warn_c__Wno_format_nonliteral+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Wno_format_nonliteral=yes
+else
+ gl_cv_warn_c__Wno_format_nonliteral=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; }
+if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -Wno-format-nonliteral"
+fi
+
+
+
+ # In spite of excluding -Wlogical-op above, it is enabled, as of
+ # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-logical-op" >&5
+printf %s "checking whether C compiler handles -Wno-logical-op... " >&6; }
+if test ${gl_cv_warn_c__Wno_logical_op+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__Wno_logical_op=yes
+else
+ gl_cv_warn_c__Wno_logical_op=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_logical_op" >&6; }
+if test "x$gl_cv_warn_c__Wno_logical_op" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -Wno-logical-op"
+fi
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5
+printf %s "checking whether C compiler handles -fdiagnostics-show-option... " >&6; }
+if test ${gl_cv_warn_c__fdiagnostics_show_option+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__fdiagnostics_show_option=yes
+else
+ gl_cv_warn_c__fdiagnostics_show_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5
+printf "%s\n" "$gl_cv_warn_c__fdiagnostics_show_option" >&6; }
+if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -fdiagnostics-show-option"
+fi
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5
+printf %s "checking whether C compiler handles -funit-at-a-time... " >&6; }
+if test ${gl_cv_warn_c__funit_at_a_time+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__funit_at_a_time=yes
+else
+ gl_cv_warn_c__funit_at_a_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5
+printf "%s\n" "$gl_cv_warn_c__funit_at_a_time" >&6; }
+if test "x$gl_cv_warn_c__funit_at_a_time" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -funit-at-a-time"
+fi
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fno-common" >&5
+printf %s "checking whether C compiler handles -fno-common... " >&6; }
+if test ${gl_cv_warn_c__fno_common+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CFLAGS"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fno-common"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gl_cv_warn_c__fno_common=yes
+else
+ gl_cv_warn_c__fno_common=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fno_common" >&5
+printf "%s\n" "$gl_cv_warn_c__fno_common" >&6; }
+if test "x$gl_cv_warn_c__fno_common" = xyes
+then :
+ as_fn_append WARN_CFLAGS " -fno-common"
+fi
+
+
+
+
+
+
+printf "%s\n" "#define lint 1" >>confdefs.h
+
+
+printf "%s\n" "#define _FORTIFY_SOURCE 2" >>confdefs.h
+
+
+printf "%s\n" "#define GNULIB_PORTCHECK 1" >>confdefs.h
+
+
+ # We use a slightly smaller set of warning options for lib/.
+ # Remove the following and save the result in GNULIB_WARN_CFLAGS.
+ nw=
+ nw="$nw -Wunused-macros"
+ nw="$nw -Wmissing-prototypes"
+ nw="$nw -Wold-style-definition"
+ nw="$nw -Wsuggest-attribute=pure"
+
+ gl_warn_set=
+ set x $WARN_CFLAGS; shift
+ for gl_warn_item
+ do
+ case " $nw " in
+ *" $gl_warn_item "*)
+ ;;
+ *)
+ gl_warn_set="$gl_warn_set $gl_warn_item"
+ ;;
+ esac
+ done
+ GNULIB_WARN_CFLAGS=$gl_warn_set
+
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+printf %s "checking for inline... " >&6; }
+if test ${ac_cv_c_inline+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+printf "%s\n" "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5
+printf %s "checking for variable-length arrays... " >&6; }
+if test ${ac_cv_c_vararrays+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC_NO_VLA__
+ defined
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "defined" >/dev/null 2>&1
+then :
+ ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Test for VLA support. This test is partly inspired
+ from examples in the C standard. Use at least two VLA
+ functions to detect the GCC 3.4.3 bug described in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
+ */
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ extern int n;
+ int B[100];
+ int fvla (int m, int C[m][m]);
+
+ int
+ simple (int count, int all[static count])
+ {
+ return all[count - 1];
+ }
+
+ int
+ fvla (int m, int C[m][m])
+ {
+ typedef int VLA[m][m];
+ VLA x;
+ int D[m];
+ static int (*q)[m] = &B;
+ int (*s)[n] = q;
+ return C && &x[0][0] == &D[0] && &D[0] == s[0];
+ }
+ #endif
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_vararrays=yes
+else
+ ac_cv_c_vararrays=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5
+printf "%s\n" "$ac_cv_c_vararrays" >&6; }
+ if test "$ac_cv_c_vararrays" = yes; then
+
+printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h
+
+ elif test "$ac_cv_c_vararrays" = no; then
+
+printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h
+
+ fi
+
+
+
+printf "%s\n" "#define DEFAULT_EDITOR_PROGRAM \"ed\"" >>confdefs.h
+
+
+# Extract the first word of "pr", so it can be a program name with args.
+set dummy pr; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_PR_PROGRAM+y}
+then :
+ printf %s "(cached) " >&6
+else
+ case $PR_PROGRAM in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PR_PROGRAM="$PR_PROGRAM" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_path_PR_PROGRAM="$as_dir$ac_word$ac_exec_ext"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_PR_PROGRAM" && ac_cv_path_PR_PROGRAM=""""
+ ;;
+esac
+fi
+PR_PROGRAM=$ac_cv_path_PR_PROGRAM
+if test -n "$PR_PROGRAM"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PR_PROGRAM" >&5
+printf "%s\n" "$PR_PROGRAM" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PR_PROGRAM "$PR_PROGRAM"
+_ACEOF
+
+
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes
+then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+_ACEOF
+
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+printf %s "checking for $ac_hdr that defines DIR... " >&6; }
+if eval test \${$as_ac_Header+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main (void)
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ eval "$as_ac_Header=yes"
+else
+ eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"
+then :
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+printf %s "checking for library containing opendir... " >&6; }
+if test ${ac_cv_search_opendir+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main (void)
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir
+do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test ${ac_cv_search_opendir+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_opendir+y}
+then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+printf "%s\n" "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+printf %s "checking for library containing opendir... " >&6; }
+if test ${ac_cv_search_opendir+y}
+then :
+ printf %s "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main (void)
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x
+do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test ${ac_cv_search_opendir+y}
+then :
+ break
+fi
+done
+if test ${ac_cv_search_opendir+y}
+then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+printf "%s\n" "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no
+then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
+printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
+if test ${ac_cv_header_sys_wait_h+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main (void)
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_header_sys_wait_h=yes
+else
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
+printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes
+then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+
+if test $ac_cv_func_sigprocmask = no; then
+ for ac_func in sigblock
+do :
+ ac_fn_c_check_func "$LINENO" "sigblock" "ac_cv_func_sigblock"
+if test "x$ac_cv_func_sigblock" = xyes
+then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGBLOCK 1
+_ACEOF
+
+fi
+done
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5
+printf %s "checking whether closedir returns void... " >&6; }
+if test ${ac_cv_func_closedir_void+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ ac_cv_func_closedir_void=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
+
+int
+main (void)
+{
+return closedir (opendir (".")) != 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_func_closedir_void=no
+else
+ ac_cv_func_closedir_void=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5
+printf "%s\n" "$ac_cv_func_closedir_void" >&6; }
+if test $ac_cv_func_closedir_void = yes; then
+
+printf "%s\n" "#define CLOSEDIR_VOID 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+if test "x$ac_cv_func_fork" = xyes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+printf %s "checking for working fork... " >&6; }
+if test ${ac_cv_func_fork_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ ac_cv_func_fork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main (void)
+{
+
+ /* By Ruediger Kuhlmann. */
+ return fork () < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_func_fork_works=yes
+else
+ ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+printf "%s\n" "$ac_cv_func_fork_works" >&6; }
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+printf %s "checking for working vfork... " >&6; }
+if test ${ac_cv_func_vfork_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+ if test "$cross_compiling" = yes
+then :
+ ac_cv_func_vfork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Thanks to Paul Eggert for this test. */
+$ac_includes_default
+#include <signal.h>
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+
+static void
+do_nothing (int sig)
+{
+ (void) sig;
+}
+
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
+sparc_address_test (int arg)
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+
+int
+main (void)
+{
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test (0);
+
+ /* On Solaris 2.4, changes by the child to the signal handler
+ also munge signal handlers in the parent. To detect this,
+ start by putting the parent's handler in a known state. */
+ signal (SIGTERM, SIG_DFL);
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* Alter the child's signal handler. */
+ if (signal (SIGTERM, do_nothing) != SIG_DFL)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ return (
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child munge the parent's signal handler? */
+ || signal (SIGTERM, SIG_DFL) != SIG_DFL
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_func_vfork_works=yes
+else
+ ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+printf "%s\n" "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=$ac_cv_func_vfork
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+printf "%s\n" "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+
+# When .tarball-version exists, we're building from a tarball
+# and must not make man/*.1 files depend on the generated src/version.c,
+# because that would induce a requirement to run the help2man perl script.
+# We are not yet prepared to make perl a build-from-tarball requirement.
+# Hence, here we detect .tarball-version existence. When not present,
+# we define a variable to be used in man/Makefile.am to induce the
+# proper dependency (so that man/*.1 will be rebuilt upon any version change),
+# but not when built from a tarball.
+
+test -f $srcdir/.tarball-version \
+ && SRC_VERSION_C= \
+ || SRC_VERSION_C=../src/version.c
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+printf %s "checking whether NLS is requested... " >&6; }
+ # Check whether --enable-nls was given.
+if test ${enable_nls+y}
+then :
+ enableval=$enable_nls; USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+printf "%s\n" "$USE_NLS" >&6; }
+
+
+
+
+ GETTEXT_MACRO_VERSION=0.19
+
+
+
+
+# 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 "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_MSGFMT+y}
+then :
+ printf %s "(cached) " >&6
+else
+ case "$MSGFMT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; 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..." >&5
+ if $ac_dir/$ac_word --statistics /dev/null >&5 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); then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
+printf "%s\n" "$MSGFMT" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_GMSGFMT+y}
+then :
+ printf %s "(cached) " >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
+printf "%s\n" "$GMSGFMT" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+
+ 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
+
+ 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
+
+
+
+# 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 "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_XGETTEXT+y}
+then :
+ printf %s "(cached) " >&6
+else
+ case "$XGETTEXT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; 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..." >&5
+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 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); then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
+printf "%s\n" "$XGETTEXT" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ rm -f messages.po
+
+ 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
+
+
+
+# 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 "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_MSGMERGE+y}
+then :
+ printf %s "(cached) " >&6
+else
+ case "$MSGMERGE" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; 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..." >&5
+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+ ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
+printf "%s\n" "$MSGMERGE" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ test -n "$localedir" || localedir='${datadir}/locale'
+
+
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+
+
+ ac_config_commands="$ac_config_commands po-directories"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
+printf %s "checking for CFPreferencesCopyAppValue... " >&6; }
+if test ${gt_cv_func_CFPreferencesCopyAppValue+y}
+then :
+ printf %s "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <CoreFoundation/CFPreferences.h>
+int
+main (void)
+{
+CFPreferencesCopyAppValue(NULL, NULL)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gt_cv_func_CFPreferencesCopyAppValue=yes
+else
+ gt_cv_func_CFPreferencesCopyAppValue=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
+printf %s "checking for CFLocaleCopyCurrent... " >&6; }
+if test ${gt_cv_func_CFLocaleCopyCurrent+y}
+then :
+ printf %s "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <CoreFoundation/CFLocale.h>
+int
+main (void)
+{
+CFLocaleCopyCurrent();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ gt_cv_func_CFLocaleCopyCurrent=yes
+else
+ gt_cv_func_CFLocaleCopyCurrent=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
+printf "%s\n" "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+
+printf "%s\n" "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+
+ 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
+
+
+
+
+
+
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ 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"
+
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+
+
+ 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
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+'
+ 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
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
+printf %s "checking for GNU gettext in libc... " >&6; }
+if eval test \${$gt_func_gnugettext_libc+y}
+then :
+ printf %s "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+
+int
+main (void)
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ eval "$gt_func_gnugettext_libc=yes"
+else
+ eval "$gt_func_gnugettext_libc=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$gt_func_gnugettext_libc
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+
+
+
+
+
+ am_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCICONV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+printf %s "checking for iconv... " >&6; }
+if test ${am_cv_func_iconv+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
+printf "%s\n" "$am_cv_func_iconv" >&6; }
+ if test "$am_cv_func_iconv" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+printf %s "checking for working iconv... " >&6; }
+if test ${am_cv_func_iconv_works+y}
+then :
+ printf %s "(cached) " >&6
+else
+
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main (void)
+{
+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 ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ ICONV_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,
+ &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 ICONV_CONST char input[] = "\263";
+ char buf[10];
+ ICONV_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,
+ &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 ICONV_CONST char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ &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 ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ ICONV_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,
+ &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;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ am_cv_func_iconv_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ test "$am_cv_func_iconv_works" = no || break
+ done
+ LIBS="$am_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+printf "%s\n" "$am_cv_func_iconv_works" >&6; }
+ 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
+
+printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h
+
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+printf %s "checking how to link with libiconv... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+printf "%s\n" "$LIBICONV" >&6; }
+ else
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libintl-prefix was given.
+if test ${with_libintl_prefix+y}
+then :
+ withval=$with_libintl_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+
+fi
+
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ LIBINTL_PREFIX=
+ HAVE_LIBINTL=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='intl '
+ 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"
+ 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" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+ else
+ :
+ fi
+ else
+ 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
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$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"; 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"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; 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
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ 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
+ if test "$acl_hardcode_direct" = yes; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ 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
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
+ fi
+ fi
+ 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" = 'intl'; then
+ LIBINTL_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" = 'intl'; then
+ LIBINTL_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ 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 $INCINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ 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
+ INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; 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 $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ 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
+ 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*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
+printf %s "checking for GNU gettext in libintl... " >&6; }
+if eval test \${$gt_func_gnugettext_libintl+y}
+then :
+ printf %s "(cached) " >&6
+else
+ gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 *);
+
+int
+main (void)
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ eval "$gt_func_gnugettext_libintl=yes"
+else
+ eval "$gt_func_gnugettext_libintl=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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 *);
+
+int
+main (void)
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"
+fi
+eval ac_res=\$$gt_func_gnugettext_libintl
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ fi
+
+ 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
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ 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
+
+printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h
+
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5
+printf %s "checking whether to use NLS... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+printf "%s\n" "$USE_NLS" >&6; }
+ if test "$USE_NLS" = "yes"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
+printf %s "checking where the gettext function comes from... " >&6; }
+ 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
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5
+printf "%s\n" "$gt_source" >&6; }
+ 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
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
+printf %s "checking how to link with libintl... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
+printf "%s\n" "$LIBINTL" >&6; }
+
+ for element in $INCINTL; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+ fi
+
+
+printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h
+
+
+printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h
+
+ fi
+
+ POSUB=po
+ fi
+
+
+
+ INTLLIBS="$LIBINTL"
+
+
+
+
+
+
+
+XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
+
+ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile gnulib-tests/Makefile man/Makefile po/Makefile.in"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
+ as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS=
+if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then
+ as_fn_error $? "conditional \"GNU_MAKE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+CONFIG_INCLUDE=lib/config.h
+
+if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then
+ as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then
+ as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then
+ as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+
+ gl_libobjs=
+ gl_ltlibobjs=
+ if test -n "$gl_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ 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"
+ done
+ fi
+ gl_LIBOBJS=$gl_libobjs
+
+ gl_LTLIBOBJS=$gl_ltlibobjs
+
+
+
+if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+ gltests_libobjs=
+ gltests_ltlibobjs=
+ if test -n "$gltests_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ 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"
+ done
+ fi
+ gltests_LIBOBJS=$gltests_libobjs
+
+ gltests_LTLIBOBJS=$gltests_ltlibobjs
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+# The user is always right.
+if ${PATH_SEPARATOR+false} :; then
+ 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
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+export as_nl
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ printf "%s\n" "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by GNU diffutils $as_me 3.5, which was
+generated by GNU Autoconf 2.69.147-5ad35. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_links="$ac_config_links"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration links:
+$config_links
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-diffutils@gnu.org>.
+GNU diffutils home page: <http://www.gnu.org/software/diffutils/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`printf "%s\n" "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+GNU diffutils config.status 3.5
+configured by $0, generated by GNU Autoconf 2.69.147-5ad35,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2015 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ printf "%s\n" "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ printf "%s\n" "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ printf "%s\n" "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ printf "%s\n" "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+GNUmakefile=$GNUmakefile
+# 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%}"
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;
+ "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;;
+ "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+ "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
+ test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers
+ test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links
+ test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`printf "%s\n" "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ printf "%s\n" "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ printf "%s\n" "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+ :L)
+ #
+ # CONFIG_LINK
+ #
+
+ if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
+ :
+ else
+ # Prefer the file from the source tree if names are identical.
+ if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
+ ac_source=$srcdir/$ac_source
+ fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
+printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;}
+
+ if test ! -r "$ac_source"; then
+ as_fn_error $? "$ac_source: file not found" "$LINENO" 5
+ fi
+ rm -f "$ac_file"
+
+ # Try a relative symlink, then a hard link, then a copy.
+ case $ac_source in
+ [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
+ *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
+ esac
+ ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+ ln "$ac_source" "$ac_file" 2>/dev/null ||
+ cp -p "$ac_source" "$ac_file" ||
+ as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
+ fi
+ ;;
+ :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$am_mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
+}
+ ;;
+ "po-directories":C)
+ 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 ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..936338f
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,180 @@
+# Configure template for GNU Diffutils.
+
+# Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2016
+# Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_PREREQ(2.61)
+
+AC_INIT([GNU diffutils],
+ m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+ [bug-diffutils@gnu.org])
+
+AC_CONFIG_SRCDIR([src/diff.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects
+ color-tests parallel-tests])
+AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
+
+AC_CONFIG_HEADER([lib/config.h:lib/config.hin])
+
+AC_PROG_AWK
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_MISSING_PROG([HELP2MAN], [help2man])
+AC_PROG_RANLIB
+gl_EARLY
+gl_USE_SYSTEM_EXTENSIONS
+gl_INIT
+
+AC_ARG_ENABLE([gcc-warnings],
+ [AS_HELP_STRING([--enable-gcc-warnings],
+ [turn on lots of GCC warnings (for developers)])],
+ [case $enableval in
+ yes|no) ;;
+ *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
+ esac
+ gl_gcc_warnings=$enableval],
+ [if test -d "$srcdir"/.git; then
+ gl_gcc_warnings=yes
+ else
+ gl_gcc_warnings=no
+ fi]
+)
+
+if test "$gl_gcc_warnings" = yes; then
+ gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
+ AC_SUBST([WERROR_CFLAGS])
+
+ nw=
+ # This, $nw, is the list of warnings we disable.
+ nw="$nw -Wdeclaration-after-statement" # too useful to forbid
+ nw="$nw -Waggregate-return" # anachronistic
+ nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
+ nw="$nw -Wc++-compat" # We don't care about C++ compilers
+ nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
+ nw="$nw -Wtraditional" # Warns on #elif which we use often
+ nw="$nw -Wcast-qual" # Too many warnings for now
+ nw="$nw -Wconversion" # Too many warnings for now
+ nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
+ nw="$nw -Wsign-conversion" # Too many warnings for now
+ nw="$nw -Wtraditional-conversion" # Too many warnings for now
+ nw="$nw -Wunreachable-code" # Too many warnings for now
+ nw="$nw -Wpadded" # Our structs are not padded
+ nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
+ nw="$nw -Wlogical-op" # any use of fwrite provokes this
+ nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
+ nw="$nw -Wvla" # warnings in gettext.h
+ nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
+ nw="$nw -Wswitch-enum" # Too many warnings for now
+ nw="$nw -Wswitch-default" # Too many warnings for now
+ nw="$nw -Wstack-protector" # not worth working around
+ # things I might fix soon:
+ nw="$nw -Wfloat-equal" # sort.c, seq.c
+ nw="$nw -Wmissing-format-attribute" # copy.c
+ nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
+ nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
+ nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c
+ nw="$nw -Wformat-extra-args" # sdiff.c
+ # ?? -Wstrict-overflow
+
+ gl_MANYWARN_ALL_GCC([ws])
+ gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
+ for w in $ws; do
+ gl_WARN_ADD([$w])
+ done
+ gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
+ gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
+ gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
+ gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
+ gl_WARN_ADD([-Wno-format-nonliteral])
+
+ # In spite of excluding -Wlogical-op above, it is enabled, as of
+ # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
+ gl_WARN_ADD([-Wno-logical-op])
+
+ gl_WARN_ADD([-fdiagnostics-show-option])
+ gl_WARN_ADD([-funit-at-a-time])
+ gl_WARN_ADD([-fno-common])
+
+ AC_SUBST([WARN_CFLAGS])
+
+ AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
+ AC_DEFINE([_FORTIFY_SOURCE], [2],
+ [enable compile-time and run-time bounds-checking, and some warnings])
+ AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
+
+ # We use a slightly smaller set of warning options for lib/.
+ # Remove the following and save the result in GNULIB_WARN_CFLAGS.
+ nw=
+ nw="$nw -Wunused-macros"
+ nw="$nw -Wmissing-prototypes"
+ nw="$nw -Wold-style-definition"
+ nw="$nw -Wsuggest-attribute=pure"
+ gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
+ AC_SUBST([GNULIB_WARN_CFLAGS])
+fi
+
+AC_C_INLINE
+AC_C_VARARRAYS
+
+AC_DEFINE([DEFAULT_EDITOR_PROGRAM], ["ed"],
+ [Name of editor program, unless overridden.])
+
+AC_PATH_PROG([PR_PROGRAM], [pr], [""])
+AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR_PROGRAM"], [Name of "pr" program.])
+
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_HEADER_DIRENT
+AC_HEADER_SYS_WAIT
+AC_TYPE_PID_T
+
+AC_CHECK_FUNCS_ONCE([sigaction sigprocmask strcasecoll stricoll])
+if test $ac_cv_func_sigprocmask = no; then
+ AC_CHECK_FUNCS([sigblock])
+fi
+AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_FORK
+
+# When .tarball-version exists, we're building from a tarball
+# and must not make man/*.1 files depend on the generated src/version.c,
+# because that would induce a requirement to run the help2man perl script.
+# We are not yet prepared to make perl a build-from-tarball requirement.
+# Hence, here we detect .tarball-version existence. When not present,
+# we define a variable to be used in man/Makefile.am to induce the
+# proper dependency (so that man/*.1 will be rebuilt upon any version change),
+# but not when built from a tarball.
+AC_SUBST([SRC_VERSION_C])
+test -f $srcdir/.tarball-version \
+ && SRC_VERSION_C= \
+ || SRC_VERSION_C=../src/version.c
+
+AM_GNU_GETTEXT([external], [need-ngettext])
+AM_GNU_GETTEXT_VERSION([0.19.2])
+XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
+
+AC_CONFIG_FILES([
+ Makefile doc/Makefile
+ lib/Makefile
+ src/Makefile
+ tests/Makefile
+ gnulib-tests/Makefile
+ man/Makefile
+ po/Makefile.in
+])
+AC_OUTPUT
diff --git a/dist-check.mk b/dist-check.mk
new file mode 100644
index 0000000..06d8d90
--- /dev/null
+++ b/dist-check.mk
@@ -0,0 +1,171 @@
+# Most of this is probably too coreutils-centric to be useful to other packages.
+
+bin=bin-$$$$
+
+write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
+
+tmpdir = $(abs_top_builddir)/tests/torture
+
+t=$(tmpdir)/$(PACKAGE)/test
+pfx=$(t)/i
+
+built_programs = \
+ $$(echo 'spy:;@echo $$(bin_PROGRAMS)' \
+ | MAKEFLAGS= $(MAKE) -s -C src -f Makefile -f - spy \
+ | fmt -1 | sed 's,$(EXEEXT)$$,,' | sort -u)
+
+# More than once, tainted build and source directory names would
+# have caused at least one "make check" test to apply "chmod 700"
+# to all directories under $HOME. Make sure it doesn't happen again.
+tp = $(tmpdir)/taint
+t_prefix = $(tp)/a
+t_taint = '$(t_prefix) b'
+fake_home = $(tp)/home
+
+# When extracting from a distribution tarball, extract using the fastest
+# method possible. With dist-xz, that means using the *.xz file.
+ifneq ('', $(filter *.xz, $(DIST_ARCHIVES)))
+ tar_decompress_opt_ = J
+ suffix_ = xz
+else
+ ifneq ('', $(filter *.gz, $(DIST_ARCHIVES)))
+ tar_decompress_opt_ = z
+ suffix_ = gz
+ else
+ tar_decompress_opt_ = j
+ suffix_ = bz2
+ endif
+endif
+amtar_extract_ = $(AMTAR) -$(tar_decompress_opt_)xf
+preferred_tarball_ = $(distdir).tar.$(suffix_)
+
+# Ensure that tests run from tainted build and src dir names work,
+# and don't affect anything in $HOME. Create witness files in $HOME,
+# record their attributes, and build/test. Then ensure that the
+# witnesses were not affected.
+# Skip this test when using libtool, since libtool-generated scripts
+# cannot deal with a space-tainted srcdir.
+ALL_RECURSIVE_TARGETS += taint-distcheck
+taint-distcheck: $(DIST_ARCHIVES)
+ grep '^[ ]*LT_INIT' configure.ac >/dev/null && exit 0 || :
+ test -d $(t_taint) && chmod -R 700 $(t_taint) || :
+ -rm -rf $(t_taint) $(fake_home)
+ mkdir -p $(t_prefix) $(t_taint) $(fake_home)
+ $(amtar_extract_) $(preferred_tarball_) -C $(t_taint)
+ mkfifo $(fake_home)/fifo
+ touch $(fake_home)/f
+ mkdir -p $(fake_home)/d/e
+ ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
+ HOME=$(fake_home); export HOME; \
+ cd $(t_taint)/$(distdir) \
+ && ./configure \
+ && $(MAKE) \
+ && $(MAKE) check \
+ && ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
+ && diff $(tp)/.ls-before $(tp)/.ls-after \
+ && test -d $(t_prefix)
+ rm -rf $(tp)
+
+# Verify that a twisted use of --program-transform-name=PROGRAM works.
+define install-transform-check
+ echo running install-transform-check \
+ && rm -rf $(pfx) \
+ && $(MAKE) program_transform_name='s/.*/zyx/' \
+ prefix=$(pfx) install \
+ && test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
+ && test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
+endef
+
+# Install, then verify that all binaries and man pages are in place.
+# Note that neither the binary, ginstall, nor the [.1 man page is installed.
+define my-instcheck
+ echo running my-instcheck; \
+ $(MAKE) prefix=$(pfx) install \
+ && test ! -f $(pfx)/bin/ginstall \
+ && { fail=0; \
+ for i in $(built_programs); do \
+ test "$$i" = ginstall && i=install; \
+ for j in "$(pfx)/bin/$$i" \
+ "$(pfx)/share/man/man1/$$i.1"; do \
+ case $$j in *'[.1') continue;; esac; \
+ test -f "$$j" && : \
+ || { echo "$$j not installed"; fail=1; }; \
+ done; \
+ done; \
+ test $$fail = 1 && exit 1 || :; \
+ }
+endef
+
+# The hard-linking for-loop below ensures that there is a bin/ directory
+# full of all of the programs under test (except the ones that are required
+# for basic Makefile rules), all symlinked to the just-built "false" program.
+# This is to ensure that if ever a test neglects to make PATH include
+# the build srcdir, these always-failing programs will run.
+# Otherwise, it is too easy to test the wrong programs.
+# Note that "false" itself is a symlink to true, so it too will malfunction.
+define coreutils-path-check
+ { \
+ echo running coreutils-path-check; \
+ if test -f $(srcdir)/src/true.c; then \
+ fail=1; \
+ mkdir $(bin) \
+ && ($(write_loser)) > $(bin)/loser \
+ && chmod a+x $(bin)/loser \
+ && for i in $(built_programs); do \
+ case $$i in \
+ rm|expr|basename|echo|sort|ls|tr);; \
+ cat|dirname|mv|wc);; \
+ *) ln $(bin)/loser $(bin)/$$i;; \
+ esac; \
+ done \
+ && ln -sf ../src/true $(bin)/false \
+ && PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH \
+ $(MAKE) -C tests check \
+ && { test -d gnulib-tests \
+ && $(MAKE) -C gnulib-tests check \
+ || :; } \
+ && rm -rf $(bin) \
+ && fail=0; \
+ else \
+ fail=0; \
+ fi; \
+ test $$fail = 1 && exit 1 || :; \
+ }
+endef
+
+# Use this to make sure we don't run these programs when building
+# from a virgin compressed tarball file, below.
+null_AM_MAKEFLAGS ?= \
+ ACLOCAL=false \
+ AUTOCONF=false \
+ AUTOMAKE=false \
+ AUTOHEADER=false \
+ GPERF=false \
+ MAKEINFO=false
+
+ALL_RECURSIVE_TARGETS += my-distcheck
+my-distcheck: $(DIST_ARCHIVES) $(local-check)
+ $(MAKE) syntax-check
+ $(MAKE) check
+ -rm -rf $(t)
+ mkdir -p $(t)
+ $(amtar_extract_) $(preferred_tarball_) -C $(t)
+ (set -e; cd $(t)/$(distdir); \
+ ./configure --quiet --enable-gcc-warnings --disable-nls; \
+ $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)'; \
+ $(MAKE) dvi; \
+ $(install-transform-check); \
+ $(my-instcheck); \
+ $(coreutils-path-check); \
+ $(MAKE) distclean \
+ )
+ (cd $(t) && mv $(distdir) $(distdir).old \
+ && $(amtar_extract_) - ) < $(preferred_tarball_)
+ find $(t)/$(distdir).old $(t)/$(distdir) -name .deps | xargs rm -rf
+ diff -ur $(t)/$(distdir).old $(t)/$(distdir)
+ -rm -rf $(t)
+ rmdir $(tmpdir)/$(PACKAGE) $(tmpdir)
+ @echo "========================"; \
+ echo "ready for distribution:"; \
+ for i in $(DIST_ARCHIVES); do echo " $$i"; done; \
+ echo "========================"
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..4f738c6
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,23 @@
+# Makefile for GNU diffutils documentation.
+
+# Copyright (C) 2001-2002, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AM_MAKEINFOFLAGS = --no-split
+
+info_TEXINFOS = diffutils.texi
+diffutils_TEXINFOS = fdl.texi
+
+EXTRA_DIST = diagmeet.note
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..23a7fae
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,1667 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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@
+
+# Makefile for GNU diffutils documentation.
+
+# Copyright (C) 2001-2002, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+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@
+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@
+subdir = doc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
+ $(srcdir)/stamp-vti $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 =
+SOURCES =
+DIST_SOURCES =
+AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
+am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
+am__v_DVIPS_0 = @echo " DVIPS " $@;
+am__v_DVIPS_1 =
+AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
+am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
+am__v_MAKEINFO_1 =
+AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
+am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
+am__v_INFOHTML_0 = @echo " INFOHTML" $@;
+am__v_INFOHTML_1 =
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
+am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
+am__v_TEXI2DVI_1 =
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
+am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
+am__v_TEXI2PDF_1 =
+AM_V_texinfo = $(am__v_texinfo_@AM_V@)
+am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
+am__v_texinfo_0 = -q
+am__v_texinfo_1 =
+AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
+am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+am__v_texidevnull_0 = > /dev/null
+am__v_texidevnull_1 =
+INFO_DEPS = $(srcdir)/diffutils.info
+TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
+am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
+DVIS = diffutils.dvi
+PDFS = diffutils.pdf
+PSS = diffutils.ps
+HTMLS = diffutils.html
+TEXINFOS = diffutils.texi
+TEXI2DVI = texi2dvi
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+MAKEINFOHTML = $(MAKEINFO) --html
+AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
+DVIPS = dvips
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__installdirs = "$(DESTDIR)$(infodir)"
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(diffutils_TEXINFOS) $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/mdate-sh \
+ $(top_srcdir)/build-aux/texinfo.tex
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_MAKEINFOFLAGS = --no-split
+info_TEXINFOS = diffutils.texi
+diffutils_TEXINFOS = fdl.texi
+EXTRA_DIST = diagmeet.note
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .dvi .html .info .pdf .ps .texi
+$(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) --gnu doc/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/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):
+
+.texi.info:
+ $(AM_V_MAKEINFO)$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+ -I $(srcdir) --no-split -o $@-t \
+ $<
+ $(AM_V_at)mv -f $@-t $@
+
+.texi.dvi:
+ $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
+ $<
+
+.texi.pdf:
+ $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+ $<
+
+.texi.html:
+ $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+ $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $(@:.html=.htp) $<; \
+ then \
+ rm -rf $@ && mv $(@:.html=.htp) $@; \
+ else \
+ rm -rf $(@:.html=.htp); exit 1; \
+ fi
+$(srcdir)/diffutils.info: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS)
+diffutils.dvi: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS)
+diffutils.pdf: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS)
+diffutils.html: diffutils.texi $(srcdir)/version.texi $(diffutils_TEXINFOS)
+$(srcdir)/version.texi: $(srcdir)/stamp-vti
+$(srcdir)/stamp-vti: diffutils.texi $(top_srcdir)/configure
+ @(dir=.; test -f ./diffutils.texi || dir=$(srcdir); \
+ set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/diffutils.texi`; \
+ echo "@set UPDATED $$1 $$2 $$3"; \
+ echo "@set UPDATED-MONTH $$2 $$3"; \
+ echo "@set EDITION $(VERSION)"; \
+ echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
+ (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
+ || (echo "Updating $(srcdir)/version.texi" && \
+ cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
+ mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
+ rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
+ @cp $(srcdir)/version.texi $@
+
+mostlyclean-vti:
+ -rm -f vti.tmp* $(srcdir)/version.texi.tmp*
+
+maintainer-clean-vti:
+ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
+.dvi.ps:
+ $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) $(AM_V_texinfo) -o $@ $<
+
+uninstall-dvi-am:
+ @$(NORMAL_UNINSTALL)
+ @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
+ rm -f "$(DESTDIR)$(dvidir)/$$f"; \
+ done
+
+uninstall-html-am:
+ @$(NORMAL_UNINSTALL)
+ @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
+ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
+ done
+
+uninstall-info-am:
+ @$(PRE_UNINSTALL)
+ @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
+ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
+ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
+ done; \
+ else :; fi
+ @$(NORMAL_UNINSTALL)
+ @list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
+ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile"; \
+ rm -f $$relfile; \
+ else :; fi); \
+ done
+
+uninstall-pdf-am:
+ @$(NORMAL_UNINSTALL)
+ @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
+ done
+
+uninstall-ps-am:
+ @$(NORMAL_UNINSTALL)
+ @list='$(PSS)'; test -n "$(psdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(psdir)/$$f"; \
+ done
+
+dist-info: $(INFO_DEPS)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ list='$(INFO_DEPS)'; \
+ for base in $$list; do \
+ case $$base in \
+ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
+ if test -f $$base; then \
+ file=./$$base; \
+ else \
+ file=$(srcdir)/$$base; \
+ fi; \
+ if test -f $$file && test ! -f "$(distdir)/$$base"; then \
+ cp -p $$file "$(distdir)/$$base"; \
+ fi; \
+ done
+
+mostlyclean-aminfo:
+ -rm -rf diffutils.t2d diffutils.t2p
+
+clean-aminfo:
+ -test -z "diffutils.dvi diffutils.pdf diffutils.ps diffutils.html" \
+ || rm -rf diffutils.dvi diffutils.pdf diffutils.ps diffutils.html
+
+maintainer-clean-aminfo:
+ -test -z "$(INFO_DEPS)" || rm -f $(INFO_DEPS)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(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
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-info
+check-am: all-am
+check: check-am
+all-am: Makefile $(INFO_DEPS)
+installdirs:
+ for dir in "$(DESTDIR)$(infodir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+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:
+
+clean-generic:
+
+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)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-aminfo clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am: $(DVIS)
+
+html: html-am
+
+html-am: $(HTMLS)
+
+info: info-am
+
+info-am: $(INFO_DEPS)
+
+install-data-am: install-info-am
+
+install-dvi: install-dvi-am
+
+install-dvi-am: $(DVIS)
+ @$(NORMAL_INSTALL)
+ @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
+ done
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+ @$(NORMAL_INSTALL)
+ @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ $(am__strip_dir) \
+ d2=$$d$$p; \
+ if test -d "$$d2"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
+ else \
+ list2="$$list2 $$d2"; \
+ fi; \
+ done; \
+ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done; }
+install-info: install-info-am
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
+ fi; \
+ for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
+ if test -f $$file; then \
+ echo ./$$file; \
+ else \
+ echo $(srcdir)/$$file; \
+ fi; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
+ @$(POST_INSTALL)
+ @if $(am__can_run_installinfo); then \
+ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
+ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
+ done; \
+ else : ; fi
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am: $(PDFS)
+ @$(NORMAL_INSTALL)
+ @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
+install-ps: install-ps-am
+
+install-ps-am: $(PSS)
+ @$(NORMAL_INSTALL)
+ @list='$(PSS)'; test -n "$(psdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-aminfo \
+ maintainer-clean-generic maintainer-clean-vti
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
+
+pdf: pdf-am
+
+pdf-am: $(PDFS)
+
+ps: ps-am
+
+ps-am: $(PSS)
+
+uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
+ uninstall-pdf-am uninstall-ps-am
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
+ cscopelist-am ctags-am dist-info distclean distclean-generic \
+ 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 \
+ maintainer-clean maintainer-clean-aminfo \
+ maintainer-clean-generic maintainer-clean-vti mostlyclean \
+ mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \
+ pdf-am ps ps-am tags-am uninstall uninstall-am \
+ uninstall-dvi-am uninstall-html-am uninstall-info-am \
+ uninstall-pdf-am uninstall-ps-am
+
+.PRECIOUS: Makefile
+
+
+# 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/doc/diagmeet.note b/doc/diagmeet.note
new file mode 100644
index 0000000..2d30d21
--- /dev/null
+++ b/doc/diagmeet.note
@@ -0,0 +1,62 @@
+Here is a comparison matrix which shows a case in which
+it is possible for the forward and backward scan in 'diag'
+to meet along a nonzero length of diagonal simultaneous
+(so that bdiag[d] and fdiag[d] are not equal)
+even though there is no snake on that diagonal at the meeting point.
+
+
+ 85 1 1 1 159 1 1 17
+ 1 2 3 4
+60
+ 1 2
+1
+ 2 2 3 4
+71
+ 3 3 4 5
+85
+ 4 3 4 5
+17
+ 5 4 5
+1
+ 6 4 5 6
+183
+ 7 5 6 7
+10
+ 8 6 7
+1
+ 9 6 7 8
+12
+ 7 8 9 10
+13
+ 10 8 9 10
+14
+ 10 9 10
+17
+ 10 10
+1
+ 10 9 10
+1
+ 8 10 10 10
+183
+ 8 7 9 9 9
+10
+ 7 6 8 9 8 8
+1
+ 6 5 7 7
+1
+ 5 6 6
+1
+ 5 5 5
+50
+ 5 4 4 4
+1
+ 4 3 3
+85
+ 5 4 3 2 2
+1
+ 2 1
+17
+ 5 4 3 2 1 1
+1
+ 1 0
+ 85 1 1 1 159 1 1 17
diff --git a/doc/diffutils.info b/doc/diffutils.info
new file mode 100644
index 0000000..179f11d
--- /dev/null
+++ b/doc/diffutils.info
@@ -0,0 +1,5313 @@
+This is diffutils.info-t, produced by makeinfo version 6.1 from
+diffutils.texi.
+
+This manual is for GNU Diffutils (version 3.5, 4 August 2016), and
+documents the GNU 'diff', 'diff3', 'sdiff', and 'cmp' commands for
+showing the differences between files and the GNU 'patch' command for
+using their output to update files.
+
+ Copyright (C) 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2016 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation License,
+ Version 1.3 or any later version published by the Free Software
+ Foundation; with no Invariant Sections, no Front-Cover Texts, and
+ no Back-Cover Texts. A copy of the license is included in the
+ section entitled "GNU Free Documentation License."
+INFO-DIR-SECTION Individual utilities
+START-INFO-DIR-ENTRY
+* cmp: (diffutils)Invoking cmp. Compare 2 files byte by byte.
+* diff: (diffutils)Invoking diff. Compare 2 files line by line.
+* diff3: (diffutils)Invoking diff3. Compare 3 files line by line.
+* patch: (diffutils)Invoking patch. Apply a patch to a file.
+* sdiff: (diffutils)Invoking sdiff. Merge 2 files side-by-side.
+END-INFO-DIR-ENTRY
+
+INFO-DIR-SECTION Text creation and manipulation
+START-INFO-DIR-ENTRY
+* Diffutils: (diffutils). Comparing and merging files.
+END-INFO-DIR-ENTRY
+
+
+File: diffutils.info-t, Node: Top, Next: Overview, Up: (dir)
+
+Comparing and Merging Files
+***************************
+
+This manual is for GNU Diffutils (version 3.5, 4 August 2016), and
+documents the GNU 'diff', 'diff3', 'sdiff', and 'cmp' commands for
+showing the differences between files and the GNU 'patch' command for
+using their output to update files.
+
+ Copyright (C) 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2016 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation License,
+ Version 1.3 or any later version published by the Free Software
+ Foundation; with no Invariant Sections, no Front-Cover Texts, and
+ no Back-Cover Texts. A copy of the license is included in the
+ section entitled "GNU Free Documentation License."
+
+* Menu:
+
+* Overview:: Preliminary information.
+* Comparison:: What file comparison means.
+
+* Output Formats:: Formats for two-way difference reports.
+* Incomplete Lines:: Lines that lack trailing newlines.
+* Comparing Directories:: Comparing files and directories.
+* Adjusting Output:: Making 'diff' output prettier.
+* diff Performance:: Making 'diff' smarter or faster.
+
+* Comparing Three Files:: Formats for three-way difference reports.
+* diff3 Merging:: Merging from a common ancestor.
+
+* Interactive Merging:: Interactive merging with 'sdiff'.
+
+* Merging with patch:: Using 'patch' to change old files into new ones.
+* Making Patches:: Tips for making and using patch distributions.
+
+* Invoking cmp:: Compare two files byte by byte.
+* Invoking diff:: Compare two files line by line.
+* Invoking diff3:: Compare three files line by line.
+* Invoking patch:: Apply a diff file to an original.
+* Invoking sdiff:: Side-by-side merge of file differences.
+
+* Standards conformance:: Conformance to the POSIX standard.
+* Projects:: If you've found a bug or other shortcoming.
+
+* Copying This Manual:: How to make copies of this manual.
+* Translations:: Available translations of this manual.
+* Index:: Index.
+
+
+File: diffutils.info-t, Node: Overview, Next: Comparison, Prev: Top, Up: Top
+
+Overview
+********
+
+Computer users often find occasion to ask how two files differ. Perhaps
+one file is a newer version of the other file. Or maybe the two files
+started out as identical copies but were changed by different people.
+
+ You can use the 'diff' command to show differences between two files,
+or each corresponding file in two directories. 'diff' outputs
+differences between files line by line in any of several formats,
+selectable by command line options. This set of differences is often
+called a "diff" or "patch". For files that are identical, 'diff'
+normally produces no output; for binary (non-text) files, 'diff'
+normally reports only that they are different.
+
+ You can use the 'cmp' command to show the byte and line numbers where
+two files differ. 'cmp' can also show all the bytes that differ between
+the two files, side by side. A way to compare two files character by
+character is the Emacs command 'M-x compare-windows'. *Note Other
+Window: (emacs)Other Window, for more information on that command.
+
+ You can use the 'diff3' command to show differences among three
+files. When two people have made independent changes to a common
+original, 'diff3' can report the differences between the original and
+the two changed versions, and can produce a merged file that contains
+both persons' changes together with warnings about conflicts.
+
+ You can use the 'sdiff' command to merge two files interactively.
+
+ You can use the set of differences produced by 'diff' to distribute
+updates to text files (such as program source code) to other people.
+This method is especially useful when the differences are small compared
+to the complete files. Given 'diff' output, you can use the 'patch'
+program to update, or "patch", a copy of the file. If you think of
+'diff' as subtracting one file from another to produce their difference,
+you can think of 'patch' as adding the difference to one file to
+reproduce the other.
+
+ This manual first concentrates on making diffs, and later shows how
+to use diffs to update files.
+
+ GNU 'diff' was written by Paul Eggert, Mike Haertel, David Hayes,
+Richard Stallman, and Len Tower. Wayne Davison designed and implemented
+the unified output format. The basic algorithm is described by Eugene
+W. Myers in "An O(ND) Difference Algorithm and its Variations",
+'Algorithmica' Vol. 1, 1986, pp. 251-266,
+<http://dx.doi.org/10.1007/BF01840446>; and in "A File Comparison
+Program", Webb Miller and Eugene W. Myers, 'Software--Practice and
+Experience' Vol. 15, 1985, pp. 1025-1040,
+<http://dx.doi.org/10.1002/spe.4380151102>. The algorithm was
+independently discovered as described by Esko Ukkonen in "Algorithms for
+Approximate String Matching", 'Information and Control' Vol. 64, 1985,
+pp. 100-118, <http://dx.doi.org/10.1016/S0019-9958(85)80046-2>. Related
+algorithms are surveyed by Alfred V. Aho in section 6.3 of "Algorithms
+for Finding Patterns in Strings", 'Handbook of Theoretical Computer
+Science' (Jan Van Leeuwen, ed.), Vol. A, 'Algorithms and Complexity',
+Elsevier/MIT Press, 1990, pp. 255-300.
+
+ GNU 'diff3' was written by Randy Smith. GNU 'sdiff' was written by
+Thomas Lord. GNU 'cmp' was written by Torbjo"rn Granlund and David
+MacKenzie.
+
+ GNU 'patch' was written mainly by Larry Wall and Paul Eggert; several
+GNU enhancements were contributed by Wayne Davison and David MacKenzie.
+Parts of this manual are adapted from a manual page written by Larry
+Wall, with his permission.
+
+
+File: diffutils.info-t, Node: Comparison, Next: Output Formats, Prev: Overview, Up: Top
+
+1 What Comparison Means
+***********************
+
+There are several ways to think about the differences between two files.
+One way to think of the differences is as a series of lines that were
+deleted from, inserted in, or changed in one file to produce the other
+file. 'diff' compares two files line by line, finds groups of lines
+that differ, and reports each group of differing lines. It can report
+the differing lines in several formats, which have different purposes.
+
+ GNU 'diff' can show whether files are different without detailing the
+differences. It also provides ways to suppress certain kinds of
+differences that are not important to you. Most commonly, such
+differences are changes in the amount of white space between words or
+lines. 'diff' also provides ways to suppress differences in alphabetic
+case or in lines that match a regular expression that you provide.
+These options can accumulate; for example, you can ignore changes in
+both white space and alphabetic case.
+
+ Another way to think of the differences between two files is as a
+sequence of pairs of bytes that can be either identical or different.
+'cmp' reports the differences between two files byte by byte, instead of
+line by line. As a result, it is often more useful than 'diff' for
+comparing binary files. For text files, 'cmp' is useful mainly when you
+want to know only whether two files are identical, or whether one file
+is a prefix of the other.
+
+ To illustrate the effect that considering changes byte by byte can
+have compared with considering them line by line, think of what happens
+if a single newline character is added to the beginning of a file. If
+that file is then compared with an otherwise identical file that lacks
+the newline at the beginning, 'diff' will report that a blank line has
+been added to the file, while 'cmp' will report that almost every byte
+of the two files differs.
+
+ 'diff3' normally compares three input files line by line, finds
+groups of lines that differ, and reports each group of differing lines.
+Its output is designed to make it easy to inspect two different sets of
+changes to the same file.
+
+ These commands compare input files without necessarily reading them.
+For example, if 'diff' is asked simply to report whether two files
+differ, and it discovers that the files have different sizes, it need
+not read them to do its job.
+
+* Menu:
+
+* Hunks:: Groups of differing lines.
+* White Space:: Suppressing differences in white space.
+* Blank Lines:: Suppressing differences whose lines are all blank.
+* Specified Lines:: Suppressing differences whose lines all match a pattern.
+* Case Folding:: Suppressing differences in alphabetic case.
+* Brief:: Summarizing which files are different.
+* Binary:: Comparing binary files or forcing text comparisons.
+
+
+File: diffutils.info-t, Node: Hunks, Next: White Space, Up: Comparison
+
+1.1 Hunks
+=========
+
+When comparing two files, 'diff' finds sequences of lines common to both
+files, interspersed with groups of differing lines called "hunks".
+Comparing two identical files yields one sequence of common lines and no
+hunks, because no lines differ. Comparing two entirely different files
+yields no common lines and one large hunk that contains all lines of
+both files. In general, there are many ways to match up lines between
+two given files. 'diff' tries to minimize the total hunk size by
+finding large sequences of common lines interspersed with small hunks of
+differing lines.
+
+ For example, suppose the file 'F' contains the three lines 'a', 'b',
+'c', and the file 'G' contains the same three lines in reverse order
+'c', 'b', 'a'. If 'diff' finds the line 'c' as common, then the command
+'diff F G' produces this output:
+
+ 1,2d0
+ < a
+ < b
+ 3a2,3
+ > b
+ > a
+
+But if 'diff' notices the common line 'b' instead, it produces this
+output:
+
+ 1c1
+ < a
+ ---
+ > c
+ 3c3
+ < c
+ ---
+ > a
+
+It is also possible to find 'a' as the common line. 'diff' does not
+always find an optimal matching between the files; it takes shortcuts to
+run faster. But its output is usually close to the shortest possible.
+You can adjust this tradeoff with the '--minimal' ('-d') option (*note
+diff Performance::).
+
+
+File: diffutils.info-t, Node: White Space, Next: Blank Lines, Prev: Hunks, Up: Comparison
+
+1.2 Suppressing Differences in Blank and Tab Spacing
+====================================================
+
+The '--ignore-tab-expansion' ('-E') option ignores the distinction
+between tabs and spaces on input. A tab is considered to be equivalent
+to the number of spaces to the next tab stop (*note Tabs::).
+
+ The '--ignore-trailing-space' ('-Z') option ignores white space at
+line end.
+
+ The '--ignore-space-change' ('-b') option is stronger than '-E' and
+'-Z' combined. It ignores white space at line end, and considers all
+other sequences of one or more white space characters within a line to
+be equivalent. With this option, 'diff' considers the following two
+lines to be equivalent, where '$' denotes the line end:
+
+ Here lyeth muche rychnesse in lytell space. -- John Heywood$
+ Here lyeth muche rychnesse in lytell space. -- John Heywood $
+
+ The '--ignore-all-space' ('-w') option is stronger still. It ignores
+differences even if one line has white space where the other line has
+none. "White space" characters include tab, vertical tab, form feed,
+carriage return, and space; some locales may define additional
+characters to be white space. With this option, 'diff' considers the
+following two lines to be equivalent, where '$' denotes the line end and
+'^M' denotes a carriage return:
+
+ Here lyeth muche rychnesse in lytell space.-- John Heywood$
+ He relyeth much erychnes seinly tells pace. --John Heywood ^M$
+
+ For many other programs newline is also a white space character, but
+'diff' is a line-oriented program and a newline character always ends a
+line. Hence the '-w' or '--ignore-all-space' option does not ignore
+newline-related changes; it ignores only other white space changes.
+
+
+File: diffutils.info-t, Node: Blank Lines, Next: Specified Lines, Prev: White Space, Up: Comparison
+
+1.3 Suppressing Differences Whose Lines Are All Blank
+=====================================================
+
+The '--ignore-blank-lines' ('-B') option ignores changes that consist
+entirely of blank lines. With this option, for example, a file
+containing
+ 1. A point is that which has no part.
+
+ 2. A line is breadthless length.
+ -- Euclid, The Elements, I
+is considered identical to a file containing
+ 1. A point is that which has no part.
+ 2. A line is breadthless length.
+
+
+ -- Euclid, The Elements, I
+
+ Normally this option affects only lines that are completely empty,
+but if you also specify an option that ignores trailing spaces, lines
+are also affected if they look empty but contain white space. In other
+words, '-B' is equivalent to '-I '^$'' by default, but it is equivalent
+to '-I '^[[:space:]]*$'' if '-b', '-w' or '-Z' is also specified.
+
+
+File: diffutils.info-t, Node: Specified Lines, Next: Case Folding, Prev: Blank Lines, Up: Comparison
+
+1.4 Suppressing Differences Whose Lines All Match a Regular Expression
+======================================================================
+
+To ignore insertions and deletions of lines that match a 'grep'-style
+regular expression, use the '--ignore-matching-lines=REGEXP' ('-I
+REGEXP') option. You should escape regular expressions that contain
+shell metacharacters to prevent the shell from expanding them. For
+example, 'diff -I '^[[:digit:]]'' ignores all changes to lines beginning
+with a digit.
+
+ However, '-I' only ignores the insertion or deletion of lines that
+contain the regular expression if every changed line in the hunk--every
+insertion and every deletion--matches the regular expression. In other
+words, for each nonignorable change, 'diff' prints the complete set of
+changes in its vicinity, including the ignorable ones.
+
+ You can specify more than one regular expression for lines to ignore
+by using more than one '-I' option. 'diff' tries to match each line
+against each regular expression.
+
+
+File: diffutils.info-t, Node: Case Folding, Next: Brief, Prev: Specified Lines, Up: Comparison
+
+1.5 Suppressing Case Differences
+================================
+
+GNU 'diff' can treat lower case letters as equivalent to their upper
+case counterparts, so that, for example, it considers 'Funky Stuff',
+'funky STUFF', and 'fUNKy stuFf' to all be the same. To request this,
+use the '-i' or '--ignore-case' option.
+
+
+File: diffutils.info-t, Node: Brief, Next: Binary, Prev: Case Folding, Up: Comparison
+
+1.6 Summarizing Which Files Differ
+==================================
+
+When you only want to find out whether files are different, and you
+don't care what the differences are, you can use the summary output
+format. In this format, instead of showing the differences between the
+files, 'diff' simply reports whether files differ. The '--brief' ('-q')
+option selects this output format.
+
+ This format is especially useful when comparing the contents of two
+directories. It is also much faster than doing the normal line by line
+comparisons, because 'diff' can stop analyzing the files as soon as it
+knows that there are any differences.
+
+ You can also get a brief indication of whether two files differ by
+using 'cmp'. For files that are identical, 'cmp' produces no output.
+When the files differ, by default, 'cmp' outputs the byte and line
+number where the first difference occurs, or reports that one file is a
+prefix of the other. You can use the '-s', '--quiet', or '--silent'
+option to suppress that information, so that 'cmp' produces no output
+and reports whether the files differ using only its exit status (*note
+Invoking cmp::).
+
+ Unlike 'diff', 'cmp' cannot compare directories; it can only compare
+two files.
+
+
+File: diffutils.info-t, Node: Binary, Prev: Brief, Up: Comparison
+
+1.7 Binary Files and Forcing Text Comparisons
+=============================================
+
+If 'diff' thinks that either of the two files it is comparing is binary
+(a non-text file), it normally treats that pair of files much as if the
+summary output format had been selected (*note Brief::), and reports
+only that the binary files are different. This is because line by line
+comparisons are usually not meaningful for binary files. This does not
+count as trouble, even though the resulting output does not capture all
+the differences.
+
+ 'diff' determines whether a file is text or binary by checking the
+first few bytes in the file; the exact number of bytes is system
+dependent, but it is typically several thousand. If every byte in that
+part of the file is non-null, 'diff' considers the file to be text;
+otherwise it considers the file to be binary.
+
+ Sometimes you might want to force 'diff' to consider files to be
+text. For example, you might be comparing text files that contain null
+characters; 'diff' would erroneously decide that those are non-text
+files. Or you might be comparing documents that are in a format used by
+a word processing system that uses null characters to indicate special
+formatting. You can force 'diff' to consider all files to be text
+files, and compare them line by line, by using the '--text' ('-a')
+option. If the files you compare using this option do not in fact
+contain text, they will probably contain few newline characters, and the
+'diff' output will consist of hunks showing differences between long
+lines of whatever characters the files contain.
+
+ You can also force 'diff' to report only whether files differ (but
+not how). Use the '--brief' ('-q') option for this.
+
+ In operating systems that distinguish between text and binary files,
+'diff' normally reads and writes all data as text. Use the '--binary'
+option to force 'diff' to read and write binary data instead. This
+option has no effect on a POSIX-compliant system like GNU or traditional
+Unix. However, many personal computer operating systems represent the
+end of a line with a carriage return followed by a newline. On such
+systems, 'diff' normally ignores these carriage returns on input and
+generates them at the end of each output line, but with the '--binary'
+option 'diff' treats each carriage return as just another input
+character, and does not generate a carriage return at the end of each
+output line. This can be useful when dealing with non-text files that
+are meant to be interchanged with POSIX-compliant systems.
+
+ The '--strip-trailing-cr' causes 'diff' to treat input lines that end
+in carriage return followed by newline as if they end in plain newline.
+This can be useful when comparing text that is imperfectly imported from
+many personal computer operating systems. This option affects how lines
+are read, which in turn affects how they are compared and output.
+
+ If you want to compare two files byte by byte, you can use the 'cmp'
+program with the '--verbose' ('-l') option to show the values of each
+differing byte in the two files. With GNU 'cmp', you can also use the
+'-b' or '--print-bytes' option to show the ASCII representation of those
+bytes. *Note Invoking cmp::, for more information.
+
+ If 'diff3' thinks that any of the files it is comparing is binary (a
+non-text file), it normally reports an error, because such comparisons
+are usually not useful. 'diff3' uses the same test as 'diff' to decide
+whether a file is binary. As with 'diff', if the input files contain a
+few non-text bytes but otherwise are like text files, you can force
+'diff3' to consider all files to be text files and compare them line by
+line by using the '-a' or '--text' option.
+
+
+File: diffutils.info-t, Node: Output Formats, Next: Incomplete Lines, Prev: Comparison, Up: Top
+
+2 'diff' Output Formats
+***********************
+
+'diff' has several mutually exclusive options for output format. The
+following sections describe each format, illustrating how 'diff' reports
+the differences between two sample input files.
+
+* Menu:
+
+* Sample diff Input:: Sample 'diff' input files for examples.
+* Context:: Showing differences with the surrounding text.
+* Side by Side:: Showing differences in two columns.
+* Normal:: Showing differences without surrounding text.
+* Scripts:: Generating scripts for other programs.
+* If-then-else:: Merging files with if-then-else.
+
+
+File: diffutils.info-t, Node: Sample diff Input, Next: Context, Up: Output Formats
+
+2.1 Two Sample Input Files
+==========================
+
+Here are two sample files that we will use in numerous examples to
+illustrate the output of 'diff' and how various options can change it.
+
+ This is the file 'lao':
+
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+ The Named is the mother of all things.
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ so we may see their outcome.
+ The two are the same,
+ But after they are produced,
+ they have different names.
+
+ This is the file 'tzu':
+
+ The Nameless is the origin of Heaven and Earth;
+ The named is the mother of all things.
+
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ so we may see their outcome.
+ The two are the same,
+ But after they are produced,
+ they have different names.
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+
+ In this example, the first hunk contains just the first two lines of
+'lao', the second hunk contains the fourth line of 'lao' opposing the
+second and third lines of 'tzu', and the last hunk contains just the
+last three lines of 'tzu'.
+
+
+File: diffutils.info-t, Node: Context, Next: Side by Side, Prev: Sample diff Input, Up: Output Formats
+
+2.2 Showing Differences in Their Context
+========================================
+
+Usually, when you are looking at the differences between files, you will
+also want to see the parts of the files near the lines that differ, to
+help you understand exactly what has changed. These nearby parts of the
+files are called the "context".
+
+ GNU 'diff' provides two output formats that show context around the
+differing lines: "context format" and "unified format". It can
+optionally show in which function or section of the file the differing
+lines are found.
+
+ If you are distributing new versions of files to other people in the
+form of 'diff' output, you should use one of the output formats that
+show context so that they can apply the diffs even if they have made
+small changes of their own to the files. 'patch' can apply the diffs in
+this case by searching in the files for the lines of context around the
+differing lines; if those lines are actually a few lines away from where
+the diff says they are, 'patch' can adjust the line numbers accordingly
+and still apply the diff correctly. *Note Imperfect::, for more
+information on using 'patch' to apply imperfect diffs.
+
+* Menu:
+
+* Context Format:: An output format that shows surrounding lines.
+* Unified Format:: A more compact output format that shows context.
+* Sections:: Showing which sections of the files differences are in.
+* Alternate Names:: Showing alternate file names in context headers.
+
+
+File: diffutils.info-t, Node: Context Format, Next: Unified Format, Up: Context
+
+2.2.1 Context Format
+--------------------
+
+The context output format shows several lines of context around the
+lines that differ. It is the standard format for distributing updates
+to source code.
+
+ To select this output format, use the '--context[=LINES]' ('-C
+LINES') or '-c' option. The argument LINES that some of these options
+take is the number of lines of context to show. If you do not specify
+LINES, it defaults to three. For proper operation, 'patch' typically
+needs at least two lines of context.
+
+* Menu:
+
+* Example Context:: Sample output in context format.
+* Less Context:: Another sample with less context.
+* Detailed Context:: A detailed description of the context output format.
+
+
+File: diffutils.info-t, Node: Example Context, Next: Less Context, Up: Context Format
+
+2.2.1.1 An Example of Context Format
+....................................
+
+Here is the output of 'diff -c lao tzu' (*note Sample diff Input::, for
+the complete contents of the two files). Notice that up to three lines
+that are not different are shown around each line that is different;
+they are the context lines. Also notice that the first two hunks have
+run together, because their contents overlap.
+
+ *** lao 2002-02-21 23:30:39.942229878 -0800
+ --- tzu 2002-02-21 23:30:50.442260588 -0800
+ ***************
+ *** 1,7 ****
+ - The Way that can be told of is not the eternal Way;
+ - The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+ ! The Named is the mother of all things.
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ --- 1,6 ----
+ The Nameless is the origin of Heaven and Earth;
+ ! The named is the mother of all things.
+ !
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ ***************
+ *** 9,11 ****
+ --- 8,13 ----
+ The two are the same,
+ But after they are produced,
+ they have different names.
+ + They both may be called deep and profound.
+ + Deeper and more profound,
+ + The door of all subtleties!
+
+
+File: diffutils.info-t, Node: Less Context, Next: Detailed Context, Prev: Example Context, Up: Context Format
+
+2.2.1.2 An Example of Context Format with Less Context
+......................................................
+
+Here is the output of 'diff -C 1 lao tzu' (*note Sample diff Input::,
+for the complete contents of the two files). Notice that at most one
+context line is reported here.
+
+ *** lao 2002-02-21 23:30:39.942229878 -0800
+ --- tzu 2002-02-21 23:30:50.442260588 -0800
+ ***************
+ *** 1,5 ****
+ - The Way that can be told of is not the eternal Way;
+ - The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+ ! The Named is the mother of all things.
+ Therefore let there always be non-being,
+ --- 1,4 ----
+ The Nameless is the origin of Heaven and Earth;
+ ! The named is the mother of all things.
+ !
+ Therefore let there always be non-being,
+ ***************
+ *** 11 ****
+ --- 10,13 ----
+ they have different names.
+ + They both may be called deep and profound.
+ + Deeper and more profound,
+ + The door of all subtleties!
+
+
+File: diffutils.info-t, Node: Detailed Context, Prev: Less Context, Up: Context Format
+
+2.2.1.3 Detailed Description of Context Format
+..............................................
+
+The context output format starts with a two-line header, which looks
+like this:
+
+ *** FROM-FILE FROM-FILE-MODIFICATION-TIME
+ --- TO-FILE TO-FILE-MODIFICATION TIME
+
+The time stamp normally looks like '2002-02-21 23:30:39.942229878 -0800'
+to indicate the date, time with fractional seconds, and time zone in
+Internet RFC 2822 format (ftp://ftp.isi.edu/in-notes/rfc2822.txt). (The
+fractional seconds are omitted on hosts that do not support fractional
+time stamps.) However, a traditional time stamp like 'Thu Feb 21
+23:30:39 2002' is used if the 'LC_TIME' locale category is either 'C' or
+'POSIX'.
+
+ You can change the header's content with the '--label=LABEL' option;
+see *note Alternate Names::.
+
+ Next come one or more hunks of differences; each hunk shows one area
+where the files differ. Context format hunks look like this:
+
+ ***************
+ *** FROM-FILE-LINE-NUMBERS ****
+ FROM-FILE-LINE
+ FROM-FILE-LINE...
+ --- TO-FILE-LINE-NUMBERS ----
+ TO-FILE-LINE
+ TO-FILE-LINE...
+
+ If a hunk contains two or more lines, its line numbers look like
+'START,END'. Otherwise only its end line number appears. An empty hunk
+is considered to end at the line that precedes the hunk.
+
+ The lines of context around the lines that differ start with two
+space characters. The lines that differ between the two files start
+with one of the following indicator characters, followed by a space
+character:
+
+'!'
+ A line that is part of a group of one or more lines that changed
+ between the two files. There is a corresponding group of lines
+ marked with '!' in the part of this hunk for the other file.
+
+'+'
+ An "inserted" line in the second file that corresponds to nothing
+ in the first file.
+
+'-'
+ A "deleted" line in the first file that corresponds to nothing in
+ the second file.
+
+ If all of the changes in a hunk are insertions, the lines of
+FROM-FILE are omitted. If all of the changes are deletions, the lines
+of TO-FILE are omitted.
+
+
+File: diffutils.info-t, Node: Unified Format, Next: Sections, Prev: Context Format, Up: Context
+
+2.2.2 Unified Format
+--------------------
+
+The unified output format is a variation on the context format that is
+more compact because it omits redundant context lines. To select this
+output format, use the '--unified[=LINES]' ('-U LINES'), or '-u' option.
+The argument LINES is the number of lines of context to show. When it
+is not given, it defaults to three.
+
+ At present, only GNU 'diff' can produce this format and only GNU
+'patch' can automatically apply diffs in this format. For proper
+operation, 'patch' typically needs at least three lines of context.
+
+* Menu:
+
+* Example Unified:: Sample output in unified format.
+* Detailed Unified:: A detailed description of unified format.
+
+
+File: diffutils.info-t, Node: Example Unified, Next: Detailed Unified, Up: Unified Format
+
+2.2.2.1 An Example of Unified Format
+....................................
+
+Here is the output of the command 'diff -u lao tzu' (*note Sample diff
+Input::, for the complete contents of the two files):
+
+ --- lao 2002-02-21 23:30:39.942229878 -0800
+ +++ tzu 2002-02-21 23:30:50.442260588 -0800
+ @@ -1,7 +1,6 @@
+ -The Way that can be told of is not the eternal Way;
+ -The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+ -The Named is the mother of all things.
+ +The named is the mother of all things.
+ +
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ @@ -9,3 +8,6 @@
+ The two are the same,
+ But after they are produced,
+ they have different names.
+ +They both may be called deep and profound.
+ +Deeper and more profound,
+ +The door of all subtleties!
+
+
+File: diffutils.info-t, Node: Detailed Unified, Prev: Example Unified, Up: Unified Format
+
+2.2.2.2 Detailed Description of Unified Format
+..............................................
+
+The unified output format starts with a two-line header, which looks
+like this:
+
+ --- FROM-FILE FROM-FILE-MODIFICATION-TIME
+ +++ TO-FILE TO-FILE-MODIFICATION-TIME
+
+The time stamp looks like '2002-02-21 23:30:39.942229878 -0800' to
+indicate the date, time with fractional seconds, and time zone. The
+fractional seconds are omitted on hosts that do not support fractional
+time stamps.
+
+ You can change the header's content with the '--label=LABEL' option.
+*Note Alternate Names::.
+
+ Next come one or more hunks of differences; each hunk shows one area
+where the files differ. Unified format hunks look like this:
+
+ @@ FROM-FILE-LINE-NUMBERS TO-FILE-LINE-NUMBERS @@
+ LINE-FROM-EITHER-FILE
+ LINE-FROM-EITHER-FILE...
+
+ If a hunk contains just one line, only its start line number appears.
+Otherwise its line numbers look like 'START,COUNT'. An empty hunk is
+considered to start at the line that follows the hunk.
+
+ If a hunk and its context contain two or more lines, its line numbers
+look like 'START,COUNT'. Otherwise only its end line number appears.
+An empty hunk is considered to end at the line that precedes the hunk.
+
+ The lines common to both files begin with a space character. The
+lines that actually differ between the two files have one of the
+following indicator characters in the left print column:
+
+'+'
+ A line was added here to the first file.
+
+'-'
+ A line was removed here from the first file.
+
+
+File: diffutils.info-t, Node: Sections, Next: Alternate Names, Prev: Unified Format, Up: Context
+
+2.2.3 Showing Which Sections Differences Are in
+-----------------------------------------------
+
+Sometimes you might want to know which part of the files each change
+falls in. If the files are source code, this could mean which function
+was changed. If the files are documents, it could mean which chapter or
+appendix was changed. GNU 'diff' can show this by displaying the
+nearest section heading line that precedes the differing lines. Which
+lines are "section headings" is determined by a regular expression.
+
+* Menu:
+
+* Specified Headings:: Showing headings that match regular expressions.
+* C Function Headings:: Showing headings of C functions.
+
+
+File: diffutils.info-t, Node: Specified Headings, Next: C Function Headings, Up: Sections
+
+2.2.3.1 Showing Lines That Match Regular Expressions
+....................................................
+
+To show in which sections differences occur for files that are not
+source code for C or similar languages, use the
+'--show-function-line=REGEXP' ('-F REGEXP') option. 'diff' considers
+lines that match the 'grep'-style regular expression REGEXP to be the
+beginning of a section of the file. Here are suggested regular
+expressions for some common languages:
+
+'^[[:alpha:]$_]'
+ C, C++, Prolog
+'^('
+ Lisp
+'^@node'
+ Texinfo
+
+ This option does not automatically select an output format; in order
+to use it, you must select the context format (*note Context Format::)
+or unified format (*note Unified Format::). In other output formats it
+has no effect.
+
+ The '--show-function-line' ('-F') option finds the nearest unchanged
+line that precedes each hunk of differences and matches the given
+regular expression. Then it adds that line to the end of the line of
+asterisks in the context format, or to the '@@' line in unified format.
+If no matching line exists, this option leaves the output for that hunk
+unchanged. If that line is more than 40 characters long, it outputs
+only the first 40 characters. You can specify more than one regular
+expression for such lines; 'diff' tries to match each line against each
+regular expression, starting with the last one given. This means that
+you can use '-p' and '-F' together, if you wish.
+
+
+File: diffutils.info-t, Node: C Function Headings, Prev: Specified Headings, Up: Sections
+
+2.2.3.2 Showing C Function Headings
+...................................
+
+To show in which functions differences occur for C and similar
+languages, you can use the '--show-c-function' ('-p') option. This
+option automatically defaults to the context output format (*note
+Context Format::), with the default number of lines of context. You can
+override that number with '-C LINES' elsewhere in the command line. You
+can override both the format and the number with '-U LINES' elsewhere in
+the command line.
+
+ The '--show-c-function' ('-p') option is equivalent to '-F
+'^[[:alpha:]$_]'' if the unified format is specified, otherwise '-c -F
+'^[[:alpha:]$_]'' (*note Specified Headings::). GNU 'diff' provides
+this option for the sake of convenience.
+
+
+File: diffutils.info-t, Node: Alternate Names, Prev: Sections, Up: Context
+
+2.2.4 Showing Alternate File Names
+----------------------------------
+
+If you are comparing two files that have meaningless or uninformative
+names, you might want 'diff' to show alternate names in the header of
+the context and unified output formats. To do this, use the
+'--label=LABEL' option. The first time you give this option, its
+argument replaces the name and date of the first file in the header; the
+second time, its argument replaces the name and date of the second file.
+If you give this option more than twice, 'diff' reports an error. The
+'--label' option does not affect the file names in the 'pr' header when
+the '-l' or '--paginate' option is used (*note Pagination::).
+
+ Here are the first two lines of the output from 'diff -C 2
+--label=original --label=modified lao tzu':
+
+ *** original
+ --- modified
+
+
+File: diffutils.info-t, Node: Side by Side, Next: Normal, Prev: Context, Up: Output Formats
+
+2.3 Showing Differences Side by Side
+====================================
+
+'diff' can produce a side by side difference listing of two files. The
+files are listed in two columns with a gutter between them. The gutter
+contains one of the following markers:
+
+white space
+ The corresponding lines are in common. That is, either the lines
+ are identical, or the difference is ignored because of one of the
+ '--ignore' options (*note White Space::).
+
+'|'
+ The corresponding lines differ, and they are either both complete
+ or both incomplete.
+
+'<'
+ The files differ and only the first file contains the line.
+
+'>'
+ The files differ and only the second file contains the line.
+
+'('
+ Only the first file contains the line, but the difference is
+ ignored.
+
+')'
+ Only the second file contains the line, but the difference is
+ ignored.
+
+'\'
+ The corresponding lines differ, and only the first line is
+ incomplete.
+
+'/'
+ The corresponding lines differ, and only the second line is
+ incomplete.
+
+ Normally, an output line is incomplete if and only if the lines that
+it contains are incomplete. *Note Incomplete Lines::. However, when an
+output line represents two differing lines, one might be incomplete
+while the other is not. In this case, the output line is complete, but
+its the gutter is marked '\' if the first line is incomplete, '/' if the
+second line is.
+
+ Side by side format is sometimes easiest to read, but it has
+limitations. It generates much wider output than usual, and truncates
+lines that are too long to fit. Also, it relies on lining up output
+more heavily than usual, so its output looks particularly bad if you use
+varying width fonts, nonstandard tab stops, or nonprinting characters.
+
+ You can use the 'sdiff' command to interactively merge side by side
+differences. *Note Interactive Merging::, for more information on
+merging files.
+
+* Menu:
+
+* Side by Side Format:: Controlling side by side output format.
+* Example Side by Side:: Sample side by side output.
+
+
+File: diffutils.info-t, Node: Side by Side Format, Next: Example Side by Side, Up: Side by Side
+
+2.3.1 Controlling Side by Side Format
+-------------------------------------
+
+The '--side-by-side' ('-y') option selects side by side format. Because
+side by side output lines contain two input lines, the output is wider
+than usual: normally 130 print columns, which can fit onto a traditional
+printer line. You can set the width of the output with the
+'--width=COLUMNS' ('-W COLUMNS') option. The output is split into two
+halves of equal width, separated by a small gutter to mark differences;
+the right half is aligned to a tab stop so that tabs line up. Input
+lines that are too long to fit in half of an output line are truncated
+for output.
+
+ The '--left-column' option prints only the left column of two common
+lines. The '--suppress-common-lines' option suppresses common lines
+entirely.
+
+
+File: diffutils.info-t, Node: Example Side by Side, Prev: Side by Side Format, Up: Side by Side
+
+2.3.2 An Example of Side by Side Format
+---------------------------------------
+
+Here is the output of the command 'diff -y -W 72 lao tzu' (*note Sample
+diff Input::, for the complete contents of the two files).
+
+ The Way that can be told of is n <
+ The name that can be named is no <
+ The Nameless is the origin of He The Nameless is the origin of He
+ The Named is the mother of all t | The named is the mother of all t
+ >
+ Therefore let there always be no Therefore let there always be no
+ so we may see their subtlety, so we may see their subtlety,
+ And let there always be being, And let there always be being,
+ so we may see their outcome. so we may see their outcome.
+ The two are the same, The two are the same,
+ But after they are produced, But after they are produced,
+ they have different names. they have different names.
+ > They both may be called deep and
+ > Deeper and more profound,
+ > The door of all subtleties!
+
+
+File: diffutils.info-t, Node: Normal, Next: Scripts, Prev: Side by Side, Up: Output Formats
+
+2.4 Showing Differences Without Context
+=======================================
+
+The "normal" 'diff' output format shows each hunk of differences without
+any surrounding context. Sometimes such output is the clearest way to
+see how lines have changed, without the clutter of nearby unchanged
+lines (although you can get similar results with the context or unified
+formats by using 0 lines of context). However, this format is no longer
+widely used for sending out patches; for that purpose, the context
+format (*note Context Format::) and the unified format (*note Unified
+Format::) are superior. Normal format is the default for compatibility
+with older versions of 'diff' and the POSIX standard. Use the
+'--normal' option to select this output format explicitly.
+
+* Menu:
+
+* Example Normal:: Sample output in the normal format.
+* Detailed Normal:: A detailed description of normal output format.
+
+
+File: diffutils.info-t, Node: Example Normal, Next: Detailed Normal, Up: Normal
+
+2.4.1 An Example of Normal Format
+---------------------------------
+
+Here is the output of the command 'diff lao tzu' (*note Sample diff
+Input::, for the complete contents of the two files). Notice that it
+shows only the lines that are different between the two files.
+
+ 1,2d0
+ < The Way that can be told of is not the eternal Way;
+ < The name that can be named is not the eternal name.
+ 4c2,3
+ < The Named is the mother of all things.
+ ---
+ > The named is the mother of all things.
+ >
+ 11a11,13
+ > They both may be called deep and profound.
+ > Deeper and more profound,
+ > The door of all subtleties!
+
+
+File: diffutils.info-t, Node: Detailed Normal, Prev: Example Normal, Up: Normal
+
+2.4.2 Detailed Description of Normal Format
+-------------------------------------------
+
+The normal output format consists of one or more hunks of differences;
+each hunk shows one area where the files differ. Normal format hunks
+look like this:
+
+ CHANGE-COMMAND
+ < FROM-FILE-LINE
+ < FROM-FILE-LINE...
+ ---
+ > TO-FILE-LINE
+ > TO-FILE-LINE...
+
+ There are three types of change commands. Each consists of a line
+number or comma-separated range of lines in the first file, a single
+character indicating the kind of change to make, and a line number or
+comma-separated range of lines in the second file. All line numbers are
+the original line numbers in each file. The types of change commands
+are:
+
+'LaR'
+ Add the lines in range R of the second file after line L of the
+ first file. For example, '8a12,15' means append lines 12-15 of
+ file 2 after line 8 of file 1; or, if changing file 2 into file 1,
+ delete lines 12-15 of file 2.
+
+'FcT'
+ Replace the lines in range F of the first file with lines in range
+ T of the second file. This is like a combined add and delete, but
+ more compact. For example, '5,7c8,10' means change lines 5-7 of
+ file 1 to read as lines 8-10 of file 2; or, if changing file 2 into
+ file 1, change lines 8-10 of file 2 to read as lines 5-7 of file 1.
+
+'RdL'
+ Delete the lines in range R from the first file; line L is where
+ they would have appeared in the second file had they not been
+ deleted. For example, '5,7d3' means delete lines 5-7 of file 1;
+ or, if changing file 2 into file 1, append lines 5-7 of file 1
+ after line 3 of file 2.
+
+
+File: diffutils.info-t, Node: Scripts, Next: If-then-else, Prev: Normal, Up: Output Formats
+
+2.5 Making Edit Scripts
+=======================
+
+Several output modes produce command scripts for editing FROM-FILE to
+produce TO-FILE.
+
+* Menu:
+
+* ed Scripts:: Using 'diff' to produce commands for 'ed'.
+* Forward ed:: Making forward 'ed' scripts.
+* RCS:: A special 'diff' output format used by RCS.
+
+
+File: diffutils.info-t, Node: ed Scripts, Next: Forward ed, Up: Scripts
+
+2.5.1 'ed' Scripts
+------------------
+
+'diff' can produce commands that direct the 'ed' text editor to change
+the first file into the second file. Long ago, this was the only output
+mode that was suitable for editing one file into another automatically;
+today, with 'patch', it is almost obsolete. Use the '--ed' ('-e')
+option to select this output format.
+
+ Like the normal format (*note Normal::), this output format does not
+show any context; unlike the normal format, it does not include the
+information necessary to apply the diff in reverse (to produce the first
+file if all you have is the second file and the diff).
+
+ If the file 'd' contains the output of 'diff -e old new', then the
+command '(cat d && echo w) | ed - old' edits 'old' to make it a copy of
+'new'. More generally, if 'd1', 'd2', ..., 'dN' contain the outputs of
+'diff -e old new1', 'diff -e new1 new2', ..., 'diff -e newN-1 newN',
+respectively, then the command '(cat d1 d2 ... dN && echo w) | ed - old'
+edits 'old' to make it a copy of 'newN'.
+
+* Menu:
+
+* Example ed:: A sample 'ed' script.
+* Detailed ed:: A detailed description of 'ed' format.
+
+
+File: diffutils.info-t, Node: Example ed, Next: Detailed ed, Up: ed Scripts
+
+2.5.1.1 Example 'ed' Script
+...........................
+
+Here is the output of 'diff -e lao tzu' (*note Sample diff Input::, for
+the complete contents of the two files):
+
+ 11a
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+ .
+ 4c
+ The named is the mother of all things.
+
+ .
+ 1,2d
+
+
+File: diffutils.info-t, Node: Detailed ed, Prev: Example ed, Up: ed Scripts
+
+2.5.1.2 Detailed Description of 'ed' Format
+...........................................
+
+The 'ed' output format consists of one or more hunks of differences.
+The changes closest to the ends of the files come first so that commands
+that change the number of lines do not affect how 'ed' interprets line
+numbers in succeeding commands. 'ed' format hunks look like this:
+
+ CHANGE-COMMAND
+ TO-FILE-LINE
+ TO-FILE-LINE...
+ .
+
+ Because 'ed' uses a single period on a line to indicate the end of
+input, GNU 'diff' protects lines of changes that contain a single period
+on a line by writing two periods instead, then writing a subsequent 'ed'
+command to change the two periods into one. The 'ed' format cannot
+represent an incomplete line, so if the second file ends in a changed
+incomplete line, 'diff' reports an error and then pretends that a
+newline was appended.
+
+ There are three types of change commands. Each consists of a line
+number or comma-separated range of lines in the first file and a single
+character indicating the kind of change to make. All line numbers are
+the original line numbers in the file. The types of change commands
+are:
+
+'La'
+ Add text from the second file after line L in the first file. For
+ example, '8a' means to add the following lines after line 8 of file
+ 1.
+
+'Rc'
+ Replace the lines in range R in the first file with the following
+ lines. Like a combined add and delete, but more compact. For
+ example, '5,7c' means change lines 5-7 of file 1 to read as the
+ text file 2.
+
+'Rd'
+ Delete the lines in range R from the first file. For example,
+ '5,7d' means delete lines 5-7 of file 1.
+
+
+File: diffutils.info-t, Node: Forward ed, Next: RCS, Prev: ed Scripts, Up: Scripts
+
+2.5.2 Forward 'ed' Scripts
+--------------------------
+
+'diff' can produce output that is like an 'ed' script, but with hunks in
+forward (front to back) order. The format of the commands is also
+changed slightly: command characters precede the lines they modify,
+spaces separate line numbers in ranges, and no attempt is made to
+disambiguate hunk lines consisting of a single period. Like 'ed'
+format, forward 'ed' format cannot represent incomplete lines.
+
+ Forward 'ed' format is not very useful, because neither 'ed' nor
+'patch' can apply diffs in this format. It exists mainly for
+compatibility with older versions of 'diff'. Use the '-f' or
+'--forward-ed' option to select it.
+
+
+File: diffutils.info-t, Node: RCS, Prev: Forward ed, Up: Scripts
+
+2.5.3 RCS Scripts
+-----------------
+
+The RCS output format is designed specifically for use by the Revision
+Control System, which is a set of free programs used for organizing
+different versions and systems of files. Use the '--rcs' ('-n') option
+to select this output format. It is like the forward 'ed' format (*note
+Forward ed::), but it can represent arbitrary changes to the contents of
+a file because it avoids the forward 'ed' format's problems with lines
+consisting of a single period and with incomplete lines. Instead of
+ending text sections with a line consisting of a single period, each
+command specifies the number of lines it affects; a combination of the
+'a' and 'd' commands are used instead of 'c'. Also, if the second file
+ends in a changed incomplete line, then the output also ends in an
+incomplete line.
+
+ Here is the output of 'diff -n lao tzu' (*note Sample diff Input::,
+for the complete contents of the two files):
+
+ d1 2
+ d4 1
+ a4 2
+ The named is the mother of all things.
+
+ a11 3
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+
+
+File: diffutils.info-t, Node: If-then-else, Prev: Scripts, Up: Output Formats
+
+2.6 Merging Files with If-then-else
+===================================
+
+You can use 'diff' to merge two files of C source code. The output of
+'diff' in this format contains all the lines of both files. Lines
+common to both files are output just once; the differing parts are
+separated by the C preprocessor directives '#ifdef NAME' or '#ifndef
+NAME', '#else', and '#endif'. When compiling the output, you select
+which version to use by either defining or leaving undefined the macro
+NAME.
+
+ To merge two files, use 'diff' with the '-D NAME' or '--ifdef=NAME'
+option. The argument NAME is the C preprocessor identifier to use in
+the '#ifdef' and '#ifndef' directives.
+
+ For example, if you change an instance of 'wait (&s)' to 'waitpid
+(-1, &s, 0)' and then merge the old and new files with the
+'--ifdef=HAVE_WAITPID' option, then the affected part of your code might
+look like this:
+
+ do {
+ #ifndef HAVE_WAITPID
+ if ((w = wait (&s)) < 0 && errno != EINTR)
+ #else /* HAVE_WAITPID */
+ if ((w = waitpid (-1, &s, 0)) < 0 && errno != EINTR)
+ #endif /* HAVE_WAITPID */
+ return w;
+ } while (w != child);
+
+ You can specify formats for languages other than C by using line
+group formats and line formats, as described in the next sections.
+
+* Menu:
+
+* Line Group Formats:: Formats for general if-then-else line groups.
+* Line Formats:: Formats for each line in a line group.
+* Example If-then-else:: Sample if-then-else format output.
+* Detailed If-then-else:: A detailed description of if-then-else format.
+
+
+File: diffutils.info-t, Node: Line Group Formats, Next: Line Formats, Up: If-then-else
+
+2.6.1 Line Group Formats
+------------------------
+
+Line group formats let you specify formats suitable for many
+applications that allow if-then-else input, including programming
+languages and text formatting languages. A line group format specifies
+the output format for a contiguous group of similar lines.
+
+ For example, the following command compares the TeX files 'old' and
+'new', and outputs a merged file in which old regions are surrounded by
+'\begin{em}'-'\end{em}' lines, and new regions are surrounded by
+'\begin{bf}'-'\end{bf}' lines.
+
+ diff \
+ --old-group-format='\begin{em}
+ %<\end{em}
+ ' \
+ --new-group-format='\begin{bf}
+ %>\end{bf}
+ ' \
+ old new
+
+ The following command is equivalent to the above example, but it is a
+little more verbose, because it spells out the default line group
+formats.
+
+ diff \
+ --old-group-format='\begin{em}
+ %<\end{em}
+ ' \
+ --new-group-format='\begin{bf}
+ %>\end{bf}
+ ' \
+ --unchanged-group-format='%=' \
+ --changed-group-format='\begin{em}
+ %<\end{em}
+ \begin{bf}
+ %>\end{bf}
+ ' \
+ old new
+
+ Here is a more advanced example, which outputs a diff listing with
+headers containing line numbers in a "plain English" style.
+
+ diff \
+ --unchanged-group-format='' \
+ --old-group-format='-------- %dn line%(n=1?:s) deleted at %df:
+ %<' \
+ --new-group-format='-------- %dN line%(N=1?:s) added after %de:
+ %>' \
+ --changed-group-format='-------- %dn line%(n=1?:s) changed at %df:
+ %<-------- to:
+ %>' \
+ old new
+
+ To specify a line group format, use 'diff' with one of the options
+listed below. You can specify up to four line group formats, one for
+each kind of line group. You should quote FORMAT, because it typically
+contains shell metacharacters.
+
+'--old-group-format=FORMAT'
+ These line groups are hunks containing only lines from the first
+ file. The default old group format is the same as the changed
+ group format if it is specified; otherwise it is a format that
+ outputs the line group as-is.
+
+'--new-group-format=FORMAT'
+ These line groups are hunks containing only lines from the second
+ file. The default new group format is same as the changed group
+ format if it is specified; otherwise it is a format that outputs
+ the line group as-is.
+
+'--changed-group-format=FORMAT'
+ These line groups are hunks containing lines from both files. The
+ default changed group format is the concatenation of the old and
+ new group formats.
+
+'--unchanged-group-format=FORMAT'
+ These line groups contain lines common to both files. The default
+ unchanged group format is a format that outputs the line group
+ as-is.
+
+ In a line group format, ordinary characters represent themselves;
+conversion specifications start with '%' and have one of the following
+forms.
+
+'%<'
+ stands for the lines from the first file, including the trailing
+ newline. Each line is formatted according to the old line format
+ (*note Line Formats::).
+
+'%>'
+ stands for the lines from the second file, including the trailing
+ newline. Each line is formatted according to the new line format.
+
+'%='
+ stands for the lines common to both files, including the trailing
+ newline. Each line is formatted according to the unchanged line
+ format.
+
+'%%'
+ stands for '%'.
+
+'%c'C''
+ where C is a single character, stands for C. C may not be a
+ backslash or an apostrophe. For example, '%c':'' stands for a
+ colon, even inside the then-part of an if-then-else format, which a
+ colon would normally terminate.
+
+'%c'\O''
+ where O is a string of 1, 2, or 3 octal digits, stands for the
+ character with octal code O. For example, '%c'\0'' stands for a
+ null character.
+
+'FN'
+ where F is a 'printf' conversion specification and N is one of the
+ following letters, stands for N's value formatted with F.
+
+ 'e'
+ The line number of the line just before the group in the old
+ file.
+
+ 'f'
+ The line number of the first line in the group in the old
+ file; equals E + 1.
+
+ 'l'
+ The line number of the last line in the group in the old file.
+
+ 'm'
+ The line number of the line just after the group in the old
+ file; equals L + 1.
+
+ 'n'
+ The number of lines in the group in the old file; equals L - F
+ + 1.
+
+ 'E, F, L, M, N'
+ Likewise, for lines in the new file.
+
+ The 'printf' conversion specification can be '%d', '%o', '%x', or
+ '%X', specifying decimal, octal, lower case hexadecimal, or upper
+ case hexadecimal output respectively. After the '%' the following
+ options can appear in sequence: a series of zero or more flags; an
+ integer specifying the minimum field width; and a period followed
+ by an optional integer specifying the minimum number of digits.
+ The flags are '-' for left-justification, ''' for separating the
+ digit into groups as specified by the 'LC_NUMERIC' locale category,
+ and '0' for padding with zeros instead of spaces. For example,
+ '%5dN' prints the number of new lines in the group in a field of
+ width 5 characters, using the 'printf' format '"%5d"'.
+
+'(A=B?T:E)'
+ If A equals B then T else E. A and B are each either a decimal
+ constant or a single letter interpreted as above. This format spec
+ is equivalent to T if A's value equals B's; otherwise it is
+ equivalent to E.
+
+ For example, '%(N=0?no:%dN) line%(N=1?:s)' is equivalent to 'no
+ lines' if N (the number of lines in the group in the new file) is
+ 0, to '1 line' if N is 1, and to '%dN lines' otherwise.
+
+
+File: diffutils.info-t, Node: Line Formats, Next: Example If-then-else, Prev: Line Group Formats, Up: If-then-else
+
+2.6.2 Line Formats
+------------------
+
+Line formats control how each line taken from an input file is output as
+part of a line group in if-then-else format.
+
+ For example, the following command outputs text with a one-character
+change indicator to the left of the text. The first character of output
+is '-' for deleted lines, '|' for added lines, and a space for unchanged
+lines. The formats contain newline characters where newlines are
+desired on output.
+
+ diff \
+ --old-line-format='-%l
+ ' \
+ --new-line-format='|%l
+ ' \
+ --unchanged-line-format=' %l
+ ' \
+ old new
+
+ To specify a line format, use one of the following options. You
+should quote FORMAT, since it often contains shell metacharacters.
+
+'--old-line-format=FORMAT'
+ formats lines just from the first file.
+
+'--new-line-format=FORMAT'
+ formats lines just from the second file.
+
+'--unchanged-line-format=FORMAT'
+ formats lines common to both files.
+
+'--line-format=FORMAT'
+ formats all lines; in effect, it sets all three above options
+ simultaneously.
+
+ In a line format, ordinary characters represent themselves;
+conversion specifications start with '%' and have one of the following
+forms.
+
+'%l'
+ stands for the contents of the line, not counting its trailing
+ newline (if any). This format ignores whether the line is
+ incomplete; *Note Incomplete Lines::.
+
+'%L'
+ stands for the contents of the line, including its trailing newline
+ (if any). If a line is incomplete, this format preserves its
+ incompleteness.
+
+'%%'
+ stands for '%'.
+
+'%c'C''
+ where C is a single character, stands for C. C may not be a
+ backslash or an apostrophe. For example, '%c':'' stands for a
+ colon.
+
+'%c'\O''
+ where O is a string of 1, 2, or 3 octal digits, stands for the
+ character with octal code O. For example, '%c'\0'' stands for a
+ null character.
+
+'Fn'
+ where F is a 'printf' conversion specification, stands for the line
+ number formatted with F. For example, '%.5dn' prints the line
+ number using the 'printf' format '"%.5d"'. *Note Line Group
+ Formats::, for more about printf conversion specifications.
+
+ The default line format is '%l' followed by a newline character.
+
+ If the input contains tab characters and it is important that they
+line up on output, you should ensure that '%l' or '%L' in a line format
+is just after a tab stop (e.g. by preceding '%l' or '%L' with a tab
+character), or you should use the '-t' or '--expand-tabs' option.
+
+ Taken together, the line and line group formats let you specify many
+different formats. For example, the following command uses a format
+similar to normal 'diff' format. You can tailor this command to get
+fine control over 'diff' output.
+
+ diff \
+ --old-line-format='< %l
+ ' \
+ --new-line-format='> %l
+ ' \
+ --old-group-format='%df%(f=l?:,%dl)d%dE
+ %<' \
+ --new-group-format='%dea%dF%(F=L?:,%dL)
+ %>' \
+ --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)
+ %<---
+ %>' \
+ --unchanged-group-format='' \
+ old new
+
+
+File: diffutils.info-t, Node: Example If-then-else, Next: Detailed If-then-else, Prev: Line Formats, Up: If-then-else
+
+2.6.3 An Example of If-then-else Format
+---------------------------------------
+
+Here is the output of 'diff -DTWO lao tzu' (*note Sample diff Input::,
+for the complete contents of the two files):
+
+ #ifndef TWO
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+ #endif /* ! TWO */
+ The Nameless is the origin of Heaven and Earth;
+ #ifndef TWO
+ The Named is the mother of all things.
+ #else /* TWO */
+ The named is the mother of all things.
+
+ #endif /* TWO */
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ so we may see their outcome.
+ The two are the same,
+ But after they are produced,
+ they have different names.
+ #ifdef TWO
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+ #endif /* TWO */
+
+
+File: diffutils.info-t, Node: Detailed If-then-else, Prev: Example If-then-else, Up: If-then-else
+
+2.6.4 Detailed Description of If-then-else Format
+-------------------------------------------------
+
+For lines common to both files, 'diff' uses the unchanged line group
+format. For each hunk of differences in the merged output format, if
+the hunk contains only lines from the first file, 'diff' uses the old
+line group format; if the hunk contains only lines from the second file,
+'diff' uses the new group format; otherwise, 'diff' uses the changed
+group format.
+
+ The old, new, and unchanged line formats specify the output format of
+lines from the first file, lines from the second file, and lines common
+to both files, respectively.
+
+ The option '--ifdef=NAME' is equivalent to the following sequence of
+options using shell syntax:
+
+ --old-group-format='#ifndef NAME
+ %<#endif /* ! NAME */
+ ' \
+ --new-group-format='#ifdef NAME
+ %>#endif /* NAME */
+ ' \
+ --unchanged-group-format='%=' \
+ --changed-group-format='#ifndef NAME
+ %<#else /* NAME */
+ %>#endif /* NAME */
+ '
+
+ You should carefully check the 'diff' output for proper nesting. For
+example, when using the '-D NAME' or '--ifdef=NAME' option, you should
+check that if the differing lines contain any of the C preprocessor
+directives '#ifdef', '#ifndef', '#else', '#elif', or '#endif', they are
+nested properly and match. If they don't, you must make corrections
+manually. It is a good idea to carefully check the resulting code
+anyway to make sure that it really does what you want it to; depending
+on how the input files were produced, the output might contain duplicate
+or otherwise incorrect code.
+
+ The 'patch' '-D NAME' option behaves like the 'diff' '-D NAME'
+option, except it operates on a file and a diff to produce a merged
+file. *Note patch Options::.
+
+
+File: diffutils.info-t, Node: Incomplete Lines, Next: Comparing Directories, Prev: Output Formats, Up: Top
+
+3 Incomplete Lines
+******************
+
+When an input file ends in a non-newline character, its last line is
+called an "incomplete line" because its last character is not a newline.
+All other lines are called "full lines" and end in a newline character.
+Incomplete lines do not match full lines unless differences in white
+space are ignored (*note White Space::).
+
+ An incomplete line is normally distinguished on output from a full
+line by a following line that starts with '\'. However, the RCS format
+(*note RCS::) outputs the incomplete line as-is, without any trailing
+newline or following line. The side by side format normally represents
+incomplete lines as-is, but in some cases uses a '\' or '/' gutter
+marker. *Note Side by Side::. The if-then-else line format preserves a
+line's incompleteness with '%L', and discards the newline with '%l'.
+*Note Line Formats::. Finally, with the 'ed' and forward 'ed' output
+formats (*note Output Formats::) 'diff' cannot represent an incomplete
+line, so it pretends there was a newline and reports an error.
+
+ For example, suppose 'F' and 'G' are one-byte files that contain just
+'f' and 'g', respectively. Then 'diff F G' outputs
+
+ 1c1
+ < f
+ \ No newline at end of file
+ ---
+ > g
+ \ No newline at end of file
+
+(The exact message may differ in non-English locales.) 'diff -n F G'
+outputs the following without a trailing newline:
+
+ d1 1
+ a1 1
+ g
+
+'diff -e F G' reports two errors and outputs the following:
+
+ 1c
+ g
+ .
+
+
+File: diffutils.info-t, Node: Comparing Directories, Next: Adjusting Output, Prev: Incomplete Lines, Up: Top
+
+4 Comparing Directories
+***********************
+
+You can use 'diff' to compare some or all of the files in two directory
+trees. When both file name arguments to 'diff' are directories, it
+compares each file that is contained in both directories, examining file
+names in alphabetical order as specified by the 'LC_COLLATE' locale
+category. Normally 'diff' is silent about pairs of files that contain
+no differences, but if you use the '--report-identical-files' ('-s')
+option, it reports pairs of identical files. Normally 'diff' reports
+subdirectories common to both directories without comparing
+subdirectories' files, but if you use the '-r' or '--recursive' option,
+it compares every corresponding pair of files in the directory trees, as
+many levels deep as they go.
+
+ If only one file exists, 'diff' normally does not show its contents;
+it merely reports that one file exists but the other does not. You can
+make 'diff' act as though the missing file is empty, so that it outputs
+the entire contents of the file that actually exists. (It is output as
+either an insertion or a deletion, depending on whether the missing file
+is in the first or the second position.) To do this, use the
+'--new-file' ('-N') option. This option affects command-line arguments
+as well as files found via directory traversal; for example, 'diff -N a
+b' treats 'a' as empty if 'a' does not exist but 'b' does, and similarly
+'diff -N - b' treats standard input as empty if it is closed but 'b'
+exists.
+
+ If the older directory contains large files that are not in the newer
+directory, you can make the patch smaller by using the
+'--unidirectional-new-file' option instead of '-N'. This option is like
+'-N' except that it inserts the contents only of files that appear in
+the second directory but not the first (that is, files that were added).
+At the top of the patch, write instructions for the user applying the
+patch to remove the files that were deleted before applying the patch.
+*Note Making Patches::, for more discussion of making patches for
+distribution.
+
+ To ignore some files while comparing directories, use the
+'--exclude=PATTERN' ('-x PATTERN') option. This option ignores any
+files or subdirectories whose base names match the shell pattern
+PATTERN. Unlike in the shell, a period at the start of the base of a
+file name matches a wildcard at the start of a pattern. You should
+enclose PATTERN in quotes so that the shell does not expand it. For
+example, the option '-x '*.[ao]'' ignores any file whose name ends with
+'.a' or '.o'.
+
+ This option accumulates if you specify it more than once. For
+example, using the options '-x 'RCS' -x '*,v'' ignores any file or
+subdirectory whose base name is 'RCS' or ends with ',v'.
+
+ If you need to give this option many times, you can instead put the
+patterns in a file, one pattern per line, and use the
+'--exclude-from=FILE' ('-X FILE') option. Trailing white space and
+empty lines are ignored in the pattern file.
+
+ If you have been comparing two directories and stopped partway
+through, later you might want to continue where you left off. You can
+do this by using the '--starting-file=FILE' ('-S FILE') option. This
+compares only the file FILE and all alphabetically later files in the
+topmost directory level.
+
+ If two directories differ only in that file names are lower case in
+one directory and upper case in the upper, 'diff' normally reports many
+differences because it compares file names in a case sensitive way.
+With the '--ignore-file-name-case' option, 'diff' ignores case
+differences in file names, so that for example the contents of the file
+'Tao' in one directory are compared to the contents of the file 'TAO' in
+the other. The '--no-ignore-file-name-case' option cancels the effect
+of the '--ignore-file-name-case' option, reverting to the default
+behavior.
+
+ If an '--exclude=PATTERN' ('-x PATTERN') option, or an
+'--exclude-from=FILE' ('-X FILE') option, is specified while the
+'--ignore-file-name-case' option is in effect, case is ignored when
+excluding file names matching the specified patterns.
+
+ To tell 'diff' not to follow a symbolic link, use the
+'--no-dereference' option.
+
+
+File: diffutils.info-t, Node: Adjusting Output, Next: diff Performance, Prev: Comparing Directories, Up: Top
+
+5 Making 'diff' Output Prettier
+*******************************
+
+'diff' provides several ways to adjust the appearance of its output.
+These adjustments can be applied to any output format.
+
+* Menu:
+
+* Tabs:: Preserving the alignment of tab stops.
+* Trailing Blanks:: Suppressing blanks before empty output lines.
+* Pagination:: Page numbering and time-stamping 'diff' output.
+
+
+File: diffutils.info-t, Node: Tabs, Next: Trailing Blanks, Up: Adjusting Output
+
+5.1 Preserving Tab Stop Alignment
+=================================
+
+The lines of text in some of the 'diff' output formats are preceded by
+one or two characters that indicate whether the text is inserted,
+deleted, or changed. The addition of those characters can cause tabs to
+move to the next tab stop, throwing off the alignment of columns in the
+line. GNU 'diff' provides two ways to make tab-aligned columns line up
+correctly.
+
+ The first way is to have 'diff' convert all tabs into the correct
+number of spaces before outputting them; select this method with the
+'--expand-tabs' ('-t') option. To use this form of output with 'patch',
+you must give 'patch' the '-l' or '--ignore-white-space' option (*note
+Changed White Space::, for more information). 'diff' normally assumes
+that tab stops are set every 8 print columns, but this can be altered by
+the '--tabsize=COLUMNS' option.
+
+ The other method for making tabs line up correctly is to add a tab
+character instead of a space after the indicator character at the
+beginning of the line. This ensures that all following tab characters
+are in the same position relative to tab stops that they were in the
+original files, so that the output is aligned correctly. Its
+disadvantage is that it can make long lines too long to fit on one line
+of the screen or the paper. It also does not work with the unified
+output format, which does not have a space character after the change
+type indicator character. Select this method with the '-T' or
+'--initial-tab' option.
+
+
+File: diffutils.info-t, Node: Trailing Blanks, Next: Pagination, Prev: Tabs, Up: Adjusting Output
+
+5.2 Omitting trailing blanks
+============================
+
+When outputting lines in normal or context format, or outputting an
+unchanged line in unified format, 'diff' normally outputs a blank just
+before each line. If the line is empty, the output of 'diff' therefore
+contains trailing blanks even though the input does not contain them.
+For example, when outputting an unchanged empty line in context format,
+'diff' normally outputs a line with two leading spaces.
+
+ Some text editors and email agents routinely delete trailing blanks,
+so it can be a problem to deal with diff output files that contain them.
+You can avoid this problem with the '--suppress-blank-empty' option. It
+causes 'diff' to omit trailing blanks at the end of output lines in
+normal, context, and unified format, unless the trailing blanks were
+already present in the input. This changes the output format slightly,
+so that output lines are guaranteed to never end in a blank unless an
+input line ends in a blank. This format is less likely to be munged by
+text editors or by transmission via email. It is accepted by GNU
+'patch' as well.
+
+
+File: diffutils.info-t, Node: Pagination, Prev: Trailing Blanks, Up: Adjusting Output
+
+5.3 Paginating 'diff' Output
+============================
+
+It can be convenient to have long output page-numbered and time-stamped.
+The '--paginate' ('-l') option does this by sending the 'diff' output
+through the 'pr' program. Here is what the page header might look like
+for 'diff -lc lao tzu':
+
+ 2002-02-22 14:20 diff -lc lao tzu Page 1
+
+
+File: diffutils.info-t, Node: diff Performance, Next: Comparing Three Files, Prev: Adjusting Output, Up: Top
+
+6 'diff' Performance Tradeoffs
+******************************
+
+GNU 'diff' runs quite efficiently; however, in some circumstances you
+can cause it to run faster or produce a more compact set of changes.
+
+ One way to improve 'diff' performance is to use hard or symbolic
+links to files instead of copies. This improves performance because
+'diff' normally does not need to read two hard or symbolic links to the
+same file, since their contents must be identical. For example, suppose
+you copy a large directory hierarchy, make a few changes to the copy,
+and then often use 'diff -r' to compare the original to the copy. If
+the original files are read-only, you can greatly improve performance by
+creating the copy using hard or symbolic links (e.g., with GNU 'cp -lR'
+or 'cp -sR'). Before editing a file in the copy for the first time, you
+should break the link and replace it with a regular copy.
+
+ You can also affect the performance of GNU 'diff' by giving it
+options that change the way it compares files. Performance has more
+than one dimension. These options improve one aspect of performance at
+the cost of another, or they improve performance in some cases while
+hurting it in others.
+
+ The way that GNU 'diff' determines which lines have changed always
+comes up with a near-minimal set of differences. Usually it is good
+enough for practical purposes. If the 'diff' output is large, you might
+want 'diff' to use a modified algorithm that sometimes produces a
+smaller set of differences. The '--minimal' ('-d') option does this;
+however, it can also cause 'diff' to run more slowly than usual, so it
+is not the default behavior.
+
+ When the files you are comparing are large and have small groups of
+changes scattered throughout them, you can use the '--speed-large-files'
+option to make a different modification to the algorithm that 'diff'
+uses. If the input files have a constant small density of changes, this
+option speeds up the comparisons without changing the output. If not,
+'diff' might produce a larger set of differences; however, the output
+will still be correct.
+
+ Normally 'diff' discards the prefix and suffix that is common to both
+files before it attempts to find a minimal set of differences. This
+makes 'diff' run faster, but occasionally it may produce non-minimal
+output. The '--horizon-lines=LINES' option prevents 'diff' from
+discarding the last LINES lines of the prefix and the first LINES lines
+of the suffix. This gives 'diff' further opportunities to find a
+minimal output.
+
+ Suppose a run of changed lines includes a sequence of lines at one
+end and there is an identical sequence of lines just outside the other
+end. The 'diff' command is free to choose which identical sequence is
+included in the hunk. In this case, 'diff' normally shifts the hunk's
+boundaries when this merges adjacent hunks, or shifts a hunk's lines
+towards the end of the file. Merging hunks can make the output look
+nicer in some cases.
+
+
+File: diffutils.info-t, Node: Comparing Three Files, Next: diff3 Merging, Prev: diff Performance, Up: Top
+
+7 Comparing Three Files
+***********************
+
+Use the program 'diff3' to compare three files and show any differences
+among them. ('diff3' can also merge files; see *note diff3 Merging::).
+
+ The "normal" 'diff3' output format shows each hunk of differences
+without surrounding context. Hunks are labeled depending on whether
+they are two-way or three-way, and lines are annotated by their location
+in the input files.
+
+ *Note Invoking diff3::, for more information on how to run 'diff3'.
+
+* Menu:
+
+* Sample diff3 Input:: Sample 'diff3' input for examples.
+* Example diff3 Normal:: Sample output in the normal format.
+* Detailed diff3 Normal:: A detailed description of normal output format.
+* diff3 Hunks:: The format of normal output format.
+
+
+File: diffutils.info-t, Node: Sample diff3 Input, Next: Example diff3 Normal, Up: Comparing Three Files
+
+7.1 A Third Sample Input File
+=============================
+
+Here is a third sample file that will be used in examples to illustrate
+the output of 'diff3' and how various options can change it. The first
+two files are the same that we used for 'diff' (*note Sample diff
+Input::). This is the third sample file, called 'tao':
+
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+ The named is the mother of all things.
+
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ so we may see their result.
+ The two are the same,
+ But after they are produced,
+ they have different names.
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+
+
+File: diffutils.info-t, Node: Example diff3 Normal, Next: Detailed diff3 Normal, Prev: Sample diff3 Input, Up: Comparing Three Files
+
+7.2 An Example of 'diff3' Normal Format
+=======================================
+
+Here is the output of the command 'diff3 lao tzu tao' (*note Sample
+diff3 Input::, for the complete contents of the files). Notice that it
+shows only the lines that are different among the three files.
+
+ ====2
+ 1:1,2c
+ 3:1,2c
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+ 2:0a
+ ====1
+ 1:4c
+ The Named is the mother of all things.
+ 2:2,3c
+ 3:4,5c
+ The named is the mother of all things.
+
+ ====3
+ 1:8c
+ 2:7c
+ so we may see their outcome.
+ 3:9c
+ so we may see their result.
+ ====
+ 1:11a
+ 2:11,13c
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+ 3:13,14c
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+
+
+File: diffutils.info-t, Node: Detailed diff3 Normal, Next: diff3 Hunks, Prev: Example diff3 Normal, Up: Comparing Three Files
+
+7.3 Detailed Description of 'diff3' Normal Format
+=================================================
+
+Each hunk begins with a line marked '===='. Three-way hunks have plain
+'====' lines, and two-way hunks have '1', '2', or '3' appended to
+specify which of the three input files differ in that hunk. The hunks
+contain copies of two or three sets of input lines each preceded by one
+or two commands identifying where the lines came from.
+
+ Normally, two spaces precede each copy of an input line to
+distinguish it from the commands. But with the '--initial-tab' ('-T')
+option, 'diff3' uses a tab instead of two spaces; this lines up tabs
+correctly. *Note Tabs::, for more information.
+
+ Commands take the following forms:
+
+'FILE:La'
+ This hunk appears after line L of file FILE, and contains no lines
+ in that file. To edit this file to yield the other files, one must
+ append hunk lines taken from the other files. For example, '1:11a'
+ means that the hunk follows line 11 in the first file and contains
+ no lines from that file.
+
+'FILE:Rc'
+ This hunk contains the lines in the range R of file FILE. The
+ range R is a comma-separated pair of line numbers, or just one
+ number if there is only one line. To edit this file to yield the
+ other files, one must change the specified lines to be the lines
+ taken from the other files. For example, '2:11,13c' means that the
+ hunk contains lines 11 through 13 from the second file.
+
+ If the last line in a set of input lines is incomplete (*note
+Incomplete Lines::), it is distinguished on output from a full line by a
+following line that starts with '\'.
+
+
+File: diffutils.info-t, Node: diff3 Hunks, Prev: Detailed diff3 Normal, Up: Comparing Three Files
+
+7.4 'diff3' Hunks
+=================
+
+Groups of lines that differ in two or three of the input files are
+called "diff3 hunks", by analogy with 'diff' hunks (*note Hunks::). If
+all three input files differ in a 'diff3' hunk, the hunk is called a
+"three-way hunk"; if just two input files differ, it is a "two-way
+hunk".
+
+ As with 'diff', several solutions are possible. When comparing the
+files 'A', 'B', and 'C', 'diff3' normally finds 'diff3' hunks by merging
+the two-way hunks output by the two commands 'diff A B' and 'diff A C'.
+This does not necessarily minimize the size of the output, but
+exceptions should be rare.
+
+ For example, suppose 'F' contains the three lines 'a', 'b', 'f', 'G'
+contains the lines 'g', 'b', 'g', and 'H' contains the lines 'a', 'b',
+'h'. 'diff3 F G H' might output the following:
+
+ ====2
+ 1:1c
+ 3:1c
+ a
+ 2:1c
+ g
+ ====
+ 1:3c
+ f
+ 2:3c
+ g
+ 3:3c
+ h
+
+because it found a two-way hunk containing 'a' in the first and third
+files and 'g' in the second file, then the single line 'b' common to all
+three files, then a three-way hunk containing the last line of each
+file.
+
+
+File: diffutils.info-t, Node: diff3 Merging, Next: Interactive Merging, Prev: Comparing Three Files, Up: Top
+
+8 Merging From a Common Ancestor
+********************************
+
+When two people have made changes to copies of the same file, 'diff3'
+can produce a merged output that contains both sets of changes together
+with warnings about conflicts.
+
+ One might imagine programs with names like 'diff4' and 'diff5' to
+compare more than three files simultaneously, but in practice the need
+rarely arises. You can use 'diff3' to merge three or more sets of
+changes to a file by merging two change sets at a time.
+
+ 'diff3' can incorporate changes from two modified versions into a
+common preceding version. This lets you merge the sets of changes
+represented by the two newer files. Specify the common ancestor version
+as the second argument and the two newer versions as the first and third
+arguments, like this:
+
+ diff3 MINE OLDER YOURS
+
+You can remember the order of the arguments by noting that they are in
+alphabetical order.
+
+ You can think of this as subtracting OLDER from YOURS and adding the
+result to MINE, or as merging into MINE the changes that would turn
+OLDER into YOURS. This merging is well-defined as long as MINE and
+OLDER match in the neighborhood of each such change. This fails to be
+true when all three input files differ or when only OLDER differs; we
+call this a "conflict". When all three input files differ, we call the
+conflict an "overlap".
+
+ 'diff3' gives you several ways to handle overlaps and conflicts. You
+can omit overlaps or conflicts, or select only overlaps, or mark
+conflicts with special '<<<<<<<' and '>>>>>>>' lines.
+
+ 'diff3' can output the merge results as an 'ed' script that that can
+be applied to the first file to yield the merged output. However, it is
+usually better to have 'diff3' generate the merged output directly; this
+bypasses some problems with 'ed'.
+
+* Menu:
+
+* Which Changes:: Selecting changes to incorporate.
+* Marking Conflicts:: Marking conflicts.
+* Bypassing ed:: Generating merged output directly.
+* Merging Incomplete Lines:: How 'diff3' merges incomplete lines.
+* Saving the Changed File:: Emulating System V behavior.
+
+
+File: diffutils.info-t, Node: Which Changes, Next: Marking Conflicts, Up: diff3 Merging
+
+8.1 Selecting Which Changes to Incorporate
+==========================================
+
+You can select all unmerged changes from OLDER to YOURS for merging into
+MINE with the '--ed' ('-e') option. You can select only the
+nonoverlapping unmerged changes with '--easy-only' ('-3'), and you can
+select only the overlapping changes with '--overlap-only' ('-x').
+
+ The '-e', '-3' and '-x' options select only "unmerged changes", i.e.
+changes where MINE and YOURS differ; they ignore changes from OLDER to
+YOURS where MINE and YOURS are identical, because they assume that such
+changes have already been merged. If this assumption is not a safe one,
+you can use the '--show-all' ('-A') option (*note Marking Conflicts::).
+
+ Here is the output of the command 'diff3' with each of these three
+options (*note Sample diff3 Input::, for the complete contents of the
+files). Notice that '-e' outputs the union of the disjoint sets of
+changes output by '-3' and '-x'.
+
+ Output of 'diff3 -e lao tzu tao':
+ 11a
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+ .
+ 8c
+ so we may see their result.
+ .
+
+ Output of 'diff3 -3 lao tzu tao':
+ 8c
+ so we may see their result.
+ .
+
+ Output of 'diff3 -x lao tzu tao':
+ 11a
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+ .
+
+
+File: diffutils.info-t, Node: Marking Conflicts, Next: Bypassing ed, Prev: Which Changes, Up: diff3 Merging
+
+8.2 Marking Conflicts
+=====================
+
+'diff3' can mark conflicts in the merged output by bracketing them with
+special marker lines. A conflict that comes from two files A and B is
+marked as follows:
+
+ <<<<<<< A
+ lines from A
+ =======
+ lines from B
+ >>>>>>> B
+
+ A conflict that comes from three files A, B and C is marked as
+follows:
+
+ <<<<<<< A
+ lines from A
+ ||||||| B
+ lines from B
+ =======
+ lines from C
+ >>>>>>> C
+
+ The '--show-all' ('-A') option acts like the '-e' option, except that
+it brackets conflicts, and it outputs all changes from OLDER to YOURS,
+not just the unmerged changes. Thus, given the sample input files
+(*note Sample diff3 Input::), 'diff3 -A lao tzu tao' puts brackets
+around the conflict where only 'tzu' differs:
+
+ <<<<<<< tzu
+ =======
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+ >>>>>>> tao
+
+ And it outputs the three-way conflict as follows:
+
+ <<<<<<< lao
+ ||||||| tzu
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+ =======
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+ >>>>>>> tao
+
+ The '--show-overlap' ('-E') option outputs less information than the
+'--show-all' ('-A') option, because it outputs only unmerged changes,
+and it never outputs the contents of the second file. Thus the '-E'
+option acts like the '-e' option, except that it brackets the first and
+third files from three-way overlapping changes. Similarly, '-X' acts
+like '-x', except it brackets all its (necessarily overlapping) changes.
+For example, for the three-way overlapping change above, the '-E' and
+'-X' options output the following:
+
+ <<<<<<< lao
+ =======
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+ >>>>>>> tao
+
+ If you are comparing files that have meaningless or uninformative
+names, you can use the '--label=LABEL' option to show alternate names in
+the '<<<<<<<', '|||||||' and '>>>>>>>' brackets. This option can be
+given up to three times, once for each input file. Thus 'diff3 -A
+--label X --label Y --label Z A B C' acts like 'diff3 -A A B C', except
+that the output looks like it came from files named 'X', 'Y' and 'Z'
+rather than from files named 'A', 'B' and 'C'.
+
+
+File: diffutils.info-t, Node: Bypassing ed, Next: Merging Incomplete Lines, Prev: Marking Conflicts, Up: diff3 Merging
+
+8.3 Generating the Merged Output Directly
+=========================================
+
+With the '--merge' ('-m') option, 'diff3' outputs the merged file
+directly. This is more efficient than using 'ed' to generate it, and
+works even with non-text files that 'ed' would reject. If you specify
+'-m' without an 'ed' script option, '-A' is assumed.
+
+ For example, the command 'diff3 -m lao tzu tao' (*note Sample diff3
+Input:: for a copy of the input files) would output the following:
+
+ <<<<<<< tzu
+ =======
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+ >>>>>>> tao
+ The Nameless is the origin of Heaven and Earth;
+ The Named is the mother of all things.
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+ so we may see their result.
+ The two are the same,
+ But after they are produced,
+ they have different names.
+ <<<<<<< lao
+ ||||||| tzu
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+ =======
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+ >>>>>>> tao
+
+
+File: diffutils.info-t, Node: Merging Incomplete Lines, Next: Saving the Changed File, Prev: Bypassing ed, Up: diff3 Merging
+
+8.4 How 'diff3' Merges Incomplete Lines
+=======================================
+
+With '-m', incomplete lines (*note Incomplete Lines::) are simply copied
+to the output as they are found; if the merged output ends in an
+conflict and one of the input files ends in an incomplete line,
+succeeding '|||||||', '=======' or '>>>>>>>' brackets appear somewhere
+other than the start of a line because they are appended to the
+incomplete line.
+
+ Without '-m', if an 'ed' script option is specified and an incomplete
+line is found, 'diff3' generates a warning and acts as if a newline had
+been present.
+
+
+File: diffutils.info-t, Node: Saving the Changed File, Prev: Merging Incomplete Lines, Up: diff3 Merging
+
+8.5 Saving the Changed File
+===========================
+
+Traditional Unix 'diff3' generates an 'ed' script without the trailing
+'w' and 'q' commands that save the changes. System V 'diff3' generates
+these extra commands. GNU 'diff3' normally behaves like traditional
+Unix 'diff3', but with the '-i' option it behaves like System V 'diff3'
+and appends the 'w' and 'q' commands.
+
+ The '-i' option requires one of the 'ed' script options '-AeExX3',
+and is incompatible with the merged output option '-m'.
+
+
+File: diffutils.info-t, Node: Interactive Merging, Next: Merging with patch, Prev: diff3 Merging, Up: Top
+
+9 Interactive Merging with 'sdiff'
+**********************************
+
+With 'sdiff', you can merge two files interactively based on a
+side-by-side '-y' format comparison (*note Side by Side::). Use
+'--output=FILE' ('-o FILE') to specify where to put the merged text.
+*Note Invoking sdiff::, for more details on the options to 'sdiff'.
+
+ Another way to merge files interactively is to use the Emacs Lisp
+package 'emerge'. *Note Emerge: (emacs)Emerge, for more information.
+
+* Menu:
+
+* sdiff Option Summary:: Summary of 'sdiff' options.
+* Merge Commands:: Merging two files interactively.
+
+
+File: diffutils.info-t, Node: sdiff Option Summary, Next: Merge Commands, Up: Interactive Merging
+
+9.1 Specifying 'diff' Options to 'sdiff'
+========================================
+
+The following 'sdiff' options have the same meaning as for 'diff'.
+*Note diff Options::, for the use of these options.
+
+ -a -b -d -i -t -v
+ -B -E -I REGEXP -Z
+
+ --expand-tabs
+ --ignore-blank-lines --ignore-case
+ --ignore-matching-lines=REGEXP --ignore-space-change
+ --ignore-tab-expansion --ignore-trailing-space
+ --left-column --minimal --speed-large-files
+ --strip-trailing-cr --suppress-common-lines
+ --tabsize=COLUMNS --text --version --width=COLUMNS
+
+ For historical reasons, 'sdiff' has alternate names for some options.
+The '-l' option is equivalent to the '--left-column' option, and
+similarly '-s' is equivalent to '--suppress-common-lines'. The meaning
+of the 'sdiff' '-w' and '-W' options is interchanged from that of
+'diff': with 'sdiff', '-w COLUMNS' is equivalent to '--width=COLUMNS',
+and '-W' is equivalent to '--ignore-all-space'. 'sdiff' without the
+'-o' option is equivalent to 'diff' with the '--side-by-side' ('-y')
+option (*note Side by Side::).
+
+
+File: diffutils.info-t, Node: Merge Commands, Prev: sdiff Option Summary, Up: Interactive Merging
+
+9.2 Merge Commands
+==================
+
+Groups of common lines, with a blank gutter, are copied from the first
+file to the output. After each group of differing lines, 'sdiff'
+prompts with '%' and pauses, waiting for one of the following commands.
+Follow each command with <RET>.
+
+'e'
+ Discard both versions. Invoke a text editor on an empty temporary
+ file, then copy the resulting file to the output.
+
+'eb'
+ Concatenate the two versions, edit the result in a temporary file,
+ then copy the edited result to the output.
+
+'ed'
+ Like 'eb', except precede each version with a header that shows
+ what file and lines the version came from.
+
+'el'
+'e1'
+ Edit a copy of the left version, then copy the result to the
+ output.
+
+'er'
+'e2'
+ Edit a copy of the right version, then copy the result to the
+ output.
+
+'l'
+'1'
+ Copy the left version to the output.
+
+'q'
+ Quit.
+
+'r'
+'2'
+ Copy the right version to the output.
+
+'s'
+ Silently copy common lines.
+
+'v'
+ Verbosely copy common lines. This is the default.
+
+ The text editor invoked is specified by the 'EDITOR' environment
+variable if it is set. The default is system-dependent.
+
+
+File: diffutils.info-t, Node: Merging with patch, Next: Making Patches, Prev: Interactive Merging, Up: Top
+
+10 Merging with 'patch'
+***********************
+
+'patch' takes comparison output produced by 'diff' and applies the
+differences to a copy of the original file, producing a patched version.
+With 'patch', you can distribute just the changes to a set of files
+instead of distributing the entire file set; your correspondents can
+apply 'patch' to update their copy of the files with your changes.
+'patch' automatically determines the diff format, skips any leading or
+trailing headers, and uses the headers to determine which file to patch.
+This lets your correspondents feed a mail message containing a
+difference listing directly to 'patch'.
+
+ 'patch' detects and warns about common problems like forward patches.
+It saves any patches that it could not apply. It can also maintain a
+'patchlevel.h' file to ensure that your correspondents apply diffs in
+the proper order.
+
+ 'patch' accepts a series of diffs in its standard input, usually
+separated by headers that specify which file to patch. It applies
+'diff' hunks (*note Hunks::) one by one. If a hunk does not exactly
+match the original file, 'patch' uses heuristics to try to patch the
+file as well as it can. If no approximate match can be found, 'patch'
+rejects the hunk and skips to the next hunk. 'patch' normally replaces
+each file F with its new version, putting reject hunks (if any) into
+'F.rej'.
+
+ *Note Invoking patch::, for detailed information on the options to
+'patch'.
+
+* Menu:
+
+* patch Input:: Selecting the type of 'patch' input.
+* Revision Control:: Getting files from RCS, SCCS, etc.
+* Imperfect:: Dealing with imperfect patches.
+* Creating and Removing:: Creating and removing files with a patch.
+* Patching Time Stamps:: Updating time stamps on patched files.
+* Multiple Patches:: Handling multiple patches in a file.
+* patch Directories:: Changing directory and stripping directories.
+* Backups:: Whether backup files are made.
+* Backup Names:: Backup file names.
+* Reject Names:: Reject file names.
+* patch Messages:: Messages and questions 'patch' can produce.
+* patch and POSIX:: Conformance to the POSIX standard.
+* patch and Tradition:: GNU versus traditional 'patch'.
+
+
+File: diffutils.info-t, Node: patch Input, Next: Revision Control, Up: Merging with patch
+
+10.1 Selecting the 'patch' Input Format
+=======================================
+
+'patch' normally determines which 'diff' format the patch file uses by
+examining its contents. For patch files that contain particularly
+confusing leading text, you might need to use one of the following
+options to force 'patch' to interpret the patch file as a certain format
+of diff. The output formats listed here are the only ones that 'patch'
+can understand.
+
+'-c'
+'--context'
+ context diff.
+
+'-e'
+'--ed'
+ 'ed' script.
+
+'-n'
+'--normal'
+ normal diff.
+
+'-u'
+'--unified'
+ unified diff.
+
+
+File: diffutils.info-t, Node: Revision Control, Next: Imperfect, Prev: patch Input, Up: Merging with patch
+
+10.2 Revision Control
+=====================
+
+If a nonexistent input file is under a revision control system supported
+by 'patch', 'patch' normally asks the user whether to get (or check out)
+the file from the revision control system. Patch currently supports
+RCS, ClearCase and SCCS. Under RCS and SCCS, 'patch' also asks when the
+input file is read-only and matches the default version in the revision
+control system.
+
+ The '--get=NUM' ('-g NUM') option affects access to files under
+supported revision control systems. If NUM is positive, 'patch' gets
+the file without asking the user; if zero, 'patch' neither asks the user
+nor gets the file; and if negative, 'patch' asks the user before getting
+the file. The default value of NUM is given by the value of the
+'PATCH_GET' environment variable if it is set; if not, the default value
+is zero if 'patch' is conforming to POSIX, negative otherwise. *Note
+patch and POSIX::.
+
+ The choice of revision control system is unaffected by the
+'VERSION_CONTROL' environment variable (*note Backup Names::).
+
+
+File: diffutils.info-t, Node: Imperfect, Next: Creating and Removing, Prev: Revision Control, Up: Merging with patch
+
+10.3 Applying Imperfect Patches
+===============================
+
+'patch' tries to skip any leading text in the patch file, apply the
+diff, and then skip any trailing text. Thus you can feed a mail message
+directly to 'patch', and it should work. If the entire diff is indented
+by a constant amount of white space, 'patch' automatically ignores the
+indentation. If a context diff contains trailing carriage return on
+each line, 'patch' automatically ignores the carriage return. If a
+context diff has been encapsulated by prepending '- ' to lines beginning
+with '-' as per Internet RFC 934
+(ftp://ftp.isi.edu/in-notes/rfc934.txt), 'patch' automatically
+unencapsulates the input.
+
+ However, certain other types of imperfect input require user
+intervention or testing.
+
+* Menu:
+
+* Changed White Space:: When tabs and spaces don't match exactly.
+* Reversed Patches:: Applying reversed patches correctly.
+* Inexact:: Helping 'patch' find close matches.
+* Dry Runs:: Predicting what 'patch' will do.
+
+
+File: diffutils.info-t, Node: Changed White Space, Next: Reversed Patches, Up: Imperfect
+
+10.3.1 Applying Patches with Changed White Space
+------------------------------------------------
+
+Sometimes mailers, editors, or other programs change spaces into tabs,
+or vice versa. If this happens to a patch file or an input file, the
+files might look the same, but 'patch' will not be able to match them
+properly. If this problem occurs, use the '-l' or
+'--ignore-white-space' option, which makes 'patch' compare blank
+characters (i.e. spaces and tabs) loosely so that any nonempty sequence
+of blanks in the patch file matches any nonempty sequence of blanks in
+the input files. Non-blank characters must still match exactly. Each
+line of the context must still match a line in the input file.
+
+
+File: diffutils.info-t, Node: Reversed Patches, Next: Inexact, Prev: Changed White Space, Up: Imperfect
+
+10.3.2 Applying Reversed Patches
+--------------------------------
+
+Sometimes people run 'diff' with the new file first instead of second.
+This creates a diff that is "reversed". To apply such patches, give
+'patch' the '--reverse' ('-R') option. 'patch' then attempts to swap
+each hunk around before applying it. Rejects come out in the swapped
+format.
+
+ Often 'patch' can guess that the patch is reversed. If the first
+hunk of a patch fails, 'patch' reverses the hunk to see if it can apply
+it that way. If it can, 'patch' asks you if you want to have the '-R'
+option set; if it can't, 'patch' continues to apply the patch normally.
+This method cannot detect a reversed patch if it is a normal diff and
+the first command is an append (which should have been a delete) since
+appends always succeed, because a null context matches anywhere. But
+most patches add or change lines rather than delete them, so most
+reversed normal diffs begin with a delete, which fails, and 'patch'
+notices.
+
+ If you apply a patch that you have already applied, 'patch' thinks it
+is a reversed patch and offers to un-apply the patch. This could be
+construed as a feature. If you did this inadvertently and you don't
+want to un-apply the patch, just answer 'n' to this offer and to the
+subsequent "apply anyway" question--or type 'C-c' to kill the 'patch'
+process.
+
+
+File: diffutils.info-t, Node: Inexact, Next: Dry Runs, Prev: Reversed Patches, Up: Imperfect
+
+10.3.3 Helping 'patch' Find Inexact Matches
+-------------------------------------------
+
+For context diffs, and to a lesser extent normal diffs, 'patch' can
+detect when the line numbers mentioned in the patch are incorrect, and
+it attempts to find the correct place to apply each hunk of the patch.
+As a first guess, it takes the line number mentioned in the hunk, plus
+or minus any offset used in applying the previous hunk. If that is not
+the correct place, 'patch' scans both forward and backward for a set of
+lines matching the context given in the hunk.
+
+ First 'patch' looks for a place where all lines of the context match.
+If it cannot find such a place, and it is reading a context or unified
+diff, and the maximum fuzz factor is set to 1 or more, then 'patch'
+makes another scan, ignoring the first and last line of context. If
+that fails, and the maximum fuzz factor is set to 2 or more, it makes
+another scan, ignoring the first two and last two lines of context are
+ignored. It continues similarly if the maximum fuzz factor is larger.
+
+ The '--fuzz=LINES' ('-F LINES') option sets the maximum fuzz factor
+to LINES. This option only applies to context and unified diffs; it
+ignores up to LINES lines while looking for the place to install a hunk.
+Note that a larger fuzz factor increases the odds of making a faulty
+patch. The default fuzz factor is 2; there is no point to setting it to
+more than the number of lines of context in the diff, ordinarily 3.
+
+ If 'patch' cannot find a place to install a hunk of the patch, it
+writes the hunk out to a reject file (*note Reject Names::, for
+information on how reject files are named). It writes out rejected
+hunks in context format no matter what form the input patch is in. If
+the input is a normal or 'ed' diff, many of the contexts are simply
+null. The line numbers on the hunks in the reject file may be different
+from those in the patch file: they show the approximate location where
+'patch' thinks the failed hunks belong in the new file rather than in
+the old one.
+
+ If the '--verbose' option is given, then as it completes each hunk
+'patch' tells you whether the hunk succeeded or failed, and if it
+failed, on which line (in the new file) 'patch' thinks the hunk should
+go. If this is different from the line number specified in the diff, it
+tells you the offset. A single large offset _may_ indicate that 'patch'
+installed a hunk in the wrong place. 'patch' also tells you if it used
+a fuzz factor to make the match, in which case you should also be
+slightly suspicious.
+
+ 'patch' cannot tell if the line numbers are off in an 'ed' script,
+and can only detect wrong line numbers in a normal diff when it finds a
+change or delete command. It may have the same problem with a context
+diff using a fuzz factor equal to or greater than the number of lines of
+context shown in the diff (typically 3). In these cases, you should
+probably look at a context diff between your original and patched input
+files to see if the changes make sense. Compiling without errors is a
+pretty good indication that the patch worked, but not a guarantee.
+
+ A patch against an empty file applies to a nonexistent file, and vice
+versa. *Note Creating and Removing::.
+
+ 'patch' usually produces the correct results, even when it must make
+many guesses. However, the results are guaranteed only when the patch
+is applied to an exact copy of the file that the patch was generated
+from.
+
+
+File: diffutils.info-t, Node: Dry Runs, Prev: Inexact, Up: Imperfect
+
+10.3.4 Predicting what 'patch' will do
+--------------------------------------
+
+It may not be obvious in advance what 'patch' will do with a complicated
+or poorly formatted patch. If you are concerned that the input might
+cause 'patch' to modify the wrong files, you can use the '--dry-run'
+option, which causes 'patch' to print the results of applying patches
+without actually changing any files. You can then inspect the
+diagnostics generated by the dry run to see whether 'patch' will modify
+the files that you expect. If the patch does not do what you want, you
+can modify the patch (or the other options to 'patch') and try another
+dry run. Once you are satisfied with the proposed patch you can apply
+it by invoking 'patch' as before, but this time without the '--dry-run'
+option.
+
+
+File: diffutils.info-t, Node: Creating and Removing, Next: Patching Time Stamps, Prev: Imperfect, Up: Merging with patch
+
+10.4 Creating and Removing Files
+================================
+
+Sometimes when comparing two directories, a file may exist in one
+directory but not the other. If you give 'diff' the '--new-file' ('-N')
+option, or if you supply an old or new file that is named '/dev/null' or
+is empty and is dated the Epoch (1970-01-01 00:00:00 UTC), 'diff'
+outputs a patch that adds or deletes the contents of this file. When
+given such a patch, 'patch' normally creates a new file or removes the
+old file. However, when conforming to POSIX (*note patch and POSIX::),
+'patch' does not remove the old file, but leaves it empty. The
+'--remove-empty-files' ('-E') option causes 'patch' to remove output
+files that are empty after applying a patch, even if the patch does not
+appear to be one that removed the file.
+
+ If the patch appears to create a file that already exists, 'patch'
+asks for confirmation before applying the patch.
+
+
+File: diffutils.info-t, Node: Patching Time Stamps, Next: Multiple Patches, Prev: Creating and Removing, Up: Merging with patch
+
+10.5 Updating Time Stamps on Patched Files
+==========================================
+
+When 'patch' updates a file, it normally sets the file's last-modified
+time stamp to the current time of day. If you are using 'patch' to
+track a software distribution, this can cause 'make' to incorrectly
+conclude that a patched file is out of date. For example, if 'syntax.c'
+depends on 'syntax.y', and 'patch' updates 'syntax.c' and then
+'syntax.y', then 'syntax.c' will normally appear to be out of date with
+respect to 'syntax.y' even though its contents are actually up to date.
+
+ The '--set-utc' ('-Z') option causes 'patch' to set a patched file's
+modification and access times to the time stamps given in context diff
+headers. If the context diff headers do not specify a time zone, they
+are assumed to use Coordinated Universal Time (UTC, often known as GMT).
+
+ The '--set-time' ('-T') option acts like '-Z' or '--set-utc', except
+that it assumes that the context diff headers' time stamps use local
+time instead of UTC. This option is not recommended, because patches
+using local time cannot easily be used by people in other time zones,
+and because local time stamps are ambiguous when local clocks move
+backwards during daylight-saving time adjustments. If the context diff
+headers specify a time zone, this option is equivalent to '--set-utc'
+('-Z').
+
+ 'patch' normally refrains from setting a file's time stamps if the
+file's original last-modified time stamp does not match the time given
+in the diff header, of if the file's contents do not exactly match the
+patch. However, if the '--force' ('-f') option is given, the file's
+time stamps are set regardless.
+
+ Due to the limitations of the current 'diff' format, 'patch' cannot
+update the times of files whose contents have not changed. Also, if you
+set file time stamps to values other than the current time of day, you
+should also remove (e.g., with 'make clean') all files that depend on
+the patched files, so that later invocations of 'make' do not get
+confused by the patched files' times.
+
+
+File: diffutils.info-t, Node: Multiple Patches, Next: patch Directories, Prev: Patching Time Stamps, Up: Merging with patch
+
+10.6 Multiple Patches in a File
+===============================
+
+If the patch file contains more than one patch, and if you do not
+specify an input file on the command line, 'patch' tries to apply each
+patch as if they came from separate patch files. This means that it
+determines the name of the file to patch for each patch, and that it
+examines the leading text before each patch for file names and
+prerequisite revision level (*note Making Patches::, for more on that
+topic).
+
+ 'patch' uses the following rules to intuit a file name from the
+leading text before a patch. First, 'patch' takes an ordered list of
+candidate file names as follows:
+
+ * If the header is that of a context diff, 'patch' takes the old and
+ new file names in the header. A name is ignored if it does not
+ have enough slashes to satisfy the '-pNUM' or '--strip=NUM' option.
+ The name '/dev/null' is also ignored.
+
+ * If there is an 'Index:' line in the leading garbage and if either
+ the old and new names are both absent or if 'patch' is conforming
+ to POSIX, 'patch' takes the name in the 'Index:' line.
+
+ * For the purpose of the following rules, the candidate file names
+ are considered to be in the order (old, new, index), regardless of
+ the order that they appear in the header.
+
+Then 'patch' selects a file name from the candidate list as follows:
+
+ * If some of the named files exist, 'patch' selects the first name if
+ conforming to POSIX, and the best name otherwise.
+
+ * If 'patch' is not ignoring RCS, ClearCase, and SCCS (*note Revision
+ Control::), and no named files exist but an RCS, ClearCase, or SCCS
+ master is found, 'patch' selects the first named file with an RCS,
+ ClearCase, or SCCS master.
+
+ * If no named files exist, no RCS, ClearCase, or SCCS master was
+ found, some names are given, 'patch' is not conforming to POSIX,
+ and the patch appears to create a file, 'patch' selects the best
+ name requiring the creation of the fewest directories.
+
+ * If no file name results from the above heuristics, you are asked
+ for the name of the file to patch, and 'patch' selects that name.
+
+ To determine the "best" of a nonempty list of file names, 'patch'
+first takes all the names with the fewest path name components; of
+those, it then takes all the names with the shortest basename; of those,
+it then takes all the shortest names; finally, it takes the first
+remaining name.
+
+ *Note patch and POSIX::, to see whether 'patch' is conforming to
+POSIX.
+
+
+File: diffutils.info-t, Node: patch Directories, Next: Backups, Prev: Multiple Patches, Up: Merging with patch
+
+10.7 Applying Patches in Other Directories
+==========================================
+
+The '--directory=DIRECTORY' ('-d DIRECTORY') option to 'patch' makes
+directory DIRECTORY the current directory for interpreting both file
+names in the patch file, and file names given as arguments to other
+options (such as '-B' and '-o'). For example, while in a mail reading
+program, you can patch a file in the '/usr/src/emacs' directory directly
+from a message containing the patch like this:
+
+ | patch -d /usr/src/emacs
+
+ Sometimes the file names given in a patch contain leading
+directories, but you keep your files in a directory different from the
+one given in the patch. In those cases, you can use the
+'--strip=NUMBER' ('-pNUMBER') option to set the file name strip count to
+NUMBER. The strip count tells 'patch' how many slashes, along with the
+directory names between them, to strip from the front of file names. A
+sequence of one or more adjacent slashes is counted as a single slash.
+By default, 'patch' strips off all leading directories, leaving just the
+base file names.
+
+ For example, suppose the file name in the patch file is
+'/gnu/src/emacs/etc/NEWS'. Using '-p0' gives the entire file name
+unmodified, '-p1' gives 'gnu/src/emacs/etc/NEWS' (no leading slash),
+'-p4' gives 'etc/NEWS', and not specifying '-p' at all gives 'NEWS'.
+
+ 'patch' looks for each file (after any slashes have been stripped) in
+the current directory, or if you used the '-d DIRECTORY' option, in that
+directory.
+
+
+File: diffutils.info-t, Node: Backups, Next: Backup Names, Prev: patch Directories, Up: Merging with patch
+
+10.8 Backup Files
+=================
+
+Normally, 'patch' creates a backup file if the patch does not exactly
+match the original input file, because in that case the original data
+might not be recovered if you undo the patch with 'patch -R' (*note
+Reversed Patches::). However, when conforming to POSIX, 'patch' does
+not create backup files by default. *Note patch and POSIX::.
+
+ The '--backup' ('-b') option causes 'patch' to make a backup file
+regardless of whether the patch matches the original input. The
+'--backup-if-mismatch' option causes 'patch' to create backup files for
+mismatches files; this is the default when not conforming to POSIX. The
+'--no-backup-if-mismatch' option causes 'patch' to not create backup
+files, even for mismatched patches; this is the default when conforming
+to POSIX.
+
+ When backing up a file that does not exist, an empty, unreadable
+backup file is created as a placeholder to represent the nonexistent
+file.
+
+
+File: diffutils.info-t, Node: Backup Names, Next: Reject Names, Prev: Backups, Up: Merging with patch
+
+10.9 Backup File Names
+======================
+
+Normally, 'patch' renames an original input file into a backup file by
+appending to its name the extension '.orig', or '~' if using '.orig'
+would make the backup file name too long.(1) The '-z BACKUP-SUFFIX' or
+'--suffix=BACKUP-SUFFIX' option causes 'patch' to use BACKUP-SUFFIX as
+the backup extension instead.
+
+ Alternately, you can specify the extension for backup files with the
+'SIMPLE_BACKUP_SUFFIX' environment variable, which the options override.
+
+ 'patch' can also create numbered backup files the way GNU Emacs does.
+With this method, instead of having a single backup of each file,
+'patch' makes a new backup file name each time it patches a file. For
+example, the backups of a file named 'sink' would be called,
+successively, 'sink.~1~', 'sink.~2~', 'sink.~3~', etc.
+
+ The '-V BACKUP-STYLE' or '--version-control=BACKUP-STYLE' option
+takes as an argument a method for creating backup file names. You can
+alternately control the type of backups that 'patch' makes with the
+'PATCH_VERSION_CONTROL' environment variable, which the '-V' option
+overrides. If 'PATCH_VERSION_CONTROL' is not set, the 'VERSION_CONTROL'
+environment variable is used instead. Please note that these options
+and variables control backup file names; they do not affect the choice
+of revision control system (*note Revision Control::).
+
+ The values of these environment variables and the argument to the
+'-V' option are like the GNU Emacs 'version-control' variable (*note
+(emacs)Backup Names::, for more information on backup versions in
+Emacs). They also recognize synonyms that are more descriptive. The
+valid values are listed below; unique abbreviations are acceptable.
+
+'t'
+'numbered'
+ Always make numbered backups.
+
+'nil'
+'existing'
+ Make numbered backups of files that already have them, simple
+ backups of the others. This is the default.
+
+'never'
+'simple'
+ Always make simple backups.
+
+ You can also tell 'patch' to prepend a prefix, such as a directory
+name, to produce backup file names. The '--prefix=PREFIX' ('-B PREFIX')
+option makes backup files by prepending PREFIX to them. The
+'--basename-prefix=PREFIX' ('-Y PREFIX') prepends PREFIX to the last
+file name component of backup file names instead; for example, '-Y ~'
+causes the backup name for 'dir/file.c' to be 'dir/~file.c'. If you use
+either of these prefix options, the suffix-based options are ignored.
+
+ If you specify the output file with the '-o' option, that file is the
+one that is backed up, not the input file.
+
+ Options that affect the names of backup files do not affect whether
+backups are made. For example, if you specify the
+'--no-backup-if-mismatch' option, none of the options described in this
+section have any affect, because no backups are made.
+
+ ---------- Footnotes ----------
+
+ (1) A coding error in GNU 'patch' version 2.5.4 causes it to always
+use '~', but this should be fixed in the next release.
+
+
+File: diffutils.info-t, Node: Reject Names, Next: patch Messages, Prev: Backup Names, Up: Merging with patch
+
+10.10 Reject File Names
+=======================
+
+The names for reject files (files containing patches that 'patch' could
+not find a place to apply) are normally the name of the output file with
+'.rej' appended (or '#' if using '.rej' would make the backup file name
+too long).
+
+ Alternatively, you can tell 'patch' to place all of the rejected
+patches in a single file. The '-r REJECT-FILE' or
+'--reject-file=REJECT-FILE' option uses REJECT-FILE as the reject file
+name.
+
+
+File: diffutils.info-t, Node: patch Messages, Next: patch and POSIX, Prev: Reject Names, Up: Merging with patch
+
+10.11 Messages and Questions from 'patch'
+=========================================
+
+'patch' can produce a variety of messages, especially if it has trouble
+decoding its input. In a few situations where it's not sure how to
+proceed, 'patch' normally prompts you for more information from the
+keyboard. There are options to produce more or fewer messages, to have
+it not ask for keyboard input, and to affect the way that file names are
+quoted in messages.
+
+* Menu:
+
+* More or Fewer Messages:: Controlling the verbosity of 'patch'.
+* patch and Keyboard Input:: Inhibiting keyboard input.
+* patch Quoting Style:: Quoting file names in diagnostics.
+
+ 'patch' exits with status 0 if all hunks are applied successfully, 1
+if some hunks cannot be applied, and 2 if there is more serious trouble.
+When applying a set of patches in a loop, you should check the exit
+status, so you don't apply a later patch to a partially patched file.
+
+
+File: diffutils.info-t, Node: More or Fewer Messages, Next: patch and Keyboard Input, Up: patch Messages
+
+10.11.1 Controlling the Verbosity of 'patch'
+--------------------------------------------
+
+You can cause 'patch' to produce more messages by using the '--verbose'
+option. For example, when you give this option, the message 'Hmm...'
+indicates that 'patch' is reading text in the patch file, attempting to
+determine whether there is a patch in that text, and if so, what kind of
+patch it is.
+
+ You can inhibit all terminal output from 'patch', unless an error
+occurs, by using the '-s', '--quiet', or '--silent' option.
+
+
+File: diffutils.info-t, Node: patch and Keyboard Input, Next: patch Quoting Style, Prev: More or Fewer Messages, Up: patch Messages
+
+10.11.2 Inhibiting Keyboard Input
+---------------------------------
+
+There are two ways you can prevent 'patch' from asking you any
+questions. The '--force' ('-f') option assumes that you know what you
+are doing. It causes 'patch' to do the following:
+
+ * Skip patches that do not contain file names in their headers.
+
+ * Patch files even though they have the wrong version for the
+ 'Prereq:' line in the patch;
+
+ * Assume that patches are not reversed even if they look like they
+ are.
+
+The '--batch' ('-t') option is similar to '-f', in that it suppresses
+questions, but it makes somewhat different assumptions:
+
+ * Skip patches that do not contain file names in their headers (the
+ same as '-f').
+
+ * Skip patches for which the file has the wrong version for the
+ 'Prereq:' line in the patch;
+
+ * Assume that patches are reversed if they look like they are.
+
+
+File: diffutils.info-t, Node: patch Quoting Style, Prev: patch and Keyboard Input, Up: patch Messages
+
+10.11.3 'patch' Quoting Style
+-----------------------------
+
+When 'patch' outputs a file name in a diagnostic message, it can format
+the name in any of several ways. This can be useful to output file
+names unambiguously, even if they contain punctuation or special
+characters like newlines. The '--quoting-style=WORD' option controls
+how names are output. The WORD should be one of the following:
+
+'literal'
+ Output names as-is.
+'shell'
+ Quote names for the shell if they contain shell metacharacters or
+ would cause ambiguous output.
+'shell-always'
+ Quote names for the shell, even if they would normally not require
+ quoting.
+'c'
+ Quote names as for a C language string.
+'escape'
+ Quote as with 'c' except omit the surrounding double-quote
+ characters.
+
+ You can specify the default value of the '--quoting-style' option
+with the environment variable 'QUOTING_STYLE'. If that environment
+variable is not set, the default value is 'shell', but this default may
+change in a future version of 'patch'.
+
+
+File: diffutils.info-t, Node: patch and POSIX, Next: patch and Tradition, Prev: patch Messages, Up: Merging with patch
+
+10.12 'patch' and the POSIX Standard
+====================================
+
+If you specify the '--posix' option, or set the 'POSIXLY_CORRECT'
+environment variable, 'patch' conforms more strictly to the POSIX
+standard, as follows:
+
+ * Take the first existing file from the list (old, new, index) when
+ intuiting file names from diff headers. *Note Multiple Patches::.
+
+ * Do not remove files that are removed by a diff. *Note Creating and
+ Removing::.
+
+ * Do not ask whether to get files from RCS, ClearCase, or SCCS.
+ *Note Revision Control::.
+
+ * Require that all options precede the files in the command line.
+
+ * Do not backup files, even when there is a mismatch. *Note
+ Backups::.
+
+
+File: diffutils.info-t, Node: patch and Tradition, Prev: patch and POSIX, Up: Merging with patch
+
+10.13 GNU 'patch' and Traditional 'patch'
+=========================================
+
+The current version of GNU 'patch' normally follows the POSIX standard.
+*Note patch and POSIX::, for the few exceptions to this general rule.
+
+ Unfortunately, POSIX redefined the behavior of 'patch' in several
+important ways. You should be aware of the following differences if you
+must interoperate with traditional 'patch', or with GNU 'patch' version
+2.1 and earlier.
+
+ * In traditional 'patch', the '-p' option's operand was optional, and
+ a bare '-p' was equivalent to '-p0'. The '-p' option now requires
+ an operand, and '-p 0' is now equivalent to '-p0'. For maximum
+ compatibility, use options like '-p0' and '-p1'.
+
+ Also, traditional 'patch' simply counted slashes when stripping
+ path prefixes; 'patch' now counts pathname components. That is, a
+ sequence of one or more adjacent slashes now counts as a single
+ slash. For maximum portability, avoid sending patches containing
+ '//' in file names.
+
+ * In traditional 'patch', backups were enabled by default. This
+ behavior is now enabled with the '--backup' ('-b') option.
+
+ Conversely, in POSIX 'patch', backups are never made, even when
+ there is a mismatch. In GNU 'patch', this behavior is enabled with
+ the '--no-backup-if-mismatch' option, or by conforming to POSIX.
+
+ The '-b SUFFIX' option of traditional 'patch' is equivalent to the
+ '-b -z SUFFIX' options of GNU 'patch'.
+
+ * Traditional 'patch' used a complicated (and incompletely
+ documented) method to intuit the name of the file to be patched
+ from the patch header. This method did not conform to POSIX, and
+ had a few gotchas. Now 'patch' uses a different, equally
+ complicated (but better documented) method that is optionally
+ POSIX-conforming; we hope it has fewer gotchas. The two methods
+ are compatible if the file names in the context diff header and the
+ 'Index:' line are all identical after prefix-stripping. Your patch
+ is normally compatible if each header's file names all contain the
+ same number of slashes.
+
+ * When traditional 'patch' asked the user a question, it sent the
+ question to standard error and looked for an answer from the first
+ file in the following list that was a terminal: standard error,
+ standard output, '/dev/tty', and standard input. Now 'patch' sends
+ questions to standard output and gets answers from '/dev/tty'.
+ Defaults for some answers have been changed so that 'patch' never
+ goes into an infinite loop when using default answers.
+
+ * Traditional 'patch' exited with a status value that counted the
+ number of bad hunks, or with status 1 if there was real trouble.
+ Now 'patch' exits with status 1 if some hunks failed, or with 2 if
+ there was real trouble.
+
+ * Limit yourself to the following options when sending instructions
+ meant to be executed by anyone running GNU 'patch', traditional
+ 'patch', or a 'patch' that conforms to POSIX. Spaces are
+ significant in the following list, and operands are required.
+
+ -c
+ -d DIR
+ -D DEFINE
+ -e
+ -l
+ -n
+ -N
+ -o OUTFILE
+ -pNUM
+ -R
+ -r REJECTFILE
+
+
+File: diffutils.info-t, Node: Making Patches, Next: Invoking cmp, Prev: Merging with patch, Up: Top
+
+11 Tips for Making and Using Patches
+************************************
+
+Use some common sense when making and using patches. For example, when
+sending bug fixes to a program's maintainer, send several small patches,
+one per independent subject, instead of one large, harder-to-digest
+patch that covers all the subjects.
+
+ Here are some other things you should keep in mind if you are going
+to distribute patches for updating a software package.
+
+* Menu:
+
+* Tips for Patch Producers:: Advice for making patches.
+* Tips for Patch Consumers:: Advice for using patches.
+* Avoiding Common Mistakes:: Avoiding common mistakes when using 'patch'.
+* Generating Smaller Patches:: How to generate smaller patches.
+
+
+File: diffutils.info-t, Node: Tips for Patch Producers, Next: Tips for Patch Consumers, Up: Making Patches
+
+11.1 Tips for Patch Producers
+=============================
+
+To create a patch that changes an older version of a package into a
+newer version, first make a copy of the older and newer versions in
+adjacent subdirectories. It is common to do that by unpacking 'tar'
+archives of the two versions.
+
+ To generate the patch, use the command 'diff -Naur OLD NEW' where OLD
+and NEW identify the old and new directories. The names OLD and NEW
+should not contain any slashes. The '-N' option lets the patch create
+and remove files; '-a' lets the patch update non-text files; '-u'
+generates useful time stamps and enough context; and '-r' lets the patch
+update subdirectories. Here is an example command, using Bourne shell
+syntax:
+
+ diff -Naur gcc-3.0.3 gcc-3.0.4
+
+ Tell your recipients how to apply the patches. This should include
+which working directory to use, and which 'patch' options to use; the
+option '-p1' is recommended. Test your procedure by pretending to be a
+recipient and applying your patches to a copy of the original files.
+
+ *Note Avoiding Common Mistakes::, for how to avoid common mistakes
+when generating a patch.
+
+
+File: diffutils.info-t, Node: Tips for Patch Consumers, Next: Avoiding Common Mistakes, Prev: Tips for Patch Producers, Up: Making Patches
+
+11.2 Tips for Patch Consumers
+=============================
+
+A patch producer should tell recipients how to apply the patches, so the
+first rule of thumb for a patch consumer is to follow the instructions
+supplied with the patch.
+
+ GNU 'diff' can analyze files with arbitrarily long lines and files
+that end in incomplete lines. However, older versions of 'patch' cannot
+patch such files. If you are having trouble applying such patches, try
+upgrading to a recent version of GNU 'patch'.
+
+
+File: diffutils.info-t, Node: Avoiding Common Mistakes, Next: Generating Smaller Patches, Prev: Tips for Patch Consumers, Up: Making Patches
+
+11.3 Avoiding Common Mistakes
+=============================
+
+When producing a patch for multiple files, apply 'diff' to directories
+whose names do not have slashes. This reduces confusion when the patch
+consumer specifies the '-pNUMBER' option, since this option can have
+surprising results when the old and new file names have different
+numbers of slashes. For example, do not send a patch with a header that
+looks like this:
+
+ diff -Naur v2.0.29/prog/README prog/README
+ --- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800
+ +++ prog/README 2002-03-17 20:49:32.442260588 -0800
+
+because the two file names have different numbers of slashes, and
+different versions of 'patch' interpret the file names differently. To
+avoid confusion, send output that looks like this instead:
+
+ diff -Naur v2.0.29/prog/README v2.0.30/prog/README
+ --- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800
+ +++ v2.0.30/prog/README 2002-03-17 20:49:32.442260588 -0800
+
+ Make sure you have specified the file names correctly, either in a
+context diff header or with an 'Index:' line. Take care to not send out
+reversed patches, since these make people wonder whether they have
+already applied the patch.
+
+ Avoid sending patches that compare backup file names like
+'README.orig' or 'README~', since this might confuse 'patch' into
+patching a backup file instead of the real file. Instead, send patches
+that compare the same base file names in different directories, e.g.
+'old/README' and 'new/README'.
+
+ To save people from partially applying a patch before other patches
+that should have gone before it, you can make the first patch in the
+patch file update a file with a name like 'patchlevel.h' or 'version.c',
+which contains a patch level or version number. If the input file
+contains the wrong version number, 'patch' will complain immediately.
+
+ An even clearer way to prevent this problem is to put a 'Prereq:'
+line before the patch. If the leading text in the patch file contains a
+line that starts with 'Prereq:', 'patch' takes the next word from that
+line (normally a version number) and checks whether the next input file
+contains that word, preceded and followed by either white space or a
+newline. If not, 'patch' prompts you for confirmation before
+proceeding. This makes it difficult to accidentally apply patches in
+the wrong order.
+
+
+File: diffutils.info-t, Node: Generating Smaller Patches, Prev: Avoiding Common Mistakes, Up: Making Patches
+
+11.4 Generating Smaller Patches
+===============================
+
+The simplest way to generate a patch is to use 'diff -Naur' (*note Tips
+for Patch Producers::), but you might be able to reduce the size of the
+patch by renaming or removing some files before making the patch. If
+the older version of the package contains any files that the newer
+version does not, or if any files have been renamed between the two
+versions, make a list of 'rm' and 'mv' commands for the user to execute
+in the old version directory before applying the patch. Then run those
+commands yourself in the scratch directory.
+
+ If there are any files that you don't need to include in the patch
+because they can easily be rebuilt from other files (for example, 'TAGS'
+and output from 'yacc' and 'makeinfo'), exclude them from the patch by
+giving 'diff' the '-x PATTERN' option (*note Comparing Directories::).
+If you want your patch to modify a derived file because your recipients
+lack tools to build it, make sure that the patch for the derived file
+follows any patches for files that it depends on, so that the
+recipients' time stamps will not confuse 'make'.
+
+ Now you can create the patch using 'diff -Naur'. Make sure to
+specify the scratch directory first and the newer directory second.
+
+ Add to the top of the patch a note telling the user any 'rm' and 'mv'
+commands to run before applying the patch. Then you can remove the
+scratch directory.
+
+ You can also shrink the patch size by using fewer lines of context,
+but bear in mind that 'patch' typically needs at least two lines for
+proper operation when patches do not exactly match the input files.
+
+
+File: diffutils.info-t, Node: Invoking cmp, Next: Invoking diff, Prev: Making Patches, Up: Top
+
+12 Invoking 'cmp'
+*****************
+
+The 'cmp' command compares two files, and if they differ, tells the
+first byte and line number where they differ or reports that one file is
+a prefix of the other. Bytes and lines are numbered starting with 1.
+The arguments of 'cmp' are as follows:
+
+ cmp OPTIONS... FROM-FILE [TO-FILE [FROM-SKIP [TO-SKIP]]]
+
+ The file name '-' is always the standard input. 'cmp' also uses the
+standard input if one file name is omitted. The FROM-SKIP and TO-SKIP
+operands specify how many bytes to ignore at the start of each file;
+they are equivalent to the '--ignore-initial=FROM-SKIP:TO-SKIP' option.
+
+ By default, 'cmp' outputs nothing if the two files have the same
+contents. If one file is a prefix of the other, 'cmp' prints to
+standard error a message of the following form:
+
+ cmp: EOF on SHORTER-FILE
+
+ Otherwise, 'cmp' prints to standard output a message of the following
+form:
+
+ FROM-FILE TO-FILE differ: char BYTE-NUMBER, line LINE-NUMBER
+
+ The message formats can differ outside the POSIX locale. Also, POSIX
+allows the EOF message to be followed by a blank and some additional
+information.
+
+ An exit status of 0 means no differences were found, 1 means some
+differences were found, and 2 means trouble.
+
+* Menu:
+
+* cmp Options:: Summary of options to 'cmp'.
+
+
+File: diffutils.info-t, Node: cmp Options, Up: Invoking cmp
+
+12.1 Options to 'cmp'
+=====================
+
+Below is a summary of all of the options that GNU 'cmp' accepts. Most
+options have two equivalent names, one of which is a single letter
+preceded by '-', and the other of which is a long name preceded by '--'.
+Multiple single letter options (unless they take an argument) can be
+combined into a single command line word: '-bl' is equivalent to '-b
+-l'.
+
+'-b'
+'--print-bytes'
+ Print the differing bytes. Display control bytes as a '^' followed
+ by a letter of the alphabet and precede bytes that have the high
+ bit set with 'M-' (which stands for "meta").
+
+'--help'
+ Output a summary of usage and then exit.
+
+'-i SKIP'
+'--ignore-initial=SKIP'
+ Ignore any differences in the first SKIP bytes of the input files.
+ Treat files with fewer than SKIP bytes as if they are empty. If
+ SKIP is of the form 'FROM-SKIP:TO-SKIP', skip the first FROM-SKIP
+ bytes of the first input file and the first TO-SKIP bytes of the
+ second.
+
+'-l'
+'--verbose'
+ Output the (decimal) byte numbers and (octal) values of all
+ differing bytes, instead of the default standard output. Each
+ output line contains a differing byte's number relative to the
+ start of the input, followed by the differing byte values. Byte
+ numbers start at 1. Also, output the EOF message if one file is
+ shorter than the other.
+
+'-n COUNT'
+'--bytes=COUNT'
+ Compare at most COUNT input bytes.
+
+'-s'
+'--quiet'
+'--silent'
+ Do not print anything; only return an exit status indicating
+ whether the files differ.
+
+'-v'
+'--version'
+ Output version information and then exit.
+
+ In the above table, operands that are byte counts are normally
+decimal, but may be preceded by '0' for octal and '0x' for hexadecimal.
+
+ A byte count can be followed by a suffix to specify a multiple of
+that count; in this case an omitted integer is understood to be 1. A
+bare size letter, or one followed by 'iB', specifies a multiple using
+powers of 1024. A size letter followed by 'B' specifies powers of 1000
+instead. For example, '-n 4M' and '-n 4MiB' are equivalent to '-n
+4194304', whereas '-n 4MB' is equivalent to '-n 4000000'. This notation
+is upward compatible with the SI prefixes
+(http://www.bipm.fr/enus/3_SI/si-prefixes.html) for decimal multiples
+and with the IEC 60027-2 prefixes for binary multiples
+(http://physics.nist.gov/cuu/Units/binary.html).
+
+ The following suffixes are defined. Large sizes like '1Y' may be
+rejected by your computer due to limitations of its arithmetic.
+
+'kB'
+ kilobyte: 10^3 = 1000.
+'k'
+'K'
+'KiB'
+ kibibyte: 2^10 = 1024. 'K' is special: the SI prefix is 'k' and
+ the IEC 60027-2 prefix is 'Ki', but tradition and POSIX use 'k' to
+ mean 'KiB'.
+'MB'
+ megabyte: 10^6 = 1,000,000.
+'M'
+'MiB'
+ mebibyte: 2^20 = 1,048,576.
+'GB'
+ gigabyte: 10^9 = 1,000,000,000.
+'G'
+'GiB'
+ gibibyte: 2^30 = 1,073,741,824.
+'TB'
+ terabyte: 10^12 = 1,000,000,000,000.
+'T'
+'TiB'
+ tebibyte: 2^40 = 1,099,511,627,776.
+'PB'
+ petabyte: 10^15 = 1,000,000,000,000,000.
+'P'
+'PiB'
+ pebibyte: 2^50 = 1,125,899,906,842,624.
+'EB'
+ exabyte: 10^18 = 1,000,000,000,000,000,000.
+'E'
+'EiB'
+ exbibyte: 2^60 = 1,152,921,504,606,846,976.
+'ZB'
+ zettabyte: 10^21 = 1,000,000,000,000,000,000,000
+'Z'
+'ZiB'
+ 2^70 = 1,180,591,620,717,411,303,424. ('Zi' is a GNU extension to
+ IEC 60027-2.)
+'YB'
+ yottabyte: 10^24 = 1,000,000,000,000,000,000,000,000.
+'Y'
+'YiB'
+ 2^80 = 1,208,925,819,614,629,174,706,176. ('Yi' is a GNU extension
+ to IEC 60027-2.)
+
+
+File: diffutils.info-t, Node: Invoking diff, Next: Invoking diff3, Prev: Invoking cmp, Up: Top
+
+13 Invoking 'diff'
+******************
+
+The format for running the 'diff' command is:
+
+ diff OPTIONS... FILES...
+
+ In the simplest case, two file names FROM-FILE and TO-FILE are given,
+and 'diff' compares the contents of FROM-FILE and TO-FILE. A file name
+of '-' stands for the standard input.
+
+ If one file is a directory and the other is not, 'diff' compares the
+file in the directory whose name is that of the non-directory. The
+non-directory file must not be '-'.
+
+ If two file names are given and both are directories, 'diff' compares
+corresponding files in both directories, in alphabetical order; this
+comparison is not recursive unless the '--recursive' ('-r') option is
+given. 'diff' never compares the actual contents of a directory as if
+it were a file. The file that is fully specified may not be standard
+input, because standard input is nameless and the notion of "file with
+the same name" does not apply.
+
+ If the '--from-file=FILE' option is given, the number of file names
+is arbitrary, and FILE is compared to each named file. Similarly, if
+the '--to-file=FILE' option is given, each named file is compared to
+FILE.
+
+ 'diff' options begin with '-', so normally file names may not begin
+with '-'. However, '--' as an argument by itself treats the remaining
+arguments as file names even if they begin with '-'.
+
+ An exit status of 0 means no differences were found, 1 means some
+differences were found, and 2 means trouble.
+
+* Menu:
+
+* diff Options:: Summary of options to 'diff'.
+
+
+File: diffutils.info-t, Node: diff Options, Up: Invoking diff
+
+13.1 Options to 'diff'
+======================
+
+Below is a summary of all of the options that GNU 'diff' accepts. Most
+options have two equivalent names, one of which is a single letter
+preceded by '-', and the other of which is a long name preceded by '--'.
+Multiple single letter options (unless they take an argument) can be
+combined into a single command line word: '-ac' is equivalent to '-a
+-c'. Long named options can be abbreviated to any unique prefix of
+their name. Brackets ([ and ]) indicate that an option takes an
+optional argument.
+
+'-a'
+'--text'
+ Treat all files as text and compare them line-by-line, even if they
+ do not seem to be text. *Note Binary::.
+
+'-b'
+'--ignore-space-change'
+ Ignore changes in amount of white space. *Note White Space::.
+
+'-B'
+'--ignore-blank-lines'
+ Ignore changes that just insert or delete blank lines. *Note Blank
+ Lines::.
+
+'--binary'
+ Read and write data in binary mode. *Note Binary::.
+
+'-c'
+ Use the context output format, showing three lines of context.
+ *Note Context Format::.
+
+'--color [=WHEN]'
+ Specify whether to use color for distinguishing different contexts,
+ like header, added or removed lines. WHEN may be omitted, or one
+ of:
+ * none Do not use color at all. This is the default when no
+ -color option is specified.
+ * auto Use color only if standard output is a terminal.
+ * always Always use color.
+ Specifying '--color' and no WHEN is equivalent to '--color=auto'.
+
+'-C LINES'
+'--context[=LINES]'
+ Use the context output format, showing LINES (an integer) lines of
+ context, or three if LINES is not given. *Note Context Format::.
+ For proper operation, 'patch' typically needs at least two lines of
+ context.
+
+ For compatibility 'diff' also supports an obsolete option syntax
+ '-LINES' that has effect when combined with '-c', '-p', or '-u'.
+ New scripts should use '-U LINES' ('-C LINES') instead.
+
+'--changed-group-format=FORMAT'
+ Use FORMAT to output a line group containing differing lines from
+ both files in if-then-else format. *Note Line Group Formats::.
+
+'-d'
+'--minimal'
+ Change the algorithm perhaps find a smaller set of changes. This
+ makes 'diff' slower (sometimes much slower). *Note diff
+ Performance::.
+
+'-D NAME'
+'--ifdef=NAME'
+ Make merged '#ifdef' format output, conditional on the preprocessor
+ macro NAME. *Note If-then-else::.
+
+'-e'
+'--ed'
+ Make output that is a valid 'ed' script. *Note ed Scripts::.
+
+'-E'
+'--ignore-tab-expansion'
+ Ignore changes due to tab expansion. *Note White Space::.
+
+'-f'
+'--forward-ed'
+ Make output that looks vaguely like an 'ed' script but has changes
+ in the order they appear in the file. *Note Forward ed::.
+
+'-F REGEXP'
+'--show-function-line=REGEXP'
+ In context and unified format, for each hunk of differences, show
+ some of the last preceding line that matches REGEXP. *Note
+ Specified Headings::.
+
+'--from-file=FILE'
+ Compare FILE to each operand; FILE may be a directory.
+
+'--help'
+ Output a summary of usage and then exit.
+
+'--horizon-lines=LINES'
+ Do not discard the last LINES lines of the common prefix and the
+ first LINES lines of the common suffix. *Note diff Performance::.
+
+'-i'
+'--ignore-case'
+ Ignore changes in case; consider upper- and lower-case letters
+ equivalent. *Note Case Folding::.
+
+'-I REGEXP'
+'--ignore-matching-lines=REGEXP'
+ Ignore changes that just insert or delete lines that match REGEXP.
+ *Note Specified Lines::.
+
+'--ignore-file-name-case'
+ Ignore case when comparing file names. For example, recursive
+ comparison of 'd' to 'e' might compare the contents of 'd/Init' and
+ 'e/inIt'. At the top level, 'diff d inIt' might compare the
+ contents of 'd/Init' and 'inIt'. *Note Comparing Directories::.
+
+'-l'
+'--paginate'
+ Pass the output through 'pr' to paginate it. *Note Pagination::.
+
+'-L LABEL'
+'--label=LABEL'
+ Use LABEL instead of the file name in the context format (*note
+ Context Format::) and unified format (*note Unified Format::)
+ headers. *Note RCS::.
+
+'--left-column'
+ Print only the left column of two common lines in side by side
+ format. *Note Side by Side Format::.
+
+'--line-format=FORMAT'
+ Use FORMAT to output all input lines in if-then-else format. *Note
+ Line Formats::.
+
+'-n'
+'--rcs'
+ Output RCS-format diffs; like '-f' except that each command
+ specifies the number of lines affected. *Note RCS::.
+
+'-N'
+'--new-file'
+ If one file is missing, treat it as present but empty. *Note
+ Comparing Directories::.
+
+'--new-group-format=FORMAT'
+ Use FORMAT to output a group of lines taken from just the second
+ file in if-then-else format. *Note Line Group Formats::.
+
+'--new-line-format=FORMAT'
+ Use FORMAT to output a line taken from just the second file in
+ if-then-else format. *Note Line Formats::.
+
+'--no-dereference'
+ Act on symbolic links themselves instead of what they point to.
+ Two symbolic links are deemed equal only when each points to
+ precisely the same name.
+
+'--old-group-format=FORMAT'
+ Use FORMAT to output a group of lines taken from just the first
+ file in if-then-else format. *Note Line Group Formats::.
+
+'--old-line-format=FORMAT'
+ Use FORMAT to output a line taken from just the first file in
+ if-then-else format. *Note Line Formats::.
+
+'-p'
+'--show-c-function'
+ Show which C function each change is in. *Note C Function
+ Headings::.
+
+'--palette=PALETTE'
+ Specify what color palette to use when colored output is enabled.
+ It defaults to 'rs=0:hd=1:ad=32:de=31:ln=36' for red deleted lines,
+ green added lines, cyan line numbers, bold header.
+
+ Supported capabilities are as follows.
+
+ 'ad=32'
+
+ SGR substring for added lines. The default is green
+ foreground.
+
+ 'de=31'
+
+ SGR substring for deleted lines. The default is red
+ foreground.
+
+ 'hd=1'
+
+ SGR substring for chunk header. The default is bold
+ foreground.
+
+ 'ln=36'
+
+ SGR substring for line numbers. The default is cyan
+ foreground.
+
+'-q'
+'--brief'
+ Report only whether the files differ, not the details of the
+ differences. *Note Brief::.
+
+'-r'
+'--recursive'
+ When comparing directories, recursively compare any subdirectories
+ found. *Note Comparing Directories::.
+
+'-s'
+'--report-identical-files'
+ Report when two files are the same. *Note Comparing Directories::.
+
+'-S FILE'
+'--starting-file=FILE'
+ When comparing directories, start with the file FILE. This is used
+ for resuming an aborted comparison. *Note Comparing Directories::.
+
+'--speed-large-files'
+ Use heuristics to speed handling of large files that have numerous
+ scattered small changes. *Note diff Performance::.
+
+'--strip-trailing-cr'
+ Strip any trailing carriage return at the end of an input line.
+ *Note Binary::.
+
+'--suppress-common-lines'
+ Do not print common lines in side by side format. *Note Side by
+ Side Format::.
+
+'-t'
+'--expand-tabs'
+ Expand tabs to spaces in the output, to preserve the alignment of
+ tabs in the input files. *Note Tabs::.
+
+'-T'
+'--initial-tab'
+ Output a tab rather than a space before the text of a line in
+ normal or context format. This causes the alignment of tabs in the
+ line to look normal. *Note Tabs::.
+
+'--tabsize=COLUMNS'
+ Assume that tab stops are set every COLUMNS (default 8) print
+ columns. *Note Tabs::.
+
+'--suppress-blank-empty'
+ Suppress any blanks before newlines when printing the
+ representation of an empty line, when outputting normal, context,
+ or unified format. *Note Trailing Blanks::.
+
+'--to-file=FILE'
+ Compare each operand to FILE; FILE may be a directory.
+
+'-u'
+ Use the unified output format, showing three lines of context.
+ *Note Unified Format::.
+
+'--unchanged-group-format=FORMAT'
+ Use FORMAT to output a group of common lines taken from both files
+ in if-then-else format. *Note Line Group Formats::.
+
+'--unchanged-line-format=FORMAT'
+ Use FORMAT to output a line common to both files in if-then-else
+ format. *Note Line Formats::.
+
+'--unidirectional-new-file'
+ If a first file is missing, treat it as present but empty. *Note
+ Comparing Directories::.
+
+'-U LINES'
+'--unified[=LINES]'
+ Use the unified output format, showing LINES (an integer) lines of
+ context, or three if LINES is not given. *Note Unified Format::.
+ For proper operation, 'patch' typically needs at least two lines of
+ context.
+
+ On older systems, 'diff' supports an obsolete option '-LINES' that
+ has effect when combined with '-u'. POSIX 1003.1-2001 (*note
+ Standards conformance::) does not allow this; use '-U LINES'
+ instead.
+
+'-v'
+'--version'
+ Output version information and then exit.
+
+'-w'
+'--ignore-all-space'
+ Ignore white space when comparing lines. *Note White Space::.
+
+'-W COLUMNS'
+'--width=COLUMNS'
+ Output at most COLUMNS (default 130) print columns per line in side
+ by side format. *Note Side by Side Format::.
+
+'-x PATTERN'
+'--exclude=PATTERN'
+ When comparing directories, ignore files and subdirectories whose
+ basenames match PATTERN. *Note Comparing Directories::.
+
+'-X FILE'
+'--exclude-from=FILE'
+ When comparing directories, ignore files and subdirectories whose
+ basenames match any pattern contained in FILE. *Note Comparing
+ Directories::.
+
+'-y'
+'--side-by-side'
+ Use the side by side output format. *Note Side by Side Format::.
+
+'-Z'
+'--ignore-trailing-space'
+ Ignore white space at line end. *Note White Space::.
+
+
+File: diffutils.info-t, Node: Invoking diff3, Next: Invoking patch, Prev: Invoking diff, Up: Top
+
+14 Invoking 'diff3'
+*******************
+
+The 'diff3' command compares three files and outputs descriptions of
+their differences. Its arguments are as follows:
+
+ diff3 OPTIONS... MINE OLDER YOURS
+
+ The files to compare are MINE, OLDER, and YOURS. At most one of
+these three file names may be '-', which tells 'diff3' to read the
+standard input for that file.
+
+ An exit status of 0 means 'diff3' was successful, 1 means some
+conflicts were found, and 2 means trouble.
+
+* Menu:
+
+* diff3 Options:: Summary of options to 'diff3'.
+
+
+File: diffutils.info-t, Node: diff3 Options, Up: Invoking diff3
+
+14.1 Options to 'diff3'
+=======================
+
+Below is a summary of all of the options that GNU 'diff3' accepts.
+Multiple single letter options (unless they take an argument) can be
+combined into a single command line argument.
+
+'-a'
+'--text'
+ Treat all files as text and compare them line-by-line, even if they
+ do not appear to be text. *Note Binary::.
+
+'-A'
+'--show-all'
+ Incorporate all unmerged changes from OLDER to YOURS into MINE,
+ surrounding conflicts with bracket lines. *Note Marking
+ Conflicts::.
+
+'--diff-program=PROGRAM'
+ Use the compatible comparison program PROGRAM to compare files
+ instead of 'diff'.
+
+'-e'
+'--ed'
+ Generate an 'ed' script that incorporates all the changes from
+ OLDER to YOURS into MINE. *Note Which Changes::.
+
+'-E'
+'--show-overlap'
+ Like '-e', except bracket lines from overlapping changes' first and
+ third files. *Note Marking Conflicts::. With '-E', an overlapping
+ change looks like this:
+
+ <<<<<<< MINE
+ lines from MINE
+ =======
+ lines from YOURS
+ >>>>>>> YOURS
+
+'--help'
+ Output a summary of usage and then exit.
+
+'-i'
+ Generate 'w' and 'q' commands at the end of the 'ed' script for
+ System V compatibility. This option must be combined with one of
+ the '-AeExX3' options, and may not be combined with '-m'. *Note
+ Saving the Changed File::.
+
+'--label=LABEL'
+ Use the label LABEL for the brackets output by the '-A', '-E' and
+ '-X' options. This option may be given up to three times, one for
+ each input file. The default labels are the names of the input
+ files. Thus 'diff3 --label X --label Y --label Z -m A B C' acts
+ like 'diff3 -m A B C', except that the output looks like it came
+ from files named 'X', 'Y' and 'Z' rather than from files named 'A',
+ 'B' and 'C'. *Note Marking Conflicts::.
+
+'-m'
+'--merge'
+ Apply the edit script to the first file and send the result to
+ standard output. Unlike piping the output from 'diff3' to 'ed',
+ this works even for binary files and incomplete lines. '-A' is
+ assumed if no edit script option is specified. *Note Bypassing
+ ed::.
+
+'--strip-trailing-cr'
+ Strip any trailing carriage return at the end of an input line.
+ *Note Binary::.
+
+'-T'
+'--initial-tab'
+ Output a tab rather than two spaces before the text of a line in
+ normal format. This causes the alignment of tabs in the line to
+ look normal. *Note Tabs::.
+
+'-v'
+'--version'
+ Output version information and then exit.
+
+'-x'
+'--overlap-only'
+ Like '-e', except output only the overlapping changes. *Note Which
+ Changes::.
+
+'-X'
+ Like '-E', except output only the overlapping changes. In other
+ words, like '-x', except bracket changes as in '-E'. *Note Marking
+ Conflicts::.
+
+'-3'
+'--easy-only'
+ Like '-e', except output only the nonoverlapping changes. *Note
+ Which Changes::.
+
+
+File: diffutils.info-t, Node: Invoking patch, Next: Invoking sdiff, Prev: Invoking diff3, Up: Top
+
+15 Invoking 'patch'
+*******************
+
+Normally 'patch' is invoked like this:
+
+ patch <PATCHFILE
+
+ The full format for invoking 'patch' is:
+
+ patch OPTIONS... [ORIGFILE [PATCHFILE]]
+
+ You can also specify where to read the patch from with the '-i
+PATCHFILE' or '--input=PATCHFILE' option. If you do not specify
+PATCHFILE, or if PATCHFILE is '-', 'patch' reads the patch (that is, the
+'diff' output) from the standard input.
+
+ If you do not specify an input file on the command line, 'patch'
+tries to intuit from the "leading text" (any text in the patch that
+comes before the 'diff' output) which file to edit. *Note Multiple
+Patches::.
+
+ By default, 'patch' replaces the original input file with the patched
+version, possibly after renaming the original file into a backup file
+(*note Backup Names::, for a description of how 'patch' names backup
+files). You can also specify where to put the output with the '-o FILE'
+or '--output=FILE' option; however, do not use this option if FILE is
+one of the input files.
+
+* Menu:
+
+* patch Options:: Summary table of options to 'patch'.
+
+
+File: diffutils.info-t, Node: patch Options, Up: Invoking patch
+
+15.1 Options to 'patch'
+=======================
+
+Here is a summary of all of the options that GNU 'patch' accepts. *Note
+patch and Tradition::, for which of these options are safe to use in
+older versions of 'patch'.
+
+ Multiple single-letter options that do not take an argument can be
+combined into a single command line argument with only one dash.
+
+'-b'
+'--backup'
+ Back up the original contents of each file, even if backups would
+ normally not be made. *Note Backups::.
+
+'-B PREFIX'
+'--prefix=PREFIX'
+ Prepend PREFIX to backup file names. *Note Backup Names::.
+
+'--backup-if-mismatch'
+ Back up the original contents of each file if the patch does not
+ exactly match the file. This is the default behavior when not
+ conforming to POSIX. *Note Backups::.
+
+'--binary'
+ Read and write all files in binary mode, except for standard output
+ and '/dev/tty'. This option has no effect on POSIX-conforming
+ systems like GNU/Linux. On systems where this option makes a
+ difference, the patch should be generated by 'diff -a --binary'.
+ *Note Binary::.
+
+'-c'
+'--context'
+ Interpret the patch file as a context diff. *Note patch Input::.
+
+'-d DIRECTORY'
+'--directory=DIRECTORY'
+ Make directory DIRECTORY the current directory for interpreting
+ both file names in the patch file, and file names given as
+ arguments to other options. *Note patch Directories::.
+
+'-D NAME'
+'--ifdef=NAME'
+ Make merged if-then-else output using NAME. *Note If-then-else::.
+
+'--dry-run'
+ Print the results of applying the patches without actually changing
+ any files. *Note Dry Runs::.
+
+'-e'
+'--ed'
+ Interpret the patch file as an 'ed' script. *Note patch Input::.
+
+'-E'
+'--remove-empty-files'
+ Remove output files that are empty after the patches have been
+ applied. *Note Creating and Removing::.
+
+'-f'
+'--force'
+ Assume that the user knows exactly what he or she is doing, and do
+ not ask any questions. *Note patch Messages::.
+
+'-F LINES'
+'--fuzz=LINES'
+ Set the maximum fuzz factor to LINES. *Note Inexact::.
+
+'-g NUM'
+'--get=NUM'
+ If NUM is positive, get input files from a revision control system
+ as necessary; if zero, do not get the files; if negative, ask the
+ user whether to get the files. *Note Revision Control::.
+
+'--help'
+ Output a summary of usage and then exit.
+
+'-i PATCHFILE'
+'--input=PATCHFILE'
+ Read the patch from PATCHFILE rather than from standard input.
+ *Note patch Options::.
+
+'-l'
+'--ignore-white-space'
+ Let any sequence of blanks (spaces or tabs) in the patch file match
+ any sequence of blanks in the input file. *Note Changed White
+ Space::.
+
+'-n'
+'--normal'
+ Interpret the patch file as a normal diff. *Note patch Input::.
+
+'-N'
+'--forward'
+ Ignore patches that 'patch' thinks are reversed or already applied.
+ See also '-R'. *Note Reversed Patches::.
+
+'--no-backup-if-mismatch'
+ Do not back up the original contents of files. This is the default
+ behavior when conforming to POSIX. *Note Backups::.
+
+'-o FILE'
+'--output=FILE'
+ Use FILE as the output file name. *Note patch Options::.
+
+'-pNUMBER'
+'--strip=NUMBER'
+ Set the file name strip count to NUMBER. *Note patch
+ Directories::.
+
+'--posix'
+ Conform to POSIX, as if the 'POSIXLY_CORRECT' environment variable
+ had been set. *Note patch and POSIX::.
+
+'--quoting-style=WORD'
+ Use style WORD to quote names in diagnostics, as if the
+ 'QUOTING_STYLE' environment variable had been set to WORD. *Note
+ patch Quoting Style::.
+
+'-r REJECT-FILE'
+'--reject-file=REJECT-FILE'
+ Use REJECT-FILE as the reject file name. *Note Reject Names::.
+
+'-R'
+'--reverse'
+ Assume that this patch was created with the old and new files
+ swapped. *Note Reversed Patches::.
+
+'-s'
+'--quiet'
+'--silent'
+ Work silently unless an error occurs. *Note patch Messages::.
+
+'-t'
+'--batch'
+ Do not ask any questions. *Note patch Messages::.
+
+'-T'
+'--set-time'
+ Set the modification and access times of patched files from time
+ stamps given in context diff headers, assuming that the context
+ diff headers use local time. *Note Patching Time Stamps::.
+
+'-u'
+'--unified'
+ Interpret the patch file as a unified diff. *Note patch Input::.
+
+'-v'
+'--version'
+ Output version information and then exit.
+
+'-V BACKUP-STYLE'
+'--version=control=BACKUP-STYLE'
+ Select the naming convention for backup file names. *Note Backup
+ Names::.
+
+'--verbose'
+ Print more diagnostics than usual. *Note patch Messages::.
+
+'-x NUMBER'
+'--debug=NUMBER'
+ Set internal debugging flags. Of interest only to 'patch'
+ patchers.
+
+'-Y PREFIX'
+'--basename-prefix=PREFIX'
+ Prepend PREFIX to base names of backup files. *Note Backup
+ Names::.
+
+'-z SUFFIX'
+'--suffix=SUFFIX'
+ Use SUFFIX as the backup extension instead of '.orig' or '~'.
+ *Note Backup Names::.
+
+'-Z'
+'--set-utc'
+ Set the modification and access times of patched files from time
+ stamps given in context diff headers, assuming that the context
+ diff headers use UTC. *Note Patching Time Stamps::.
+
+
+File: diffutils.info-t, Node: Invoking sdiff, Next: Standards conformance, Prev: Invoking patch, Up: Top
+
+16 Invoking 'sdiff'
+*******************
+
+The 'sdiff' command merges two files and interactively outputs the
+results. Its arguments are as follows:
+
+ sdiff -o OUTFILE OPTIONS... FROM-FILE TO-FILE
+
+ This merges FROM-FILE with TO-FILE, with output to OUTFILE. If
+FROM-FILE is a directory and TO-FILE is not, 'sdiff' compares the file
+in FROM-FILE whose file name is that of TO-FILE, and vice versa.
+FROM-FILE and TO-FILE may not both be directories.
+
+ 'sdiff' options begin with '-', so normally FROM-FILE and TO-FILE may
+not begin with '-'. However, '--' as an argument by itself treats the
+remaining arguments as file names even if they begin with '-'. You may
+not use '-' as an input file.
+
+ 'sdiff' without '--output' ('-o') produces a side-by-side difference.
+This usage is obsolete; use the '--side-by-side' ('-y') option of 'diff'
+instead.
+
+ An exit status of 0 means no differences were found, 1 means some
+differences were found, and 2 means trouble.
+
+* Menu:
+
+* sdiff Options:: Summary of options to 'diff'.
+
+
+File: diffutils.info-t, Node: sdiff Options, Up: Invoking sdiff
+
+16.1 Options to 'sdiff'
+=======================
+
+Below is a summary of all of the options that GNU 'sdiff' accepts. Each
+option has two equivalent names, one of which is a single letter
+preceded by '-', and the other of which is a long name preceded by '--'.
+Multiple single letter options (unless they take an argument) can be
+combined into a single command line argument. Long named options can be
+abbreviated to any unique prefix of their name.
+
+'-a'
+'--text'
+ Treat all files as text and compare them line-by-line, even if they
+ do not appear to be text. *Note Binary::.
+
+'-b'
+'--ignore-space-change'
+ Ignore changes in amount of white space. *Note White Space::.
+
+'-B'
+'--ignore-blank-lines'
+ Ignore changes that just insert or delete blank lines. *Note Blank
+ Lines::.
+
+'-d'
+'--minimal'
+ Change the algorithm to perhaps find a smaller set of changes.
+ This makes 'sdiff' slower (sometimes much slower). *Note diff
+ Performance::.
+
+'--diff-program=PROGRAM'
+ Use the compatible comparison program PROGRAM to compare files
+ instead of 'diff'.
+
+'-E'
+'--ignore-tab-expansion'
+ Ignore changes due to tab expansion. *Note White Space::.
+
+'--help'
+ Output a summary of usage and then exit.
+
+'-i'
+'--ignore-case'
+ Ignore changes in case; consider upper- and lower-case to be the
+ same. *Note Case Folding::.
+
+'-I REGEXP'
+'--ignore-matching-lines=REGEXP'
+ Ignore changes that just insert or delete lines that match REGEXP.
+ *Note Specified Lines::.
+
+'-l'
+'--left-column'
+ Print only the left column of two common lines. *Note Side by Side
+ Format::.
+
+'-o FILE'
+'--output=FILE'
+ Put merged output into FILE. This option is required for merging.
+
+'-s'
+'--suppress-common-lines'
+ Do not print common lines. *Note Side by Side Format::.
+
+'--speed-large-files'
+ Use heuristics to speed handling of large files that have numerous
+ scattered small changes. *Note diff Performance::.
+
+'--strip-trailing-cr'
+ Strip any trailing carriage return at the end of an input line.
+ *Note Binary::.
+
+'-t'
+'--expand-tabs'
+ Expand tabs to spaces in the output, to preserve the alignment of
+ tabs in the input files. *Note Tabs::.
+
+'--tabsize=COLUMNS'
+ Assume that tab stops are set every COLUMNS (default 8) print
+ columns. *Note Tabs::.
+
+'-v'
+'--version'
+ Output version information and then exit.
+
+'-w COLUMNS'
+'--width=COLUMNS'
+ Output at most COLUMNS (default 130) print columns per line. *Note
+ Side by Side Format::. Note that for historical reasons, this
+ option is '-W' in 'diff', '-w' in 'sdiff'.
+
+'-W'
+'--ignore-all-space'
+ Ignore white space when comparing lines. *Note White Space::.
+ Note that for historical reasons, this option is '-w' in 'diff',
+ '-W' in 'sdiff'.
+
+'-Z'
+'--ignore-trailing-space'
+ Ignore white space at line end. *Note White Space::.
+
+
+File: diffutils.info-t, Node: Standards conformance, Next: Projects, Prev: Invoking sdiff, Up: Top
+
+17 Standards conformance
+************************
+
+In a few cases, the GNU utilities' default behavior is incompatible with
+the POSIX standard. To suppress these incompatibilities, define the
+'POSIXLY_CORRECT' environment variable. Unless you are checking for
+POSIX conformance, you probably do not need to define 'POSIXLY_CORRECT'.
+
+ Normally options and operands can appear in any order, and programs
+act as if all the options appear before any operands. For example,
+'diff lao tzu -C 2' acts like 'diff -C 2 lao tzu', since '2' is an
+option-argument of '-C'. However, if the 'POSIXLY_CORRECT' environment
+variable is set, options must appear before operands, unless otherwise
+specified for a particular command.
+
+ Newer versions of POSIX are occasionally incompatible with older
+versions. For example, older versions of POSIX allowed the command
+'diff -c -10' to have the same meaning as 'diff -C 10', but POSIX
+1003.1-2001 'diff' no longer allows digit-string options like '-10'.
+
+ The GNU utilities normally conform to the version of POSIX that is
+standard for your system. To cause them to conform to a different
+version of POSIX, define the '_POSIX2_VERSION' environment variable to a
+value of the form YYYYMM specifying the year and month the standard was
+adopted. Two values are currently supported for '_POSIX2_VERSION':
+'199209' stands for POSIX 1003.2-1992, and '200112' stands for POSIX
+1003.1-2001. For example, if you are running older software that
+assumes an older version of POSIX and uses 'diff -c -10', you can work
+around the compatibility problems by setting '_POSIX2_VERSION=199209' in
+your environment.
+
+
+File: diffutils.info-t, Node: Projects, Next: Copying This Manual, Prev: Standards conformance, Up: Top
+
+18 Future Projects
+******************
+
+Here are some ideas for improving GNU 'diff' and 'patch'. The GNU
+project has identified some improvements as potential programming
+projects for volunteers. You can also help by reporting any bugs that
+you find.
+
+ If you are a programmer and would like to contribute something to the
+GNU project, please consider volunteering for one of these projects. If
+you are seriously contemplating work, please write to <gvc@gnu.org> to
+coordinate with other volunteers.
+
+* Menu:
+
+* Shortcomings:: Suggested projects for improvements.
+* Bugs:: Reporting bugs.
+
+
+File: diffutils.info-t, Node: Shortcomings, Next: Bugs, Up: Projects
+
+18.1 Suggested Projects for Improving GNU 'diff' and 'patch'
+============================================================
+
+One should be able to use GNU 'diff' to generate a patch from any pair
+of directory trees, and given the patch and a copy of one such tree, use
+'patch' to generate a faithful copy of the other. Unfortunately, some
+changes to directory trees cannot be expressed using current patch
+formats; also, 'patch' does not handle some of the existing formats.
+These shortcomings motivate the following suggested projects.
+
+* Menu:
+
+* Internationalization:: Handling multibyte and varying-width characters.
+* Changing Structure:: Handling changes to the directory structure.
+* Special Files:: Handling symbolic links, device special files, etc.
+* Unusual File Names:: Handling file names that contain unusual characters.
+* Time Stamp Order:: Outputting diffs in time stamp order.
+* Ignoring Changes:: Ignoring certain changes while showing others.
+* Speedups:: Improving performance.
+
+
+File: diffutils.info-t, Node: Internationalization, Next: Changing Structure, Up: Shortcomings
+
+18.1.1 Handling Multibyte and Varying-Width Characters
+------------------------------------------------------
+
+'diff', 'diff3' and 'sdiff' treat each line of input as a string of
+unibyte characters. This can mishandle multibyte characters in some
+cases. For example, when asked to ignore spaces, 'diff' does not
+properly ignore a multibyte space character.
+
+ Also, 'diff' currently assumes that each byte is one column wide, and
+this assumption is incorrect in some locales, e.g., locales that use
+UTF-8 encoding. This causes problems with the '-y' or '--side-by-side'
+option of 'diff'.
+
+ These problems need to be fixed without unduly affecting the
+performance of the utilities in unibyte environments.
+
+ The IBM GNU/Linux Technology Center Internationalization Team has
+proposed patches to support internationalized 'diff'
+(http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.patch.gz).
+Unfortunately, these patches are incomplete and are to an older version
+of 'diff', so more work needs to be done in this area.
+
+
+File: diffutils.info-t, Node: Changing Structure, Next: Special Files, Prev: Internationalization, Up: Shortcomings
+
+18.1.2 Handling Changes to the Directory Structure
+--------------------------------------------------
+
+'diff' and 'patch' do not handle some changes to directory structure.
+For example, suppose one directory tree contains a directory named 'D'
+with some subsidiary files, and another contains a file with the same
+name 'D'. 'diff -r' does not output enough information for 'patch' to
+transform the directory subtree into the file.
+
+ There should be a way to specify that a file has been removed without
+having to include its entire contents in the patch file. There should
+also be a way to tell 'patch' that a file was renamed, even if there is
+no way for 'diff' to generate such information. There should be a way
+to tell 'patch' that a file's time stamp has changed, even if its
+contents have not changed.
+
+ These problems can be fixed by extending the 'diff' output format to
+represent changes in directory structure, and extending 'patch' to
+understand these extensions.
+
+
+File: diffutils.info-t, Node: Special Files, Next: Unusual File Names, Prev: Changing Structure, Up: Shortcomings
+
+18.1.3 Files that are Neither Directories Nor Regular Files
+-----------------------------------------------------------
+
+Some files are neither directories nor regular files: they are unusual
+files like symbolic links, device special files, named pipes, and
+sockets. Currently, 'diff' treats symbolic links as if they were the
+pointed-to files, except that a recursive 'diff' reports an error if it
+detects infinite loops of symbolic links (e.g., symbolic links to '..').
+'diff' treats other special files like regular files if they are
+specified at the top level, but simply reports their presence when
+comparing directories. This means that 'patch' cannot represent changes
+to such files. For example, if you change which file a symbolic link
+points to, 'diff' outputs the difference between the two files, instead
+of the change to the symbolic link.
+
+ 'diff' should optionally report changes to special files specially,
+and 'patch' should be extended to understand these extensions.
+
+
+File: diffutils.info-t, Node: Unusual File Names, Next: Time Stamp Order, Prev: Special Files, Up: Shortcomings
+
+18.1.4 File Names that Contain Unusual Characters
+-------------------------------------------------
+
+When a file name contains an unusual character like a newline or white
+space, 'diff -r' generates a patch that 'patch' cannot parse. The
+problem is with format of 'diff' output, not just with 'patch', because
+with odd enough file names one can cause 'diff' to generate a patch that
+is syntactically correct but patches the wrong files. The format of
+'diff' output should be extended to handle all possible file names.
+
+
+File: diffutils.info-t, Node: Time Stamp Order, Next: Ignoring Changes, Prev: Unusual File Names, Up: Shortcomings
+
+18.1.5 Outputting Diffs in Time Stamp Order
+-------------------------------------------
+
+Applying 'patch' to a multiple-file diff can result in files whose time
+stamps are out of order. GNU 'patch' has options to restore the time
+stamps of the updated files (*note Patching Time Stamps::), but
+sometimes it is useful to generate a patch that works even if the
+recipient does not have GNU patch, or does not use these options. One
+way to do this would be to implement a 'diff' option to output diffs in
+time stamp order.
+
+
+File: diffutils.info-t, Node: Ignoring Changes, Next: Speedups, Prev: Time Stamp Order, Up: Shortcomings
+
+18.1.6 Ignoring Certain Changes
+-------------------------------
+
+It would be nice to have a feature for specifying two strings, one in
+FROM-FILE and one in TO-FILE, which should be considered to match.
+Thus, if the two strings are 'foo' and 'bar', then if two lines differ
+only in that 'foo' in file 1 corresponds to 'bar' in file 2, the lines
+are treated as identical.
+
+ It is not clear how general this feature can or should be, or what
+syntax should be used for it.
+
+ A partial substitute is to filter one or both files before comparing,
+e.g.:
+
+ sed 's/foo/bar/g' file1 | diff - file2
+
+ However, this outputs the filtered text, not the original.
+
+
+File: diffutils.info-t, Node: Speedups, Prev: Ignoring Changes, Up: Shortcomings
+
+18.1.7 Improving Performance
+----------------------------
+
+When comparing two large directory structures, one of which was
+originally copied from the other with time stamps preserved (e.g., with
+'cp -pR'), it would greatly improve performance if an option told 'diff'
+to assume that two files with the same size and time stamps have the
+same content. *Note diff Performance::.
+
+
+File: diffutils.info-t, Node: Bugs, Prev: Shortcomings, Up: Projects
+
+18.2 Reporting Bugs
+===================
+
+If you think you have found a bug in GNU 'cmp', 'diff', 'diff3', or
+'sdiff', please report it by electronic mail to the GNU utilities bug
+report mailing list (http://mail.gnu.org/mailman/listinfo/bug-diffutils)
+<bug-diffutils@gnu.org>. Please send bug reports for GNU 'patch' to
+<bug-patch@gnu.org>. Send as precise a description of the problem as
+you can, including the output of the '--version' option and sample input
+files that produce the bug, if applicable. If you have a nontrivial fix
+for the bug, please send it as well. If you have a patch, please send
+it too. It may simplify the maintainer's job if the patch is relative
+to a recent test release, which you can find in the directory
+<ftp://alpha.gnu.org/gnu/diffutils/>.
+
+
+File: diffutils.info-t, Node: Copying This Manual, Next: Translations, Prev: Projects, Up: Top
+
+Appendix A Copying This Manual
+******************************
+
+ Version 1.3, 3 November 2008
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ <http://fsf.org/>
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book. We
+ recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it can
+ be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You accept
+ the license if you copy, modify or distribute the work in a way
+ requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in the
+ notice that says that the Document is released under this License.
+ If a section does not fit the above definition of Secondary then it
+ is not allowed to be designated as Invariant. The Document may
+ contain zero Invariant Sections. If the Document does not identify
+ any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images composed
+ of pixels) generic paint programs or (for drawings) some widely
+ available drawing editor, and that is suitable for input to text
+ formatters or for automatic translation to a variety of formats
+ suitable for input to text formatters. A copy made in an otherwise
+ Transparent file format whose markup, or absence of markup, has
+ been arranged to thwart or discourage subsequent modification by
+ readers is not Transparent. An image format is not Transparent if
+ used for any substantial amount of text. A copy that is not
+ "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and standard-conforming
+ simple HTML, PostScript or PDF designed for human modification.
+ Examples of transparent image formats include PNG, XCF and JPG.
+ Opaque formats include proprietary formats that can be read and
+ edited only by proprietary word processors, SGML or XML for which
+ the DTD and/or processing tools are not generally available, and
+ the machine-generated HTML, PostScript or PDF produced by some word
+ processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ The "publisher" means any person or entity that distributes copies
+ of the Document to the public.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow the
+ conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the title
+ equally prominent and visible. You may add other material on the
+ covers in addition. Copying with changes limited to the covers, as
+ long as they preserve the title of the Document and satisfy these
+ conditions, can be treated as verbatim copying in other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a machine-readable
+ Transparent copy along with each Opaque copy, or state in or with
+ each Opaque copy a computer-network location from which the general
+ network-using public has access to download using public-standard
+ network protocols a complete Transparent copy of the Document, free
+ of added material. If you use the latter option, you must take
+ reasonably prudent steps, when you begin distribution of Opaque
+ copies in quantity, to ensure that this Transparent copy will
+ remain thus accessible at the stated location until at least one
+ year after the last time you distribute an Opaque copy (directly or
+ through your agents or retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of copies,
+ to give them a chance to provide you with an updated version of the
+ Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with the
+ Modified Version filling the role of the Document, thus licensing
+ distribution and modification of the Modified Version to whoever
+ possesses a copy of it. In addition, you must do these things in
+ the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of previous
+ versions (which should, if there were any, be listed in the
+ History section of the Document). You may use the same title
+ as a previous version if the original publisher of that
+ version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on the
+ Title Page. If there is no section Entitled "History" in the
+ Document, create one stating the title, year, authors, and
+ publisher of the Document as given on its Title Page, then add
+ an item describing the Modified Version as stated in the
+ previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in the
+ "History" section. You may omit a network location for a work
+ that was published at least four years before the Document
+ itself, or if the original publisher of the version it refers
+ to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section
+ all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document, unaltered
+ in their text and in their titles. Section numbers or the
+ equivalent are not considered part of the section titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option designate
+ some or all of these sections as invariant. To do this, add their
+ titles to the list of Invariant Sections in the Modified Version's
+ license notice. These titles must be distinct from any other
+ section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end of
+ the list of Cover Texts in the Modified Version. Only one passage
+ of Front-Cover Text and one of Back-Cover Text may be added by (or
+ through arrangements made by) any one entity. If the Document
+ already includes a cover text for the same cover, previously added
+ by you or by arrangement made by the same entity you are acting on
+ behalf of, you may not add another; but you may replace the old
+ one, on explicit permission from the previous publisher that added
+ the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination all
+ of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the documents
+ in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow this
+ License in all other respects regarding verbatim copying of that
+ document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of a
+ storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense, or distribute it is void,
+ and will automatically terminate your rights under this License.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly and
+ finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from you
+ under this License. If your rights have been terminated and not
+ permanently reinstated, receipt of a copy of some or all of the
+ same material does not give you any rights to use it.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ <http://www.gnu.org/copyleft/>.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If the
+ Document does not specify a version number of this License, you may
+ choose any version ever published (not as a draft) by the Free
+ Software Foundation. If the Document specifies that a proxy can
+ decide which future versions of this License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Document.
+
+ 11. RELICENSING
+
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+ World Wide Web server that publishes copyrightable works and also
+ provides prominent facilities for anybody to edit those works. A
+ public wiki that anybody can edit is an example of such a server.
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+ site means any set of copyrightable works thus published on the MMC
+ site.
+
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+ license published by Creative Commons Corporation, a not-for-profit
+ corporation with a principal place of business in San Francisco,
+ California, as well as future copyleft versions of that license
+ published by that same organization.
+
+ "Incorporate" means to publish or republish a Document, in whole or
+ in part, as part of another Document.
+
+ An MMC is "eligible for relicensing" if it is licensed under this
+ License, and if all works that were first published under this
+ License somewhere other than this MMC, and subsequently
+ incorporated in whole or in part into the MMC, (1) had no cover
+ texts or invariant sections, and (2) were thus incorporated prior
+ to November 1, 2008.
+
+ The operator of an MMC Site may republish an MMC contained in the
+ site under CC-BY-SA on the same site at any time before August 1,
+ 2009, provided the MMC is eligible for relicensing.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of free
+software license, such as the GNU General Public License, to permit
+their use in free software.
+
+
+File: diffutils.info-t, Node: Translations, Next: Index, Prev: Copying This Manual, Up: Top
+
+Appendix B Translations of This Manual
+**************************************
+
+Nishio Futoshi of the GNUjdoc project has prepared a Japanese
+translation of this manual. Its most recent version can be found at
+<http://openlab.ring.gr.jp/gnujdoc/cvsweb/cvsweb.cgi/gnujdoc/>.
+
+
+File: diffutils.info-t, Node: Index, Prev: Translations, Up: Top
+
+Appendix C Index
+****************
+
+
+* Menu:
+
+* ! output format: Context. (line 6)
+* +- output format: Unified Format. (line 6)
+* < output format: Normal. (line 6)
+* <<<<<<< for marking conflicts: Marking Conflicts. (line 6)
+* _POSIX2_VERSION: Standards conformance.
+ (line 23)
+* ad capability: diff Options. (line 179)
+* aligning tab stops: Tabs. (line 6)
+* alternate file names: Alternate Names. (line 6)
+* always color option: diff Options. (line 43)
+* auto color option: diff Options. (line 42)
+* backup file names: Backup Names. (line 6)
+* backup file strategy: Backups. (line 6)
+* binary file diff: Binary. (line 6)
+* blank and tab difference suppression: White Space. (line 6)
+* blank line difference suppression: Blank Lines. (line 6)
+* brief difference reports: Brief. (line 6)
+* bug reports: Bugs. (line 6)
+* C function headings: C Function Headings. (line 6)
+* C if-then-else output format: If-then-else. (line 6)
+* case difference suppression: Case Folding. (line 6)
+* ClearCase: Revision Control. (line 6)
+* cmp invocation: Invoking cmp. (line 6)
+* cmp options: cmp Options. (line 6)
+* color, distinguishing different context: diff Options. (line 37)
+* columnar output: Side by Side. (line 6)
+* common mistakes with patches: Avoiding Common Mistakes.
+ (line 6)
+* comparing three files: Comparing Three Files.
+ (line 6)
+* conflict: diff3 Merging. (line 26)
+* conflict marking: Marking Conflicts. (line 6)
+* context output format: Context. (line 6)
+* creating files: Creating and Removing.
+ (line 6)
+* de capability: diff Options. (line 184)
+* diagnostics from patch: patch Messages. (line 6)
+* diff invocation: Invoking diff. (line 6)
+* diff merging: Interactive Merging. (line 6)
+* diff options: diff Options. (line 6)
+* diff sample input: Sample diff Input. (line 6)
+* diff3 hunks: diff3 Hunks. (line 6)
+* diff3 invocation: Invoking diff3. (line 6)
+* diff3 options: diff3 Options. (line 6)
+* diff3 sample input: Sample diff3 Input. (line 6)
+* directories and patch: patch Directories. (line 6)
+* directory structure changes: Changing Structure. (line 6)
+* dry runs for patch: Dry Runs. (line 6)
+* ed script output format: ed Scripts. (line 6)
+* EDITOR: Merge Commands. (line 50)
+* empty files, removing: Creating and Removing.
+ (line 6)
+* exabyte, definition of: cmp Options. (line 99)
+* exbibyte, definition of: cmp Options. (line 102)
+* file name alternates: Alternate Names. (line 6)
+* file names with unusual characters: Unusual File Names. (line 6)
+* format of diff output: Output Formats. (line 6)
+* format of diff3 output: Comparing Three Files.
+ (line 6)
+* formats for if-then-else line groups: Line Group Formats. (line 6)
+* forward ed script output format: Forward ed. (line 6)
+* full lines: Incomplete Lines. (line 6)
+* function headings, C: C Function Headings. (line 6)
+* fuzz factor when patching: Inexact. (line 6)
+* gibibyte, definition of: cmp Options. (line 87)
+* gigabyte, definition of: cmp Options. (line 84)
+* hd capability: diff Options. (line 189)
+* headings: Sections. (line 6)
+* hunks: Hunks. (line 6)
+* hunks for diff3: diff3 Hunks. (line 6)
+* if-then-else output format: If-then-else. (line 6)
+* ifdef output format: If-then-else. (line 6)
+* imperfect patch application: Imperfect. (line 6)
+* incomplete line merging: Merging Incomplete Lines.
+ (line 6)
+* incomplete lines: Incomplete Lines. (line 6)
+* inexact patches: Inexact. (line 6)
+* inhibit messages from patch: More or Fewer Messages.
+ (line 6)
+* interactive merging: Interactive Merging. (line 6)
+* introduction: Comparison. (line 6)
+* intuiting file names from patches: Multiple Patches. (line 6)
+* invoking cmp: Invoking cmp. (line 6)
+* invoking diff: Invoking diff. (line 6)
+* invoking diff3: Invoking diff3. (line 6)
+* invoking patch: Invoking patch. (line 6)
+* invoking sdiff: Invoking sdiff. (line 6)
+* keyboard input to patch: patch and Keyboard Input.
+ (line 6)
+* kibibyte, definition of: cmp Options. (line 75)
+* kilobyte, definition of: cmp Options. (line 71)
+* LC_COLLATE: Comparing Directories.
+ (line 6)
+* LC_NUMERIC: Line Group Formats. (line 143)
+* LC_TIME: Detailed Context. (line 12)
+* line formats: Line Formats. (line 6)
+* line group formats: Line Group Formats. (line 6)
+* ln capability: diff Options. (line 194)
+* mebibyte, definition of: cmp Options. (line 82)
+* megabyte, definition of: cmp Options. (line 79)
+* merge commands: Merge Commands. (line 6)
+* merged diff3 format: Bypassing ed. (line 6)
+* merged output format: If-then-else. (line 6)
+* merging from a common ancestor: diff3 Merging. (line 6)
+* merging interactively: Merge Commands. (line 6)
+* messages from patch: patch Messages. (line 6)
+* multibyte characters: Internationalization.
+ (line 6)
+* multiple patches: Multiple Patches. (line 6)
+* newline treatment by diff: Incomplete Lines. (line 6)
+* none color option: diff Options. (line 40)
+* normal output format: Normal. (line 6)
+* options for cmp: cmp Options. (line 6)
+* options for diff: diff Options. (line 6)
+* options for diff3: diff3 Options. (line 6)
+* options for patch: patch Options. (line 6)
+* options for sdiff: sdiff Options. (line 6)
+* output formats: Output Formats. (line 6)
+* overlap: diff3 Merging. (line 26)
+* overlapping change, selection of: Which Changes. (line 6)
+* overview of diff and patch: Overview. (line 6)
+* paginating diff output: Pagination. (line 6)
+* patch consumer tips: Tips for Patch Consumers.
+ (line 6)
+* patch input format: patch Input. (line 6)
+* patch invocation: Invoking patch. (line 6)
+* patch messages and questions: patch Messages. (line 6)
+* patch options: patch Options. (line 6)
+* patch producer tips: Tips for Patch Producers.
+ (line 6)
+* patch, common mistakes: Avoiding Common Mistakes.
+ (line 6)
+* patches, shrinking: Generating Smaller Patches.
+ (line 6)
+* patching directories: patch Directories. (line 6)
+* PATCH_GET: Revision Control. (line 13)
+* PATCH_VERSION_CONTROL: Backup Names. (line 21)
+* pebibyte, definition of: cmp Options. (line 97)
+* performance of diff: diff Performance. (line 6)
+* petabyte, definition of: cmp Options. (line 94)
+* POSIX: patch and POSIX. (line 6)
+* POSIX <1>: Standards conformance.
+ (line 6)
+* POSIXLY_CORRECT: patch and POSIX. (line 6)
+* POSIXLY_CORRECT <1>: Standards conformance.
+ (line 6)
+* projects for directories: Shortcomings. (line 6)
+* quoting style: patch Quoting Style. (line 6)
+* QUOTING_STYLE: patch Quoting Style. (line 26)
+* RCS: Revision Control. (line 6)
+* RCS script output format: RCS. (line 6)
+* regular expression matching headings: Specified Headings. (line 6)
+* regular expression suppression: Specified Lines. (line 6)
+* reject file names: Reject Names. (line 6)
+* removing empty files: Creating and Removing.
+ (line 6)
+* reporting bugs: Bugs. (line 6)
+* reversed patches: Reversed Patches. (line 6)
+* revision control: Revision Control. (line 6)
+* sample input for diff: Sample diff Input. (line 6)
+* sample input for diff3: Sample diff3 Input. (line 6)
+* SCCS: Revision Control. (line 6)
+* script output formats: Scripts. (line 6)
+* sdiff invocation: Invoking sdiff. (line 6)
+* sdiff options: sdiff Options. (line 6)
+* sdiff output format: sdiff Option Summary.
+ (line 6)
+* section headings: Sections. (line 6)
+* side by side: Side by Side. (line 6)
+* side by side format: Side by Side Format. (line 6)
+* SIMPLE_BACKUP_SUFFIX: Backup Names. (line 12)
+* special files: Special Files. (line 6)
+* specified headings: Specified Headings. (line 6)
+* summarizing which files differ: Brief. (line 6)
+* System V diff3 compatibility: Saving the Changed File.
+ (line 6)
+* tab and blank difference suppression: White Space. (line 6)
+* tab stop alignment: Tabs. (line 6)
+* tebibyte, definition of: cmp Options. (line 92)
+* terabyte, definition of: cmp Options. (line 89)
+* terminal, using color iff: diff Options. (line 42)
+* testing patch: Dry Runs. (line 6)
+* text versus binary diff: Binary. (line 6)
+* time stamp format, context diffs: Detailed Context. (line 12)
+* time stamp format, unified diffs: Detailed Unified. (line 12)
+* time stamps on patched files: Patching Time Stamps.
+ (line 6)
+* traditional patch: patch and Tradition. (line 6)
+* trailing blanks: Trailing Blanks. (line 6)
+* two-column output: Side by Side. (line 6)
+* unified output format: Unified Format. (line 6)
+* unmerged change: Which Changes. (line 6)
+* varying-width characters: Internationalization.
+ (line 6)
+* verbose messages from patch: More or Fewer Messages.
+ (line 6)
+* version control: Revision Control. (line 6)
+* VERSION_CONTROL: Revision Control. (line 22)
+* VERSION_CONTROL <1>: Backup Names. (line 21)
+* white space in patches: Changed White Space. (line 6)
+* yottabyte, definition of: cmp Options. (line 110)
+* zettabyte, definition of: cmp Options. (line 104)
+
+
+
+Tag Table:
+Node: Top1432
+Node: Overview3646
+Node: Comparison7200
+Node: Hunks10144
+Node: White Space11587
+Node: Blank Lines13428
+Node: Specified Lines14419
+Node: Case Folding15547
+Node: Brief15966
+Node: Binary17291
+Node: Output Formats21090
+Node: Sample diff Input21817
+Node: Context23318
+Node: Context Format24897
+Node: Example Context25691
+Node: Less Context27201
+Node: Detailed Context28393
+Node: Unified Format30593
+Node: Example Unified31392
+Node: Detailed Unified32432
+Node: Sections34076
+Node: Specified Headings34837
+Node: C Function Headings36388
+Node: Alternate Names37236
+Node: Side by Side38151
+Node: Side by Side Format40303
+Node: Example Side by Side41207
+Node: Normal42549
+Node: Example Normal43552
+Node: Detailed Normal44291
+Node: Scripts46032
+Node: ed Scripts46439
+Node: Example ed47647
+Node: Detailed ed48099
+Node: Forward ed49860
+Node: RCS50638
+Node: If-then-else51856
+Node: Line Group Formats53536
+Node: Line Formats59419
+Node: Example If-then-else62690
+Node: Detailed If-then-else63771
+Node: Incomplete Lines65658
+Node: Comparing Directories67296
+Node: Adjusting Output71590
+Node: Tabs72099
+Node: Trailing Blanks73715
+Node: Pagination74942
+Node: diff Performance75412
+Node: Comparing Three Files78503
+Node: Sample diff3 Input79383
+Node: Example diff3 Normal80333
+Node: Detailed diff3 Normal81399
+Node: diff3 Hunks83189
+Node: diff3 Merging84457
+Node: Which Changes86704
+Node: Marking Conflicts88106
+Node: Bypassing ed90563
+Node: Merging Incomplete Lines91908
+Node: Saving the Changed File92636
+Node: Interactive Merging93254
+Node: sdiff Option Summary93965
+Node: Merge Commands95170
+Node: Merging with patch96461
+Node: patch Input98832
+Node: Revision Control99516
+Node: Imperfect100689
+Node: Changed White Space101840
+Node: Reversed Patches102639
+Node: Inexact104105
+Node: Dry Runs107663
+Node: Creating and Removing108529
+Node: Patching Time Stamps109581
+Node: Multiple Patches111782
+Node: patch Directories114446
+Node: Backups116072
+Node: Backup Names117139
+Ref: Backup Names-Footnote-1120096
+Node: Reject Names120223
+Node: patch Messages120814
+Node: More or Fewer Messages121876
+Node: patch and Keyboard Input122509
+Node: patch Quoting Style123540
+Node: patch and POSIX124688
+Node: patch and Tradition125529
+Node: Making Patches128953
+Node: Tips for Patch Producers129781
+Node: Tips for Patch Consumers131039
+Node: Avoiding Common Mistakes131678
+Node: Generating Smaller Patches134205
+Node: Invoking cmp135967
+Node: cmp Options137391
+Node: Invoking diff141037
+Node: diff Options142658
+Node: Invoking diff3152509
+Node: diff3 Options153149
+Node: Invoking patch156184
+Node: patch Options157394
+Node: Invoking sdiff162623
+Node: sdiff Options163767
+Node: Standards conformance166741
+Node: Projects168489
+Node: Shortcomings169203
+Node: Internationalization170307
+Node: Changing Structure171475
+Node: Special Files172581
+Node: Unusual File Names173694
+Node: Time Stamp Order174335
+Node: Ignoring Changes174980
+Node: Speedups175752
+Node: Bugs176218
+Node: Copying This Manual177073
+Node: Translations202194
+Node: Index202568
+
+End Tag Table
diff --git a/doc/diffutils.texi b/doc/diffutils.texi
new file mode 100644
index 0000000..b478380
--- /dev/null
+++ b/doc/diffutils.texi
@@ -0,0 +1,4759 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename diffutils.info
+@include version.texi
+@settitle Comparing and Merging Files
+@syncodeindex vr cp
+@setchapternewpage odd
+@comment %**end of header
+@copying
+This manual is for GNU Diffutils
+(version @value{VERSION}, @value{UPDATED}),
+and documents the @acronym{GNU} @command{diff}, @command{diff3},
+@command{sdiff}, and @command{cmp} commands for showing the
+differences between files and the @acronym{GNU} @command{patch} command for
+using their output to update files.
+
+Copyright @copyright{} 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2016 Free
+Software Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+A copy of the license is included in the section entitled
+``@acronym{GNU} Free Documentation License.''
+@end quotation
+@end copying
+
+@c Debian install-info (up through at least version 1.9.20) uses only the
+@c first dircategory. Put this one first, as it is more useful in practice.
+@dircategory Individual utilities
+@direntry
+* cmp: (diffutils)Invoking cmp. Compare 2 files byte by byte.
+* diff: (diffutils)Invoking diff. Compare 2 files line by line.
+* diff3: (diffutils)Invoking diff3. Compare 3 files line by line.
+* patch: (diffutils)Invoking patch. Apply a patch to a file.
+* sdiff: (diffutils)Invoking sdiff. Merge 2 files side-by-side.
+@end direntry
+
+@dircategory Text creation and manipulation
+@direntry
+* Diffutils: (diffutils). Comparing and merging files.
+@end direntry
+
+@titlepage
+@title Comparing and Merging Files
+@subtitle for Diffutils @value{VERSION} and @code{patch} 2.5.4
+@subtitle @value{UPDATED}
+@author David MacKenzie, Paul Eggert, and Richard Stallman
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@shortcontents
+@contents
+
+@ifnottex
+@node Top
+@top Comparing and Merging Files
+
+@insertcopying
+@end ifnottex
+
+@menu
+* Overview:: Preliminary information.
+* Comparison:: What file comparison means.
+
+* Output Formats:: Formats for two-way difference reports.
+* Incomplete Lines:: Lines that lack trailing newlines.
+* Comparing Directories:: Comparing files and directories.
+* Adjusting Output:: Making @command{diff} output prettier.
+* diff Performance:: Making @command{diff} smarter or faster.
+
+* Comparing Three Files:: Formats for three-way difference reports.
+* diff3 Merging:: Merging from a common ancestor.
+
+* Interactive Merging:: Interactive merging with @command{sdiff}.
+
+* Merging with patch:: Using @command{patch} to change old files into new ones.
+* Making Patches:: Tips for making and using patch distributions.
+
+* Invoking cmp:: Compare two files byte by byte.
+* Invoking diff:: Compare two files line by line.
+* Invoking diff3:: Compare three files line by line.
+* Invoking patch:: Apply a diff file to an original.
+* Invoking sdiff:: Side-by-side merge of file differences.
+
+* Standards conformance:: Conformance to the @acronym{POSIX} standard.
+* Projects:: If you've found a bug or other shortcoming.
+
+* Copying This Manual:: How to make copies of this manual.
+* Translations:: Available translations of this manual.
+* Index:: Index.
+@end menu
+
+@node Overview
+@unnumbered Overview
+@cindex overview of @command{diff} and @command{patch}
+
+Computer users often find occasion to ask how two files differ. Perhaps
+one file is a newer version of the other file. Or maybe the two files
+started out as identical copies but were changed by different people.
+
+You can use the @command{diff} command to show differences between two
+files, or each corresponding file in two directories. @command{diff}
+outputs differences between files line by line in any of several
+formats, selectable by command line options. This set of differences is
+often called a @dfn{diff} or @dfn{patch}. For files that are identical,
+@command{diff} normally produces no output; for binary (non-text) files,
+@command{diff} normally reports only that they are different.
+
+You can use the @command{cmp} command to show the byte and line numbers
+where two files differ. @command{cmp} can also show all the bytes
+that differ between the two files, side by side. A way to compare
+two files character by character is the Emacs command @kbd{M-x
+compare-windows}. @xref{Other Window, , Other Window, emacs, The @acronym{GNU}
+Emacs Manual}, for more information on that command.
+
+You can use the @command{diff3} command to show differences among three
+files. When two people have made independent changes to a common
+original, @command{diff3} can report the differences between the original
+and the two changed versions, and can produce a merged file that
+contains both persons' changes together with warnings about conflicts.
+
+You can use the @command{sdiff} command to merge two files interactively.
+
+You can use the set of differences produced by @command{diff} to distribute
+updates to text files (such as program source code) to other people.
+This method is especially useful when the differences are small compared
+to the complete files. Given @command{diff} output, you can use the
+@command{patch} program to update, or @dfn{patch}, a copy of the file. If you
+think of @command{diff} as subtracting one file from another to produce
+their difference, you can think of @command{patch} as adding the difference
+to one file to reproduce the other.
+
+This manual first concentrates on making diffs, and later shows how to
+use diffs to update files.
+
+@acronym{GNU} @command{diff} was written by Paul Eggert, Mike Haertel,
+David Hayes, Richard Stallman, and Len Tower. Wayne Davison designed and
+implemented the unified output format. The basic algorithm is described
+by Eugene W. Myers in ``An O(ND) Difference Algorithm and its Variations'',
+@cite{Algorithmica} Vol.@: 1, 1986, pp.@: 251--266,
+@url{http://dx.doi.org/10.1007/BF01840446}; and in ``A File
+Comparison Program'', Webb Miller and Eugene W. Myers,
+@cite{Software---Practice and Experience} Vol.@: 15, 1985,
+pp.@: 1025--1040,
+@url{http://dx.doi.org/10.1002/spe.4380151102}.
+@c From: "Gene Myers" <gene@cs.arizona.edu>
+@c They are about the same basic algorithm; the Algorithmica
+@c paper gives a rigorous treatment and the sub-algorithm for
+@c delivering scripts and should be the primary reference, but
+@c both should be mentioned.
+The algorithm was independently discovered as described by Esko Ukkonen in
+``Algorithms for Approximate String Matching'',
+@cite{Information and Control} Vol.@: 64, 1985, pp.@: 100--118,
+@url{http://dx.doi.org/10.1016/S0019-9958(85)80046-2}.
+@c From: "Gene Myers" <gene@cs.arizona.edu>
+@c Date: Wed, 29 Sep 1993 08:27:55 MST
+@c Ukkonen should be given credit for also discovering the algorithm used
+@c in GNU diff.
+Related algorithms are surveyed by Alfred V. Aho in
+section 6.3 of ``Algorithms for Finding Patterns in Strings'',
+@cite{Handbook of Theoretical Computer Science} (Jan Van Leeuwen,
+ed.), Vol.@: A, @cite{Algorithms and Complexity}, Elsevier/MIT Press,
+1990, pp.@: 255--300.
+
+@acronym{GNU} @command{diff3} was written by Randy Smith. @acronym{GNU}
+@command{sdiff} was written by Thomas Lord. @acronym{GNU} @command{cmp}
+was written by Torbj@"orn Granlund and David MacKenzie.
+
+@acronym{GNU} @command{patch} was written mainly by Larry Wall and Paul Eggert;
+several @acronym{GNU} enhancements were contributed by Wayne Davison and
+David MacKenzie. Parts of this manual are adapted from a manual page
+written by Larry Wall, with his permission.
+
+@node Comparison
+@chapter What Comparison Means
+@cindex introduction
+
+There are several ways to think about the differences between two files.
+One way to think of the differences is as a series of lines that were
+deleted from, inserted in, or changed in one file to produce the other
+file. @command{diff} compares two files line by line, finds groups of
+lines that differ, and reports each group of differing lines. It can
+report the differing lines in several formats, which have different
+purposes.
+
+@acronym{GNU} @command{diff} can show whether files are different
+without detailing the differences. It also provides ways to suppress
+certain kinds of differences that are not important to you. Most
+commonly, such differences are changes in the amount of white space
+between words or lines. @command{diff} also provides ways to suppress
+differences in alphabetic case or in lines that match a regular
+expression that you provide. These options can accumulate; for
+example, you can ignore changes in both white space and alphabetic
+case.
+
+Another way to think of the differences between two files is as a
+sequence of pairs of bytes that can be either identical or
+different. @command{cmp} reports the differences between two files
+byte by byte, instead of line by line. As a result, it is often
+more useful than @command{diff} for comparing binary files. For text
+files, @command{cmp} is useful mainly when you want to know only whether
+two files are identical, or whether one file is a prefix of the other.
+
+To illustrate the effect that considering changes byte by byte
+can have compared with considering them line by line, think of what
+happens if a single newline character is added to the beginning of a
+file. If that file is then compared with an otherwise identical file
+that lacks the newline at the beginning, @command{diff} will report that a
+blank line has been added to the file, while @command{cmp} will report that
+almost every byte of the two files differs.
+
+@command{diff3} normally compares three input files line by line, finds
+groups of lines that differ, and reports each group of differing lines.
+Its output is designed to make it easy to inspect two different sets of
+changes to the same file.
+
+These commands compare input files without necessarily reading them.
+For example, if @command{diff} is asked simply to report whether two
+files differ, and it discovers that the files have different sizes, it
+need not read them to do its job.
+
+@menu
+* Hunks:: Groups of differing lines.
+* White Space:: Suppressing differences in white space.
+* Blank Lines:: Suppressing differences whose lines are all blank.
+* Specified Lines:: Suppressing differences whose lines all match a pattern.
+* Case Folding:: Suppressing differences in alphabetic case.
+* Brief:: Summarizing which files are different.
+* Binary:: Comparing binary files or forcing text comparisons.
+@end menu
+
+@node Hunks
+@section Hunks
+@cindex hunks
+
+When comparing two files, @command{diff} finds sequences of lines common to
+both files, interspersed with groups of differing lines called
+@dfn{hunks}. Comparing two identical files yields one sequence of
+common lines and no hunks, because no lines differ. Comparing two
+entirely different files yields no common lines and one large hunk that
+contains all lines of both files. In general, there are many ways to
+match up lines between two given files. @command{diff} tries to minimize
+the total hunk size by finding large sequences of common lines
+interspersed with small hunks of differing lines.
+
+For example, suppose the file @file{F} contains the three lines
+@samp{a}, @samp{b}, @samp{c}, and the file @file{G} contains the same
+three lines in reverse order @samp{c}, @samp{b}, @samp{a}. If
+@command{diff} finds the line @samp{c} as common, then the command
+@samp{diff F G} produces this output:
+
+@example
+1,2d0
+< a
+< b
+3a2,3
+> b
+> a
+@end example
+
+@noindent
+But if @command{diff} notices the common line @samp{b} instead, it produces
+this output:
+
+@example
+1c1
+< a
+---
+> c
+3c3
+< c
+---
+> a
+@end example
+
+@noindent
+It is also possible to find @samp{a} as the common line. @command{diff}
+does not always find an optimal matching between the files; it takes
+shortcuts to run faster. But its output is usually close to the
+shortest possible. You can adjust this tradeoff with the
+@option{--minimal} (@option{-d}) option (@pxref{diff Performance}).
+
+@node White Space
+@section Suppressing Differences in Blank and Tab Spacing
+@cindex blank and tab difference suppression
+@cindex tab and blank difference suppression
+
+The @option{--ignore-tab-expansion} (@option{-E}) option ignores the
+distinction between tabs and spaces on input. A tab is considered to be
+equivalent to the number of spaces to the next tab stop (@pxref{Tabs}).
+
+The @option{--ignore-trailing-space} (@option{-Z}) option ignores white
+space at line end.
+
+The @option{--ignore-space-change} (@option{-b}) option is stronger than
+@option{-E} and @option{-Z} combined.
+It ignores white space at line end, and considers all other sequences of
+one or more white space characters within a line to be equivalent. With this
+option, @command{diff} considers the following two lines to be equivalent,
+where @samp{$} denotes the line end:
+
+@example
+Here lyeth muche rychnesse in lytell space. -- John Heywood$
+Here lyeth muche rychnesse in lytell space. -- John Heywood $
+@end example
+
+The @option{--ignore-all-space} (@option{-w}) option is stronger still.
+It ignores differences even if one line has white space where
+the other line has none. @dfn{White space} characters include
+tab, vertical tab, form feed, carriage return, and space;
+some locales may define additional characters to be white space.
+With this option, @command{diff} considers the
+following two lines to be equivalent, where @samp{$} denotes the line
+end and @samp{^M} denotes a carriage return:
+
+@example
+Here lyeth muche rychnesse in lytell space.-- John Heywood$
+ He relyeth much erychnes seinly tells pace. --John Heywood ^M$
+@end example
+
+For many other programs newline is also a white space character, but
+@command{diff} is a line-oriented program and a newline character
+always ends a line. Hence the @option{-w} or
+@option{--ignore-all-space} option does not ignore newline-related
+changes; it ignores only other white space changes.
+
+@node Blank Lines
+@section Suppressing Differences Whose Lines Are All Blank
+@cindex blank line difference suppression
+
+The @option{--ignore-blank-lines} (@option{-B}) option ignores changes
+that consist entirely of blank lines. With this option, for example, a
+file containing
+@example
+1. A point is that which has no part.
+
+2. A line is breadthless length.
+-- Euclid, The Elements, I
+@end example
+@noindent
+is considered identical to a file containing
+@example
+1. A point is that which has no part.
+2. A line is breadthless length.
+
+
+-- Euclid, The Elements, I
+@end example
+
+Normally this option affects only lines that are completely empty, but
+if you also specify an option that ignores trailing spaces,
+lines are also affected if they look empty but contain white space.
+In other words, @option{-B} is equivalent to @samp{-I '^$'} by
+default, but it is equivalent to @option{-I '^[[:space:]]*$'} if
+@option{-b}, @option{-w} or @option{-Z} is also specified.
+
+@node Specified Lines
+@section Suppressing Differences Whose Lines All Match a Regular Expression
+@cindex regular expression suppression
+
+To ignore insertions and deletions of lines that match a
+@command{grep}-style regular expression, use the
+@option{--ignore-matching-lines=@var{regexp}} (@option{-I @var{regexp}}) option.
+You should escape
+regular expressions that contain shell metacharacters to prevent the
+shell from expanding them. For example, @samp{diff -I '^[[:digit:]]'} ignores
+all changes to lines beginning with a digit.
+
+However, @option{-I} only ignores the insertion or deletion of lines that
+contain the regular expression if every changed line in the hunk---every
+insertion and every deletion---matches the regular expression. In other
+words, for each nonignorable change, @command{diff} prints the complete set
+of changes in its vicinity, including the ignorable ones.
+
+You can specify more than one regular expression for lines to ignore by
+using more than one @option{-I} option. @command{diff} tries to match each
+line against each regular expression.
+
+@node Case Folding
+@section Suppressing Case Differences
+@cindex case difference suppression
+
+@acronym{GNU} @command{diff} can treat lower case letters as
+equivalent to their upper case counterparts, so that, for example, it
+considers @samp{Funky Stuff}, @samp{funky STUFF}, and @samp{fUNKy
+stuFf} to all be the same. To request this, use the @option{-i} or
+@option{--ignore-case} option.
+
+@node Brief
+@section Summarizing Which Files Differ
+@cindex summarizing which files differ
+@cindex brief difference reports
+
+When you only want to find out whether files are different, and you
+don't care what the differences are, you can use the summary output
+format. In this format, instead of showing the differences between the
+files, @command{diff} simply reports whether files differ. The
+@option{--brief} (@option{-q}) option selects this output format.
+
+This format is especially useful when comparing the contents of two
+directories. It is also much faster than doing the normal line by line
+comparisons, because @command{diff} can stop analyzing the files as soon as
+it knows that there are any differences.
+
+You can also get a brief indication of whether two files differ by using
+@command{cmp}. For files that are identical, @command{cmp} produces no
+output. When the files differ, by default, @command{cmp} outputs the byte
+and line number where the first difference occurs, or reports that one
+file is a prefix of the other. You can use
+the @option{-s}, @option{--quiet}, or @option{--silent} option to
+suppress that information, so that @command{cmp}
+produces no output and reports whether the files differ using only its
+exit status (@pxref{Invoking cmp}).
+
+@c Fix this.
+Unlike @command{diff}, @command{cmp} cannot compare directories; it can only
+compare two files.
+
+@node Binary
+@section Binary Files and Forcing Text Comparisons
+@cindex binary file diff
+@cindex text versus binary diff
+
+If @command{diff} thinks that either of the two files it is comparing is
+binary (a non-text file), it normally treats that pair of files much as
+if the summary output format had been selected (@pxref{Brief}), and
+reports only that the binary files are different. This is because line
+by line comparisons are usually not meaningful for binary files.
+This does not count as trouble, even though the resulting output does
+not capture all the differences.
+
+@command{diff} determines whether a file is text or binary by checking the
+first few bytes in the file; the exact number of bytes is system
+dependent, but it is typically several thousand. If every byte in
+that part of the file is non-null, @command{diff} considers the file to be
+text; otherwise it considers the file to be binary.
+
+Sometimes you might want to force @command{diff} to consider files to be
+text. For example, you might be comparing text files that contain
+null characters; @command{diff} would erroneously decide that those are
+non-text files. Or you might be comparing documents that are in a
+format used by a word processing system that uses null characters to
+indicate special formatting. You can force @command{diff} to consider all
+files to be text files, and compare them line by line, by using the
+@option{--text} (@option{-a}) option. If the files you compare using this
+option do not in fact contain text, they will probably contain few
+newline characters, and the @command{diff} output will consist of hunks
+showing differences between long lines of whatever characters the files
+contain.
+
+You can also force @command{diff} to report only whether files differ
+(but not how). Use the @option{--brief} (@option{-q}) option for
+this.
+
+In operating systems that distinguish between text and binary files,
+@command{diff} normally reads and writes all data as text. Use the
+@option{--binary} option to force @command{diff} to read and write binary
+data instead. This option has no effect on a @acronym{POSIX}-compliant system
+like @acronym{GNU} or traditional Unix. However, many personal computer
+operating systems represent the end of a line with a carriage return
+followed by a newline. On such systems, @command{diff} normally ignores
+these carriage returns on input and generates them at the end of each
+output line, but with the @option{--binary} option @command{diff} treats
+each carriage return as just another input character, and does not
+generate a carriage return at the end of each output line. This can be
+useful when dealing with non-text files that are meant to be
+interchanged with @acronym{POSIX}-compliant systems.
+
+The @option{--strip-trailing-cr} causes @command{diff} to treat input
+lines that end in carriage return followed by newline as if they end
+in plain newline. This can be useful when comparing text that is
+imperfectly imported from many personal computer operating systems.
+This option affects how lines are read, which in turn affects how they
+are compared and output.
+
+If you want to compare two files byte by byte, you can use the
+@command{cmp} program with the @option{--verbose} (@option{-l})
+option to show the values of each differing byte in the two files.
+With @acronym{GNU} @command{cmp}, you can also use the @option{-b} or
+@option{--print-bytes} option to show the @acronym{ASCII} representation of
+those bytes. @xref{Invoking cmp}, for more information.
+
+If @command{diff3} thinks that any of the files it is comparing is binary
+(a non-text file), it normally reports an error, because such
+comparisons are usually not useful. @command{diff3} uses the same test as
+@command{diff} to decide whether a file is binary. As with @command{diff}, if
+the input files contain a few non-text bytes but otherwise are like
+text files, you can force @command{diff3} to consider all files to be text
+files and compare them line by line by using the @option{-a} or
+@option{--text} option.
+
+@node Output Formats
+@chapter @command{diff} Output Formats
+@cindex output formats
+@cindex format of @command{diff} output
+
+@command{diff} has several mutually exclusive options for output format.
+The following sections describe each format, illustrating how
+@command{diff} reports the differences between two sample input files.
+
+@menu
+* Sample diff Input:: Sample @command{diff} input files for examples.
+* Context:: Showing differences with the surrounding text.
+* Side by Side:: Showing differences in two columns.
+* Normal:: Showing differences without surrounding text.
+* Scripts:: Generating scripts for other programs.
+* If-then-else:: Merging files with if-then-else.
+@end menu
+
+@node Sample diff Input
+@section Two Sample Input Files
+@cindex @command{diff} sample input
+@cindex sample input for @command{diff}
+
+Here are two sample files that we will use in numerous examples to
+illustrate the output of @command{diff} and how various options can change
+it.
+
+This is the file @file{lao}:
+
+@example
+The Way that can be told of is not the eternal Way;
+The name that can be named is not the eternal name.
+The Nameless is the origin of Heaven and Earth;
+The Named is the mother of all things.
+Therefore let there always be non-being,
+ so we may see their subtlety,
+And let there always be being,
+ so we may see their outcome.
+The two are the same,
+But after they are produced,
+ they have different names.
+@end example
+
+This is the file @file{tzu}:
+
+@example
+The Nameless is the origin of Heaven and Earth;
+The named is the mother of all things.
+
+Therefore let there always be non-being,
+ so we may see their subtlety,
+And let there always be being,
+ so we may see their outcome.
+The two are the same,
+But after they are produced,
+ they have different names.
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
+@end example
+
+In this example, the first hunk contains just the first two lines of
+@file{lao}, the second hunk contains the fourth line of @file{lao}
+opposing the second and third lines of @file{tzu}, and the last hunk
+contains just the last three lines of @file{tzu}.
+
+@node Context
+@section Showing Differences in Their Context
+@cindex context output format
+@cindex @samp{!} output format
+
+Usually, when you are looking at the differences between files, you will
+also want to see the parts of the files near the lines that differ, to
+help you understand exactly what has changed. These nearby parts of the
+files are called the @dfn{context}.
+
+@acronym{GNU} @command{diff} provides two output formats that show context
+around the differing lines: @dfn{context format} and @dfn{unified
+format}. It can optionally show in which function or section of the
+file the differing lines are found.
+
+If you are distributing new versions of files to other people in the
+form of @command{diff} output, you should use one of the output formats
+that show context so that they can apply the diffs even if they have
+made small changes of their own to the files. @command{patch} can apply
+the diffs in this case by searching in the files for the lines of
+context around the differing lines; if those lines are actually a few
+lines away from where the diff says they are, @command{patch} can adjust
+the line numbers accordingly and still apply the diff correctly.
+@xref{Imperfect}, for more information on using @command{patch} to apply
+imperfect diffs.
+
+@menu
+* Context Format:: An output format that shows surrounding lines.
+* Unified Format:: A more compact output format that shows context.
+* Sections:: Showing which sections of the files differences are in.
+* Alternate Names:: Showing alternate file names in context headers.
+@end menu
+
+@node Context Format
+@subsection Context Format
+
+The context output format shows several lines of context around the
+lines that differ. It is the standard format for distributing updates
+to source code.
+
+To select this output format, use the
+@option{--context@r{[}=@var{lines}@r{]}} (@option{-C @var{lines}})
+or @option{-c} option. The
+argument @var{lines} that some of these options take is the number of
+lines of context to show. If you do not specify @var{lines}, it
+defaults to three. For proper operation, @command{patch} typically needs
+at least two lines of context.
+
+@menu
+* Example Context:: Sample output in context format.
+* Less Context:: Another sample with less context.
+* Detailed Context:: A detailed description of the context output format.
+@end menu
+
+@node Example Context
+@subsubsection An Example of Context Format
+
+Here is the output of @samp{diff -c lao tzu} (@pxref{Sample diff Input},
+for the complete contents of the two files). Notice that up to three
+lines that are not different are shown around each line that is
+different; they are the context lines. Also notice that the first two
+hunks have run together, because their contents overlap.
+
+@example
+*** lao 2002-02-21 23:30:39.942229878 -0800
+--- tzu 2002-02-21 23:30:50.442260588 -0800
+***************
+*** 1,7 ****
+- The Way that can be told of is not the eternal Way;
+- The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+! The Named is the mother of all things.
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+--- 1,6 ----
+ The Nameless is the origin of Heaven and Earth;
+! The named is the mother of all things.
+! @-
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+***************
+*** 9,11 ****
+--- 8,13 ----
+ The two are the same,
+ But after they are produced,
+ they have different names.
++ They both may be called deep and profound.
++ Deeper and more profound,
++ The door of all subtleties!
+@end example
+
+@node Less Context
+@subsubsection An Example of Context Format with Less Context
+
+Here is the output of @samp{diff -C 1 lao tzu} (@pxref{Sample diff
+Input}, for the complete contents of the two files). Notice that at
+most one context line is reported here.
+
+@example
+*** lao 2002-02-21 23:30:39.942229878 -0800
+--- tzu 2002-02-21 23:30:50.442260588 -0800
+***************
+*** 1,5 ****
+- The Way that can be told of is not the eternal Way;
+- The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+! The Named is the mother of all things.
+ Therefore let there always be non-being,
+--- 1,4 ----
+ The Nameless is the origin of Heaven and Earth;
+! The named is the mother of all things.
+! @-
+ Therefore let there always be non-being,
+***************
+*** 11 ****
+--- 10,13 ----
+ they have different names.
++ They both may be called deep and profound.
++ Deeper and more profound,
++ The door of all subtleties!
+@end example
+
+@node Detailed Context
+@subsubsection Detailed Description of Context Format
+
+The context output format starts with a two-line header, which looks
+like this:
+
+@example
+*** @var{from-file} @var{from-file-modification-time}
+--- @var{to-file} @var{to-file-modification time}
+@end example
+
+@noindent
+@vindex LC_TIME
+@cindex time stamp format, context diffs
+The time stamp normally looks like @samp{2002-02-21 23:30:39.942229878
+-0800} to indicate the date, time with fractional seconds, and time
+zone in @uref{ftp://ftp.isi.edu/in-notes/rfc2822.txt, Internet RFC
+2822 format}. (The fractional seconds are omitted on hosts that do
+not support fractional time stamps.) However, a traditional time
+stamp like @samp{Thu Feb 21 23:30:39 2002} is used if the
+@env{LC_TIME} locale category is either @samp{C} or @samp{POSIX}.
+
+You can change the header's content with the
+@option{--label=@var{label}} option; see @ref{Alternate Names}.
+
+Next come one or more hunks of differences; each hunk shows one area
+where the files differ. Context format hunks look like this:
+
+@example
+***************
+*** @var{from-file-line-numbers} ****
+ @var{from-file-line}
+ @var{from-file-line}@dots{}
+--- @var{to-file-line-numbers} ----
+ @var{to-file-line}
+ @var{to-file-line}@dots{}
+@end example
+
+If a hunk contains two or more lines, its line numbers look like
+@samp{@var{start},@var{end}}. Otherwise only its end line number
+appears. An empty hunk is considered to end at the line that precedes
+the hunk.
+
+The lines of context around the lines that differ start with two space
+characters. The lines that differ between the two files start with one
+of the following indicator characters, followed by a space character:
+
+@table @samp
+@item !
+A line that is part of a group of one or more lines that changed between
+the two files. There is a corresponding group of lines marked with
+@samp{!} in the part of this hunk for the other file.
+
+@item +
+An ``inserted'' line in the second file that corresponds to nothing in
+the first file.
+
+@item -
+A ``deleted'' line in the first file that corresponds to nothing in the
+second file.
+@end table
+
+If all of the changes in a hunk are insertions, the lines of
+@var{from-file} are omitted. If all of the changes are deletions, the
+lines of @var{to-file} are omitted.
+
+@node Unified Format
+@subsection Unified Format
+@cindex unified output format
+@cindex @samp{+-} output format
+
+The unified output format is a variation on the context format that is
+more compact because it omits redundant context lines. To select this
+output format, use the
+@option{--unified@r{[}=@var{lines}@r{]}} (@option{-U @var{lines}}),
+or @option{-u} option.
+The argument @var{lines} is the number of lines of context to show.
+When it is not given, it defaults to three.
+
+At present, only @acronym{GNU} @command{diff} can produce this format and
+only @acronym{GNU} @command{patch} can automatically apply diffs in this
+format. For proper operation, @command{patch} typically needs at
+least three lines of context.
+
+@menu
+* Example Unified:: Sample output in unified format.
+* Detailed Unified:: A detailed description of unified format.
+@end menu
+
+@node Example Unified
+@subsubsection An Example of Unified Format
+
+Here is the output of the command @samp{diff -u lao tzu}
+(@pxref{Sample diff Input}, for the complete contents of the two files):
+
+@example
+--- lao 2002-02-21 23:30:39.942229878 -0800
++++ tzu 2002-02-21 23:30:50.442260588 -0800
+@@@@ -1,7 +1,6 @@@@
+-The Way that can be told of is not the eternal Way;
+-The name that can be named is not the eternal name.
+ The Nameless is the origin of Heaven and Earth;
+-The Named is the mother of all things.
++The named is the mother of all things.
++
+ Therefore let there always be non-being,
+ so we may see their subtlety,
+ And let there always be being,
+@@@@ -9,3 +8,6 @@@@
+ The two are the same,
+ But after they are produced,
+ they have different names.
++They both may be called deep and profound.
++Deeper and more profound,
++The door of all subtleties!
+@end example
+
+@node Detailed Unified
+@subsubsection Detailed Description of Unified Format
+
+The unified output format starts with a two-line header, which looks
+like this:
+
+@example
+--- @var{from-file} @var{from-file-modification-time}
++++ @var{to-file} @var{to-file-modification-time}
+@end example
+
+@noindent
+@cindex time stamp format, unified diffs
+The time stamp looks like @samp{2002-02-21 23:30:39.942229878 -0800}
+to indicate the date, time with fractional seconds, and time zone.
+The fractional seconds are omitted on hosts that do not support
+fractional time stamps.
+
+You can change the header's content with the
+@option{--label=@var{label}} option. @xref{Alternate Names}.
+
+Next come one or more hunks of differences; each hunk shows one area
+where the files differ. Unified format hunks look like this:
+
+@example
+@@@@ @var{from-file-line-numbers} @var{to-file-line-numbers} @@@@
+ @var{line-from-either-file}
+ @var{line-from-either-file}@dots{}
+@end example
+
+If a hunk contains just one line, only its start line number appears.
+Otherwise its line numbers look like @samp{@var{start},@var{count}}.
+An empty hunk is considered to start at the line that follows the hunk.
+
+If a hunk and its context contain two or more lines, its
+line numbers look like @samp{@var{start},@var{count}}. Otherwise only
+its end line number appears. An empty hunk is considered to end at
+the line that precedes the hunk.
+
+The lines common to both files begin with a space character. The lines
+that actually differ between the two files have one of the following
+indicator characters in the left print column:
+
+@table @samp
+@item +
+A line was added here to the first file.
+
+@item -
+A line was removed here from the first file.
+@end table
+
+@node Sections
+@subsection Showing Which Sections Differences Are in
+@cindex headings
+@cindex section headings
+
+Sometimes you might want to know which part of the files each change
+falls in. If the files are source code, this could mean which
+function was changed. If the files are documents, it could mean which
+chapter or appendix was changed. @acronym{GNU} @command{diff} can
+show this by displaying the nearest section heading line that precedes
+the differing lines. Which lines are ``section headings'' is
+determined by a regular expression.
+
+@menu
+* Specified Headings:: Showing headings that match regular expressions.
+* C Function Headings:: Showing headings of C functions.
+@end menu
+
+@node Specified Headings
+@subsubsection Showing Lines That Match Regular Expressions
+@cindex specified headings
+@cindex regular expression matching headings
+
+To show in which sections differences occur for files that are not
+source code for C or similar languages, use the
+@option{--show-function-line=@var{regexp}} (@option{-F @var{regexp}}) option.
+@command{diff}
+considers lines that match the @command{grep}-style regular expression
+@var{regexp} to be the beginning
+of a section of the file. Here are suggested regular expressions for
+some common languages:
+
+@c Please add to this list, e.g. Fortran, Pascal, Perl, Python.
+@table @samp
+@item ^[[:alpha:]$_]
+C, C++, Prolog
+@item ^(
+Lisp
+@item ^@@node
+Texinfo
+@end table
+
+This option does not automatically select an output format; in order to
+use it, you must select the context format (@pxref{Context Format}) or
+unified format (@pxref{Unified Format}). In other output formats it
+has no effect.
+
+The @option{--show-function-line} (@option{-F}) option finds the nearest
+unchanged line that precedes each hunk of differences and matches the
+given regular expression. Then it adds that line to the end of the
+line of asterisks in the context format, or to the @samp{@@@@} line in
+unified format. If no matching line exists, this option leaves the output for
+that hunk unchanged. If that line is more than 40 characters long, it
+outputs only the first 40 characters. You can specify more than one
+regular expression for such lines; @command{diff} tries to match each line
+against each regular expression, starting with the last one given. This
+means that you can use @option{-p} and @option{-F} together, if you wish.
+
+@node C Function Headings
+@subsubsection Showing C Function Headings
+@cindex C function headings
+@cindex function headings, C
+
+To show in which functions differences occur for C and similar
+languages, you can use the @option{--show-c-function} (@option{-p}) option.
+This option automatically defaults to the context output format
+(@pxref{Context Format}), with the default number of lines of context.
+You can override that number with @option{-C @var{lines}} elsewhere in the
+command line. You can override both the format and the number with
+@option{-U @var{lines}} elsewhere in the command line.
+
+The @option{--show-c-function} (@option{-p}) option is equivalent to
+@option{-F '^[[:alpha:]$_]'} if the unified format is specified, otherwise
+@option{-c -F '^[[:alpha:]$_]'} (@pxref{Specified Headings}). @acronym{GNU}
+@command{diff} provides this option for the sake of convenience.
+
+@node Alternate Names
+@subsection Showing Alternate File Names
+@cindex alternate file names
+@cindex file name alternates
+
+If you are comparing two files that have meaningless or uninformative
+names, you might want @command{diff} to show alternate names in the header
+of the context and unified output formats. To do this, use the
+@option{--label=@var{label}} option. The first time
+you give this option, its argument replaces the name and date of the
+first file in the header; the second time, its argument replaces the
+name and date of the second file. If you give this option more than
+twice, @command{diff} reports an error. The @option{--label} option does not
+affect the file names in the @command{pr} header when the @option{-l} or
+@option{--paginate} option is used (@pxref{Pagination}).
+
+Here are the first two lines of the output from @samp{diff -C 2
+--label=original --label=modified lao tzu}:
+
+@example
+*** original
+--- modified
+@end example
+
+@node Side by Side
+@section Showing Differences Side by Side
+@cindex side by side
+@cindex two-column output
+@cindex columnar output
+
+@command{diff} can produce a side by side difference listing of two files.
+The files are listed in two columns with a gutter between them. The
+gutter contains one of the following markers:
+
+@table @asis
+@item white space
+The corresponding lines are in common. That is, either the lines are
+identical, or the difference is ignored because of one of the
+@option{--ignore} options (@pxref{White Space}).
+
+@item @samp{|}
+The corresponding lines differ, and they are either both complete
+or both incomplete.
+
+@item @samp{<}
+The files differ and only the first file contains the line.
+
+@item @samp{>}
+The files differ and only the second file contains the line.
+
+@item @samp{(}
+Only the first file contains the line, but the difference is ignored.
+
+@item @samp{)}
+Only the second file contains the line, but the difference is ignored.
+
+@item @samp{\}
+The corresponding lines differ, and only the first line is incomplete.
+
+@item @samp{/}
+The corresponding lines differ, and only the second line is incomplete.
+@end table
+
+Normally, an output line is incomplete if and only if the lines that it
+contains are incomplete. @xref{Incomplete Lines}. However, when an
+output line represents two differing lines, one might be incomplete
+while the other is not. In this case, the output line is complete,
+but its the gutter is marked @samp{\} if the first line is incomplete,
+@samp{/} if the second line is.
+
+Side by side format is sometimes easiest to read, but it has limitations.
+It generates much wider output than usual, and truncates lines that are
+too long to fit. Also, it relies on lining up output more heavily than
+usual, so its output looks particularly bad if you use varying
+width fonts, nonstandard tab stops, or nonprinting characters.
+
+You can use the @command{sdiff} command to interactively merge side by side
+differences. @xref{Interactive Merging}, for more information on merging files.
+
+@menu
+* Side by Side Format:: Controlling side by side output format.
+* Example Side by Side:: Sample side by side output.
+@end menu
+
+@node Side by Side Format
+@subsection Controlling Side by Side Format
+@cindex side by side format
+
+The @option{--side-by-side} (@option{-y}) option selects side by side
+format. Because side by side output lines contain two input lines, the
+output is wider than usual: normally 130 print columns, which can fit
+onto a traditional printer line. You can set the width of the output
+with the @option{--width=@var{columns}} (@option{-W @var{columns}})
+option. The output is split into two halves of equal width, separated by a
+small gutter to mark differences; the right half is aligned to a tab
+stop so that tabs line up. Input lines that are too long to fit in half
+of an output line are truncated for output.
+
+The @option{--left-column} option prints only the left column of two
+common lines. The @option{--suppress-common-lines} option suppresses
+common lines entirely.
+
+@node Example Side by Side
+@subsection An Example of Side by Side Format
+
+Here is the output of the command @samp{diff -y -W 72 lao tzu}
+(@pxref{Sample diff Input}, for the complete contents of the two files).
+
+@example
+The Way that can be told of is n <
+The name that can be named is no <
+The Nameless is the origin of He The Nameless is the origin of He
+The Named is the mother of all t | The named is the mother of all t
+ >
+Therefore let there always be no Therefore let there always be no
+ so we may see their subtlety, so we may see their subtlety,
+And let there always be being, And let there always be being,
+ so we may see their outcome. so we may see their outcome.
+The two are the same, The two are the same,
+But after they are produced, But after they are produced,
+ they have different names. they have different names.
+ > They both may be called deep and
+ > Deeper and more profound,
+ > The door of all subtleties!
+@end example
+
+@node Normal
+@section Showing Differences Without Context
+@cindex normal output format
+@cindex @samp{<} output format
+
+The ``normal'' @command{diff} output format shows each hunk of differences
+without any surrounding context. Sometimes such output is the clearest
+way to see how lines have changed, without the clutter of nearby
+unchanged lines (although you can get similar results with the context
+or unified formats by using 0 lines of context). However, this format
+is no longer widely used for sending out patches; for that purpose, the
+context format (@pxref{Context Format}) and the unified format
+(@pxref{Unified Format}) are superior. Normal format is the default for
+compatibility with older versions of @command{diff} and the @acronym{POSIX}
+standard. Use the @option{--normal} option to select this output
+format explicitly.
+
+@menu
+* Example Normal:: Sample output in the normal format.
+* Detailed Normal:: A detailed description of normal output format.
+@end menu
+
+@node Example Normal
+@subsection An Example of Normal Format
+
+Here is the output of the command @samp{diff lao tzu}
+(@pxref{Sample diff Input}, for the complete contents of the two files).
+Notice that it shows only the lines that are different between the two
+files.
+
+@example
+1,2d0
+< The Way that can be told of is not the eternal Way;
+< The name that can be named is not the eternal name.
+4c2,3
+< The Named is the mother of all things.
+---
+> The named is the mother of all things.
+> @-
+11a11,13
+> They both may be called deep and profound.
+> Deeper and more profound,
+> The door of all subtleties!
+@end example
+
+@node Detailed Normal
+@subsection Detailed Description of Normal Format
+
+The normal output format consists of one or more hunks of differences;
+each hunk shows one area where the files differ. Normal format hunks
+look like this:
+
+@example
+@var{change-command}
+< @var{from-file-line}
+< @var{from-file-line}@dots{}
+---
+> @var{to-file-line}
+> @var{to-file-line}@dots{}
+@end example
+
+There are three types of change commands. Each consists of a line
+number or comma-separated range of lines in the first file, a single
+character indicating the kind of change to make, and a line number or
+comma-separated range of lines in the second file. All line numbers are
+the original line numbers in each file. The types of change commands
+are:
+
+@table @samp
+@item @var{l}a@var{r}
+Add the lines in range @var{r} of the second file after line @var{l} of
+the first file. For example, @samp{8a12,15} means append lines 12--15
+of file 2 after line 8 of file 1; or, if changing file 2 into file 1,
+delete lines 12--15 of file 2.
+
+@item @var{f}c@var{t}
+Replace the lines in range @var{f} of the first file with lines in range
+@var{t} of the second file. This is like a combined add and delete, but
+more compact. For example, @samp{5,7c8,10} means change lines 5--7 of
+file 1 to read as lines 8--10 of file 2; or, if changing file 2 into
+file 1, change lines 8--10 of file 2 to read as lines 5--7 of file 1.
+
+@item @var{r}d@var{l}
+Delete the lines in range @var{r} from the first file; line @var{l} is where
+they would have appeared in the second file had they not been deleted.
+For example, @samp{5,7d3} means delete lines 5--7 of file 1; or, if
+changing file 2 into file 1, append lines 5--7 of file 1 after line 3 of
+file 2.
+@end table
+
+@node Scripts
+@section Making Edit Scripts
+@cindex script output formats
+
+Several output modes produce command scripts for editing @var{from-file}
+to produce @var{to-file}.
+
+@menu
+* ed Scripts:: Using @command{diff} to produce commands for @command{ed}.
+* Forward ed:: Making forward @command{ed} scripts.
+* RCS:: A special @command{diff} output format used by @acronym{RCS}.
+@end menu
+
+@node ed Scripts
+@subsection @command{ed} Scripts
+@cindex @command{ed} script output format
+
+@command{diff} can produce commands that direct the @command{ed} text editor
+to change the first file into the second file. Long ago, this was the
+only output mode that was suitable for editing one file into another
+automatically; today, with @command{patch}, it is almost obsolete. Use the
+@option{--ed} (@option{-e}) option to select this output format.
+
+Like the normal format (@pxref{Normal}), this output format does not
+show any context; unlike the normal format, it does not include the
+information necessary to apply the diff in reverse (to produce the first
+file if all you have is the second file and the diff).
+
+If the file @file{d} contains the output of @samp{diff -e old new}, then
+the command @samp{(cat d && echo w) | ed - old} edits @file{old} to make
+it a copy of @file{new}. More generally, if @file{d1}, @file{d2},
+@dots{}, @file{dN} contain the outputs of @samp{diff -e old new1},
+@samp{diff -e new1 new2}, @dots{}, @samp{diff -e newN-1 newN},
+respectively, then the command @samp{(cat d1 d2 @dots{} dN && echo w) |
+ed - old} edits @file{old} to make it a copy of @file{newN}.
+
+@menu
+* Example ed:: A sample @command{ed} script.
+* Detailed ed:: A detailed description of @command{ed} format.
+@end menu
+
+@node Example ed
+@subsubsection Example @command{ed} Script
+
+Here is the output of @samp{diff -e lao tzu} (@pxref{Sample
+diff Input}, for the complete contents of the two files):
+
+@example
+11a
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
+.
+4c
+The named is the mother of all things.
+
+.
+1,2d
+@end example
+
+@node Detailed ed
+@subsubsection Detailed Description of @command{ed} Format
+
+The @command{ed} output format consists of one or more hunks of
+differences. The changes closest to the ends of the files come first so
+that commands that change the number of lines do not affect how
+@command{ed} interprets line numbers in succeeding commands. @command{ed}
+format hunks look like this:
+
+@example
+@var{change-command}
+@var{to-file-line}
+@var{to-file-line}@dots{}
+.
+@end example
+
+Because @command{ed} uses a single period on a line to indicate the
+end of input, @acronym{GNU} @command{diff} protects lines of changes
+that contain a single period on a line by writing two periods instead,
+then writing a subsequent @command{ed} command to change the two
+periods into one. The @command{ed} format cannot represent an
+incomplete line, so if the second file ends in a changed incomplete
+line, @command{diff} reports an error and then pretends that a newline
+was appended.
+
+There are three types of change commands. Each consists of a line
+number or comma-separated range of lines in the first file and a single
+character indicating the kind of change to make. All line numbers are
+the original line numbers in the file. The types of change commands
+are:
+
+@table @samp
+@item @var{l}a
+Add text from the second file after line @var{l} in the first file. For
+example, @samp{8a} means to add the following lines after line 8 of file
+1.
+
+@item @var{r}c
+Replace the lines in range @var{r} in the first file with the following
+lines. Like a combined add and delete, but more compact. For example,
+@samp{5,7c} means change lines 5--7 of file 1 to read as the text file
+2.
+
+@item @var{r}d
+Delete the lines in range @var{r} from the first file. For example,
+@samp{5,7d} means delete lines 5--7 of file 1.
+@end table
+
+@node Forward ed
+@subsection Forward @command{ed} Scripts
+@cindex forward @command{ed} script output format
+
+@command{diff} can produce output that is like an @command{ed} script, but
+with hunks in forward (front to back) order. The format of the commands
+is also changed slightly: command characters precede the lines they
+modify, spaces separate line numbers in ranges, and no attempt is made
+to disambiguate hunk lines consisting of a single period. Like
+@command{ed} format, forward @command{ed} format cannot represent incomplete
+lines.
+
+Forward @command{ed} format is not very useful, because neither @command{ed}
+nor @command{patch} can apply diffs in this format. It exists mainly for
+compatibility with older versions of @command{diff}. Use the @option{-f} or
+@option{--forward-ed} option to select it.
+
+@node RCS
+@subsection @acronym{RCS} Scripts
+@cindex @acronym{RCS} script output format
+
+The @acronym{RCS} output format is designed specifically for use by
+the Revision Control System, which is a set of free programs used for
+organizing different versions and systems of files. Use the
+@option{--rcs} (@option{-n}) option to select this output format. It
+is like the forward @command{ed} format (@pxref{Forward ed}), but it
+can represent arbitrary changes to the contents of a file because it
+avoids the forward @command{ed} format's problems with lines
+consisting of a single period and with incomplete lines. Instead of
+ending text sections with a line consisting of a single period, each
+command specifies the number of lines it affects; a combination of the
+@samp{a} and @samp{d} commands are used instead of @samp{c}. Also, if
+the second file ends in a changed incomplete line, then the output
+also ends in an incomplete line.
+
+Here is the output of @samp{diff -n lao tzu} (@pxref{Sample
+diff Input}, for the complete contents of the two files):
+
+@example
+d1 2
+d4 1
+a4 2
+The named is the mother of all things.
+
+a11 3
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
+@end example
+
+@node If-then-else
+@section Merging Files with If-then-else
+@cindex merged output format
+@cindex if-then-else output format
+@cindex C if-then-else output format
+@cindex @command{ifdef} output format
+
+You can use @command{diff} to merge two files of C source code. The output
+of @command{diff} in this format contains all the lines of both files.
+Lines common to both files are output just once; the differing parts are
+separated by the C preprocessor directives @code{#ifdef @var{name}} or
+@code{#ifndef @var{name}}, @code{#else}, and @code{#endif}. When
+compiling the output, you select which version to use by either defining
+or leaving undefined the macro @var{name}.
+
+To merge two files, use @command{diff} with the @option{-D @var{name}} or
+@option{--ifdef=@var{name}} option. The argument @var{name} is the C
+preprocessor identifier to use in the @code{#ifdef} and @code{#ifndef}
+directives.
+
+For example, if you change an instance of @code{wait (&s)} to
+@code{waitpid (-1, &s, 0)} and then merge the old and new files with
+the @option{--ifdef=HAVE_WAITPID} option, then the affected part of your code
+might look like this:
+
+@example
+ do @{
+#ifndef HAVE_WAITPID
+ if ((w = wait (&s)) < 0 && errno != EINTR)
+#else /* HAVE_WAITPID */
+ if ((w = waitpid (-1, &s, 0)) < 0 && errno != EINTR)
+#endif /* HAVE_WAITPID */
+ return w;
+ @} while (w != child);
+@end example
+
+You can specify formats for languages other than C by using line group
+formats and line formats, as described in the next sections.
+
+@menu
+* Line Group Formats:: Formats for general if-then-else line groups.
+* Line Formats:: Formats for each line in a line group.
+* Example If-then-else:: Sample if-then-else format output.
+* Detailed If-then-else:: A detailed description of if-then-else format.
+@end menu
+
+@node Line Group Formats
+@subsection Line Group Formats
+@cindex line group formats
+@cindex formats for if-then-else line groups
+
+Line group formats let you specify formats suitable for many
+applications that allow if-then-else input, including programming
+languages and text formatting languages. A line group format specifies
+the output format for a contiguous group of similar lines.
+
+For example, the following command compares the TeX files @file{old}
+and @file{new}, and outputs a merged file in which old regions are
+surrounded by @samp{\begin@{em@}}-@samp{\end@{em@}} lines, and new
+regions are surrounded by @samp{\begin@{bf@}}-@samp{\end@{bf@}} lines.
+
+@example
+diff \
+ --old-group-format='\begin@{em@}
+%<\end@{em@}
+' \
+ --new-group-format='\begin@{bf@}
+%>\end@{bf@}
+' \
+ old new
+@end example
+
+The following command is equivalent to the above example, but it is a
+little more verbose, because it spells out the default line group formats.
+
+@example
+diff \
+ --old-group-format='\begin@{em@}
+%<\end@{em@}
+' \
+ --new-group-format='\begin@{bf@}
+%>\end@{bf@}
+' \
+ --unchanged-group-format='%=' \
+ --changed-group-format='\begin@{em@}
+%<\end@{em@}
+\begin@{bf@}
+%>\end@{bf@}
+' \
+ old new
+@end example
+
+Here is a more advanced example, which outputs a diff listing with
+headers containing line numbers in a ``plain English'' style.
+
+@example
+diff \
+ --unchanged-group-format='' \
+ --old-group-format='-------- %dn line%(n=1?:s) deleted at %df:
+%<' \
+ --new-group-format='-------- %dN line%(N=1?:s) added after %de:
+%>' \
+ --changed-group-format='-------- %dn line%(n=1?:s) changed at %df:
+%<-------- to:
+%>' \
+ old new
+@end example
+
+To specify a line group format, use @command{diff} with one of the options
+listed below. You can specify up to four line group formats, one for
+each kind of line group. You should quote @var{format}, because it
+typically contains shell metacharacters.
+
+@table @option
+@item --old-group-format=@var{format}
+These line groups are hunks containing only lines from the first file.
+The default old group format is the same as the changed group format if
+it is specified; otherwise it is a format that outputs the line group as-is.
+
+@item --new-group-format=@var{format}
+These line groups are hunks containing only lines from the second
+file. The default new group format is same as the changed group
+format if it is specified; otherwise it is a format that outputs the
+line group as-is.
+
+@item --changed-group-format=@var{format}
+These line groups are hunks containing lines from both files. The
+default changed group format is the concatenation of the old and new
+group formats.
+
+@item --unchanged-group-format=@var{format}
+These line groups contain lines common to both files. The default
+unchanged group format is a format that outputs the line group as-is.
+@end table
+
+In a line group format, ordinary characters represent themselves;
+conversion specifications start with @samp{%} and have one of the
+following forms.
+
+@table @samp
+@item %<
+stands for the lines from the first file, including the trailing newline.
+Each line is formatted according to the old line format (@pxref{Line Formats}).
+
+@item %>
+stands for the lines from the second file, including the trailing newline.
+Each line is formatted according to the new line format.
+
+@item %=
+stands for the lines common to both files, including the trailing newline.
+Each line is formatted according to the unchanged line format.
+
+@item %%
+stands for @samp{%}.
+
+@item %c'@var{C}'
+where @var{C} is a single character, stands for @var{C}.
+@var{C} may not be a backslash or an apostrophe.
+For example, @samp{%c':'} stands for a colon, even inside
+the then-part of an if-then-else format, which a colon would
+normally terminate.
+
+@item %c'\@var{O}'
+where @var{O} is a string of 1, 2, or 3 octal digits,
+stands for the character with octal code @var{O}.
+For example, @samp{%c'\0'} stands for a null character.
+
+@item @var{F}@var{n}
+where @var{F} is a @code{printf} conversion specification and @var{n} is one
+of the following letters, stands for @var{n}'s value formatted with @var{F}.
+
+@table @samp
+@item e
+The line number of the line just before the group in the old file.
+
+@item f
+The line number of the first line in the group in the old file;
+equals @var{e} + 1.
+
+@item l
+The line number of the last line in the group in the old file.
+
+@item m
+The line number of the line just after the group in the old file;
+equals @var{l} + 1.
+
+@item n
+The number of lines in the group in the old file; equals @var{l} - @var{f} + 1.
+
+@item E, F, L, M, N
+Likewise, for lines in the new file.
+
+@end table
+
+@vindex LC_NUMERIC
+The @code{printf} conversion specification can be @samp{%d},
+@samp{%o}, @samp{%x}, or @samp{%X}, specifying decimal, octal,
+lower case hexadecimal, or upper case hexadecimal output
+respectively. After the @samp{%} the following options can appear in
+sequence: a series of zero or more flags; an integer
+specifying the minimum field width; and a period followed by an
+optional integer specifying the minimum number of digits.
+The flags are @samp{-} for left-justification, @samp{'} for separating
+the digit into groups as specified by the @env{LC_NUMERIC} locale category,
+and @samp{0} for padding with zeros instead of spaces.
+For example, @samp{%5dN} prints the number of new lines in the group
+in a field of width 5 characters, using the @code{printf} format @code{"%5d"}.
+
+@item (@var{A}=@var{B}?@var{T}:@var{E})
+If @var{A} equals @var{B} then @var{T} else @var{E}.
+@var{A} and @var{B} are each either a decimal constant
+or a single letter interpreted as above.
+This format spec is equivalent to @var{T} if
+@var{A}'s value equals @var{B}'s; otherwise it is equivalent to @var{E}.
+
+For example, @samp{%(N=0?no:%dN) line%(N=1?:s)} is equivalent to
+@samp{no lines} if @var{N} (the number of lines in the group in the
+new file) is 0, to @samp{1 line} if @var{N} is 1, and to @samp{%dN lines}
+otherwise.
+@end table
+
+@node Line Formats
+@subsection Line Formats
+@cindex line formats
+
+Line formats control how each line taken from an input file is
+output as part of a line group in if-then-else format.
+
+For example, the following command outputs text with a one-character
+change indicator to the left of the text. The first character of output
+is @samp{-} for deleted lines, @samp{|} for added lines, and a space for
+unchanged lines. The formats contain newline characters where newlines
+are desired on output.
+
+@example
+diff \
+ --old-line-format='-%l
+' \
+ --new-line-format='|%l
+' \
+ --unchanged-line-format=' %l
+' \
+ old new
+@end example
+
+To specify a line format, use one of the following options. You should
+quote @var{format}, since it often contains shell metacharacters.
+
+@table @option
+@item --old-line-format=@var{format}
+formats lines just from the first file.
+
+@item --new-line-format=@var{format}
+formats lines just from the second file.
+
+@item --unchanged-line-format=@var{format}
+formats lines common to both files.
+
+@item --line-format=@var{format}
+formats all lines; in effect, it sets all three above options simultaneously.
+@end table
+
+In a line format, ordinary characters represent themselves;
+conversion specifications start with @samp{%} and have one of the
+following forms.
+
+@table @samp
+@item %l
+stands for the contents of the line, not counting its trailing
+newline (if any). This format ignores whether the line is incomplete;
+@xref{Incomplete Lines}.
+
+@item %L
+stands for the contents of the line, including its trailing newline
+(if any). If a line is incomplete, this format preserves its
+incompleteness.
+
+@item %%
+stands for @samp{%}.
+
+@item %c'@var{C}'
+where @var{C} is a single character, stands for @var{C}.
+@var{C} may not be a backslash or an apostrophe.
+For example, @samp{%c':'} stands for a colon.
+
+@item %c'\@var{O}'
+where @var{O} is a string of 1, 2, or 3 octal digits,
+stands for the character with octal code @var{O}.
+For example, @samp{%c'\0'} stands for a null character.
+
+@item @var{F}n
+where @var{F} is a @code{printf} conversion specification,
+stands for the line number formatted with @var{F}.
+For example, @samp{%.5dn} prints the line number using the
+@code{printf} format @code{"%.5d"}. @xref{Line Group Formats}, for
+more about printf conversion specifications.
+
+@end table
+
+The default line format is @samp{%l} followed by a newline character.
+
+If the input contains tab characters and it is important that they line
+up on output, you should ensure that @samp{%l} or @samp{%L} in a line
+format is just after a tab stop (e.g.@: by preceding @samp{%l} or
+@samp{%L} with a tab character), or you should use the @option{-t} or
+@option{--expand-tabs} option.
+
+Taken together, the line and line group formats let you specify many
+different formats. For example, the following command uses a format
+similar to normal @command{diff} format. You can tailor this command
+to get fine control over @command{diff} output.
+
+@example
+diff \
+ --old-line-format='< %l
+' \
+ --new-line-format='> %l
+' \
+ --old-group-format='%df%(f=l?:,%dl)d%dE
+%<' \
+ --new-group-format='%dea%dF%(F=L?:,%dL)
+%>' \
+ --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)
+%<---
+%>' \
+ --unchanged-group-format='' \
+ old new
+@end example
+
+@node Example If-then-else
+@subsection An Example of If-then-else Format
+
+Here is the output of @samp{diff -DTWO lao tzu} (@pxref{Sample
+diff Input}, for the complete contents of the two files):
+
+@example
+#ifndef TWO
+The Way that can be told of is not the eternal Way;
+The name that can be named is not the eternal name.
+#endif /* ! TWO */
+The Nameless is the origin of Heaven and Earth;
+#ifndef TWO
+The Named is the mother of all things.
+#else /* TWO */
+The named is the mother of all things.
+
+#endif /* TWO */
+Therefore let there always be non-being,
+ so we may see their subtlety,
+And let there always be being,
+ so we may see their outcome.
+The two are the same,
+But after they are produced,
+ they have different names.
+#ifdef TWO
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
+#endif /* TWO */
+@end example
+
+@node Detailed If-then-else
+@subsection Detailed Description of If-then-else Format
+
+For lines common to both files, @command{diff} uses the unchanged line
+group format. For each hunk of differences in the merged output
+format, if the hunk contains only lines from the first file,
+@command{diff} uses the old line group format; if the hunk contains only
+lines from the second file, @command{diff} uses the new group format;
+otherwise, @command{diff} uses the changed group format.
+
+The old, new, and unchanged line formats specify the output format of
+lines from the first file, lines from the second file, and lines common
+to both files, respectively.
+
+The option @option{--ifdef=@var{name}} is equivalent to
+the following sequence of options using shell syntax:
+
+@example
+--old-group-format='#ifndef @var{name}
+%<#endif /* ! @var{name} */
+' \
+--new-group-format='#ifdef @var{name}
+%>#endif /* @var{name} */
+' \
+--unchanged-group-format='%=' \
+--changed-group-format='#ifndef @var{name}
+%<#else /* @var{name} */
+%>#endif /* @var{name} */
+'
+@end example
+
+You should carefully check the @command{diff} output for proper nesting.
+For example, when using the @option{-D @var{name}} or
+@option{--ifdef=@var{name}} option, you should check that if the
+differing lines contain any of the C preprocessor directives
+@samp{#ifdef}, @samp{#ifndef}, @samp{#else}, @samp{#elif}, or
+@samp{#endif}, they are nested properly and match. If they don't, you
+must make corrections manually. It is a good idea to carefully check
+the resulting code anyway to make sure that it really does what you
+want it to; depending on how the input files were produced, the output
+might contain duplicate or otherwise incorrect code.
+
+The @command{patch} @option{-D @var{name}} option behaves like
+the @command{diff} @option{-D @var{name}} option, except it operates on
+a file and a diff to produce a merged file. @xref{patch Options}.
+
+@node Incomplete Lines
+@chapter Incomplete Lines
+@cindex incomplete lines
+@cindex full lines
+@cindex newline treatment by @command{diff}
+
+When an input file ends in a non-newline character, its last line is
+called an @dfn{incomplete line} because its last character is not a
+newline. All other lines are called @dfn{full lines} and end in a
+newline character. Incomplete lines do not match full lines unless
+differences in white space are ignored (@pxref{White Space}).
+
+An incomplete line is normally distinguished on output from a full
+line by a following line that starts with @samp{\}. However, the
+@acronym{RCS} format (@pxref{RCS}) outputs the incomplete line as-is,
+without any trailing newline or following line. The side by side
+format normally represents incomplete lines as-is, but in some cases
+uses a @samp{\} or @samp{/} gutter marker. @xref{Side by Side}. The
+if-then-else line format preserves a line's incompleteness with
+@samp{%L}, and discards the newline with @samp{%l}. @xref{Line Formats}.
+Finally, with the @command{ed} and forward @command{ed}
+output formats (@pxref{Output Formats}) @command{diff} cannot
+represent an incomplete line, so it pretends there was a newline and
+reports an error.
+
+For example, suppose @file{F} and @file{G} are one-byte files that
+contain just @samp{f} and @samp{g}, respectively. Then @samp{diff F G}
+outputs
+
+@example
+1c1
+< f
+\ No newline at end of file
+---
+> g
+\ No newline at end of file
+@end example
+
+@noindent
+(The exact message may differ in non-English locales.)
+@samp{diff -n F G} outputs the following without a trailing newline:
+
+@example
+d1 1
+a1 1
+g
+@end example
+
+@noindent
+@samp{diff -e F G} reports two errors and outputs the following:
+
+@example
+1c
+g
+.
+@end example
+
+@node Comparing Directories
+@chapter Comparing Directories
+
+@vindex LC_COLLATE
+You can use @command{diff} to compare some or all of the files in two
+directory trees. When both file name arguments to @command{diff} are
+directories, it compares each file that is contained in both
+directories, examining file names in alphabetical order as specified by
+the @env{LC_COLLATE} locale category. Normally
+@command{diff} is silent about pairs of files that contain no differences,
+but if you use the @option{--report-identical-files} (@option{-s}) option,
+it reports pairs of identical files. Normally @command{diff} reports
+subdirectories common to both directories without comparing
+subdirectories' files, but if you use the @option{-r} or
+@option{--recursive} option, it compares every corresponding pair of files
+in the directory trees, as many levels deep as they go.
+
+If only one file exists, @command{diff} normally does not show its
+contents; it merely reports that one file exists but the other does
+not. You can make @command{diff} act as though the missing file is
+empty, so that it outputs the entire contents of the file that
+actually exists. (It is output as either an insertion or a
+deletion, depending on whether the missing file is in the first or the
+second position.) To do this, use the @option{--new-file}
+(@option{-N}) option. This option affects command-line arguments as
+well as files found via directory traversal; for example, @samp{diff
+-N a b} treats @file{a} as empty if @file{a} does not exist but
+@file{b} does, and similarly @samp{diff -N - b} treats standard input
+as empty if it is closed but @file{b} exists.
+
+If the older directory contains large files that are not in
+the newer directory, you can make the patch smaller by using the
+@option{--unidirectional-new-file} option instead of @option{-N}.
+This option is like @option{-N} except that it inserts the contents only
+of files that appear in the second directory but not the first (that is,
+files that were added). At the top of the patch, write instructions for
+the user applying the patch to remove the files that were deleted before
+applying the patch. @xref{Making Patches}, for more discussion of
+making patches for distribution.
+
+To ignore some files while comparing directories, use the
+@option{--exclude=@var{pattern}} (@option{-x @var{pattern}}) option.
+This option
+ignores any files or subdirectories whose base names match the shell
+pattern @var{pattern}. Unlike in the shell, a period at the start of
+the base of a file name matches a wildcard at the start of a pattern.
+You should enclose @var{pattern} in quotes so that the shell does not
+expand it. For example, the option @option{-x '*.[ao]'} ignores any file
+whose name ends with @samp{.a} or @samp{.o}.
+
+This option accumulates if you specify it more than once. For example,
+using the options @option{-x 'RCS' -x '*,v'} ignores any file or
+subdirectory whose base name is @samp{RCS} or ends with @samp{,v}.
+
+If you need to give this option many times, you can instead put the
+patterns in a file, one pattern per line, and use the
+@option{--exclude-from=@var{file}} (@option{-X @var{file}}) option.
+Trailing white space and empty lines are ignored in the pattern file.
+
+If you have been comparing two directories and stopped partway through,
+later you might want to continue where you left off. You can do this by
+using the @option{--starting-file=@var{file}} (@option{-S @var{file}})
+option. This compares only the file @var{file} and all alphabetically
+later files in the topmost directory level.
+
+If two directories differ only in that file names are lower case in
+one directory and upper case in the upper, @command{diff} normally
+reports many differences because it compares file names in a
+case sensitive way. With the @option{--ignore-file-name-case} option,
+@command{diff} ignores case differences in file names, so that for example
+the contents of the file @file{Tao} in one directory are compared to
+the contents of the file @file{TAO} in the other. The
+@option{--no-ignore-file-name-case} option cancels the effect of the
+@option{--ignore-file-name-case} option, reverting to the default
+behavior.
+
+If an @option{--exclude=@var{pattern}} (@option{-x @var{pattern}}) option,
+or an @option{--exclude-from=@var{file}} (@option{-X @var{file}}) option,
+is specified while the @option{--ignore-file-name-case} option is in
+effect, case is ignored when excluding file names matching the
+specified patterns.
+
+To tell @command{diff} not to follow a symbolic link, use the
+@c later: @option{--no-dereference} (@option{-P}).
+@option{--no-dereference} option.
+
+@node Adjusting Output
+@chapter Making @command{diff} Output Prettier
+
+@command{diff} provides several ways to adjust the appearance of its output.
+These adjustments can be applied to any output format.
+
+@menu
+* Tabs:: Preserving the alignment of tab stops.
+* Trailing Blanks:: Suppressing blanks before empty output lines.
+* Pagination:: Page numbering and time-stamping @command{diff} output.
+@end menu
+
+@node Tabs
+@section Preserving Tab Stop Alignment
+@cindex tab stop alignment
+@cindex aligning tab stops
+
+The lines of text in some of the @command{diff} output formats are
+preceded by one or two characters that indicate whether the text is
+inserted, deleted, or changed. The addition of those characters can
+cause tabs to move to the next tab stop, throwing off the alignment of
+columns in the line. @acronym{GNU} @command{diff} provides two ways
+to make tab-aligned columns line up correctly.
+
+The first way is to have @command{diff} convert all tabs into the correct
+number of spaces before outputting them; select this method with the
+@option{--expand-tabs} (@option{-t}) option. To use this form of output with
+@command{patch}, you must give @command{patch} the @option{-l} or
+@option{--ignore-white-space} option (@pxref{Changed White Space}, for more
+information). @command{diff} normally assumes that tab stops are set
+every 8 print columns, but this can be altered by the
+@option{--tabsize=@var{columns}} option.
+
+The other method for making tabs line up correctly is to add a tab
+character instead of a space after the indicator character at the
+beginning of the line. This ensures that all following tab characters
+are in the same position relative to tab stops that they were in the
+original files, so that the output is aligned correctly. Its
+disadvantage is that it can make long lines too long to fit on one line
+of the screen or the paper. It also does not work with the unified
+output format, which does not have a space character after the change
+type indicator character. Select this method with the @option{-T} or
+@option{--initial-tab} option.
+
+@node Trailing Blanks
+@section Omitting trailing blanks
+@cindex trailing blanks
+When outputting lines in normal or context format, or outputting an
+unchanged line in unified format, @command{diff} normally outputs a
+blank just before each line. If the line is empty, the output of
+@command{diff} therefore contains trailing blanks even though the
+input does not contain them. For example, when outputting an
+unchanged empty line in context format, @command{diff} normally
+outputs a line with two leading spaces.
+
+Some text editors and email agents routinely delete trailing blanks,
+so it can be a problem to deal with diff output files that contain
+them. You can avoid this problem with the
+@option{--suppress-blank-empty} option. It causes @command{diff} to
+omit trailing blanks at the end of output lines in normal, context,
+and unified format, unless the trailing blanks were already present in
+the input. This changes the output format slightly, so that output
+lines are guaranteed to never end in a blank unless an input line ends
+in a blank. This format is less likely to be munged by text editors
+or by transmission via email. It is accepted by @acronym{GNU}
+@command{patch} as well.
+
+@node Pagination
+@section Paginating @command{diff} Output
+@cindex paginating @command{diff} output
+
+It can be convenient to have long output page-numbered and time-stamped.
+The @option{--paginate} (@option{-l}) option does this by sending the
+@command{diff} output through the @command{pr} program. Here is what the page
+header might look like for @samp{diff -lc lao tzu}:
+
+@example
+2002-02-22 14:20 diff -lc lao tzu Page 1
+@end example
+
+@node diff Performance
+@chapter @command{diff} Performance Tradeoffs
+@cindex performance of @command{diff}
+
+@acronym{GNU} @command{diff} runs quite efficiently; however, in some
+circumstances you can cause it to run faster or produce a more compact
+set of changes.
+
+One way to improve @command{diff} performance is to use hard or
+symbolic links to files instead of copies. This improves performance
+because @command{diff} normally does not need to read two hard or
+symbolic links to the same file, since their contents must be
+identical. For example, suppose you copy a large directory hierarchy,
+make a few changes to the copy, and then often use @samp{diff -r} to
+compare the original to the copy. If the original files are
+read-only, you can greatly improve performance by creating the copy
+using hard or symbolic links (e.g., with @acronym{GNU} @samp{cp -lR} or
+@samp{cp -sR}). Before editing a file in the copy for the first time,
+you should break the link and replace it with a regular copy.
+
+You can also affect the performance of @acronym{GNU} @command{diff} by
+giving it options that change the way it compares files.
+Performance has more than one dimension. These options improve one
+aspect of performance at the cost of another, or they improve
+performance in some cases while hurting it in others.
+
+The way that @acronym{GNU} @command{diff} determines which lines have
+changed always comes up with a near-minimal set of differences.
+Usually it is good enough for practical purposes. If the
+@command{diff} output is large, you might want @command{diff} to use a
+modified algorithm that sometimes produces a smaller set of
+differences. The @option{--minimal} (@option{-d}) option does this;
+however, it can also cause @command{diff} to run more slowly than
+usual, so it is not the default behavior.
+
+When the files you are comparing are large and have small groups of
+changes scattered throughout them, you can use the
+@option{--speed-large-files} option to make a different modification to
+the algorithm that @command{diff} uses. If the input files have a constant
+small density of changes, this option speeds up the comparisons without
+changing the output. If not, @command{diff} might produce a larger set of
+differences; however, the output will still be correct.
+
+Normally @command{diff} discards the prefix and suffix that is common to
+both files before it attempts to find a minimal set of differences.
+This makes @command{diff} run faster, but occasionally it may produce
+non-minimal output. The @option{--horizon-lines=@var{lines}} option
+prevents @command{diff} from discarding the last @var{lines} lines of the
+prefix and the first @var{lines} lines of the suffix. This gives
+@command{diff} further opportunities to find a minimal output.
+
+Suppose a run of changed lines includes a sequence of lines at one end
+and there is an identical sequence of lines just outside the other end.
+The @command{diff} command is free to choose which identical sequence is
+included in the hunk. In this case, @command{diff} normally shifts the
+hunk's boundaries when this merges adjacent hunks, or shifts a hunk's
+lines towards the end of the file. Merging hunks can make the output
+look nicer in some cases.
+
+@node Comparing Three Files
+@chapter Comparing Three Files
+@cindex comparing three files
+@cindex format of @command{diff3} output
+
+Use the program @command{diff3} to compare three files and show any
+differences among them. (@command{diff3} can also merge files; see
+@ref{diff3 Merging}).
+
+The ``normal'' @command{diff3} output format shows each hunk of
+differences without surrounding context. Hunks are labeled depending
+on whether they are two-way or three-way, and lines are annotated by
+their location in the input files.
+
+@xref{Invoking diff3}, for more information on how to run @command{diff3}.
+
+@menu
+* Sample diff3 Input:: Sample @command{diff3} input for examples.
+* Example diff3 Normal:: Sample output in the normal format.
+* Detailed diff3 Normal:: A detailed description of normal output format.
+* diff3 Hunks:: The format of normal output format.
+@end menu
+
+@node Sample diff3 Input
+@section A Third Sample Input File
+@cindex @command{diff3} sample input
+@cindex sample input for @command{diff3}
+
+Here is a third sample file that will be used in examples to illustrate
+the output of @command{diff3} and how various options can change it. The
+first two files are the same that we used for @command{diff} (@pxref{Sample
+diff Input}). This is the third sample file, called @file{tao}:
+
+@example
+The Way that can be told of is not the eternal Way;
+The name that can be named is not the eternal name.
+The Nameless is the origin of Heaven and Earth;
+The named is the mother of all things.
+
+Therefore let there always be non-being,
+ so we may see their subtlety,
+And let there always be being,
+ so we may see their result.
+The two are the same,
+But after they are produced,
+ they have different names.
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+@end example
+
+@node Example diff3 Normal
+@section An Example of @command{diff3} Normal Format
+
+Here is the output of the command @samp{diff3 lao tzu tao}
+(@pxref{Sample diff3 Input}, for the complete contents of the files).
+Notice that it shows only the lines that are different among the three
+files.
+
+@example
+====2
+1:1,2c
+3:1,2c
+ The Way that can be told of is not the eternal Way;
+ The name that can be named is not the eternal name.
+2:0a
+====1
+1:4c
+ The Named is the mother of all things.
+2:2,3c
+3:4,5c
+ The named is the mother of all things.
+ @-
+====3
+1:8c
+2:7c
+ so we may see their outcome.
+3:9c
+ so we may see their result.
+====
+1:11a
+2:11,13c
+ They both may be called deep and profound.
+ Deeper and more profound,
+ The door of all subtleties!
+3:13,14c
+ @-
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+@end example
+
+@node Detailed diff3 Normal
+@section Detailed Description of @command{diff3} Normal Format
+
+Each hunk begins with a line marked @samp{====}. Three-way hunks have
+plain @samp{====} lines, and two-way hunks have @samp{1}, @samp{2}, or
+@samp{3} appended to specify which of the three input files differ in
+that hunk. The hunks contain copies of two or three sets of input
+lines each preceded by one or two commands identifying where the lines
+came from.
+
+Normally, two spaces precede each copy of an input line to distinguish
+it from the commands. But with the @option{--initial-tab} (@option{-T})
+option, @command{diff3} uses a tab instead of two spaces; this lines up
+tabs correctly. @xref{Tabs}, for more information.
+
+Commands take the following forms:
+
+@table @samp
+@item @var{file}:@var{l}a
+This hunk appears after line @var{l} of file @var{file}, and
+contains no lines in that file. To edit this file to yield the other
+files, one must append hunk lines taken from the other files. For
+example, @samp{1:11a} means that the hunk follows line 11 in the first
+file and contains no lines from that file.
+
+@item @var{file}:@var{r}c
+This hunk contains the lines in the range @var{r} of file @var{file}.
+The range @var{r} is a comma-separated pair of line numbers, or just one
+number if there is only one line. To edit this file to yield the
+other files, one must change the specified lines to be the lines taken
+from the other files. For example, @samp{2:11,13c} means that the hunk
+contains lines 11 through 13 from the second file.
+@end table
+
+If the last line in a set of input lines is incomplete
+(@pxref{Incomplete Lines}), it is distinguished on output from a full
+line by a following line that starts with @samp{\}.
+
+@node diff3 Hunks
+@section @command{diff3} Hunks
+@cindex hunks for @command{diff3}
+@cindex @command{diff3} hunks
+
+Groups of lines that differ in two or three of the input files are
+called @dfn{diff3 hunks}, by analogy with @command{diff} hunks
+(@pxref{Hunks}). If all three input files differ in a @command{diff3}
+hunk, the hunk is called a @dfn{three-way hunk}; if just two input files
+differ, it is a @dfn{two-way hunk}.
+
+As with @command{diff}, several solutions are possible. When comparing the
+files @samp{A}, @samp{B}, and @samp{C}, @command{diff3} normally finds
+@command{diff3} hunks by merging the two-way hunks output by the two
+commands @samp{diff A B} and @samp{diff A C}. This does not necessarily
+minimize the size of the output, but exceptions should be rare.
+
+For example, suppose @file{F} contains the three lines @samp{a},
+@samp{b}, @samp{f}, @file{G} contains the lines @samp{g}, @samp{b},
+@samp{g}, and @file{H} contains the lines @samp{a}, @samp{b},
+@samp{h}. @samp{diff3 F G H} might output the following:
+
+@example
+====2
+1:1c
+3:1c
+ a
+2:1c
+ g
+====
+1:3c
+ f
+2:3c
+ g
+3:3c
+ h
+@end example
+
+@noindent
+because it found a two-way hunk containing @samp{a} in the first and
+third files and @samp{g} in the second file, then the single line
+@samp{b} common to all three files, then a three-way hunk containing
+the last line of each file.
+
+@node diff3 Merging
+@chapter Merging From a Common Ancestor
+@cindex merging from a common ancestor
+
+When two people have made changes to copies of the same file,
+@command{diff3} can produce a merged output that contains both sets of
+changes together with warnings about conflicts.
+
+One might imagine programs with names like @command{diff4} and @command{diff5}
+to compare more than three files simultaneously, but in practice the
+need rarely arises. You can use @command{diff3} to merge three or more
+sets of changes to a file by merging two change sets at a time.
+
+@command{diff3} can incorporate changes from two modified versions into a
+common preceding version. This lets you merge the sets of changes
+represented by the two newer files. Specify the common ancestor version
+as the second argument and the two newer versions as the first and third
+arguments, like this:
+
+@example
+diff3 @var{mine} @var{older} @var{yours}
+@end example
+
+@noindent
+You can remember the order of the arguments by noting that they are in
+alphabetical order.
+
+@cindex conflict
+@cindex overlap
+You can think of this as subtracting @var{older} from @var{yours} and
+adding the result to @var{mine}, or as merging into @var{mine} the
+changes that would turn @var{older} into @var{yours}. This merging is
+well-defined as long as @var{mine} and @var{older} match in the
+neighborhood of each such change. This fails to be true when all three
+input files differ or when only @var{older} differs; we call this
+a @dfn{conflict}. When all three input files differ, we call the
+conflict an @dfn{overlap}.
+
+@command{diff3} gives you several ways to handle overlaps and conflicts.
+You can omit overlaps or conflicts, or select only overlaps,
+or mark conflicts with special @samp{<<<<<<<} and @samp{>>>>>>>} lines.
+
+@command{diff3} can output the merge results as an @command{ed} script that
+that can be applied to the first file to yield the merged output.
+However, it is usually better to have @command{diff3} generate the merged
+output directly; this bypasses some problems with @command{ed}.
+
+@menu
+* Which Changes:: Selecting changes to incorporate.
+* Marking Conflicts:: Marking conflicts.
+* Bypassing ed:: Generating merged output directly.
+* Merging Incomplete Lines:: How @command{diff3} merges incomplete lines.
+* Saving the Changed File:: Emulating System V behavior.
+@end menu
+
+@node Which Changes
+@section Selecting Which Changes to Incorporate
+@cindex overlapping change, selection of
+@cindex unmerged change
+
+You can select all unmerged changes from @var{older} to @var{yours} for merging
+into @var{mine} with the @option{--ed} (@option{-e}) option. You can
+select only the nonoverlapping unmerged changes with
+@option{--easy-only} (@option{-3}),
+and you can select only the overlapping changes with
+@option{--overlap-only} (@option{-x}).
+
+The @option{-e}, @option{-3} and @option{-x} options select only
+@dfn{unmerged changes}, i.e.@: changes where @var{mine} and @var{yours}
+differ; they ignore changes from @var{older} to @var{yours} where
+@var{mine} and @var{yours} are identical, because they assume that such
+changes have already been merged. If this assumption is not a safe
+one, you can use the @option{--show-all} (@option{-A}) option
+(@pxref{Marking Conflicts}).
+
+Here is the output of the command @command{diff3} with each of these three
+options (@pxref{Sample diff3 Input}, for the complete contents of the files).
+Notice that @option{-e} outputs the union of the disjoint sets of changes
+output by @option{-3} and @option{-x}.
+
+Output of @samp{diff3 -e lao tzu tao}:
+@example
+11a
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+.
+8c
+ so we may see their result.
+.
+@end example
+
+Output of @samp{diff3 -3 lao tzu tao}:
+@example
+8c
+ so we may see their result.
+.
+@end example
+
+Output of @samp{diff3 -x lao tzu tao}:
+@example
+11a
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+.
+@end example
+
+@node Marking Conflicts
+@section Marking Conflicts
+@cindex conflict marking
+@cindex @samp{<<<<<<<} for marking conflicts
+
+@command{diff3} can mark conflicts in the merged output by
+bracketing them with special marker lines. A conflict
+that comes from two files @var{A} and @var{B} is marked as follows:
+
+@example
+<<<<<<< @var{A}
+@r{lines from @var{A}}
+=======
+@r{lines from @var{B}}
+>>>>>>> @var{B}
+@end example
+
+A conflict that comes from three files @var{A}, @var{B} and @var{C} is
+marked as follows:
+
+@example
+<<<<<<< @var{A}
+@r{lines from @var{A}}
+||||||| @var{B}
+@r{lines from @var{B}}
+=======
+@r{lines from @var{C}}
+>>>>>>> @var{C}
+@end example
+
+The @option{--show-all} (@option{-A}) option acts like the @option{-e}
+option, except that it brackets conflicts, and it outputs all changes
+from @var{older} to @var{yours}, not just the unmerged changes. Thus,
+given the sample input files (@pxref{Sample diff3 Input}), @samp{diff3
+-A lao tzu tao} puts brackets around the conflict where only @file{tzu}
+differs:
+
+@example
+<<<<<<< tzu
+=======
+The Way that can be told of is not the eternal Way;
+The name that can be named is not the eternal name.
+>>>>>>> tao
+@end example
+
+And it outputs the three-way conflict as follows:
+
+@example
+<<<<<<< lao
+||||||| tzu
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
+=======
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+>>>>>>> tao
+@end example
+
+The @option{--show-overlap} (@option{-E}) option outputs less information
+than the @option{--show-all} (@option{-A}) option, because it outputs only
+unmerged changes, and it never outputs the contents of the second
+file. Thus the @option{-E} option acts like the @option{-e} option,
+except that it brackets the first and third files from three-way
+overlapping changes. Similarly, @option{-X} acts like @option{-x}, except
+it brackets all its (necessarily overlapping) changes. For example,
+for the three-way overlapping change above, the @option{-E} and @option{-X}
+options output the following:
+
+@example
+<<<<<<< lao
+=======
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+>>>>>>> tao
+@end example
+
+If you are comparing files that have meaningless or uninformative names,
+you can use the @option{--label=@var{label}}
+option to show alternate names in the @samp{<<<<<<<}, @samp{|||||||}
+and @samp{>>>>>>>} brackets. This option can be given up to three
+times, once for each input file. Thus @samp{diff3 -A --label X
+--label Y --label Z A
+B C} acts like @samp{diff3 -A A B C}, except that the output looks like
+it came from files named @samp{X}, @samp{Y} and @samp{Z} rather than
+from files named @samp{A}, @samp{B} and @samp{C}.
+
+@node Bypassing ed
+@section Generating the Merged Output Directly
+@cindex merged @command{diff3} format
+
+With the @option{--merge} (@option{-m}) option, @command{diff3} outputs the
+merged file directly. This is more efficient than using @command{ed} to
+generate it, and works even with non-text files that @command{ed} would
+reject. If you specify @option{-m} without an @command{ed} script option,
+@option{-A} is assumed.
+
+For example, the command @samp{diff3 -m lao tzu tao}
+(@pxref{Sample diff3 Input} for a copy of the input files) would output
+the following:
+
+@example
+<<<<<<< tzu
+=======
+The Way that can be told of is not the eternal Way;
+The name that can be named is not the eternal name.
+>>>>>>> tao
+The Nameless is the origin of Heaven and Earth;
+The Named is the mother of all things.
+Therefore let there always be non-being,
+ so we may see their subtlety,
+And let there always be being,
+ so we may see their result.
+The two are the same,
+But after they are produced,
+ they have different names.
+<<<<<<< lao
+||||||| tzu
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
+=======
+
+ -- The Way of Lao-Tzu, tr. Wing-tsit Chan
+>>>>>>> tao
+@end example
+
+@node Merging Incomplete Lines
+@section How @command{diff3} Merges Incomplete Lines
+@cindex incomplete line merging
+
+With @option{-m}, incomplete lines (@pxref{Incomplete Lines}) are simply
+copied to the output as they are found; if the merged output ends in an
+conflict and one of the input files ends in an incomplete
+line, succeeding @samp{|||||||}, @samp{=======} or @samp{>>>>>>>}
+brackets appear somewhere other than the start of a line because
+they are appended to the incomplete line.
+
+Without @option{-m}, if an @command{ed} script option is specified and an
+incomplete line is found, @command{diff3} generates a warning and acts as
+if a newline had been present.
+
+@node Saving the Changed File
+@section Saving the Changed File
+@cindex System V @command{diff3} compatibility
+
+Traditional Unix @command{diff3} generates an @command{ed} script without the
+trailing @samp{w} and @samp{q} commands that save the changes.
+System V @command{diff3} generates these extra commands. @acronym{GNU}
+@command{diff3} normally behaves like traditional Unix
+@command{diff3}, but with the @option{-i} option it behaves like
+System V @command{diff3} and appends the @samp{w} and @samp{q}
+commands.
+
+The @option{-i} option requires one of the @command{ed} script options
+@option{-AeExX3}, and is incompatible with the merged output option
+@option{-m}.
+
+@node Interactive Merging
+@chapter Interactive Merging with @command{sdiff}
+@cindex diff merging
+@cindex interactive merging
+
+With @command{sdiff}, you can merge two files interactively based on a
+side-by-side @option{-y} format comparison (@pxref{Side by Side}). Use
+@option{--output=@var{file}} (@option{-o @var{file}}) to specify where to
+put the merged text. @xref{Invoking sdiff}, for more details on the
+options to @command{sdiff}.
+
+Another way to merge files interactively is to use the Emacs Lisp
+package @command{emerge}. @xref{Emerge, , Emerge, emacs, The
+@acronym{GNU} Emacs Manual}, for more information.
+
+@menu
+* sdiff Option Summary:: Summary of @command{sdiff} options.
+* Merge Commands:: Merging two files interactively.
+@end menu
+
+@node sdiff Option Summary
+@section Specifying @command{diff} Options to @command{sdiff}
+@cindex @command{sdiff} output format
+
+The following @command{sdiff} options have the same meaning as for
+@command{diff}. @xref{diff Options}, for the use of these options.
+
+@example
+-a -b -d -i -t -v
+-B -E -I @var{regexp} -Z
+
+--expand-tabs
+--ignore-blank-lines --ignore-case
+--ignore-matching-lines=@var{regexp} --ignore-space-change
+--ignore-tab-expansion --ignore-trailing-space
+--left-column --minimal --speed-large-files
+--strip-trailing-cr --suppress-common-lines
+--tabsize=@var{columns} --text --version --width=@var{columns}
+@end example
+
+For historical reasons, @command{sdiff} has alternate names for some
+options. The @option{-l} option is equivalent to the
+@option{--left-column} option, and similarly @option{-s} is equivalent
+to @option{--suppress-common-lines}. The meaning of the @command{sdiff}
+@option{-w} and @option{-W} options is interchanged from that of
+@command{diff}: with @command{sdiff}, @option{-w @var{columns}} is
+equivalent to @option{--width=@var{columns}}, and @option{-W} is
+equivalent to @option{--ignore-all-space}. @command{sdiff} without the
+@option{-o} option is equivalent to @command{diff} with the
+@option{--side-by-side} (@option{-y}) option (@pxref{Side by Side}).
+
+@node Merge Commands
+@section Merge Commands
+@cindex merge commands
+@cindex merging interactively
+
+Groups of common lines, with a blank gutter, are copied from the first
+file to the output. After each group of differing lines, @command{sdiff}
+prompts with @samp{%} and pauses, waiting for one of the following
+commands. Follow each command with @key{RET}.
+
+@table @samp
+@item e
+Discard both versions.
+Invoke a text editor on an empty temporary file,
+then copy the resulting file to the output.
+
+@item eb
+Concatenate the two versions, edit the result in a temporary file,
+then copy the edited result to the output.
+
+@item ed
+Like @samp{eb}, except precede each version with a header that
+shows what file and lines the version came from.
+
+@item el
+@itemx e1
+Edit a copy of the left version, then copy the result to the output.
+
+@item er
+@itemx e2
+Edit a copy of the right version, then copy the result to the output.
+
+@item l
+@itemx 1
+Copy the left version to the output.
+
+@item q
+Quit.
+
+@item r
+@itemx 2
+Copy the right version to the output.
+
+@item s
+Silently copy common lines.
+
+@item v
+Verbosely copy common lines. This is the default.
+@end table
+
+@vindex EDITOR
+The text editor invoked is specified by the @env{EDITOR} environment
+variable if it is set. The default is system-dependent.
+
+@node Merging with patch
+@chapter Merging with @command{patch}
+
+@command{patch} takes comparison output produced by @command{diff} and applies
+the differences to a copy of the original file, producing a patched
+version. With @command{patch}, you can distribute just the changes to a
+set of files instead of distributing the entire file set; your
+correspondents can apply @command{patch} to update their copy of the files
+with your changes. @command{patch} automatically determines the diff
+format, skips any leading or trailing headers, and uses the headers to
+determine which file to patch. This lets your correspondents feed a
+mail message containing a difference listing directly to
+@command{patch}.
+
+@command{patch} detects and warns about common problems like forward
+patches. It saves any patches that it could not apply. It can also maintain a
+@code{patchlevel.h} file to ensure that your correspondents apply
+diffs in the proper order.
+
+@command{patch} accepts a series of diffs in its standard input, usually
+separated by headers that specify which file to patch. It applies
+@command{diff} hunks (@pxref{Hunks}) one by one. If a hunk does not
+exactly match the original file, @command{patch} uses heuristics to try to
+patch the file as well as it can. If no approximate match can be found,
+@command{patch} rejects the hunk and skips to the next hunk. @command{patch}
+normally replaces each file @var{f} with its new version, putting reject
+hunks (if any) into @samp{@var{f}.rej}.
+
+@xref{Invoking patch}, for detailed information on the options to
+@command{patch}.
+
+@menu
+* patch Input:: Selecting the type of @command{patch} input.
+* Revision Control:: Getting files from @acronym{RCS}, @acronym{SCCS}, etc.
+* Imperfect:: Dealing with imperfect patches.
+* Creating and Removing:: Creating and removing files with a patch.
+* Patching Time Stamps:: Updating time stamps on patched files.
+* Multiple Patches:: Handling multiple patches in a file.
+* patch Directories:: Changing directory and stripping directories.
+* Backups:: Whether backup files are made.
+* Backup Names:: Backup file names.
+* Reject Names:: Reject file names.
+* patch Messages:: Messages and questions @command{patch} can produce.
+* patch and POSIX:: Conformance to the @acronym{POSIX} standard.
+* patch and Tradition:: @acronym{GNU} versus traditional @command{patch}.
+@end menu
+
+@node patch Input
+@section Selecting the @command{patch} Input Format
+@cindex @command{patch} input format
+
+@command{patch} normally determines which @command{diff} format the patch
+file uses by examining its contents. For patch files that contain
+particularly confusing leading text, you might need to use one of the
+following options to force @command{patch} to interpret the patch file as a
+certain format of diff. The output formats listed here are the only
+ones that @command{patch} can understand.
+
+@table @option
+@item -c
+@itemx --context
+context diff.
+
+@item -e
+@itemx --ed
+@command{ed} script.
+
+@item -n
+@itemx --normal
+normal diff.
+
+@item -u
+@itemx --unified
+unified diff.
+@end table
+
+@node Revision Control
+@section Revision Control
+@cindex revision control
+@cindex version control
+@cindex @acronym{RCS}
+@cindex ClearCase
+@cindex @acronym{SCCS}
+
+If a nonexistent input file is under a revision control system
+supported by @command{patch}, @command{patch} normally asks the user
+whether to get (or check out) the file from the revision control
+system. Patch currently supports @acronym{RCS}, ClearCase and
+@acronym{SCCS}. Under @acronym{RCS} and @acronym{SCCS},
+@command{patch} also asks when the input file is read-only and matches
+the default version in the revision control system.
+
+@vindex PATCH_GET
+The @option{--get=@var{num}} (@option{-g @var{num}}) option affects access
+to files under supported revision control systems. If @var{num} is
+positive, @command{patch} gets the file without asking the user; if
+zero, @command{patch} neither asks the user nor gets the file; and if
+negative, @command{patch} asks the user before getting the file. The
+default value of @var{num} is given by the value of the
+@env{PATCH_GET} environment variable if it is set; if not, the default
+value is zero if @command{patch} is conforming to @acronym{POSIX}, negative
+otherwise. @xref{patch and POSIX}.
+
+@vindex VERSION_CONTROL
+The choice of revision control system is unaffected by the
+@env{VERSION_CONTROL} environment variable (@pxref{Backup Names}).
+
+@node Imperfect
+@section Applying Imperfect Patches
+@cindex imperfect patch application
+
+@command{patch} tries to skip any leading text in the patch file,
+apply the diff, and then skip any trailing text. Thus you can feed a
+mail message directly to @command{patch}, and it should work. If the
+entire diff is indented by a constant amount of white space,
+@command{patch} automatically ignores the indentation. If a context
+diff contains trailing carriage return on each line, @command{patch}
+automatically ignores the carriage return. If a context diff has been
+encapsulated by prepending @w{@samp{- }} to lines beginning with @samp{-}
+as per @uref{ftp://ftp.isi.edu/in-notes/rfc934.txt, Internet RFC 934},
+@command{patch} automatically unencapsulates the input.
+
+However, certain other types of imperfect input require user
+intervention or testing.
+
+@menu
+* Changed White Space:: When tabs and spaces don't match exactly.
+* Reversed Patches:: Applying reversed patches correctly.
+* Inexact:: Helping @command{patch} find close matches.
+* Dry Runs:: Predicting what @command{patch} will do.
+@end menu
+
+@node Changed White Space
+@subsection Applying Patches with Changed White Space
+@cindex white space in patches
+
+Sometimes mailers, editors, or other programs change spaces into tabs,
+or vice versa. If this happens to a patch file or an input file, the
+files might look the same, but @command{patch} will not be able to match
+them properly. If this problem occurs, use the @option{-l} or
+@option{--ignore-white-space} option, which makes @command{patch} compare
+blank characters (i.e.@: spaces and tabs) loosely so that any nonempty
+sequence of blanks in the patch file matches any nonempty sequence of
+blanks in the input files. Non-blank
+characters must still match exactly. Each line of the context must
+still match a line in the input file.
+
+@node Reversed Patches
+@subsection Applying Reversed Patches
+@cindex reversed patches
+
+Sometimes people run @command{diff} with the new file first instead of
+second. This creates a diff that is ``reversed''. To apply such
+patches, give @command{patch} the @option{--reverse} (@option{-R}) option.
+@command{patch} then attempts to swap each hunk around before applying it.
+Rejects come out in the swapped format.
+
+Often @command{patch} can guess that the patch is reversed. If the first
+hunk of a patch fails, @command{patch} reverses the hunk to see if it can
+apply it that way. If it can, @command{patch} asks you if you want to have
+the @option{-R} option set; if it can't, @command{patch} continues to apply
+the patch normally. This method cannot detect a reversed patch if it is
+a normal diff and the first command is an append (which should have been
+a delete) since appends always succeed, because a null context matches
+anywhere. But most patches add or change lines rather than delete them,
+so most reversed normal diffs begin with a delete, which fails, and
+@command{patch} notices.
+
+If you apply a patch that you have already applied, @command{patch} thinks
+it is a reversed patch and offers to un-apply the patch. This could be
+construed as a feature. If you did this inadvertently and you don't
+want to un-apply the patch, just answer @samp{n} to this offer and to
+the subsequent ``apply anyway'' question---or type @kbd{C-c} to kill the
+@command{patch} process.
+
+@node Inexact
+@subsection Helping @command{patch} Find Inexact Matches
+@cindex inexact patches
+@cindex fuzz factor when patching
+
+For context diffs, and to a lesser extent normal diffs, @command{patch} can
+detect when the line numbers mentioned in the patch are incorrect, and
+it attempts to find the correct place to apply each hunk of the patch.
+As a first guess, it takes the line number mentioned in the hunk, plus
+or minus any offset used in applying the previous hunk. If that is not
+the correct place, @command{patch} scans both forward and backward for a
+set of lines matching the context given in the hunk.
+
+First @command{patch} looks for a place where all lines of the context
+match. If it cannot find such a place, and it is reading a context or
+unified diff, and the maximum fuzz factor is set to 1 or more, then
+@command{patch} makes another scan, ignoring the first and last line of
+context. If that fails, and the maximum fuzz factor is set to 2 or
+more, it makes another scan, ignoring the first two and last two lines
+of context are ignored. It continues similarly if the maximum fuzz
+factor is larger.
+
+The @option{--fuzz=@var{lines}} (@option{-F @var{lines}}) option sets the
+maximum fuzz factor to @var{lines}. This option only applies to context
+and unified diffs; it ignores up to @var{lines} lines while looking for
+the place to install a hunk. Note that a larger fuzz factor increases
+the odds of making a faulty patch. The default fuzz factor is 2; there
+is no point to setting it to more than the number of lines of context
+in the diff, ordinarily 3.
+
+If @command{patch} cannot find a place to install a hunk of the patch, it
+writes the hunk out to a reject file (@pxref{Reject Names}, for information
+on how reject files are named). It writes out rejected hunks in context
+format no matter what form the input patch is in. If the input is a
+normal or @command{ed} diff, many of the contexts are simply null. The
+line numbers on the hunks in the reject file may be different from those
+in the patch file: they show the approximate location where @command{patch}
+thinks the failed hunks belong in the new file rather than in the old
+one.
+
+If the @option{--verbose} option is given, then
+as it completes each hunk @command{patch} tells you whether the hunk
+succeeded or failed, and if it failed, on which line (in the new file)
+@command{patch} thinks the hunk should go. If this is different from the
+line number specified in the diff, it tells you the offset. A single
+large offset @emph{may} indicate that @command{patch} installed a hunk in
+the wrong place. @command{patch} also tells you if it used a fuzz factor
+to make the match, in which case you should also be slightly suspicious.
+
+@command{patch} cannot tell if the line numbers are off in an @command{ed}
+script, and can only detect wrong line numbers in a normal diff when it
+finds a change or delete command. It may have the same problem with a
+context diff using a fuzz factor equal to or greater than the number of
+lines of context shown in the diff (typically 3). In these cases, you
+should probably look at a context diff between your original and patched
+input files to see if the changes make sense. Compiling without errors
+is a pretty good indication that the patch worked, but not a guarantee.
+
+A patch against an empty file applies to a nonexistent file, and vice
+versa. @xref{Creating and Removing}.
+
+@command{patch} usually produces the correct results, even when it must
+make many guesses. However, the results are guaranteed only when
+the patch is applied to an exact copy of the file that the patch was
+generated from.
+
+@node Dry Runs
+@subsection Predicting what @command{patch} will do
+@cindex testing @command{patch}
+@cindex dry runs for @command{patch}
+
+It may not be obvious in advance what @command{patch} will do with a
+complicated or poorly formatted patch. If you are concerned that the
+input might cause @command{patch} to modify the wrong files, you can
+use the @option{--dry-run} option, which causes @command{patch} to
+print the results of applying patches without actually changing any
+files. You can then inspect the diagnostics generated by the dry run
+to see whether @command{patch} will modify the files that you expect.
+If the patch does not do what you want, you can modify the patch (or
+the other options to @command{patch}) and try another dry run. Once
+you are satisfied with the proposed patch you can apply it by invoking
+@command{patch} as before, but this time without the
+@option{--dry-run} option.
+
+@node Creating and Removing
+@section Creating and Removing Files
+@cindex creating files
+@cindex empty files, removing
+@cindex removing empty files
+
+Sometimes when comparing two directories, a file may exist in one
+directory but not the other. If you give @command{diff} the
+@option{--new-file} (@option{-N}) option, or if you supply an old or
+new file that is named @file{/dev/null} or is empty and is dated the
+Epoch (1970-01-01 00:00:00 UTC), @command{diff} outputs a patch that
+adds or deletes the contents of this file. When given such a patch,
+@command{patch} normally creates a new file or removes the old file.
+However, when conforming to @acronym{POSIX} (@pxref{patch and POSIX}),
+@command{patch} does not remove the old file, but leaves it empty.
+The @option{--remove-empty-files} (@option{-E}) option causes
+@command{patch} to remove output files that are empty after applying a
+patch, even if the patch does not appear to be one that removed the
+file.
+
+If the patch appears to create a file that already exists,
+@command{patch} asks for confirmation before applying the patch.
+
+@node Patching Time Stamps
+@section Updating Time Stamps on Patched Files
+@cindex time stamps on patched files
+
+When @command{patch} updates a file, it normally sets the file's
+last-modified time stamp to the current time of day. If you are using
+@command{patch} to track a software distribution, this can cause
+@command{make} to incorrectly conclude that a patched file is out of
+date. For example, if @file{syntax.c} depends on @file{syntax.y}, and
+@command{patch} updates @file{syntax.c} and then @file{syntax.y}, then
+@file{syntax.c} will normally appear to be out of date with respect to
+@file{syntax.y} even though its contents are actually up to date.
+
+The @option{--set-utc} (@option{-Z}) option causes @command{patch} to
+set a patched file's modification and access times to the time stamps
+given in context diff headers. If the context diff headers do not
+specify a time zone, they are assumed to use Coordinated Universal
+Time (@acronym{UTC}, often known as @acronym{GMT}).
+
+The @option{--set-time} (@option{-T}) option acts like @option{-Z} or
+@option{--set-utc}, except that it assumes that the context diff
+headers' time stamps use local time instead of @acronym{UTC}. This option
+is not recommended, because patches using local time cannot easily be
+used by people in other time zones, and because local time stamps are
+ambiguous when local clocks move backwards during daylight-saving time
+adjustments. If the context diff headers specify a time zone, this
+option is equivalent to @option{--set-utc} (@option{-Z}).
+
+@command{patch} normally refrains from setting a file's time stamps if
+the file's original last-modified time stamp does not match the time
+given in the diff header, of if the file's contents do not exactly
+match the patch. However, if the @option{--force} (@option{-f})
+option is given, the file's time stamps are set regardless.
+
+Due to the limitations of the current @command{diff} format,
+@command{patch} cannot update the times of files whose contents have
+not changed. Also, if you set file time stamps to values other than
+the current time of day, you should also remove (e.g., with @samp{make
+clean}) all files that depend on the patched files, so that later
+invocations of @command{make} do not get confused by the patched
+files' times.
+
+@node Multiple Patches
+@section Multiple Patches in a File
+@cindex multiple patches
+@cindex intuiting file names from patches
+
+If the patch file contains more than one patch, and if you do not
+specify an input file on the command line, @command{patch} tries to
+apply each patch as if they came from separate patch files. This
+means that it determines the name of the file to patch for each patch,
+and that it examines the leading text before each patch for file names
+and prerequisite revision level (@pxref{Making Patches}, for more on
+that topic).
+
+@command{patch} uses the following rules to intuit a file name from
+the leading text before a patch. First, @command{patch} takes an
+ordered list of candidate file names as follows:
+
+@itemize @bullet
+@item
+If the header is that of a context diff, @command{patch} takes the old
+and new file names in the header. A name is ignored if it does not
+have enough slashes to satisfy the @option{-p@var{num}} or
+@option{--strip=@var{num}} option. The name @file{/dev/null} is also
+ignored.
+
+@item
+If there is an @samp{Index:} line in the leading garbage and if either
+the old and new names are both absent or if @command{patch} is
+conforming to @acronym{POSIX}, @command{patch} takes the name in the
+@samp{Index:} line.
+
+@item
+For the purpose of the following rules, the candidate file names are
+considered to be in the order (old, new, index), regardless of the
+order that they appear in the header.
+@end itemize
+
+@noindent
+Then @command{patch} selects a file name from the candidate list as
+follows:
+
+@itemize @bullet
+@item
+If some of the named files exist, @command{patch} selects the first
+name if conforming to @acronym{POSIX}, and the best name otherwise.
+
+@item
+If @command{patch} is not ignoring @acronym{RCS}, ClearCase, and @acronym{SCCS}
+(@pxref{Revision Control}), and no named files exist but an @acronym{RCS},
+ClearCase, or @acronym{SCCS} master is found, @command{patch} selects the
+first named file with an @acronym{RCS}, ClearCase, or @acronym{SCCS} master.
+
+@item
+If no named files exist, no @acronym{RCS}, ClearCase, or @acronym{SCCS} master
+was found, some names are given, @command{patch} is not conforming to
+@acronym{POSIX}, and the patch appears to create a file, @command{patch}
+selects the best name requiring the creation of the fewest
+directories.
+
+@item
+If no file name results from the above heuristics, you are asked for
+the name of the file to patch, and @command{patch} selects that name.
+@end itemize
+
+To determine the @dfn{best} of a nonempty list of file names,
+@command{patch} first takes all the names with the fewest path name
+components; of those, it then takes all the names with the shortest
+basename; of those, it then takes all the shortest names; finally, it
+takes the first remaining name.
+
+@xref{patch and POSIX}, to see whether @command{patch} is conforming
+to @acronym{POSIX}.
+
+@node patch Directories
+@section Applying Patches in Other Directories
+@cindex directories and patch
+@cindex patching directories
+
+The @option{--directory=@var{directory}} (@option{-d @var{directory}})
+option to @command{patch} makes directory @var{directory} the current
+directory for interpreting both file names in the patch file, and file
+names given as arguments to other options (such as @option{-B} and
+@option{-o}). For example, while in a mail reading program, you can patch
+a file in the @file{/usr/src/emacs} directory directly from a message
+containing the patch like this:
+
+@example
+| patch -d /usr/src/emacs
+@end example
+
+Sometimes the file names given in a patch contain leading directories,
+but you keep your files in a directory different from the one given in
+the patch. In those cases, you can use the
+@option{--strip=@var{number}} (@option{-p@var{number}})
+option to set the file name strip count to @var{number}. The strip
+count tells @command{patch} how many slashes, along with the directory
+names between them, to strip from the front of file names. A sequence
+of one or more adjacent slashes is counted as a single slash. By
+default, @command{patch} strips off all leading directories, leaving
+just the base file names.
+
+For example, suppose the file name in the patch file is
+@file{/gnu/src/emacs/etc/NEWS}. Using @option{-p0} gives the
+entire file name unmodified, @option{-p1} gives
+@file{gnu/src/emacs/etc/NEWS} (no leading slash), @option{-p4} gives
+@file{etc/NEWS}, and not specifying @option{-p} at all gives @file{NEWS}.
+
+@command{patch} looks for each file (after any slashes have been stripped)
+in the current directory, or if you used the @option{-d @var{directory}}
+option, in that directory.
+
+@node Backups
+@section Backup Files
+@cindex backup file strategy
+
+Normally, @command{patch} creates a backup file if the patch does not
+exactly match the original input file, because in that case the
+original data might not be recovered if you undo the patch with
+@samp{patch -R} (@pxref{Reversed Patches}). However, when conforming
+to @acronym{POSIX}, @command{patch} does not create backup files by
+default. @xref{patch and POSIX}.
+
+The @option{--backup} (@option{-b}) option causes @command{patch} to
+make a backup file regardless of whether the patch matches the
+original input. The @option{--backup-if-mismatch} option causes
+@command{patch} to create backup files for mismatches files; this is
+the default when not conforming to @acronym{POSIX}. The
+@option{--no-backup-if-mismatch} option causes @command{patch} to not
+create backup files, even for mismatched patches; this is the default
+when conforming to @acronym{POSIX}.
+
+When backing up a file that does not exist, an empty, unreadable
+backup file is created as a placeholder to represent the nonexistent
+file.
+
+@node Backup Names
+@section Backup File Names
+@cindex backup file names
+
+Normally, @command{patch} renames an original input file into a backup
+file by appending to its name the extension @samp{.orig}, or @samp{~}
+if using @samp{.orig} would make the backup file name too
+long.@footnote{A coding error in @acronym{GNU} @command{patch} version
+2.5.4 causes it to always use @samp{~}, but this should be fixed in
+the next release.} The @option{-z @var{backup-suffix}} or
+@option{--suffix=@var{backup-suffix}} option causes @command{patch} to
+use @var{backup-suffix} as the backup extension instead.
+
+@vindex SIMPLE_BACKUP_SUFFIX
+Alternately, you can specify the extension for backup files with the
+@env{SIMPLE_BACKUP_SUFFIX} environment variable, which the options
+override.
+
+@command{patch} can also create numbered backup files the way
+@acronym{GNU} Emacs does. With this method, instead of having a
+single backup of each file, @command{patch} makes a new backup file
+name each time it patches a file. For example, the backups of a file
+named @file{sink} would be called, successively, @file{sink.~1~},
+@file{sink.~2~}, @file{sink.~3~}, etc.
+
+@vindex PATCH_VERSION_CONTROL
+@vindex VERSION_CONTROL
+The @option{-V @var{backup-style}} or
+@option{--version-control=@var{backup-style}} option takes as an
+argument a method for creating backup file names. You can alternately
+control the type of backups that @command{patch} makes with the
+@env{PATCH_VERSION_CONTROL} environment variable, which the
+@option{-V} option overrides. If @env{PATCH_VERSION_CONTROL} is not
+set, the @env{VERSION_CONTROL} environment variable is used instead.
+Please note that these options and variables control backup file
+names; they do not affect the choice of revision control system
+(@pxref{Revision Control}).
+
+The values of these environment variables and the argument to the
+@option{-V} option are like the @acronym{GNU} Emacs @code{version-control}
+variable (@pxref{Backup Names, , , emacs, The @acronym{GNU} Emacs Manual},
+for more information on backup versions in Emacs). They also
+recognize synonyms that are more descriptive. The valid values are
+listed below; unique abbreviations are acceptable.
+
+@table @option
+@item t
+@itemx numbered
+Always make numbered backups.
+
+@item nil
+@itemx existing
+Make numbered backups of files that already have them, simple backups of
+the others. This is the default.
+
+@item never
+@itemx simple
+Always make simple backups.
+@end table
+
+You can also tell @command{patch} to prepend a prefix, such as a
+directory name, to produce backup file names. The
+@option{--prefix=@var{prefix}} (@option{-B @var{prefix}}) option makes backup
+files by prepending @var{prefix} to them. The
+@option{--basename-prefix=@var{prefix}} (@option{-Y @var{prefix}}) prepends
+@var{prefix} to the last file name component of backup file names
+instead; for example, @option{-Y ~} causes the backup name for
+@file{dir/file.c} to be @file{dir/~file.c}. If you use either of
+these prefix options, the suffix-based options are ignored.
+
+If you specify the output file with the @option{-o} option, that file is
+the one that is backed up, not the input file.
+
+Options that affect the names of backup files do not affect whether
+backups are made. For example, if you specify the
+@option{--no-backup-if-mismatch} option, none of the options described
+in this section have any affect, because no backups are made.
+
+@node Reject Names
+@section Reject File Names
+@cindex reject file names
+
+The names for reject files (files containing patches that
+@command{patch} could not find a place to apply) are normally the name
+of the output file with @samp{.rej} appended (or @samp{#} if using
+@samp{.rej} would make the backup file name too long).
+
+Alternatively, you can tell @command{patch} to place all of the rejected
+patches in a single file. The @option{-r @var{reject-file}} or
+@option{--reject-file=@var{reject-file}} option uses @var{reject-file} as
+the reject file name.
+
+@node patch Messages
+@section Messages and Questions from @command{patch}
+@cindex @command{patch} messages and questions
+@cindex diagnostics from @command{patch}
+@cindex messages from @command{patch}
+
+@command{patch} can produce a variety of messages, especially if it
+has trouble decoding its input. In a few situations where it's not
+sure how to proceed, @command{patch} normally prompts you for more
+information from the keyboard. There are options to produce more or
+fewer messages, to have it not ask for keyboard input, and to
+affect the way that file names are quoted in messages.
+
+@menu
+* More or Fewer Messages:: Controlling the verbosity of @command{patch}.
+* patch and Keyboard Input:: Inhibiting keyboard input.
+* patch Quoting Style:: Quoting file names in diagnostics.
+@end menu
+
+@command{patch} exits with status 0 if all hunks are applied successfully,
+1 if some hunks cannot be applied, and 2 if there is more serious trouble.
+When applying a set of patches in a loop, you should check the
+exit status, so you don't apply a later patch to a partially patched
+file.
+
+@node More or Fewer Messages
+@subsection Controlling the Verbosity of @command{patch}
+@cindex verbose messages from @command{patch}
+@cindex inhibit messages from @command{patch}
+
+You can cause @command{patch} to produce more messages by using the
+@option{--verbose} option. For example, when you give this option,
+the message @samp{Hmm...} indicates that @command{patch} is reading text in
+the patch file, attempting to determine whether there is a patch in that
+text, and if so, what kind of patch it is.
+
+You can inhibit all terminal output from @command{patch}, unless an error
+occurs, by using the @option{-s}, @option{--quiet}, or @option{--silent}
+option.
+
+@node patch and Keyboard Input
+@subsection Inhibiting Keyboard Input
+@cindex keyboard input to @command{patch}
+
+There are two ways you can prevent @command{patch} from asking you any
+questions. The @option{--force} (@option{-f}) option assumes that you know
+what you are doing. It causes @command{patch} to do the following:
+
+@itemize @bullet
+@item
+Skip patches that do not contain file names in their headers.
+
+@item
+Patch files even though they have the wrong version for the
+@samp{Prereq:} line in the patch;
+
+@item
+Assume that patches are not reversed even if they look like they are.
+@end itemize
+
+@noindent
+The @option{--batch} (@option{-t}) option is similar to @option{-f}, in that
+it suppresses questions, but it makes somewhat different assumptions:
+
+@itemize @bullet
+@item
+Skip patches that do not contain file names in their headers
+(the same as @option{-f}).
+
+@item
+Skip patches for which the file has the wrong version for the
+@samp{Prereq:} line in the patch;
+
+@item
+Assume that patches are reversed if they look like they are.
+@end itemize
+
+@node patch Quoting Style
+@subsection @command{patch} Quoting Style
+@cindex quoting style
+
+When @command{patch} outputs a file name in a diagnostic message, it
+can format the name in any of several ways. This can be useful to
+output file names unambiguously, even if they contain punctuation or
+special characters like newlines. The
+@option{--quoting-style=@var{word}} option controls how names are
+output. The @var{word} should be one of the following:
+
+@table @samp
+@item literal
+Output names as-is.
+@item shell
+Quote names for the shell if they contain shell metacharacters or would
+cause ambiguous output.
+@item shell-always
+Quote names for the shell, even if they would normally not require quoting.
+@item c
+Quote names as for a C language string.
+@item escape
+Quote as with @samp{c} except omit the surrounding double-quote
+characters.
+@c The following are not yet implemented in patch 2.5.4.
+@c @item clocale
+@c Quote as with @samp{c} except use quotation marks appropriate for the
+@c locale.
+@c @item locale
+@c @c Use @t instead of @samp to avoid duplicate quoting in some output styles.
+@c Like @samp{clocale}, but quote @t{'like this'} instead of @t{"like
+@c this"} in the default C locale. This looks nicer on many displays.
+@end table
+
+@vindex QUOTING_STYLE
+You can specify the default value of the @option{--quoting-style}
+option with the environment variable @env{QUOTING_STYLE}. If that
+environment variable is not set, the default value is @samp{shell},
+but this default may change in a future version of @command{patch}.
+
+@node patch and POSIX
+@section @command{patch} and the @acronym{POSIX} Standard
+@cindex @acronym{POSIX}
+
+@vindex POSIXLY_CORRECT
+If you specify the @option{--posix} option, or set the
+@env{POSIXLY_CORRECT} environment variable, @command{patch} conforms
+more strictly to the @acronym{POSIX} standard, as follows:
+
+@itemize @bullet
+@item
+Take the first existing file from the list (old, new, index)
+when intuiting file names from diff headers. @xref{Multiple Patches}.
+
+@item
+Do not remove files that are removed by a diff.
+@xref{Creating and Removing}.
+
+@item
+Do not ask whether to get files from @acronym{RCS}, ClearCase, or
+@acronym{SCCS}. @xref{Revision Control}.
+
+@item
+Require that all options precede the files in the command line.
+
+@item
+Do not backup files, even when there is a mismatch. @xref{Backups}.
+
+@end itemize
+
+@node patch and Tradition
+@section @acronym{GNU} @command{patch} and Traditional @command{patch}
+@cindex traditional @command{patch}
+
+The current version of @acronym{GNU} @command{patch} normally follows the
+@acronym{POSIX} standard. @xref{patch and POSIX}, for the few exceptions
+to this general rule.
+
+Unfortunately, @acronym{POSIX} redefined the behavior of @command{patch} in
+several important ways. You should be aware of the following
+differences if you must interoperate with traditional @command{patch},
+or with @acronym{GNU} @command{patch} version 2.1 and earlier.
+
+@itemize @bullet
+@item
+In traditional @command{patch}, the @option{-p} option's operand was
+optional, and a bare @option{-p} was equivalent to @option{-p0}. The
+@option{-p} option now requires an operand, and @option{-p@ 0} is now
+equivalent to @option{-p0}. For maximum compatibility, use options
+like @option{-p0} and @option{-p1}.
+
+Also, traditional @command{patch} simply counted slashes when
+stripping path prefixes; @command{patch} now counts pathname
+components. That is, a sequence of one or more adjacent slashes now
+counts as a single slash. For maximum portability, avoid sending
+patches containing @file{//} in file names.
+
+@item
+In traditional @command{patch}, backups were enabled by default. This
+behavior is now enabled with the @option{--backup} (@option{-b})
+option.
+
+Conversely, in @acronym{POSIX} @command{patch}, backups are never made,
+even when there is a mismatch. In @acronym{GNU} @command{patch}, this
+behavior is enabled with the @option{--no-backup-if-mismatch} option,
+or by conforming to @acronym{POSIX}.
+
+The @option{-b@ @var{suffix}} option of traditional @command{patch} is
+equivalent to the @samp{-b -z@ @var{suffix}} options of @acronym{GNU}
+@command{patch}.
+
+@item
+Traditional @command{patch} used a complicated (and incompletely
+documented) method to intuit the name of the file to be patched from
+the patch header. This method did not conform to @acronym{POSIX}, and had
+a few gotchas. Now @command{patch} uses a different, equally
+complicated (but better documented) method that is optionally
+@acronym{POSIX}-conforming; we hope it has fewer gotchas. The two methods
+are compatible if the file names in the context diff header and the
+@samp{Index:} line are all identical after prefix-stripping. Your
+patch is normally compatible if each header's file names all contain
+the same number of slashes.
+
+@item
+When traditional @command{patch} asked the user a question, it sent
+the question to standard error and looked for an answer from the first
+file in the following list that was a terminal: standard error,
+standard output, @file{/dev/tty}, and standard input. Now
+@command{patch} sends questions to standard output and gets answers
+from @file{/dev/tty}. Defaults for some answers have been changed so
+that @command{patch} never goes into an infinite loop when using
+default answers.
+
+@item
+Traditional @command{patch} exited with a status value that counted
+the number of bad hunks, or with status 1 if there was real trouble.
+Now @command{patch} exits with status 1 if some hunks failed, or with
+2 if there was real trouble.
+
+@item
+Limit yourself to the following options when sending instructions
+meant to be executed by anyone running @acronym{GNU} @command{patch},
+traditional @command{patch}, or a @command{patch} that conforms to
+@acronym{POSIX}. Spaces are significant in the following list, and
+operands are required.
+
+@example
+@option{-c}
+@option{-d @var{dir}}
+@option{-D @var{define}}
+@option{-e}
+@option{-l}
+@option{-n}
+@option{-N}
+@option{-o @var{outfile}}
+@option{-p@var{num}}
+@option{-R}
+@option{-r @var{rejectfile}}
+@end example
+
+@end itemize
+
+@node Making Patches
+@chapter Tips for Making and Using Patches
+
+Use some common sense when making and using patches. For example,
+when sending bug fixes to a program's maintainer, send several small
+patches, one per independent subject, instead of one large,
+harder-to-digest patch that covers all the subjects.
+
+Here are some other things you should keep in mind if you are going to
+distribute patches for updating a software package.
+
+@menu
+* Tips for Patch Producers:: Advice for making patches.
+* Tips for Patch Consumers:: Advice for using patches.
+* Avoiding Common Mistakes:: Avoiding common mistakes when using @command{patch}.
+* Generating Smaller Patches:: How to generate smaller patches.
+@end menu
+
+@node Tips for Patch Producers
+@section Tips for Patch Producers
+@cindex patch producer tips
+
+To create a patch that changes an older version of a package into a
+newer version, first make a copy of the older and newer versions in
+adjacent subdirectories. It is common to do that by unpacking
+@command{tar} archives of the two versions.
+
+To generate the patch, use the command @samp{diff -Naur @var{old}
+@var{new}} where @var{old} and @var{new} identify the old and new
+directories. The names @var{old} and @var{new} should not contain any
+slashes. The @option{-N} option lets the patch create and remove
+files; @option{-a} lets the patch update non-text files; @option{-u}
+generates useful time stamps and enough context; and @option{-r} lets
+the patch update subdirectories. Here is an example command, using
+Bourne shell syntax:
+
+@example
+diff -Naur gcc-3.0.3 gcc-3.0.4
+@end example
+
+Tell your recipients how to apply the patches. This should include
+which working directory to use, and which @command{patch} options to
+use; the option @samp{-p1} is recommended. Test your procedure by
+pretending to be a recipient and applying your patches to a copy of
+the original files.
+
+@xref{Avoiding Common Mistakes}, for how to avoid common mistakes when
+generating a patch.
+
+@node Tips for Patch Consumers
+@section Tips for Patch Consumers
+@cindex patch consumer tips
+
+A patch producer should tell recipients how to apply the patches, so
+the first rule of thumb for a patch consumer is to follow the
+instructions supplied with the patch.
+
+@acronym{GNU} @command{diff} can analyze files with arbitrarily long lines
+and files that end in incomplete lines. However, older versions of
+@command{patch} cannot patch such files. If you are having trouble
+applying such patches, try upgrading to a recent version of @acronym{GNU}
+@command{patch}.
+
+@node Avoiding Common Mistakes
+@section Avoiding Common Mistakes
+@cindex common mistakes with patches
+@cindex patch, common mistakes
+
+When producing a patch for multiple files, apply @command{diff} to
+directories whose names do not have slashes. This reduces confusion
+when the patch consumer specifies the @option{-p@var{number}} option,
+since this option can have surprising results when the old and new
+file names have different numbers of slashes. For example, do not
+send a patch with a header that looks like this:
+
+@example
+diff -Naur v2.0.29/prog/README prog/README
+--- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800
++++ prog/README 2002-03-17 20:49:32.442260588 -0800
+@end example
+
+@noindent
+because the two file names have different numbers of slashes, and
+different versions of @command{patch} interpret the file names
+differently. To avoid confusion, send output that looks like this
+instead:
+
+@example
+diff -Naur v2.0.29/prog/README v2.0.30/prog/README
+--- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800
++++ v2.0.30/prog/README 2002-03-17 20:49:32.442260588 -0800
+@end example
+
+Make sure you have specified the file names correctly, either in a
+context diff header or with an @samp{Index:} line. Take care to not send out
+reversed patches, since these make people wonder whether they have
+already applied the patch.
+
+Avoid sending patches that compare backup file names like
+@file{README.orig} or @file{README~}, since this might confuse
+@command{patch} into patching a backup file instead of the real file.
+Instead, send patches that compare the same base file names in
+different directories, e.g.@: @file{old/README} and @file{new/README}.
+
+To save people from partially applying a patch before other patches that
+should have gone before it, you can make the first patch in the patch
+file update a file with a name like @file{patchlevel.h} or
+@file{version.c}, which contains a patch level or version number. If
+the input file contains the wrong version number, @command{patch} will
+complain immediately.
+
+An even clearer way to prevent this problem is to put a @samp{Prereq:}
+line before the patch. If the leading text in the patch file contains a
+line that starts with @samp{Prereq:}, @command{patch} takes the next word
+from that line (normally a version number) and checks whether the next
+input file contains that word, preceded and followed by either
+white space or a newline. If not, @command{patch} prompts you for
+confirmation before proceeding. This makes it difficult to accidentally
+apply patches in the wrong order.
+
+@node Generating Smaller Patches
+@section Generating Smaller Patches
+@cindex patches, shrinking
+
+The simplest way to generate a patch is to use @samp{diff -Naur}
+(@pxref{Tips for Patch Producers}), but you might be able to reduce
+the size of the patch by renaming or removing some files before making
+the patch. If the older version of the package contains any files
+that the newer version does not, or if any files have been renamed
+between the two versions, make a list of @command{rm} and @command{mv}
+commands for the user to execute in the old version directory before
+applying the patch. Then run those commands yourself in the scratch
+directory.
+
+If there are any files that you don't need to include in the patch
+because they can easily be rebuilt from other files (for example,
+@file{TAGS} and output from @command{yacc} and @command{makeinfo}),
+exclude them from the patch by giving @command{diff} the @option{-x
+@var{pattern}} option (@pxref{Comparing Directories}). If you want
+your patch to modify a derived file because your recipients lack tools
+to build it, make sure that the patch for the derived file follows any
+patches for files that it depends on, so that the recipients' time
+stamps will not confuse @command{make}.
+
+Now you can create the patch using @samp{diff -Naur}. Make sure to
+specify the scratch directory first and the newer directory second.
+
+Add to the top of the patch a note telling the user any @command{rm} and
+@command{mv} commands to run before applying the patch. Then you can
+remove the scratch directory.
+
+You can also shrink the patch size by using fewer lines of context,
+but bear in mind that @command{patch} typically needs at least two
+lines for proper operation when patches do not exactly match the input
+files.
+
+@node Invoking cmp
+@chapter Invoking @command{cmp}
+@cindex invoking @command{cmp}
+@cindex @command{cmp} invocation
+
+The @command{cmp} command compares two files, and if they differ,
+tells the first byte and line number where they differ or reports
+that one file is a prefix of the other. Bytes and
+lines are numbered starting with 1. The arguments of @command{cmp}
+are as follows:
+
+@example
+cmp @var{options}@dots{} @var{from-file} @r{[}@var{to-file} @r{[}@var{from-skip} @r{[}@var{to-skip}@r{]}@r{]}@r{]}
+@end example
+
+The file name @file{-} is always the standard input. @command{cmp}
+also uses the standard input if one file name is omitted. The
+@var{from-skip} and @var{to-skip} operands specify how many bytes to
+ignore at the start of each file; they are equivalent to the
+@option{--ignore-initial=@var{from-skip}:@var{to-skip}} option.
+
+By default, @command{cmp} outputs nothing if the two files have the
+same contents. If one file is a prefix of the other, @command{cmp}
+prints to standard error a message of the following form:
+
+@example
+cmp: EOF on @var{shorter-file}
+@end example
+
+Otherwise, @command{cmp} prints to standard output a message of the
+following form:
+
+@example
+@var{from-file} @var{to-file} differ: char @var{byte-number}, line @var{line-number}
+@end example
+
+The message formats can differ outside the @acronym{POSIX} locale.
+Also, @acronym{POSIX} allows the @acronym{EOF} message to be followed
+by a blank and some additional information.
+
+An exit status of 0 means no differences were found, 1 means some
+differences were found, and 2 means trouble.
+
+@menu
+* cmp Options:: Summary of options to @command{cmp}.
+@end menu
+
+@node cmp Options
+@section Options to @command{cmp}
+@cindex @command{cmp} options
+@cindex options for @command{cmp}
+
+Below is a summary of all of the options that @acronym{GNU}
+@command{cmp} accepts. Most options have two equivalent names, one of
+which is a single letter preceded by @samp{-}, and the other of which
+is a long name preceded by @samp{--}. Multiple single letter options
+(unless they take an argument) can be combined into a single command
+line word: @option{-bl} is equivalent to @option{-b -l}.
+
+@table @option
+@item -b
+@itemx --print-bytes
+Print the differing bytes. Display control bytes as a
+@samp{^} followed by a letter of the alphabet and precede bytes
+that have the high bit set with @samp{M-} (which stands for ``meta'').
+
+@item --help
+Output a summary of usage and then exit.
+
+@item -i @var{skip}
+@itemx --ignore-initial=@var{skip}
+Ignore any differences in the first @var{skip} bytes of the input
+files. Treat files with fewer than @var{skip} bytes as if they are
+empty. If @var{skip} is of the form
+@option{@var{from-skip}:@var{to-skip}}, skip the first @var{from-skip}
+bytes of the first input file and the first @var{to-skip} bytes of the
+second.
+
+@item -l
+@itemx --verbose
+Output the (decimal) byte numbers and (octal) values of all differing bytes,
+instead of the default standard output.
+Each output line contains a differing byte's number relative to the
+start of the input, followed by the differing byte values.
+Byte numbers start at 1.
+Also, output the @acronym{EOF} message if one file is shorter than the other.
+
+@item -n @var{count}
+@itemx --bytes=@var{count}
+Compare at most @var{count} input bytes.
+
+@item -s
+@itemx --quiet
+@itemx --silent
+Do not print anything; only return an exit status indicating whether
+the files differ.
+
+@item -v
+@itemx --version
+Output version information and then exit.
+@end table
+
+In the above table, operands that are byte counts are normally
+decimal, but may be preceded by @samp{0} for octal and @samp{0x} for
+hexadecimal.
+
+A byte count can be followed by a suffix to specify a multiple of that
+count; in this case an omitted integer is understood to be 1. A bare
+size letter, or one followed by @samp{iB}, specifies a multiple using
+powers of 1024. A size letter followed by @samp{B} specifies powers
+of 1000 instead. For example, @option{-n 4M} and @option{-n 4MiB} are
+equivalent to @option{-n 4194304}, whereas @option{-n 4MB} is
+equivalent to @option{-n 4000000}. This notation is upward compatible
+with the @uref{http://www.bipm.fr/enus/3_SI/si-prefixes.html, SI
+prefixes} for decimal multiples and with the
+@uref{http://physics.nist.gov/cuu/Units/binary.html, IEC 60027-2
+prefixes for binary multiples}.
+
+The following suffixes are defined. Large sizes like @code{1Y} may be
+rejected by your computer due to limitations of its arithmetic.
+
+@table @samp
+@item kB
+@cindex kilobyte, definition of
+kilobyte: @math{10^3 = 1000}.
+@item k
+@itemx K
+@itemx KiB
+@cindex kibibyte, definition of
+kibibyte: @math{2^10 = 1024}. @samp{K} is special: the SI prefix is
+@samp{k} and the IEC 60027-2 prefix is @samp{Ki}, but tradition and
+@acronym{POSIX} use @samp{k} to mean @samp{KiB}.
+@item MB
+@cindex megabyte, definition of
+megabyte: @math{10^6 = 1,000,000}.
+@item M
+@itemx MiB
+@cindex mebibyte, definition of
+mebibyte: @math{2^20 = 1,048,576}.
+@item GB
+@cindex gigabyte, definition of
+gigabyte: @math{10^9 = 1,000,000,000}.
+@item G
+@itemx GiB
+@cindex gibibyte, definition of
+gibibyte: @math{2^30 = 1,073,741,824}.
+@item TB
+@cindex terabyte, definition of
+terabyte: @math{10^12 = 1,000,000,000,000}.
+@item T
+@itemx TiB
+@cindex tebibyte, definition of
+tebibyte: @math{2^40 = 1,099,511,627,776}.
+@item PB
+@cindex petabyte, definition of
+petabyte: @math{10^15 = 1,000,000,000,000,000}.
+@item P
+@itemx PiB
+@cindex pebibyte, definition of
+pebibyte: @math{2^50 = 1,125,899,906,842,624}.
+@item EB
+@cindex exabyte, definition of
+exabyte: @math{10^18 = 1,000,000,000,000,000,000}.
+@item E
+@itemx EiB
+@cindex exbibyte, definition of
+exbibyte: @math{2^60 = 1,152,921,504,606,846,976}.
+@item ZB
+@cindex zettabyte, definition of
+zettabyte: @math{10^21 = 1,000,000,000,000,000,000,000}
+@item Z
+@itemx ZiB
+@math{2^70 = 1,180,591,620,717,411,303,424}.
+(@samp{Zi} is a GNU extension to IEC 60027-2.)
+@item YB
+@cindex yottabyte, definition of
+yottabyte: @math{10^24 = 1,000,000,000,000,000,000,000,000}.
+@item Y
+@itemx YiB
+@math{2^80 = 1,208,925,819,614,629,174,706,176}.
+(@samp{Yi} is a GNU extension to IEC 60027-2.)
+@end table
+
+@node Invoking diff
+@chapter Invoking @command{diff}
+@cindex invoking @command{diff}
+@cindex @command{diff} invocation
+
+The format for running the @command{diff} command is:
+
+@example
+diff @var{options}@dots{} @var{files}@dots{}
+@end example
+
+In the simplest case, two file names @var{from-file} and
+@var{to-file} are given, and @command{diff} compares the contents of
+@var{from-file} and @var{to-file}. A file name of @file{-} stands for
+the standard input.
+
+If one file is a directory and the other is not, @command{diff} compares
+the file in the directory whose name is that of the non-directory.
+The non-directory file must not be @file{-}.
+
+If two file names are given and both are directories,
+@command{diff} compares corresponding files in both directories, in
+alphabetical order; this comparison is not recursive unless the
+@option{--recursive} (@option{-r}) option is given. @command{diff} never
+compares the actual contents of a directory as if it were a file. The
+file that is fully specified may not be standard input, because standard
+input is nameless and the notion of ``file with the same name'' does not
+apply.
+
+If the @option{--from-file=@var{file}} option is given, the number of
+file names is arbitrary, and @var{file} is compared to each named file.
+Similarly, if the @option{--to-file=@var{file}} option is given, each
+named file is compared to @var{file}.
+
+@command{diff} options begin with @samp{-}, so normally file names
+may not begin with @samp{-}. However, @option{--} as an
+argument by itself treats the remaining arguments as file names even if
+they begin with @samp{-}.
+
+An exit status of 0 means no differences were found, 1 means some
+differences were found, and 2 means trouble.
+
+@menu
+* diff Options:: Summary of options to @command{diff}.
+@end menu
+
+@node diff Options
+@section Options to @command{diff}
+@cindex @command{diff} options
+@cindex options for @command{diff}
+
+Below is a summary of all of the options that @acronym{GNU}
+@command{diff} accepts. Most options have two equivalent names, one
+of which is a single letter preceded by @samp{-}, and the other of
+which is a long name preceded by @samp{--}. Multiple single letter
+options (unless they take an argument) can be combined into a single
+command line word: @option{-ac} is equivalent to @option{-a -c}. Long
+named options can be abbreviated to any unique prefix of their name.
+Brackets ([ and ]) indicate that an option takes an optional argument.
+
+@table @option
+@item -a
+@itemx --text
+Treat all files as text and compare them line-by-line, even if they
+do not seem to be text. @xref{Binary}.
+
+@item -b
+@itemx --ignore-space-change
+Ignore changes in amount of white space. @xref{White Space}.
+
+@item -B
+@itemx --ignore-blank-lines
+Ignore changes that just insert or delete blank lines. @xref{Blank
+Lines}.
+
+@item --binary
+Read and write data in binary mode. @xref{Binary}.
+
+@item -c
+Use the context output format, showing three lines of context.
+@xref{Context Format}.
+
+@item --color [=@var{when}]
+@cindex color, distinguishing different context
+Specify whether to use color for distinguishing different contexts,
+like header, added or removed lines. @var{when} may be omitted, or
+one of:
+@itemize @bullet
+@item none
+@vindex none @r{color option}
+Do not use color at all. This is the default when no --color option
+is specified.
+@item auto
+@vindex auto @r{color option}
+@cindex terminal, using color iff
+Use color only if standard output is a terminal.
+@item always
+@vindex always @r{color option}
+Always use color.
+@end itemize
+Specifying @option{--color} and no @var{when} is equivalent to
+@option{--color=auto}.
+
+@item -C @var{lines}
+@itemx --context@r{[}=@var{lines}@r{]}
+Use the context output format, showing @var{lines} (an integer) lines of
+context, or three if @var{lines} is not given. @xref{Context Format}.
+For proper operation, @command{patch} typically needs at least two lines of
+context.
+
+For compatibility @command{diff} also supports an obsolete option
+syntax @option{-@var{lines}} that has effect when combined with
+@option{-c}, @option{-p}, or @option{-u}. New scripts should use
+@option{-U @var{lines}} (@option{-C @var{lines}}) instead.
+
+@item --changed-group-format=@var{format}
+Use @var{format} to output a line group containing differing lines from
+both files in if-then-else format. @xref{Line Group Formats}.
+
+@item -d
+@itemx --minimal
+Change the algorithm perhaps find a smaller set of changes. This makes
+@command{diff} slower (sometimes much slower). @xref{diff Performance}.
+
+@item -D @var{name}
+@itemx --ifdef=@var{name}
+Make merged @samp{#ifdef} format output, conditional on the preprocessor
+macro @var{name}. @xref{If-then-else}.
+
+@item -e
+@itemx --ed
+Make output that is a valid @command{ed} script. @xref{ed Scripts}.
+
+@item -E
+@itemx --ignore-tab-expansion
+Ignore changes due to tab expansion.
+@xref{White Space}.
+
+@item -f
+@itemx --forward-ed
+Make output that looks vaguely like an @command{ed} script but has changes
+in the order they appear in the file. @xref{Forward ed}.
+
+@item -F @var{regexp}
+@itemx --show-function-line=@var{regexp}
+In context and unified format, for each hunk of differences, show some
+of the last preceding line that matches @var{regexp}. @xref{Specified
+Headings}.
+
+@item --from-file=@var{file}
+Compare @var{file} to each operand; @var{file} may be a directory.
+
+@item --help
+Output a summary of usage and then exit.
+
+@item --horizon-lines=@var{lines}
+Do not discard the last @var{lines} lines of the common prefix
+and the first @var{lines} lines of the common suffix.
+@xref{diff Performance}.
+
+@item -i
+@itemx --ignore-case
+Ignore changes in case; consider upper- and lower-case letters
+equivalent. @xref{Case Folding}.
+
+@item -I @var{regexp}
+@itemx --ignore-matching-lines=@var{regexp}
+Ignore changes that just insert or delete lines that match @var{regexp}.
+@xref{Specified Lines}.
+
+@item --ignore-file-name-case
+Ignore case when comparing file names. For example, recursive
+comparison of @file{d} to @file{e} might compare the contents of
+@file{d/Init} and @file{e/inIt}. At the top level, @samp{diff d inIt}
+might compare the contents of @file{d/Init} and @file{inIt}.
+@xref{Comparing Directories}.
+
+@item -l
+@itemx --paginate
+Pass the output through @command{pr} to paginate it. @xref{Pagination}.
+
+@item -L @var{label}
+@itemx --label=@var{label}
+Use @var{label} instead of the file name in the context format
+(@pxref{Context Format}) and unified format (@pxref{Unified Format})
+headers. @xref{RCS}.
+
+@item --left-column
+Print only the left column of two common lines in side by side format.
+@xref{Side by Side Format}.
+
+@item --line-format=@var{format}
+Use @var{format} to output all input lines in if-then-else format.
+@xref{Line Formats}.
+
+@item -n
+@itemx --rcs
+Output @acronym{RCS}-format diffs; like @option{-f} except that each command
+specifies the number of lines affected. @xref{RCS}.
+
+@item -N
+@itemx --new-file
+If one file is missing, treat it as present but empty.
+@xref{Comparing Directories}.
+
+@item --new-group-format=@var{format}
+Use @var{format} to output a group of lines taken from just the second
+file in if-then-else format. @xref{Line Group Formats}.
+
+@item --new-line-format=@var{format}
+Use @var{format} to output a line taken from just the second file in
+if-then-else format. @xref{Line Formats}.
+
+@item --no-dereference
+Act on symbolic links themselves instead of what they point to.
+Two symbolic links are deemed equal only when each points to
+precisely the same name.
+
+@item --old-group-format=@var{format}
+Use @var{format} to output a group of lines taken from just the first
+file in if-then-else format. @xref{Line Group Formats}.
+
+@item --old-line-format=@var{format}
+Use @var{format} to output a line taken from just the first file in
+if-then-else format. @xref{Line Formats}.
+
+@item -p
+@itemx --show-c-function
+Show which C function each change is in. @xref{C Function Headings}.
+
+@item --palette=@var{palette}
+Specify what color palette to use when colored output is enabled. It
+defaults to @samp{rs=0:hd=1:ad=32:de=31:ln=36} for red deleted lines,
+green added lines, cyan line numbers, bold header.
+
+Supported capabilities are as follows.
+
+@table @code
+@item ad=32
+@vindex ad @r{capability}
+
+SGR substring for added lines.
+The default is green foreground.
+
+@item de=31
+@vindex de @r{capability}
+
+SGR substring for deleted lines.
+The default is red foreground.
+
+@item hd=1
+@vindex hd @r{capability}
+
+SGR substring for chunk header.
+The default is bold foreground.
+
+@item ln=36
+@vindex ln @r{capability}
+
+SGR substring for line numbers.
+The default is cyan foreground.
+@end table
+
+
+@item -q
+@itemx --brief
+Report only whether the files differ, not the details of the
+differences. @xref{Brief}.
+
+@item -r
+@itemx --recursive
+When comparing directories, recursively compare any subdirectories
+found. @xref{Comparing Directories}.
+
+@item -s
+@itemx --report-identical-files
+Report when two files are the same. @xref{Comparing Directories}.
+
+@item -S @var{file}
+@itemx --starting-file=@var{file}
+When comparing directories, start with the file @var{file}. This is
+used for resuming an aborted comparison. @xref{Comparing Directories}.
+
+@item --speed-large-files
+Use heuristics to speed handling of large files that have numerous
+scattered small changes. @xref{diff Performance}.
+
+@item --strip-trailing-cr
+Strip any trailing carriage return at the end of an input line.
+@xref{Binary}.
+
+@item --suppress-common-lines
+Do not print common lines in side by side format.
+@xref{Side by Side Format}.
+
+@item -t
+@itemx --expand-tabs
+Expand tabs to spaces in the output, to preserve the alignment of tabs
+in the input files. @xref{Tabs}.
+
+@item -T
+@itemx --initial-tab
+Output a tab rather than a space before the text of a line in normal or
+context format. This causes the alignment of tabs in the line to look
+normal. @xref{Tabs}.
+
+@item --tabsize=@var{columns}
+Assume that tab stops are set every @var{columns} (default 8) print
+columns. @xref{Tabs}.
+
+@item --suppress-blank-empty
+Suppress any blanks before newlines when printing the representation
+of an empty line, when outputting normal, context, or unified format.
+@xref{Trailing Blanks}.
+
+@item --to-file=@var{file}
+Compare each operand to @var{file}; @var{file} may be a directory.
+
+@item -u
+Use the unified output format, showing three lines of context.
+@xref{Unified Format}.
+
+@item --unchanged-group-format=@var{format}
+Use @var{format} to output a group of common lines taken from both files
+in if-then-else format. @xref{Line Group Formats}.
+
+@item --unchanged-line-format=@var{format}
+Use @var{format} to output a line common to both files in if-then-else
+format. @xref{Line Formats}.
+
+@item --unidirectional-new-file
+If a first file is missing, treat it as present but empty.
+@xref{Comparing Directories}.
+
+@item -U @var{lines}
+@itemx --unified@r{[}=@var{lines}@r{]}
+Use the unified output format, showing @var{lines} (an integer) lines of
+context, or three if @var{lines} is not given. @xref{Unified Format}.
+For proper operation, @command{patch} typically needs at least two lines of
+context.
+
+On older systems, @command{diff} supports an obsolete option
+@option{-@var{lines}} that has effect when combined with @option{-u}.
+@acronym{POSIX} 1003.1-2001 (@pxref{Standards conformance}) does not allow
+this; use @option{-U @var{lines}} instead.
+
+@item -v
+@itemx --version
+Output version information and then exit.
+
+@item -w
+@itemx --ignore-all-space
+Ignore white space when comparing lines. @xref{White Space}.
+
+@item -W @var{columns}
+@itemx --width=@var{columns}
+Output at most @var{columns} (default 130) print columns per line in
+side by side format. @xref{Side by Side Format}.
+
+@item -x @var{pattern}
+@itemx --exclude=@var{pattern}
+When comparing directories, ignore files and subdirectories whose basenames
+match @var{pattern}. @xref{Comparing Directories}.
+
+@item -X @var{file}
+@itemx --exclude-from=@var{file}
+When comparing directories, ignore files and subdirectories whose basenames
+match any pattern contained in @var{file}. @xref{Comparing Directories}.
+
+@item -y
+@itemx --side-by-side
+Use the side by side output format. @xref{Side by Side Format}.
+
+@item -Z
+@itemx --ignore-trailing-space
+Ignore white space at line end. @xref{White Space}.
+@end table
+
+@node Invoking diff3
+@chapter Invoking @command{diff3}
+@cindex invoking @command{diff3}
+@cindex @command{diff3} invocation
+
+The @command{diff3} command compares three files and outputs descriptions
+of their differences. Its arguments are as follows:
+
+@example
+diff3 @var{options}@dots{} @var{mine} @var{older} @var{yours}
+@end example
+
+The files to compare are @var{mine}, @var{older}, and @var{yours}.
+At most one of these three file names may be @file{-},
+which tells @command{diff3} to read the standard input for that file.
+
+An exit status of 0 means @command{diff3} was successful, 1 means some
+conflicts were found, and 2 means trouble.
+
+@menu
+* diff3 Options:: Summary of options to @command{diff3}.
+@end menu
+
+@node diff3 Options
+@section Options to @command{diff3}
+@cindex @command{diff3} options
+@cindex options for @command{diff3}
+
+Below is a summary of all of the options that @acronym{GNU} @command{diff3}
+accepts. Multiple single letter options (unless they take an argument)
+can be combined into a single command line argument.
+
+@table @option
+@item -a
+@itemx --text
+Treat all files as text and compare them line-by-line, even if they
+do not appear to be text. @xref{Binary}.
+
+@item -A
+@itemx --show-all
+Incorporate all unmerged changes from @var{older} to @var{yours} into
+@var{mine}, surrounding conflicts with bracket lines.
+@xref{Marking Conflicts}.
+
+@item --diff-program=@var{program}
+Use the compatible comparison program @var{program} to compare files
+instead of @command{diff}.
+
+@item -e
+@itemx --ed
+Generate an @command{ed} script that incorporates all the changes from
+@var{older} to @var{yours} into @var{mine}. @xref{Which Changes}.
+
+@item -E
+@itemx --show-overlap
+Like @option{-e}, except bracket lines from overlapping changes' first
+and third files.
+@xref{Marking Conflicts}.
+With @option{-E}, an overlapping change looks like this:
+
+@example
+<<<<<<< @var{mine}
+@r{lines from @var{mine}}
+=======
+@r{lines from @var{yours}}
+>>>>>>> @var{yours}
+@end example
+
+@item --help
+Output a summary of usage and then exit.
+
+@item -i
+Generate @samp{w} and @samp{q} commands at the end of the @command{ed}
+script for System V compatibility. This option must be combined with
+one of the @option{-AeExX3} options, and may not be combined with @option{-m}.
+@xref{Saving the Changed File}.
+
+@item --label=@var{label}
+Use the label @var{label} for the brackets output by the @option{-A},
+@option{-E} and @option{-X} options. This option may be given up to three
+times, one for each input file. The default labels are the names of
+the input files. Thus @samp{diff3 --label X --label Y --label Z -m A
+B C} acts like
+@samp{diff3 -m A B C}, except that the output looks like it came from
+files named @samp{X}, @samp{Y} and @samp{Z} rather than from files
+named @samp{A}, @samp{B} and @samp{C}. @xref{Marking Conflicts}.
+
+@item -m
+@itemx --merge
+Apply the edit script to the first file and send the result to standard
+output. Unlike piping the output from @command{diff3} to @command{ed}, this
+works even for binary files and incomplete lines. @option{-A} is assumed
+if no edit script option is specified. @xref{Bypassing ed}.
+
+@item --strip-trailing-cr
+Strip any trailing carriage return at the end of an input line.
+@xref{Binary}.
+
+@item -T
+@itemx --initial-tab
+Output a tab rather than two spaces before the text of a line in normal format.
+This causes the alignment of tabs in the line to look normal. @xref{Tabs}.
+
+@item -v
+@itemx --version
+Output version information and then exit.
+
+@item -x
+@itemx --overlap-only
+Like @option{-e}, except output only the overlapping changes.
+@xref{Which Changes}.
+
+@item -X
+Like @option{-E}, except output only the overlapping changes.
+In other words, like @option{-x}, except bracket changes as in @option{-E}.
+@xref{Marking Conflicts}.
+
+@item -3
+@itemx --easy-only
+Like @option{-e}, except output only the nonoverlapping changes.
+@xref{Which Changes}.
+@end table
+
+@node Invoking patch
+@chapter Invoking @command{patch}
+@cindex invoking @command{patch}
+@cindex @command{patch} invocation
+
+Normally @command{patch} is invoked like this:
+
+@example
+patch <@var{patchfile}
+@end example
+
+The full format for invoking @command{patch} is:
+
+@example
+patch @var{options}@dots{} @r{[}@var{origfile} @r{[}@var{patchfile}@r{]}@r{]}
+@end example
+
+You can also specify where to read the patch from with the @option{-i
+@var{patchfile}} or @option{--input=@var{patchfile}} option.
+If you do not specify @var{patchfile}, or if @var{patchfile} is
+@file{-}, @command{patch} reads the patch (that is, the @command{diff} output)
+from the standard input.
+
+If you do not specify an input file on the command line, @command{patch}
+tries to intuit from the @dfn{leading text} (any text in the patch
+that comes before the @command{diff} output) which file to edit.
+@xref{Multiple Patches}.
+
+By default, @command{patch} replaces the original input file with the
+patched version, possibly after renaming the original file into a
+backup file (@pxref{Backup Names}, for a description of how
+@command{patch} names backup files). You can also specify where to
+put the output with the @option{-o @var{file}} or
+@option{--output=@var{file}} option; however, do not use this option
+if @var{file} is one of the input files.
+
+@menu
+* patch Options:: Summary table of options to @command{patch}.
+@end menu
+
+@node patch Options
+@section Options to @command{patch}
+@cindex @command{patch} options
+@cindex options for @command{patch}
+
+Here is a summary of all of the options that @acronym{GNU} @command{patch}
+accepts. @xref{patch and Tradition}, for which of these options are
+safe to use in older versions of @command{patch}.
+
+Multiple single-letter options that do not take an argument can be
+combined into a single command line argument with only one dash.
+
+@table @option
+@item -b
+@itemx --backup
+Back up the original contents of each file, even if backups would
+normally not be made. @xref{Backups}.
+
+@item -B @var{prefix}
+@itemx --prefix=@var{prefix}
+Prepend @var{prefix} to backup file names. @xref{Backup Names}.
+
+@item --backup-if-mismatch
+Back up the original contents of each file if the patch does not
+exactly match the file. This is the default behavior when not
+conforming to @acronym{POSIX}. @xref{Backups}.
+
+@item --binary
+Read and write all files in binary mode, except for standard output
+and @file{/dev/tty}. This option has no effect on
+@acronym{POSIX}-conforming systems like @acronym{GNU}/Linux. On systems where
+this option makes a difference, the patch should be generated by
+@samp{diff -a --binary}. @xref{Binary}.
+
+@item -c
+@itemx --context
+Interpret the patch file as a context diff. @xref{patch Input}.
+
+@item -d @var{directory}
+@itemx --directory=@var{directory}
+Make directory @var{directory} the current directory for interpreting
+both file names in the patch file, and file names given as arguments to
+other options. @xref{patch Directories}.
+
+@item -D @var{name}
+@itemx --ifdef=@var{name}
+Make merged if-then-else output using @var{name}. @xref{If-then-else}.
+
+@item --dry-run
+Print the results of applying the patches without actually changing
+any files. @xref{Dry Runs}.
+
+@item -e
+@itemx --ed
+Interpret the patch file as an @command{ed} script. @xref{patch Input}.
+
+@item -E
+@itemx --remove-empty-files
+Remove output files that are empty after the patches have been applied.
+@xref{Creating and Removing}.
+
+@item -f
+@itemx --force
+Assume that the user knows exactly what he or she is doing, and do not
+ask any questions. @xref{patch Messages}.
+
+@item -F @var{lines}
+@itemx --fuzz=@var{lines}
+Set the maximum fuzz factor to @var{lines}. @xref{Inexact}.
+
+@item -g @var{num}
+@itemx --get=@var{num}
+If @var{num} is positive, get input files from a revision control
+system as necessary; if zero, do not get the files; if negative, ask
+the user whether to get the files. @xref{Revision Control}.
+
+@item --help
+Output a summary of usage and then exit.
+
+@item -i @var{patchfile}
+@itemx --input=@var{patchfile}
+Read the patch from @var{patchfile} rather than from standard input.
+@xref{patch Options}.
+
+@item -l
+@itemx --ignore-white-space
+Let any sequence of blanks (spaces or tabs) in the patch file match
+any sequence of blanks in the input file. @xref{Changed White Space}.
+
+@item -n
+@itemx --normal
+Interpret the patch file as a normal diff. @xref{patch Input}.
+
+@item -N
+@itemx --forward
+Ignore patches that @command{patch} thinks are reversed or already applied.
+See also @option{-R}. @xref{Reversed Patches}.
+
+@item --no-backup-if-mismatch
+Do not back up the original contents of files. This is the default
+behavior when conforming to @acronym{POSIX}. @xref{Backups}.
+
+@item -o @var{file}
+@itemx --output=@var{file}
+Use @var{file} as the output file name. @xref{patch Options}.
+
+@item -p@var{number}
+@itemx --strip=@var{number}
+Set the file name strip count to @var{number}. @xref{patch Directories}.
+
+@item --posix
+Conform to @acronym{POSIX}, as if the @env{POSIXLY_CORRECT} environment
+variable had been set. @xref{patch and POSIX}.
+
+@item --quoting-style=@var{word}
+Use style @var{word} to quote names in diagnostics, as if the
+@env{QUOTING_STYLE} environment variable had been set to @var{word}.
+@xref{patch Quoting Style}.
+
+@item -r @var{reject-file}
+@itemx --reject-file=@var{reject-file}
+Use @var{reject-file} as the reject file name. @xref{Reject Names}.
+
+@item -R
+@itemx --reverse
+Assume that this patch was created with the old and new files swapped.
+@xref{Reversed Patches}.
+
+@item -s
+@itemx --quiet
+@itemx --silent
+Work silently unless an error occurs. @xref{patch Messages}.
+
+@item -t
+@itemx --batch
+Do not ask any questions. @xref{patch Messages}.
+
+@item -T
+@itemx --set-time
+Set the modification and access times of patched files from time
+stamps given in context diff headers, assuming that the context diff
+headers use local time. @xref{Patching Time Stamps}.
+
+@item -u
+@itemx --unified
+Interpret the patch file as a unified diff. @xref{patch Input}.
+
+@item -v
+@itemx --version
+Output version information and then exit.
+
+@item -V @var{backup-style}
+@itemx --version=control=@var{backup-style}
+Select the naming convention for backup file names. @xref{Backup Names}.
+
+@item --verbose
+Print more diagnostics than usual. @xref{patch Messages}.
+
+@item -x @var{number}
+@itemx --debug=@var{number}
+Set internal debugging flags. Of interest only to @command{patch}
+patchers.
+
+@item -Y @var{prefix}
+@itemx --basename-prefix=@var{prefix}
+Prepend @var{prefix} to base names of backup files. @xref{Backup Names}.
+
+@item -z @var{suffix}
+@itemx --suffix=@var{suffix}
+Use @var{suffix} as the backup extension instead of @samp{.orig} or
+@samp{~}. @xref{Backup Names}.
+
+@item -Z
+@itemx --set-utc
+Set the modification and access times of patched files from time
+stamps given in context diff headers, assuming that the context diff
+headers use @acronym{UTC}. @xref{Patching Time Stamps}.
+
+@end table
+
+@node Invoking sdiff
+@chapter Invoking @command{sdiff}
+@cindex invoking @command{sdiff}
+@cindex @command{sdiff} invocation
+
+The @command{sdiff} command merges two files and interactively outputs the
+results. Its arguments are as follows:
+
+@example
+sdiff -o @var{outfile} @var{options}@dots{} @var{from-file} @var{to-file}
+@end example
+
+This merges @var{from-file} with @var{to-file}, with output to @var{outfile}.
+If @var{from-file} is a directory and @var{to-file} is not, @command{sdiff}
+compares the file in @var{from-file} whose file name is that of @var{to-file},
+and vice versa. @var{from-file} and @var{to-file} may not both be
+directories.
+
+@command{sdiff} options begin with @samp{-}, so normally @var{from-file}
+and @var{to-file} may not begin with @samp{-}. However, @option{--} as an
+argument by itself treats the remaining arguments as file names even if
+they begin with @samp{-}. You may not use @file{-} as an input file.
+
+@command{sdiff} without @option{--output} (@option{-o}) produces a
+side-by-side difference. This usage is obsolete; use the
+@option{--side-by-side} (@option{-y}) option of @command{diff} instead.
+
+An exit status of 0 means no differences were found, 1 means some
+differences were found, and 2 means trouble.
+
+@menu
+* sdiff Options:: Summary of options to @command{diff}.
+@end menu
+
+@node sdiff Options
+@section Options to @command{sdiff}
+@cindex @command{sdiff} options
+@cindex options for @command{sdiff}
+
+Below is a summary of all of the options that @acronym{GNU}
+@command{sdiff} accepts. Each option has two equivalent names, one of
+which is a single letter preceded by @samp{-}, and the other of which
+is a long name preceded by @samp{--}. Multiple single letter options
+(unless they take an argument) can be combined into a single command
+line argument. Long named options can be abbreviated to any unique
+prefix of their name.
+
+@table @option
+@item -a
+@itemx --text
+Treat all files as text and compare them line-by-line, even if they
+do not appear to be text. @xref{Binary}.
+
+@item -b
+@itemx --ignore-space-change
+Ignore changes in amount of white space. @xref{White Space}.
+
+@item -B
+@itemx --ignore-blank-lines
+Ignore changes that just insert or delete blank lines. @xref{Blank
+Lines}.
+
+@item -d
+@itemx --minimal
+Change the algorithm to perhaps find a smaller set of changes. This
+makes @command{sdiff} slower (sometimes much slower). @xref{diff
+Performance}.
+
+@item --diff-program=@var{program}
+Use the compatible comparison program @var{program} to compare files
+instead of @command{diff}.
+
+@item -E
+@itemx --ignore-tab-expansion
+Ignore changes due to tab expansion.
+@xref{White Space}.
+
+@item --help
+Output a summary of usage and then exit.
+
+@item -i
+@itemx --ignore-case
+Ignore changes in case; consider upper- and lower-case to be the same.
+@xref{Case Folding}.
+
+@item -I @var{regexp}
+@itemx --ignore-matching-lines=@var{regexp}
+Ignore changes that just insert or delete lines that match @var{regexp}.
+@xref{Specified Lines}.
+
+@item -l
+@itemx --left-column
+Print only the left column of two common lines.
+@xref{Side by Side Format}.
+
+@item -o @var{file}
+@itemx --output=@var{file}
+Put merged output into @var{file}. This option is required for merging.
+
+@item -s
+@itemx --suppress-common-lines
+Do not print common lines. @xref{Side by Side Format}.
+
+@item --speed-large-files
+Use heuristics to speed handling of large files that have numerous
+scattered small changes. @xref{diff Performance}.
+
+@item --strip-trailing-cr
+Strip any trailing carriage return at the end of an input line.
+@xref{Binary}.
+
+@item -t
+@itemx --expand-tabs
+Expand tabs to spaces in the output, to preserve the alignment of tabs
+in the input files. @xref{Tabs}.
+
+@item --tabsize=@var{columns}
+Assume that tab stops are set every @var{columns} (default 8) print
+columns. @xref{Tabs}.
+
+@item -v
+@itemx --version
+Output version information and then exit.
+
+@item -w @var{columns}
+@itemx --width=@var{columns}
+Output at most @var{columns} (default 130) print columns per line.
+@xref{Side by Side Format}. Note that for historical reasons, this
+option is @option{-W} in @command{diff}, @option{-w} in @command{sdiff}.
+
+@item -W
+@itemx --ignore-all-space
+Ignore white space when comparing lines. @xref{White Space}.
+Note that for historical reasons, this option is @option{-w} in @command{diff},
+@option{-W} in @command{sdiff}.
+
+@item -Z
+@itemx --ignore-trailing-space
+Ignore white space at line end. @xref{White Space}.
+@end table
+
+@node Standards conformance
+@chapter Standards conformance
+@cindex @acronym{POSIX}
+
+@vindex POSIXLY_CORRECT
+In a few cases, the @acronym{GNU} utilities' default behavior is
+incompatible with the @acronym{POSIX} standard. To suppress these
+incompatibilities, define the @env{POSIXLY_CORRECT} environment
+variable. Unless you are checking for @acronym{POSIX} conformance, you
+probably do not need to define @env{POSIXLY_CORRECT}.
+
+Normally options and operands can appear in any order, and programs act
+as if all the options appear before any operands. For example,
+@samp{diff lao tzu -C 2} acts like @samp{diff -C 2 lao tzu}, since
+@samp{2} is an option-argument of @option{-C}. However, if the
+@env{POSIXLY_CORRECT} environment variable is set, options must appear
+before operands, unless otherwise specified for a particular command.
+
+Newer versions of @acronym{POSIX} are occasionally incompatible with older
+versions. For example, older versions of @acronym{POSIX} allowed the
+command @samp{diff -c -10} to have the same meaning as @samp{diff -C
+10}, but @acronym{POSIX} 1003.1-2001 @samp{diff} no longer allows
+digit-string options like @option{-10}.
+
+@vindex _POSIX2_VERSION
+The @acronym{GNU} utilities normally conform to the version of @acronym{POSIX}
+that is standard for your system. To cause them to conform to a
+different version of @acronym{POSIX}, define the @env{_POSIX2_VERSION}
+environment variable to a value of the form @var{yyyymm} specifying
+the year and month the standard was adopted. Two values are currently
+supported for @env{_POSIX2_VERSION}: @samp{199209} stands for
+@acronym{POSIX} 1003.2-1992, and @samp{200112} stands for @acronym{POSIX}
+1003.1-2001. For example, if you are running older software that
+assumes an older version of @acronym{POSIX} and uses @samp{diff -c -10},
+you can work around the compatibility problems by setting
+@samp{_POSIX2_VERSION=199209} in your environment.
+
+@node Projects
+@chapter Future Projects
+
+Here are some ideas for improving @acronym{GNU} @command{diff} and
+@command{patch}. The @acronym{GNU} project has identified some
+improvements as potential programming projects for volunteers. You
+can also help by reporting any bugs that you find.
+
+If you are a programmer and would like to contribute something to the
+@acronym{GNU} project, please consider volunteering for one of these
+projects. If you are seriously contemplating work, please write to
+@email{gvc@@gnu.org} to coordinate with other volunteers.
+
+@menu
+* Shortcomings:: Suggested projects for improvements.
+* Bugs:: Reporting bugs.
+@end menu
+
+@node Shortcomings
+@section Suggested Projects for Improving @acronym{GNU} @command{diff} and @command{patch}
+@cindex projects for directories
+
+One should be able to use @acronym{GNU} @command{diff} to generate a
+patch from any pair of directory trees, and given the patch and a copy
+of one such tree, use @command{patch} to generate a faithful copy of
+the other. Unfortunately, some changes to directory trees cannot be
+expressed using current patch formats; also, @command{patch} does not
+handle some of the existing formats. These shortcomings motivate the
+following suggested projects.
+
+@menu
+* Internationalization:: Handling multibyte and varying-width characters.
+* Changing Structure:: Handling changes to the directory structure.
+* Special Files:: Handling symbolic links, device special files, etc.
+* Unusual File Names:: Handling file names that contain unusual characters.
+* Time Stamp Order:: Outputting diffs in time stamp order.
+* Ignoring Changes:: Ignoring certain changes while showing others.
+* Speedups:: Improving performance.
+@end menu
+
+@node Internationalization
+@subsection Handling Multibyte and Varying-Width Characters
+@cindex multibyte characters
+@cindex varying-width characters
+
+@command{diff}, @command{diff3} and @command{sdiff} treat each line of
+input as a string of unibyte characters. This can mishandle multibyte
+characters in some cases. For example, when asked to ignore spaces,
+@command{diff} does not properly ignore a multibyte space character.
+
+Also, @command{diff} currently assumes that each byte is one column
+wide, and this assumption is incorrect in some locales, e.g., locales
+that use UTF-8 encoding. This causes problems with the @option{-y} or
+@option{--side-by-side} option of @command{diff}.
+
+These problems need to be fixed without unduly affecting the
+performance of the utilities in unibyte environments.
+
+The IBM GNU/Linux Technology Center Internationalization Team has
+proposed
+@uref{http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.patch.gz,patches
+to support internationalized @command{diff}}.
+Unfortunately, these patches are incomplete and are to an older
+version of @command{diff}, so more work needs to be done in this area.
+
+@node Changing Structure
+@subsection Handling Changes to the Directory Structure
+@cindex directory structure changes
+
+@command{diff} and @command{patch} do not handle some changes to directory
+structure. For example, suppose one directory tree contains a directory
+named @samp{D} with some subsidiary files, and another contains a file
+with the same name @samp{D}. @samp{diff -r} does not output enough
+information for @command{patch} to transform the directory subtree into
+the file.
+
+There should be a way to specify that a file has been removed without
+having to include its entire contents in the patch file. There should
+also be a way to tell @command{patch} that a file was renamed, even if
+there is no way for @command{diff} to generate such information.
+There should be a way to tell @command{patch} that a file's time stamp
+has changed, even if its contents have not changed.
+
+These problems can be fixed by extending the @command{diff} output format
+to represent changes in directory structure, and extending @command{patch}
+to understand these extensions.
+
+@node Special Files
+@subsection Files that are Neither Directories Nor Regular Files
+@cindex special files
+
+Some files are neither directories nor regular files: they are unusual
+files like symbolic links, device special files, named pipes, and
+sockets. Currently, @command{diff} treats symbolic links as if they
+were the pointed-to files, except that a recursive @command{diff}
+reports an error if it detects infinite loops of symbolic links (e.g.,
+symbolic links to @file{..}). @command{diff} treats other special
+files like regular files if they are specified at the top level, but
+simply reports their presence when comparing directories. This means
+that @command{patch} cannot represent changes to such files. For
+example, if you change which file a symbolic link points to,
+@command{diff} outputs the difference between the two files, instead
+of the change to the symbolic link.
+
+@c This might not be a good idea; is it wise for root to install devices
+@c this way?
+@command{diff} should optionally report changes to special files specially,
+and @command{patch} should be extended to understand these extensions.
+
+@node Unusual File Names
+@subsection File Names that Contain Unusual Characters
+@cindex file names with unusual characters
+
+When a file name contains an unusual character like a newline or
+white space, @samp{diff -r} generates a patch that @command{patch} cannot
+parse. The problem is with format of @command{diff} output, not just with
+@command{patch}, because with odd enough file names one can cause
+@command{diff} to generate a patch that is syntactically correct but
+patches the wrong files. The format of @command{diff} output should be
+extended to handle all possible file names.
+
+@node Time Stamp Order
+@subsection Outputting Diffs in Time Stamp Order
+
+Applying @command{patch} to a multiple-file diff can result in files
+whose time stamps are out of order. @acronym{GNU} @command{patch} has
+options to restore the time stamps of the updated files
+(@pxref{Patching Time Stamps}), but sometimes it is useful to generate
+a patch that works even if the recipient does not have @acronym{GNU} patch,
+or does not use these options. One way to do this would be to
+implement a @command{diff} option to output diffs in time stamp order.
+
+@node Ignoring Changes
+@subsection Ignoring Certain Changes
+
+It would be nice to have a feature for specifying two strings, one in
+@var{from-file} and one in @var{to-file}, which should be considered to
+match. Thus, if the two strings are @samp{foo} and @samp{bar}, then if
+two lines differ only in that @samp{foo} in file 1 corresponds to
+@samp{bar} in file 2, the lines are treated as identical.
+
+It is not clear how general this feature can or should be, or
+what syntax should be used for it.
+
+A partial substitute is to filter one or both files before comparing,
+e.g.:
+
+@example
+sed 's/foo/bar/g' file1 | diff - file2
+@end example
+
+However, this outputs the filtered text, not the original.
+
+@node Speedups
+@subsection Improving Performance
+
+When comparing two large directory structures, one of which was
+originally copied from the other with time stamps preserved (e.g.,
+with @samp{cp -pR}), it would greatly improve performance if an option
+told @command{diff} to assume that two files with the same size and
+time stamps have the same content. @xref{diff Performance}.
+
+@node Bugs
+@section Reporting Bugs
+@cindex bug reports
+@cindex reporting bugs
+
+If you think you have found a bug in @acronym{GNU} @command{cmp},
+@command{diff}, @command{diff3}, or @command{sdiff}, please report it
+by electronic mail to the
+@uref{http://mail.gnu.org/mailman/listinfo/bug-diffutils,GNU utilities
+bug report mailing list} @email{bug-diffutils@@gnu.org}. Please send
+bug reports for @acronym{GNU} @command{patch} to
+@email{bug-patch@@gnu.org}. Send as precise a description of the
+problem as you can, including the output of the @option{--version}
+option and sample input files that produce the bug, if applicable. If
+you have a nontrivial fix for the bug, please send it as well. If you
+have a patch, please send it too. It may simplify the maintainer's
+job if the patch is relative to a recent test release, which you can
+find in the directory @uref{ftp://alpha.gnu.org/gnu/diffutils/}.
+
+@node Copying This Manual
+@appendix Copying This Manual
+@include fdl.texi
+
+@node Translations
+@appendix Translations of This Manual
+
+Nishio Futoshi of the GNUjdoc project has prepared a Japanese
+translation of this manual. Its most recent version can be found at
+@uref{http://openlab.ring.gr.jp/gnujdoc/cvsweb/cvsweb.cgi/gnujdoc/}.
+
+@node Index
+@appendix Index
+
+@printindex cp
+
+@bye
diff --git a/doc/fdl.texi b/doc/fdl.texi
new file mode 100644
index 0000000..9c3bbe5
--- /dev/null
+++ b/doc/fdl.texi
@@ -0,0 +1,505 @@
+@c The GNU Free Documentation License.
+@center Version 1.3, 3 November 2008
+
+@c This file is intended to be included within another document,
+@c hence no sectioning command or @node.
+
+@display
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+@uref{http://fsf.org/}
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, La@TeX{} input
+format, SGML or XML using a publicly available
+DTD, and standard-conforming simple HTML,
+PostScript or PDF designed for human modification. Examples
+of transparent image formats include PNG, XCF and
+JPG@. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, SGML or
+XML for which the DTD and/or processing tools are
+not generally available, and the machine-generated HTML,
+PostScript or PDF produced by some word processors for
+output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The ``publisher'' means any person or entity that distributes copies
+of the Document to the public.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section Entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section Entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
+@item
+Preserve any Warranty Disclaimers.
+@end enumerate
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all
+sections Entitled ``Endorsements.''
+
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+@uref{http://www.gnu.org/copyleft/}.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+@item
+RELICENSING
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+@end enumerate
+
+@page
+@heading ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+ Copyright (C) @var{year} @var{your name}.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+@end group
+@end smallexample
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with@dots{}Texts.''@: line with this:
+
+@smallexample
+@group
+ with the Invariant Sections being @var{list their titles}, with
+ the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+ being @var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
diff --git a/doc/stamp-vti b/doc/stamp-vti
new file mode 100644
index 0000000..4f2a926
--- /dev/null
+++ b/doc/stamp-vti
@@ -0,0 +1,4 @@
+@set UPDATED 4 August 2016
+@set UPDATED-MONTH August 2016
+@set EDITION 3.5
+@set VERSION 3.5
diff --git a/doc/version.texi b/doc/version.texi
new file mode 100644
index 0000000..4f2a926
--- /dev/null
+++ b/doc/version.texi
@@ -0,0 +1,4 @@
+@set UPDATED 4 August 2016
+@set UPDATED-MONTH August 2016
+@set EDITION 3.5
+@set VERSION 3.5
diff --git a/exgettext b/exgettext
new file mode 100755
index 0000000..39a9b86
--- /dev/null
+++ b/exgettext
@@ -0,0 +1,114 @@
+#! /bin/sh
+# Wrapper around gettext for programs using the msgid convention.
+
+# Copyright (C) 1998, 2001, 2004, 2009-2013, 2015-2016 Free Software
+# Foundation, Inc.
+
+# Written by Paul Eggert <eggert@twinsun.com>.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Always operate in the C locale.
+LANG=C
+LANGUAGE=C
+LC_ALL=C
+export LANG LANGUAGE LC_ALL
+
+# Set AWK if environment has not already set it.
+AWK=${AWK-awk}
+
+# The argument to this wrapper is the xgettext command to be executed.
+# Extract the xgettext program name from the rest of the command.
+xgettext=${1?}
+shift
+
+# Save work if we're just wrapping a no-op.
+case $xgettext in
+:) exit;;
+esac
+
+# Find the files to be scanned, and the directory to scan them from.
+directory=.
+files=
+for i
+do
+ case $i in
+ --directory=*)
+ directory=`expr " $i" : ' --directory=\(.*\)'`;;
+ --files-from=*)
+ files_from=`expr " $i" : ' --files-from=\(.*\)'`
+ files=`$AWK '/^[^#]/ { print }' $files_from`;;
+ esac
+done
+
+# Generate keyword options for xgettext,
+# by scanning for declarations of functions
+# whose parameter names end in "msgid".
+generate_keyword_options='
+ /^[A-Z_a-z].*\(.*msgid[,)]/ {
+
+ paren_index = index($0, "(")
+
+ name = substr($0, 1, paren_index - 1)
+ sub(/[^0-9A-Z_a-z]*$/, "", name)
+ sub(/[ ]+PARAMS/, "", name)
+ sub(/[ ]+VPARAMS/, "", name)
+ sub(/.*[^0-9A-Z_a-z]/, "", name)
+
+ args = substr($0, paren_index)
+ sub(/msgid[,)].*/, "", args)
+ for (n = 1; sub(/^[^,]*,/, "", args); n++) {
+ continue;
+ }
+
+ if (n == 1) {
+ keyword = name
+ } else {
+ keyword = name ":" n
+ }
+
+ if (! keyword_seen[keyword]++) {
+ print "--keyword=" keyword
+ }
+ }
+'
+keyword_options=`(
+ cd $directory &&
+ $AWK "$generate_keyword_options" $files < /dev/null
+)` || exit
+
+# Run the xgettext command, with extra input containing the extra
+# msgids that it wouldn't normally find.
+generate_emsgids='
+ /%e.*}/ {
+ line = $0
+ while ((percent_index = index(line, "%e")) != 0) {
+ line = substr(line, percent_index + 2)
+ bracket_index = index(line, "}")
+ if (bracket_index == 0) {
+ continue
+ }
+ msgid = substr(line, 1, bracket_index - 1)
+ if (index(msgid, "%") != 0) {
+ continue
+ }
+ printf "#line %d \"%s\"\n", FNR, FILENAME
+ printf "_(\"%s\")\n", msgid
+ line = substr(line, bracket_index + 1)
+ }
+ }
+'
+(cd $directory &&
+ $AWK "$generate_emsgids" $files < /dev/null
+) | "$xgettext" $keyword_options ${1+"$@"} -
diff --git a/gnulib-tests/Makefile.am b/gnulib-tests/Makefile.am
new file mode 100644
index 0000000..6635f70
--- /dev/null
+++ b/gnulib-tests/Makefile.am
@@ -0,0 +1 @@
+include gnulib.mk
diff --git a/gnulib-tests/Makefile.in b/gnulib-tests/Makefile.in
new file mode 100644
index 0000000..d986484
--- /dev/null
+++ b/gnulib-tests/Makefile.in
@@ -0,0 +1,5645 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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-2016 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 <http://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.
+
+
+
+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@
+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@
+TESTS = test-accept$(EXEEXT) test-alloca-opt$(EXEEXT) \
+ test-areadlink$(EXEEXT) test-argmatch$(EXEEXT) \
+ test-arpa_inet$(EXEEXT) test-binary-io.sh test-bind$(EXEEXT) \
+ test-bitrotate$(EXEEXT) test-btowc1.sh test-btowc2.sh \
+ test-c-ctype$(EXEEXT) test-c-stack.sh test-c-stack2.sh \
+ test-c-strcase.sh test-close$(EXEEXT) test-connect$(EXEEXT) \
+ test-ctype$(EXEEXT) test-dirname$(EXEEXT) test-dup2$(EXEEXT) \
+ test-environ$(EXEEXT) test-errno$(EXEEXT) test-exclude1.sh \
+ test-exclude2.sh test-exclude3.sh test-exclude4.sh \
+ test-exclude5.sh test-exclude6.sh test-exclude7.sh \
+ test-exclude8.sh test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) \
+ test-fdopen$(EXEEXT) test-fgetc$(EXEEXT) \
+ test-filenamecat$(EXEEXT) test-float$(EXEEXT) \
+ test-fnmatch$(EXEEXT) test-fputc$(EXEEXT) test-fread$(EXEEXT) \
+ test-freopen-safer$(EXEEXT) test-freopen$(EXEEXT) \
+ test-fstat$(EXEEXT) test-ftruncate.sh test-fwrite$(EXEEXT) \
+ test-getcwd-lgpl$(EXEEXT) test-getdtablesize$(EXEEXT) \
+ test-getopt$(EXEEXT) test-gettimeofday$(EXEEXT) \
+ test-hash$(EXEEXT) test-iconv-h$(EXEEXT) test-iconv$(EXEEXT) \
+ test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \
+ test-intprops$(EXEEXT) test-inttostr$(EXEEXT) \
+ test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \
+ test-isblank$(EXEEXT) test-iswblank$(EXEEXT) \
+ test-langinfo$(EXEEXT) test-listen$(EXEEXT) \
+ test-locale$(EXEEXT) test-localeconv$(EXEEXT) \
+ test-lstat$(EXEEXT) test-malloca$(EXEEXT) test-mbrtowc1.sh \
+ test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \
+ test-mbrtowc5.sh test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \
+ test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \
+ test-mbrtowc-w32-5.sh test-mbscasecmp.sh test-mbsinit.sh \
+ test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh \
+ test-mbsrtowcs4.sh test-mbsstr1$(EXEEXT) test-mbsstr2.sh \
+ test-mbsstr3.sh test-memchr$(EXEEXT) test-nanosleep$(EXEEXT) \
+ test-netinet_in$(EXEEXT) test-nl_langinfo.sh \
+ test-open$(EXEEXT) test-pathmax$(EXEEXT) test-perror.sh \
+ test-perror2$(EXEEXT) test-pipe$(EXEEXT) \
+ test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \
+ test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \
+ test-regex$(EXEEXT) test-select$(EXEEXT) test-select-in.sh \
+ test-select-out.sh test-setenv$(EXEEXT) test-setlocale1.sh \
+ test-setlocale2.sh test-setsockopt$(EXEEXT) \
+ test-sh-quote$(EXEEXT) test-sigaction$(EXEEXT) \
+ test-signal-h$(EXEEXT) test-sigprocmask$(EXEEXT) \
+ test-sleep$(EXEEXT) test-snprintf$(EXEEXT) \
+ test-sockets$(EXEEXT) test-stat$(EXEEXT) \
+ test-stat-time$(EXEEXT) test-stdalign$(EXEEXT) \
+ test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \
+ test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \
+ test-strerror$(EXEEXT) test-strerror_r$(EXEEXT) \
+ test-strftime$(EXEEXT) test-striconv$(EXEEXT) \
+ test-string$(EXEEXT) test-strings$(EXEEXT) \
+ test-strnlen$(EXEEXT) test-strtoull$(EXEEXT) \
+ test-strtoumax$(EXEEXT) test-symlink$(EXEEXT) \
+ test-sys_ioctl$(EXEEXT) test-sys_select$(EXEEXT) \
+ test-sys_socket$(EXEEXT) test-sys_stat$(EXEEXT) \
+ test-sys_time$(EXEEXT) test-sys_types$(EXEEXT) \
+ test-sys_uio$(EXEEXT) test-sys_wait$(EXEEXT) test-init.sh \
+ test-time$(EXEEXT) test-timespec$(EXEEXT) test-unistd$(EXEEXT) \
+ test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \
+ test-uc_width$(EXEEXT) uniwidth/test-uc_width2.sh \
+ test-unsetenv$(EXEEXT) test-update-copyright.sh \
+ test-vasnprintf$(EXEEXT) test-vasprintf$(EXEEXT) \
+ test-vc-list-files-git.sh test-vc-list-files-cvs.sh \
+ test-verify$(EXEEXT) test-verify.sh test-version-etc.sh \
+ test-wchar$(EXEEXT) test-wcrtomb.sh test-wcrtomb-w32-1.sh \
+ test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \
+ test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh \
+ test-wctype-h$(EXEEXT) test-wcwidth$(EXEEXT) \
+ test-xalloc-die.sh test-xstrtol.sh test-xstrtoumax.sh \
+ test-xvasprintf$(EXEEXT)
+XFAIL_TESTS =
+noinst_PROGRAMS =
+check_PROGRAMS = test-accept$(EXEEXT) test-alloca-opt$(EXEEXT) \
+ test-areadlink$(EXEEXT) test-argmatch$(EXEEXT) \
+ test-arpa_inet$(EXEEXT) test-binary-io$(EXEEXT) \
+ test-bind$(EXEEXT) test-bitrotate$(EXEEXT) test-btowc$(EXEEXT) \
+ test-c-ctype$(EXEEXT) test-c-stack$(EXEEXT) \
+ test-c-strcasecmp$(EXEEXT) test-c-strncasecmp$(EXEEXT) \
+ test-close$(EXEEXT) test-connect$(EXEEXT) test-ctype$(EXEEXT) \
+ test-dirname$(EXEEXT) test-dup2$(EXEEXT) test-environ$(EXEEXT) \
+ test-errno$(EXEEXT) test-exclude$(EXEEXT) \
+ test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) test-fdopen$(EXEEXT) \
+ test-fgetc$(EXEEXT) test-filenamecat$(EXEEXT) \
+ test-float$(EXEEXT) test-fnmatch$(EXEEXT) test-fputc$(EXEEXT) \
+ test-fread$(EXEEXT) test-freopen-safer$(EXEEXT) \
+ test-freopen$(EXEEXT) test-fstat$(EXEEXT) \
+ test-ftruncate$(EXEEXT) test-fwrite$(EXEEXT) \
+ test-getcwd-lgpl$(EXEEXT) test-getdtablesize$(EXEEXT) \
+ test-getopt$(EXEEXT) test-gettimeofday$(EXEEXT) \
+ test-hash$(EXEEXT) test-iconv-h$(EXEEXT) test-iconv$(EXEEXT) \
+ test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \
+ test-intprops$(EXEEXT) test-inttostr$(EXEEXT) \
+ test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \
+ test-isblank$(EXEEXT) test-iswblank$(EXEEXT) \
+ test-langinfo$(EXEEXT) test-listen$(EXEEXT) \
+ test-locale$(EXEEXT) test-localeconv$(EXEEXT) \
+ test-lstat$(EXEEXT) test-malloca$(EXEEXT) \
+ test-mbrtowc$(EXEEXT) test-mbrtowc-w32$(EXEEXT) \
+ test-mbscasecmp$(EXEEXT) test-mbsinit$(EXEEXT) \
+ test-mbsrtowcs$(EXEEXT) test-mbsstr1$(EXEEXT) \
+ test-mbsstr2$(EXEEXT) test-mbsstr3$(EXEEXT) \
+ test-memchr$(EXEEXT) test-nanosleep$(EXEEXT) \
+ test-netinet_in$(EXEEXT) test-nl_langinfo$(EXEEXT) \
+ test-open$(EXEEXT) test-pathmax$(EXEEXT) test-perror$(EXEEXT) \
+ test-perror2$(EXEEXT) test-pipe$(EXEEXT) \
+ test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \
+ test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \
+ test-regex$(EXEEXT) test-select$(EXEEXT) \
+ test-select-fd$(EXEEXT) test-select-stdin$(EXEEXT) \
+ test-setenv$(EXEEXT) test-setlocale1$(EXEEXT) \
+ test-setlocale2$(EXEEXT) test-setsockopt$(EXEEXT) \
+ test-sh-quote$(EXEEXT) test-sigaction$(EXEEXT) \
+ test-signal-h$(EXEEXT) test-sigprocmask$(EXEEXT) \
+ test-sleep$(EXEEXT) test-snprintf$(EXEEXT) \
+ test-sockets$(EXEEXT) test-stat$(EXEEXT) \
+ test-stat-time$(EXEEXT) test-stdalign$(EXEEXT) \
+ test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \
+ test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \
+ test-strerror$(EXEEXT) test-strerror_r$(EXEEXT) \
+ test-strftime$(EXEEXT) test-striconv$(EXEEXT) \
+ test-string$(EXEEXT) test-strings$(EXEEXT) \
+ test-strnlen$(EXEEXT) test-strtoull$(EXEEXT) \
+ test-strtoumax$(EXEEXT) test-symlink$(EXEEXT) \
+ test-sys_ioctl$(EXEEXT) test-sys_select$(EXEEXT) \
+ test-sys_socket$(EXEEXT) test-sys_stat$(EXEEXT) \
+ test-sys_time$(EXEEXT) test-sys_types$(EXEEXT) \
+ test-sys_uio$(EXEEXT) test-sys_wait$(EXEEXT) \
+ test-time$(EXEEXT) test-timespec$(EXEEXT) test-unistd$(EXEEXT) \
+ test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \
+ test-uc_width$(EXEEXT) test-uc_width2$(EXEEXT) \
+ test-unsetenv$(EXEEXT) test-vasnprintf$(EXEEXT) \
+ test-vasprintf$(EXEEXT) test-verify$(EXEEXT) \
+ test-version-etc$(EXEEXT) test-wchar$(EXEEXT) \
+ test-wcrtomb$(EXEEXT) test-wcrtomb-w32$(EXEEXT) \
+ test-wctype-h$(EXEEXT) test-wcwidth$(EXEEXT) \
+ test-xalloc-die$(EXEEXT) test-xstrtol$(EXEEXT) \
+ test-xstrtoul$(EXEEXT) test-xstrtoumax$(EXEEXT) \
+ test-xvasprintf$(EXEEXT)
+subdir = gnulib-tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.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)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libtests_a_AR = $(AR) $(ARFLAGS)
+am__DEPENDENCIES_1 =
+am_libtests_a_OBJECTS = dtotimespec.$(OBJEXT) hash-pjw.$(OBJEXT) \
+ sockets.$(OBJEXT) sys_socket.$(OBJEXT) timespec-add.$(OBJEXT) \
+ timespec-sub.$(OBJEXT)
+libtests_a_OBJECTS = $(am_libtests_a_OBJECTS)
+PROGRAMS = $(noinst_PROGRAMS)
+test_accept_SOURCES = test-accept.c
+test_accept_OBJECTS = test-accept.$(OBJEXT)
+am__DEPENDENCIES_2 = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_accept_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_alloca_opt_SOURCES = test-alloca-opt.c
+test_alloca_opt_OBJECTS = test-alloca-opt.$(OBJEXT)
+test_alloca_opt_LDADD = $(LDADD)
+test_alloca_opt_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_areadlink_SOURCES = test-areadlink.c
+test_areadlink_OBJECTS = test-areadlink.$(OBJEXT)
+test_areadlink_LDADD = $(LDADD)
+test_areadlink_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_argmatch_SOURCES = test-argmatch.c
+test_argmatch_OBJECTS = test-argmatch.$(OBJEXT)
+test_argmatch_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_arpa_inet_SOURCES = test-arpa_inet.c
+test_arpa_inet_OBJECTS = test-arpa_inet.$(OBJEXT)
+test_arpa_inet_LDADD = $(LDADD)
+test_arpa_inet_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_binary_io_SOURCES = test-binary-io.c
+test_binary_io_OBJECTS = test-binary-io.$(OBJEXT)
+test_binary_io_LDADD = $(LDADD)
+test_binary_io_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_bind_SOURCES = test-bind.c
+test_bind_OBJECTS = test-bind.$(OBJEXT)
+test_bind_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_bitrotate_SOURCES = test-bitrotate.c
+test_bitrotate_OBJECTS = test-bitrotate.$(OBJEXT)
+test_bitrotate_LDADD = $(LDADD)
+test_bitrotate_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_btowc_SOURCES = test-btowc.c
+test_btowc_OBJECTS = test-btowc.$(OBJEXT)
+test_btowc_LDADD = $(LDADD)
+test_btowc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_c_ctype_SOURCES = test-c-ctype.c
+test_c_ctype_OBJECTS = test-c-ctype.$(OBJEXT)
+test_c_ctype_LDADD = $(LDADD)
+test_c_ctype_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_c_stack_SOURCES = test-c-stack.c
+test_c_stack_OBJECTS = test-c-stack.$(OBJEXT)
+test_c_stack_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+test_c_strcasecmp_SOURCES = test-c-strcasecmp.c
+test_c_strcasecmp_OBJECTS = test-c-strcasecmp.$(OBJEXT)
+test_c_strcasecmp_LDADD = $(LDADD)
+test_c_strcasecmp_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_c_strncasecmp_SOURCES = test-c-strncasecmp.c
+test_c_strncasecmp_OBJECTS = test-c-strncasecmp.$(OBJEXT)
+test_c_strncasecmp_LDADD = $(LDADD)
+test_c_strncasecmp_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_close_SOURCES = test-close.c
+test_close_OBJECTS = test-close.$(OBJEXT)
+test_close_LDADD = $(LDADD)
+test_close_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_connect_SOURCES = test-connect.c
+test_connect_OBJECTS = test-connect.$(OBJEXT)
+test_connect_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+test_ctype_SOURCES = test-ctype.c
+test_ctype_OBJECTS = test-ctype.$(OBJEXT)
+test_ctype_LDADD = $(LDADD)
+test_ctype_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_dirname_SOURCES = test-dirname.c
+test_dirname_OBJECTS = test-dirname.$(OBJEXT)
+test_dirname_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_dup2_SOURCES = test-dup2.c
+test_dup2_OBJECTS = test-dup2.$(OBJEXT)
+test_dup2_LDADD = $(LDADD)
+test_dup2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_environ_SOURCES = test-environ.c
+test_environ_OBJECTS = test-environ.$(OBJEXT)
+test_environ_LDADD = $(LDADD)
+test_environ_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_errno_SOURCES = test-errno.c
+test_errno_OBJECTS = test-errno.$(OBJEXT)
+test_errno_LDADD = $(LDADD)
+test_errno_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_exclude_SOURCES = test-exclude.c
+test_exclude_OBJECTS = test-exclude.$(OBJEXT)
+test_exclude_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_fcntl_SOURCES = test-fcntl.c
+test_fcntl_OBJECTS = test-fcntl.$(OBJEXT)
+test_fcntl_LDADD = $(LDADD)
+test_fcntl_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_fcntl_h_SOURCES = test-fcntl-h.c
+test_fcntl_h_OBJECTS = test-fcntl-h.$(OBJEXT)
+test_fcntl_h_LDADD = $(LDADD)
+test_fcntl_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_fdopen_SOURCES = test-fdopen.c
+test_fdopen_OBJECTS = test-fdopen.$(OBJEXT)
+test_fdopen_LDADD = $(LDADD)
+test_fdopen_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_fgetc_SOURCES = test-fgetc.c
+test_fgetc_OBJECTS = test-fgetc.$(OBJEXT)
+test_fgetc_LDADD = $(LDADD)
+test_fgetc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_filenamecat_SOURCES = test-filenamecat.c
+test_filenamecat_OBJECTS = test-filenamecat.$(OBJEXT)
+test_filenamecat_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_float_SOURCES = test-float.c
+test_float_OBJECTS = test-float.$(OBJEXT)
+test_float_LDADD = $(LDADD)
+test_float_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_fnmatch_SOURCES = test-fnmatch.c
+test_fnmatch_OBJECTS = test-fnmatch.$(OBJEXT)
+test_fnmatch_LDADD = $(LDADD)
+test_fnmatch_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_fputc_SOURCES = test-fputc.c
+test_fputc_OBJECTS = test-fputc.$(OBJEXT)
+test_fputc_LDADD = $(LDADD)
+test_fputc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_fread_SOURCES = test-fread.c
+test_fread_OBJECTS = test-fread.$(OBJEXT)
+test_fread_LDADD = $(LDADD)
+test_fread_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_freopen_SOURCES = test-freopen.c
+test_freopen_OBJECTS = test-freopen.$(OBJEXT)
+test_freopen_LDADD = $(LDADD)
+test_freopen_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_freopen_safer_SOURCES = test-freopen-safer.c
+test_freopen_safer_OBJECTS = test-freopen-safer.$(OBJEXT)
+test_freopen_safer_LDADD = $(LDADD)
+test_freopen_safer_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_fstat_SOURCES = test-fstat.c
+test_fstat_OBJECTS = test-fstat.$(OBJEXT)
+test_fstat_LDADD = $(LDADD)
+test_fstat_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_ftruncate_SOURCES = test-ftruncate.c
+test_ftruncate_OBJECTS = test-ftruncate.$(OBJEXT)
+test_ftruncate_LDADD = $(LDADD)
+test_ftruncate_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_fwrite_SOURCES = test-fwrite.c
+test_fwrite_OBJECTS = test-fwrite.$(OBJEXT)
+test_fwrite_LDADD = $(LDADD)
+test_fwrite_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_getcwd_lgpl_SOURCES = test-getcwd-lgpl.c
+test_getcwd_lgpl_OBJECTS = test-getcwd-lgpl.$(OBJEXT)
+test_getcwd_lgpl_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+test_getdtablesize_SOURCES = test-getdtablesize.c
+test_getdtablesize_OBJECTS = test-getdtablesize.$(OBJEXT)
+test_getdtablesize_LDADD = $(LDADD)
+test_getdtablesize_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_getopt_SOURCES = test-getopt.c
+test_getopt_OBJECTS = test-getopt.$(OBJEXT)
+test_getopt_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_gettimeofday_SOURCES = test-gettimeofday.c
+test_gettimeofday_OBJECTS = test-gettimeofday.$(OBJEXT)
+test_gettimeofday_LDADD = $(LDADD)
+test_gettimeofday_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_hash_SOURCES = test-hash.c
+test_hash_OBJECTS = test-hash.$(OBJEXT)
+test_hash_LDADD = $(LDADD)
+test_hash_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_iconv_SOURCES = test-iconv.c
+test_iconv_OBJECTS = test-iconv.$(OBJEXT)
+test_iconv_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_iconv_h_SOURCES = test-iconv-h.c
+test_iconv_h_OBJECTS = test-iconv-h.$(OBJEXT)
+test_iconv_h_LDADD = $(LDADD)
+test_iconv_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_ignore_value_SOURCES = test-ignore-value.c
+test_ignore_value_OBJECTS = test-ignore-value.$(OBJEXT)
+test_ignore_value_LDADD = $(LDADD)
+test_ignore_value_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_inet_pton_SOURCES = test-inet_pton.c
+test_inet_pton_OBJECTS = test-inet_pton.$(OBJEXT)
+test_inet_pton_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_intprops_SOURCES = test-intprops.c
+test_intprops_OBJECTS = test-intprops.$(OBJEXT)
+test_intprops_LDADD = $(LDADD)
+test_intprops_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_inttostr_SOURCES = test-inttostr.c
+test_inttostr_OBJECTS = test-inttostr.$(OBJEXT)
+test_inttostr_LDADD = $(LDADD)
+test_inttostr_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_inttypes_SOURCES = test-inttypes.c
+test_inttypes_OBJECTS = test-inttypes.$(OBJEXT)
+test_inttypes_LDADD = $(LDADD)
+test_inttypes_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_ioctl_SOURCES = test-ioctl.c
+test_ioctl_OBJECTS = test-ioctl.$(OBJEXT)
+test_ioctl_LDADD = $(LDADD)
+test_ioctl_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_isblank_SOURCES = test-isblank.c
+test_isblank_OBJECTS = test-isblank.$(OBJEXT)
+test_isblank_LDADD = $(LDADD)
+test_isblank_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_iswblank_SOURCES = test-iswblank.c
+test_iswblank_OBJECTS = test-iswblank.$(OBJEXT)
+test_iswblank_LDADD = $(LDADD)
+test_iswblank_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_langinfo_SOURCES = test-langinfo.c
+test_langinfo_OBJECTS = test-langinfo.$(OBJEXT)
+test_langinfo_LDADD = $(LDADD)
+test_langinfo_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_listen_SOURCES = test-listen.c
+test_listen_OBJECTS = test-listen.$(OBJEXT)
+test_listen_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_locale_SOURCES = test-locale.c
+test_locale_OBJECTS = test-locale.$(OBJEXT)
+test_locale_LDADD = $(LDADD)
+test_locale_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_localeconv_SOURCES = test-localeconv.c
+test_localeconv_OBJECTS = test-localeconv.$(OBJEXT)
+test_localeconv_LDADD = $(LDADD)
+test_localeconv_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_lstat_SOURCES = test-lstat.c
+test_lstat_OBJECTS = test-lstat.$(OBJEXT)
+test_lstat_LDADD = $(LDADD)
+test_lstat_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_malloca_SOURCES = test-malloca.c
+test_malloca_OBJECTS = test-malloca.$(OBJEXT)
+test_malloca_LDADD = $(LDADD)
+test_malloca_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbrtowc_SOURCES = test-mbrtowc.c
+test_mbrtowc_OBJECTS = test-mbrtowc.$(OBJEXT)
+test_mbrtowc_LDADD = $(LDADD)
+test_mbrtowc_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbrtowc_w32_SOURCES = test-mbrtowc-w32.c
+test_mbrtowc_w32_OBJECTS = test-mbrtowc-w32.$(OBJEXT)
+test_mbrtowc_w32_LDADD = $(LDADD)
+test_mbrtowc_w32_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbscasecmp_SOURCES = test-mbscasecmp.c
+test_mbscasecmp_OBJECTS = test-mbscasecmp.$(OBJEXT)
+test_mbscasecmp_LDADD = $(LDADD)
+test_mbscasecmp_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbsinit_SOURCES = test-mbsinit.c
+test_mbsinit_OBJECTS = test-mbsinit.$(OBJEXT)
+test_mbsinit_LDADD = $(LDADD)
+test_mbsinit_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbsrtowcs_SOURCES = test-mbsrtowcs.c
+test_mbsrtowcs_OBJECTS = test-mbsrtowcs.$(OBJEXT)
+test_mbsrtowcs_LDADD = $(LDADD)
+test_mbsrtowcs_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbsstr1_SOURCES = test-mbsstr1.c
+test_mbsstr1_OBJECTS = test-mbsstr1.$(OBJEXT)
+test_mbsstr1_LDADD = $(LDADD)
+test_mbsstr1_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbsstr2_SOURCES = test-mbsstr2.c
+test_mbsstr2_OBJECTS = test-mbsstr2.$(OBJEXT)
+test_mbsstr2_LDADD = $(LDADD)
+test_mbsstr2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_mbsstr3_SOURCES = test-mbsstr3.c
+test_mbsstr3_OBJECTS = test-mbsstr3.$(OBJEXT)
+test_mbsstr3_LDADD = $(LDADD)
+test_mbsstr3_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_memchr_SOURCES = test-memchr.c
+test_memchr_OBJECTS = test-memchr.$(OBJEXT)
+test_memchr_LDADD = $(LDADD)
+test_memchr_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_nanosleep_SOURCES = test-nanosleep.c
+test_nanosleep_OBJECTS = test-nanosleep.$(OBJEXT)
+test_nanosleep_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+test_netinet_in_SOURCES = test-netinet_in.c
+test_netinet_in_OBJECTS = test-netinet_in.$(OBJEXT)
+test_netinet_in_LDADD = $(LDADD)
+test_netinet_in_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_nl_langinfo_SOURCES = test-nl_langinfo.c
+test_nl_langinfo_OBJECTS = test-nl_langinfo.$(OBJEXT)
+test_nl_langinfo_LDADD = $(LDADD)
+test_nl_langinfo_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_open_SOURCES = test-open.c
+test_open_OBJECTS = test-open.$(OBJEXT)
+test_open_LDADD = $(LDADD)
+test_open_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_pathmax_SOURCES = test-pathmax.c
+test_pathmax_OBJECTS = test-pathmax.$(OBJEXT)
+test_pathmax_LDADD = $(LDADD)
+test_pathmax_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_perror_SOURCES = test-perror.c
+test_perror_OBJECTS = test-perror.$(OBJEXT)
+test_perror_LDADD = $(LDADD)
+test_perror_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_perror2_SOURCES = test-perror2.c
+test_perror2_OBJECTS = test-perror2.$(OBJEXT)
+test_perror2_LDADD = $(LDADD)
+test_perror2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_pipe_SOURCES = test-pipe.c
+test_pipe_OBJECTS = test-pipe.$(OBJEXT)
+test_pipe_LDADD = $(LDADD)
+test_pipe_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_quotearg_simple_SOURCES = test-quotearg-simple.c
+test_quotearg_simple_OBJECTS = test-quotearg-simple.$(OBJEXT)
+test_quotearg_simple_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_raise_SOURCES = test-raise.c
+test_raise_OBJECTS = test-raise.$(OBJEXT)
+test_raise_LDADD = $(LDADD)
+test_raise_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_rawmemchr_SOURCES = test-rawmemchr.c
+test_rawmemchr_OBJECTS = test-rawmemchr.$(OBJEXT)
+test_rawmemchr_LDADD = $(LDADD)
+test_rawmemchr_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_readlink_SOURCES = test-readlink.c
+test_readlink_OBJECTS = test-readlink.$(OBJEXT)
+test_readlink_LDADD = $(LDADD)
+test_readlink_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_regex_SOURCES = test-regex.c
+test_regex_OBJECTS = test-regex.$(OBJEXT)
+test_regex_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_select_SOURCES = test-select.c
+test_select_OBJECTS = test-select.$(OBJEXT)
+test_select_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_select_fd_SOURCES = test-select-fd.c
+test_select_fd_OBJECTS = test-select-fd.$(OBJEXT)
+test_select_fd_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_select_stdin_SOURCES = test-select-stdin.c
+test_select_stdin_OBJECTS = test-select-stdin.$(OBJEXT)
+test_select_stdin_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_setenv_SOURCES = test-setenv.c
+test_setenv_OBJECTS = test-setenv.$(OBJEXT)
+test_setenv_LDADD = $(LDADD)
+test_setenv_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_setlocale1_SOURCES = test-setlocale1.c
+test_setlocale1_OBJECTS = test-setlocale1.$(OBJEXT)
+test_setlocale1_LDADD = $(LDADD)
+test_setlocale1_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_setlocale2_SOURCES = test-setlocale2.c
+test_setlocale2_OBJECTS = test-setlocale2.$(OBJEXT)
+test_setlocale2_LDADD = $(LDADD)
+test_setlocale2_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_setsockopt_SOURCES = test-setsockopt.c
+test_setsockopt_OBJECTS = test-setsockopt.$(OBJEXT)
+test_setsockopt_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_sh_quote_SOURCES = test-sh-quote.c
+test_sh_quote_OBJECTS = test-sh-quote.$(OBJEXT)
+test_sh_quote_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_sigaction_SOURCES = test-sigaction.c
+test_sigaction_OBJECTS = test-sigaction.$(OBJEXT)
+test_sigaction_LDADD = $(LDADD)
+test_sigaction_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_signal_h_SOURCES = test-signal-h.c
+test_signal_h_OBJECTS = test-signal-h.$(OBJEXT)
+test_signal_h_LDADD = $(LDADD)
+test_signal_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sigprocmask_SOURCES = test-sigprocmask.c
+test_sigprocmask_OBJECTS = test-sigprocmask.$(OBJEXT)
+test_sigprocmask_LDADD = $(LDADD)
+test_sigprocmask_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sleep_SOURCES = test-sleep.c
+test_sleep_OBJECTS = test-sleep.$(OBJEXT)
+test_sleep_LDADD = $(LDADD)
+test_sleep_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_snprintf_SOURCES = test-snprintf.c
+test_snprintf_OBJECTS = test-snprintf.$(OBJEXT)
+test_snprintf_LDADD = $(LDADD)
+test_snprintf_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sockets_SOURCES = test-sockets.c
+test_sockets_OBJECTS = test-sockets.$(OBJEXT)
+test_sockets_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_stat_SOURCES = test-stat.c
+test_stat_OBJECTS = test-stat.$(OBJEXT)
+test_stat_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_stat_time_SOURCES = test-stat-time.c
+test_stat_time_OBJECTS = test-stat-time.$(OBJEXT)
+test_stat_time_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+test_stdalign_SOURCES = test-stdalign.c
+test_stdalign_OBJECTS = test-stdalign.$(OBJEXT)
+test_stdalign_LDADD = $(LDADD)
+test_stdalign_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_stdbool_SOURCES = test-stdbool.c
+test_stdbool_OBJECTS = test-stdbool.$(OBJEXT)
+test_stdbool_LDADD = $(LDADD)
+test_stdbool_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_stddef_SOURCES = test-stddef.c
+test_stddef_OBJECTS = test-stddef.$(OBJEXT)
+test_stddef_LDADD = $(LDADD)
+test_stddef_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_stdint_SOURCES = test-stdint.c
+test_stdint_OBJECTS = test-stdint.$(OBJEXT)
+test_stdint_LDADD = $(LDADD)
+test_stdint_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_stdio_SOURCES = test-stdio.c
+test_stdio_OBJECTS = test-stdio.$(OBJEXT)
+test_stdio_LDADD = $(LDADD)
+test_stdio_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_stdlib_SOURCES = test-stdlib.c
+test_stdlib_OBJECTS = test-stdlib.$(OBJEXT)
+test_stdlib_LDADD = $(LDADD)
+test_stdlib_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_strerror_SOURCES = test-strerror.c
+test_strerror_OBJECTS = test-strerror.$(OBJEXT)
+test_strerror_LDADD = $(LDADD)
+test_strerror_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_strerror_r_SOURCES = test-strerror_r.c
+test_strerror_r_OBJECTS = test-strerror_r.$(OBJEXT)
+test_strerror_r_LDADD = $(LDADD)
+test_strerror_r_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_strftime_SOURCES = test-strftime.c
+test_strftime_OBJECTS = test-strftime.$(OBJEXT)
+test_strftime_LDADD = $(LDADD)
+test_strftime_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_striconv_SOURCES = test-striconv.c
+test_striconv_OBJECTS = test-striconv.$(OBJEXT)
+test_striconv_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_string_SOURCES = test-string.c
+test_string_OBJECTS = test-string.$(OBJEXT)
+test_string_LDADD = $(LDADD)
+test_string_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_strings_SOURCES = test-strings.c
+test_strings_OBJECTS = test-strings.$(OBJEXT)
+test_strings_LDADD = $(LDADD)
+test_strings_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_strnlen_SOURCES = test-strnlen.c
+test_strnlen_OBJECTS = test-strnlen.$(OBJEXT)
+test_strnlen_LDADD = $(LDADD)
+test_strnlen_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_strtoull_SOURCES = test-strtoull.c
+test_strtoull_OBJECTS = test-strtoull.$(OBJEXT)
+test_strtoull_LDADD = $(LDADD)
+test_strtoull_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_strtoumax_SOURCES = test-strtoumax.c
+test_strtoumax_OBJECTS = test-strtoumax.$(OBJEXT)
+test_strtoumax_LDADD = $(LDADD)
+test_strtoumax_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_symlink_SOURCES = test-symlink.c
+test_symlink_OBJECTS = test-symlink.$(OBJEXT)
+test_symlink_LDADD = $(LDADD)
+test_symlink_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_ioctl_SOURCES = test-sys_ioctl.c
+test_sys_ioctl_OBJECTS = test-sys_ioctl.$(OBJEXT)
+test_sys_ioctl_LDADD = $(LDADD)
+test_sys_ioctl_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_select_SOURCES = test-sys_select.c
+test_sys_select_OBJECTS = test-sys_select.$(OBJEXT)
+test_sys_select_LDADD = $(LDADD)
+test_sys_select_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_socket_SOURCES = test-sys_socket.c
+test_sys_socket_OBJECTS = test-sys_socket.$(OBJEXT)
+test_sys_socket_LDADD = $(LDADD)
+test_sys_socket_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_stat_SOURCES = test-sys_stat.c
+test_sys_stat_OBJECTS = test-sys_stat.$(OBJEXT)
+test_sys_stat_LDADD = $(LDADD)
+test_sys_stat_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_time_SOURCES = test-sys_time.c
+test_sys_time_OBJECTS = test-sys_time.$(OBJEXT)
+test_sys_time_LDADD = $(LDADD)
+test_sys_time_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_types_SOURCES = test-sys_types.c
+test_sys_types_OBJECTS = test-sys_types.$(OBJEXT)
+test_sys_types_LDADD = $(LDADD)
+test_sys_types_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_uio_SOURCES = test-sys_uio.c
+test_sys_uio_OBJECTS = test-sys_uio.$(OBJEXT)
+test_sys_uio_LDADD = $(LDADD)
+test_sys_uio_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_sys_wait_SOURCES = test-sys_wait.c
+test_sys_wait_OBJECTS = test-sys_wait.$(OBJEXT)
+test_sys_wait_LDADD = $(LDADD)
+test_sys_wait_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_time_SOURCES = test-time.c
+test_time_OBJECTS = test-time.$(OBJEXT)
+test_time_LDADD = $(LDADD)
+test_time_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_timespec_SOURCES = test-timespec.c
+test_timespec_OBJECTS = test-timespec.$(OBJEXT)
+test_timespec_LDADD = $(LDADD)
+test_timespec_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+am__dirstamp = .dirstamp
+am_test_u8_mbtoucr_OBJECTS = unistr/test-u8-mbtoucr.$(OBJEXT)
+test_u8_mbtoucr_OBJECTS = $(am_test_u8_mbtoucr_OBJECTS)
+test_u8_mbtoucr_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_test_u8_uctomb_OBJECTS = unistr/test-u8-uctomb.$(OBJEXT)
+test_u8_uctomb_OBJECTS = $(am_test_u8_uctomb_OBJECTS)
+test_u8_uctomb_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_test_uc_width_OBJECTS = uniwidth/test-uc_width.$(OBJEXT)
+test_uc_width_OBJECTS = $(am_test_uc_width_OBJECTS)
+test_uc_width_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_test_uc_width2_OBJECTS = uniwidth/test-uc_width2.$(OBJEXT)
+test_uc_width2_OBJECTS = $(am_test_uc_width2_OBJECTS)
+test_uc_width2_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_unistd_SOURCES = test-unistd.c
+test_unistd_OBJECTS = test-unistd.$(OBJEXT)
+test_unistd_LDADD = $(LDADD)
+test_unistd_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_unsetenv_SOURCES = test-unsetenv.c
+test_unsetenv_OBJECTS = test-unsetenv.$(OBJEXT)
+test_unsetenv_LDADD = $(LDADD)
+test_unsetenv_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_vasnprintf_SOURCES = test-vasnprintf.c
+test_vasnprintf_OBJECTS = test-vasnprintf.$(OBJEXT)
+test_vasnprintf_LDADD = $(LDADD)
+test_vasnprintf_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_vasprintf_SOURCES = test-vasprintf.c
+test_vasprintf_OBJECTS = test-vasprintf.$(OBJEXT)
+test_vasprintf_LDADD = $(LDADD)
+test_vasprintf_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_verify_SOURCES = test-verify.c
+test_verify_OBJECTS = test-verify.$(OBJEXT)
+test_verify_LDADD = $(LDADD)
+test_verify_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_version_etc_SOURCES = test-version-etc.c
+test_version_etc_OBJECTS = test-version-etc.$(OBJEXT)
+test_version_etc_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_wchar_SOURCES = test-wchar.c
+test_wchar_OBJECTS = test-wchar.$(OBJEXT)
+test_wchar_LDADD = $(LDADD)
+test_wchar_DEPENDENCIES = libtests.a ../lib/libdiffutils.a libtests.a \
+ $(am__DEPENDENCIES_1)
+test_wcrtomb_SOURCES = test-wcrtomb.c
+test_wcrtomb_OBJECTS = test-wcrtomb.$(OBJEXT)
+test_wcrtomb_LDADD = $(LDADD)
+test_wcrtomb_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_wcrtomb_w32_SOURCES = test-wcrtomb-w32.c
+test_wcrtomb_w32_OBJECTS = test-wcrtomb-w32.$(OBJEXT)
+test_wcrtomb_w32_LDADD = $(LDADD)
+test_wcrtomb_w32_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_wctype_h_SOURCES = test-wctype-h.c
+test_wctype_h_OBJECTS = test-wctype-h.$(OBJEXT)
+test_wctype_h_LDADD = $(LDADD)
+test_wctype_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_wcwidth_SOURCES = test-wcwidth.c
+test_wcwidth_OBJECTS = test-wcwidth.$(OBJEXT)
+test_wcwidth_LDADD = $(LDADD)
+test_wcwidth_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
+ libtests.a $(am__DEPENDENCIES_1)
+test_xalloc_die_SOURCES = test-xalloc-die.c
+test_xalloc_die_OBJECTS = test-xalloc-die.$(OBJEXT)
+test_xalloc_die_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_xstrtol_SOURCES = test-xstrtol.c
+test_xstrtol_OBJECTS = test-xstrtol.$(OBJEXT)
+test_xstrtol_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_xstrtoul_SOURCES = test-xstrtoul.c
+test_xstrtoul_OBJECTS = test-xstrtoul.$(OBJEXT)
+test_xstrtoul_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_xstrtoumax_SOURCES = test-xstrtoumax.c
+test_xstrtoumax_OBJECTS = test-xstrtoumax.$(OBJEXT)
+test_xstrtoumax_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_xvasprintf_SOURCES = test-xvasprintf.c
+test_xvasprintf_OBJECTS = test-xvasprintf.$(OBJEXT)
+test_xvasprintf_DEPENDENCIES = $(am__DEPENDENCIES_2)
+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)/lib
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/bind.Po \
+ ./$(DEPDIR)/connect.Po ./$(DEPDIR)/dtotimespec.Po \
+ ./$(DEPDIR)/fdopen.Po ./$(DEPDIR)/ftruncate.Po \
+ ./$(DEPDIR)/getcwd-lgpl.Po ./$(DEPDIR)/getpagesize.Po \
+ ./$(DEPDIR)/hash-pjw.Po ./$(DEPDIR)/inet_pton.Po \
+ ./$(DEPDIR)/ioctl.Po ./$(DEPDIR)/listen.Po \
+ ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/perror.Po \
+ ./$(DEPDIR)/pipe.Po ./$(DEPDIR)/putenv.Po \
+ ./$(DEPDIR)/select.Po ./$(DEPDIR)/setlocale.Po \
+ ./$(DEPDIR)/setsockopt.Po ./$(DEPDIR)/sleep.Po \
+ ./$(DEPDIR)/snprintf.Po ./$(DEPDIR)/socket.Po \
+ ./$(DEPDIR)/sockets.Po ./$(DEPDIR)/strerror_r.Po \
+ ./$(DEPDIR)/symlink.Po ./$(DEPDIR)/sys_socket.Po \
+ ./$(DEPDIR)/test-accept.Po ./$(DEPDIR)/test-alloca-opt.Po \
+ ./$(DEPDIR)/test-areadlink.Po ./$(DEPDIR)/test-argmatch.Po \
+ ./$(DEPDIR)/test-arpa_inet.Po ./$(DEPDIR)/test-binary-io.Po \
+ ./$(DEPDIR)/test-bind.Po ./$(DEPDIR)/test-bitrotate.Po \
+ ./$(DEPDIR)/test-btowc.Po ./$(DEPDIR)/test-c-ctype.Po \
+ ./$(DEPDIR)/test-c-stack.Po ./$(DEPDIR)/test-c-strcasecmp.Po \
+ ./$(DEPDIR)/test-c-strncasecmp.Po ./$(DEPDIR)/test-close.Po \
+ ./$(DEPDIR)/test-connect.Po ./$(DEPDIR)/test-ctype.Po \
+ ./$(DEPDIR)/test-dirname.Po ./$(DEPDIR)/test-dup2.Po \
+ ./$(DEPDIR)/test-environ.Po ./$(DEPDIR)/test-errno.Po \
+ ./$(DEPDIR)/test-exclude.Po ./$(DEPDIR)/test-fcntl-h.Po \
+ ./$(DEPDIR)/test-fcntl.Po ./$(DEPDIR)/test-fdopen.Po \
+ ./$(DEPDIR)/test-fgetc.Po ./$(DEPDIR)/test-filenamecat.Po \
+ ./$(DEPDIR)/test-float.Po ./$(DEPDIR)/test-fnmatch.Po \
+ ./$(DEPDIR)/test-fputc.Po ./$(DEPDIR)/test-fread.Po \
+ ./$(DEPDIR)/test-freopen-safer.Po ./$(DEPDIR)/test-freopen.Po \
+ ./$(DEPDIR)/test-fstat.Po ./$(DEPDIR)/test-ftruncate.Po \
+ ./$(DEPDIR)/test-fwrite.Po ./$(DEPDIR)/test-getcwd-lgpl.Po \
+ ./$(DEPDIR)/test-getdtablesize.Po ./$(DEPDIR)/test-getopt.Po \
+ ./$(DEPDIR)/test-gettimeofday.Po ./$(DEPDIR)/test-hash.Po \
+ ./$(DEPDIR)/test-iconv-h.Po ./$(DEPDIR)/test-iconv.Po \
+ ./$(DEPDIR)/test-ignore-value.Po ./$(DEPDIR)/test-inet_pton.Po \
+ ./$(DEPDIR)/test-intprops.Po ./$(DEPDIR)/test-inttostr.Po \
+ ./$(DEPDIR)/test-inttypes.Po ./$(DEPDIR)/test-ioctl.Po \
+ ./$(DEPDIR)/test-isblank.Po ./$(DEPDIR)/test-iswblank.Po \
+ ./$(DEPDIR)/test-langinfo.Po ./$(DEPDIR)/test-listen.Po \
+ ./$(DEPDIR)/test-locale.Po ./$(DEPDIR)/test-localeconv.Po \
+ ./$(DEPDIR)/test-lstat.Po ./$(DEPDIR)/test-malloca.Po \
+ ./$(DEPDIR)/test-mbrtowc-w32.Po ./$(DEPDIR)/test-mbrtowc.Po \
+ ./$(DEPDIR)/test-mbscasecmp.Po ./$(DEPDIR)/test-mbsinit.Po \
+ ./$(DEPDIR)/test-mbsrtowcs.Po ./$(DEPDIR)/test-mbsstr1.Po \
+ ./$(DEPDIR)/test-mbsstr2.Po ./$(DEPDIR)/test-mbsstr3.Po \
+ ./$(DEPDIR)/test-memchr.Po ./$(DEPDIR)/test-nanosleep.Po \
+ ./$(DEPDIR)/test-netinet_in.Po ./$(DEPDIR)/test-nl_langinfo.Po \
+ ./$(DEPDIR)/test-open.Po ./$(DEPDIR)/test-pathmax.Po \
+ ./$(DEPDIR)/test-perror.Po ./$(DEPDIR)/test-perror2.Po \
+ ./$(DEPDIR)/test-pipe.Po ./$(DEPDIR)/test-quotearg-simple.Po \
+ ./$(DEPDIR)/test-raise.Po ./$(DEPDIR)/test-rawmemchr.Po \
+ ./$(DEPDIR)/test-readlink.Po ./$(DEPDIR)/test-regex.Po \
+ ./$(DEPDIR)/test-select-fd.Po ./$(DEPDIR)/test-select-stdin.Po \
+ ./$(DEPDIR)/test-select.Po ./$(DEPDIR)/test-setenv.Po \
+ ./$(DEPDIR)/test-setlocale1.Po ./$(DEPDIR)/test-setlocale2.Po \
+ ./$(DEPDIR)/test-setsockopt.Po ./$(DEPDIR)/test-sh-quote.Po \
+ ./$(DEPDIR)/test-sigaction.Po ./$(DEPDIR)/test-signal-h.Po \
+ ./$(DEPDIR)/test-sigprocmask.Po ./$(DEPDIR)/test-sleep.Po \
+ ./$(DEPDIR)/test-snprintf.Po ./$(DEPDIR)/test-sockets.Po \
+ ./$(DEPDIR)/test-stat-time.Po ./$(DEPDIR)/test-stat.Po \
+ ./$(DEPDIR)/test-stdalign.Po ./$(DEPDIR)/test-stdbool.Po \
+ ./$(DEPDIR)/test-stddef.Po ./$(DEPDIR)/test-stdint.Po \
+ ./$(DEPDIR)/test-stdio.Po ./$(DEPDIR)/test-stdlib.Po \
+ ./$(DEPDIR)/test-strerror.Po ./$(DEPDIR)/test-strerror_r.Po \
+ ./$(DEPDIR)/test-strftime.Po ./$(DEPDIR)/test-striconv.Po \
+ ./$(DEPDIR)/test-string.Po ./$(DEPDIR)/test-strings.Po \
+ ./$(DEPDIR)/test-strnlen.Po ./$(DEPDIR)/test-strtoull.Po \
+ ./$(DEPDIR)/test-strtoumax.Po ./$(DEPDIR)/test-symlink.Po \
+ ./$(DEPDIR)/test-sys_ioctl.Po ./$(DEPDIR)/test-sys_select.Po \
+ ./$(DEPDIR)/test-sys_socket.Po ./$(DEPDIR)/test-sys_stat.Po \
+ ./$(DEPDIR)/test-sys_time.Po ./$(DEPDIR)/test-sys_types.Po \
+ ./$(DEPDIR)/test-sys_uio.Po ./$(DEPDIR)/test-sys_wait.Po \
+ ./$(DEPDIR)/test-time.Po ./$(DEPDIR)/test-timespec.Po \
+ ./$(DEPDIR)/test-unistd.Po ./$(DEPDIR)/test-unsetenv.Po \
+ ./$(DEPDIR)/test-vasnprintf.Po ./$(DEPDIR)/test-vasprintf.Po \
+ ./$(DEPDIR)/test-verify.Po ./$(DEPDIR)/test-version-etc.Po \
+ ./$(DEPDIR)/test-wchar.Po ./$(DEPDIR)/test-wcrtomb-w32.Po \
+ ./$(DEPDIR)/test-wcrtomb.Po ./$(DEPDIR)/test-wctype-h.Po \
+ ./$(DEPDIR)/test-wcwidth.Po ./$(DEPDIR)/test-xalloc-die.Po \
+ ./$(DEPDIR)/test-xstrtol.Po ./$(DEPDIR)/test-xstrtoul.Po \
+ ./$(DEPDIR)/test-xstrtoumax.Po ./$(DEPDIR)/test-xvasprintf.Po \
+ ./$(DEPDIR)/timespec-add.Po ./$(DEPDIR)/timespec-sub.Po \
+ ./$(DEPDIR)/wctob.Po ./$(DEPDIR)/wctomb.Po \
+ unistr/$(DEPDIR)/test-u8-mbtoucr.Po \
+ unistr/$(DEPDIR)/test-u8-uctomb.Po \
+ uniwidth/$(DEPDIR)/test-uc_width.Po \
+ uniwidth/$(DEPDIR)/test-uc_width2.Po
+am__mv = mv -f
+am__set_depbase = depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
+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 = $(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 = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \
+ test-accept.c test-alloca-opt.c test-areadlink.c \
+ test-argmatch.c test-arpa_inet.c test-binary-io.c test-bind.c \
+ test-bitrotate.c test-btowc.c test-c-ctype.c test-c-stack.c \
+ test-c-strcasecmp.c test-c-strncasecmp.c test-close.c \
+ test-connect.c test-ctype.c test-dirname.c test-dup2.c \
+ test-environ.c test-errno.c test-exclude.c test-fcntl.c \
+ test-fcntl-h.c test-fdopen.c test-fgetc.c test-filenamecat.c \
+ test-float.c test-fnmatch.c test-fputc.c test-fread.c \
+ test-freopen.c test-freopen-safer.c test-fstat.c \
+ test-ftruncate.c test-fwrite.c test-getcwd-lgpl.c \
+ test-getdtablesize.c test-getopt.c test-gettimeofday.c \
+ test-hash.c test-iconv.c test-iconv-h.c test-ignore-value.c \
+ test-inet_pton.c test-intprops.c test-inttostr.c \
+ test-inttypes.c test-ioctl.c test-isblank.c test-iswblank.c \
+ test-langinfo.c test-listen.c test-locale.c test-localeconv.c \
+ test-lstat.c test-malloca.c test-mbrtowc.c test-mbrtowc-w32.c \
+ test-mbscasecmp.c test-mbsinit.c test-mbsrtowcs.c \
+ test-mbsstr1.c test-mbsstr2.c test-mbsstr3.c test-memchr.c \
+ test-nanosleep.c test-netinet_in.c test-nl_langinfo.c \
+ test-open.c test-pathmax.c test-perror.c test-perror2.c \
+ test-pipe.c test-quotearg-simple.c test-raise.c \
+ test-rawmemchr.c test-readlink.c test-regex.c test-select.c \
+ test-select-fd.c test-select-stdin.c test-setenv.c \
+ test-setlocale1.c test-setlocale2.c test-setsockopt.c \
+ test-sh-quote.c test-sigaction.c test-signal-h.c \
+ test-sigprocmask.c test-sleep.c test-snprintf.c test-sockets.c \
+ test-stat.c test-stat-time.c test-stdalign.c test-stdbool.c \
+ test-stddef.c test-stdint.c test-stdio.c test-stdlib.c \
+ test-strerror.c test-strerror_r.c test-strftime.c \
+ test-striconv.c test-string.c test-strings.c test-strnlen.c \
+ test-strtoull.c test-strtoumax.c test-symlink.c \
+ test-sys_ioctl.c test-sys_select.c test-sys_socket.c \
+ test-sys_stat.c test-sys_time.c test-sys_types.c \
+ test-sys_uio.c test-sys_wait.c test-time.c test-timespec.c \
+ $(test_u8_mbtoucr_SOURCES) $(test_u8_uctomb_SOURCES) \
+ $(test_uc_width_SOURCES) $(test_uc_width2_SOURCES) \
+ test-unistd.c test-unsetenv.c test-vasnprintf.c \
+ test-vasprintf.c test-verify.c test-version-etc.c test-wchar.c \
+ test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \
+ test-wcwidth.c test-xalloc-die.c test-xstrtol.c \
+ test-xstrtoul.c test-xstrtoumax.c test-xvasprintf.c
+DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \
+ test-accept.c test-alloca-opt.c test-areadlink.c \
+ test-argmatch.c test-arpa_inet.c test-binary-io.c test-bind.c \
+ test-bitrotate.c test-btowc.c test-c-ctype.c test-c-stack.c \
+ test-c-strcasecmp.c test-c-strncasecmp.c test-close.c \
+ test-connect.c test-ctype.c test-dirname.c test-dup2.c \
+ test-environ.c test-errno.c test-exclude.c test-fcntl.c \
+ test-fcntl-h.c test-fdopen.c test-fgetc.c test-filenamecat.c \
+ test-float.c test-fnmatch.c test-fputc.c test-fread.c \
+ test-freopen.c test-freopen-safer.c test-fstat.c \
+ test-ftruncate.c test-fwrite.c test-getcwd-lgpl.c \
+ test-getdtablesize.c test-getopt.c test-gettimeofday.c \
+ test-hash.c test-iconv.c test-iconv-h.c test-ignore-value.c \
+ test-inet_pton.c test-intprops.c test-inttostr.c \
+ test-inttypes.c test-ioctl.c test-isblank.c test-iswblank.c \
+ test-langinfo.c test-listen.c test-locale.c test-localeconv.c \
+ test-lstat.c test-malloca.c test-mbrtowc.c test-mbrtowc-w32.c \
+ test-mbscasecmp.c test-mbsinit.c test-mbsrtowcs.c \
+ test-mbsstr1.c test-mbsstr2.c test-mbsstr3.c test-memchr.c \
+ test-nanosleep.c test-netinet_in.c test-nl_langinfo.c \
+ test-open.c test-pathmax.c test-perror.c test-perror2.c \
+ test-pipe.c test-quotearg-simple.c test-raise.c \
+ test-rawmemchr.c test-readlink.c test-regex.c test-select.c \
+ test-select-fd.c test-select-stdin.c test-setenv.c \
+ test-setlocale1.c test-setlocale2.c test-setsockopt.c \
+ test-sh-quote.c test-sigaction.c test-signal-h.c \
+ test-sigprocmask.c test-sleep.c test-snprintf.c test-sockets.c \
+ test-stat.c test-stat-time.c test-stdalign.c test-stdbool.c \
+ test-stddef.c test-stdint.c test-stdio.c test-stdlib.c \
+ test-strerror.c test-strerror_r.c test-strftime.c \
+ test-striconv.c test-string.c test-strings.c test-strnlen.c \
+ test-strtoull.c test-strtoumax.c test-symlink.c \
+ test-sys_ioctl.c test-sys_select.c test-sys_socket.c \
+ test-sys_stat.c test-sys_time.c test-sys_types.c \
+ test-sys_uio.c test-sys_wait.c test-time.c test-timespec.c \
+ $(test_u8_mbtoucr_SOURCES) $(test_u8_uctomb_SOURCES) \
+ $(test_uc_width_SOURCES) $(test_uc_width2_SOURCES) \
+ test-unistd.c test-unsetenv.c test-vasnprintf.c \
+ test-vasprintf.c test-verify.c test-version-etc.c test-wchar.c \
+ test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \
+ test-wcwidth.c test-xalloc-die.c test-xstrtol.c \
+ test-xstrtoul.c test-xstrtoumax.c test-xvasprintf.c
+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 \
+ check recheck distdir
+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)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gnulib.mk \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/test-driver
+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"
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = 1.9.6 foreign subdir-objects
+SUBDIRS = .
+TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \
+ LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LIBSIGSEGV='@LIBSIGSEGV@' LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@' \
+ LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@' LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@' abs_aux_dir='$(abs_aux_dir)' \
+ abs_aux_dir='$(abs_aux_dir)' MAKE='$(MAKE)' \
+ LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_JA='@LOCALE_JA@' LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+noinst_HEADERS =
+noinst_LIBRARIES =
+check_LIBRARIES = libtests.a
+EXTRA_DIST = accept.c w32sock.h test-accept.c signature.h macros.h \
+ test-alloca-opt.c test-areadlink.h test-areadlink.c macros.h \
+ test-argmatch.c macros.h arpa_inet.in.h test-arpa_inet.c \
+ test-binary-io.sh test-binary-io.c macros.h bind.c w32sock.h \
+ test-bind.c signature.h macros.h test-bitrotate.c macros.h \
+ test-btowc1.sh test-btowc2.sh test-btowc.c signature.h \
+ macros.h test-c-ctype.c macros.h test-c-stack.c \
+ test-c-stack.sh test-c-stack2.sh macros.h test-c-strcase.sh \
+ test-c-strcasecmp.c test-c-strncasecmp.c macros.h test-close.c \
+ signature.h macros.h connect.c w32sock.h test-connect.c \
+ signature.h macros.h test-ctype.c test-dirname.c test-dup2.c \
+ signature.h macros.h test-environ.c test-errno.c \
+ test-exclude.c test-exclude1.sh test-exclude2.sh \
+ test-exclude3.sh test-exclude4.sh test-exclude5.sh \
+ test-exclude6.sh test-exclude7.sh test-exclude8.sh \
+ test-fcntl-h.c test-fcntl.c signature.h macros.h fdopen.c \
+ test-fdopen.c signature.h macros.h test-fgetc.c signature.h \
+ macros.h test-filenamecat.c test-float.c macros.h \
+ test-fnmatch.c signature.h macros.h fpucw.h test-fputc.c \
+ signature.h macros.h test-fread.c signature.h macros.h \
+ test-freopen-safer.c macros.h test-freopen.c signature.h \
+ macros.h test-fstat.c signature.h macros.h ftruncate.c \
+ test-ftruncate.c test-ftruncate.sh signature.h macros.h \
+ test-fwrite.c signature.h macros.h getcwd-lgpl.c \
+ test-getcwd-lgpl.c signature.h macros.h test-getdtablesize.c \
+ signature.h macros.h macros.h signature.h test-getopt.c \
+ test-getopt.h test-getopt_long.h getpagesize.c signature.h \
+ test-gettimeofday.c test-hash.c macros.h test-iconv-h.c \
+ test-iconv.c signature.h macros.h test-ignore-value.c \
+ inet_pton.c test-inet_pton.c signature.h macros.h \
+ test-intprops.c macros.h macros.h test-inttostr.c \
+ test-inttypes.c ioctl.c w32sock.h test-ioctl.c signature.h \
+ macros.h test-isblank.c signature.h macros.h test-iswblank.c \
+ macros.h test-langinfo.c listen.c w32sock.h test-listen.c \
+ signature.h macros.h test-locale.c test-localeconv.c \
+ signature.h macros.h test-lstat.h test-lstat.c signature.h \
+ macros.h test-malloca.c test-mbrtowc1.sh test-mbrtowc2.sh \
+ test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh \
+ test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \
+ test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \
+ test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h \
+ test-mbscasecmp.sh test-mbscasecmp.c macros.h test-mbsinit.sh \
+ test-mbsinit.c signature.h macros.h test-mbsrtowcs1.sh \
+ test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh \
+ test-mbsrtowcs.c signature.h macros.h test-mbsstr1.c \
+ test-mbsstr2.sh test-mbsstr2.c test-mbsstr3.sh test-mbsstr3.c \
+ macros.h test-memchr.c zerosize-ptr.h signature.h macros.h \
+ nanosleep.c test-nanosleep.c signature.h macros.h \
+ netinet_in.in.h test-netinet_in.c test-nl_langinfo.sh \
+ test-nl_langinfo.c signature.h macros.h test-open.h \
+ test-open.c signature.h macros.h test-pathmax.c perror.c \
+ macros.h signature.h test-perror.c test-perror2.c \
+ test-perror.sh pipe.c test-pipe.c signature.h macros.h \
+ putenv.c test-quotearg-simple.c test-quotearg.h macros.h \
+ zerosize-ptr.h test-raise.c signature.h macros.h \
+ test-rawmemchr.c zerosize-ptr.h signature.h macros.h \
+ test-readlink.h test-readlink.c signature.h macros.h \
+ test-regex.c macros.h same-inode.h select.c macros.h \
+ signature.h test-select.c test-select.h test-select-fd.c \
+ test-select-in.sh test-select-out.sh test-select-stdin.c \
+ test-setenv.c signature.h macros.h setlocale.c \
+ test-setlocale1.sh test-setlocale1.c test-setlocale2.sh \
+ test-setlocale2.c signature.h macros.h setsockopt.c w32sock.h \
+ test-setsockopt.c signature.h macros.h test-sh-quote.c \
+ test-sigaction.c signature.h macros.h test-signal-h.c \
+ test-sigprocmask.c signature.h macros.h sleep.c test-sleep.c \
+ signature.h macros.h \
+ $(top_srcdir)/build-aux/snippet/_Noreturn.h \
+ $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ $(top_srcdir)/build-aux/snippet/c++defs.h \
+ $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+ $(top_srcdir)/build-aux/snippet/warn-on-use.h snprintf.c \
+ test-snprintf.c signature.h macros.h socket.c w32sock.h \
+ w32sock.h test-sockets.c test-stat.h test-stat.c signature.h \
+ macros.h test-stat-time.c macros.h nap.h stdalign.in.h \
+ test-stdalign.c macros.h test-stdbool.c test-stddef.c \
+ test-stdint.c test-stdio.c test-stdlib.c test-sys_wait.h \
+ test-strerror.c signature.h macros.h strerror_r.c \
+ test-strerror_r.c signature.h macros.h test-strftime.c \
+ macros.h test-striconv.c macros.h test-string.c test-strings.c \
+ test-strnlen.c zerosize-ptr.h signature.h macros.h \
+ test-strtoull.c signature.h macros.h test-strtoumax.c \
+ signature.h macros.h symlink.c test-symlink.h test-symlink.c \
+ signature.h macros.h sys_ioctl.in.h test-sys_ioctl.c \
+ sys_select.in.h test-sys_select.c signature.h sys_socket.in.h \
+ test-sys_socket.c test-sys_stat.c test-sys_time.c \
+ test-sys_types.c sys_uio.in.h test-sys_uio.c test-sys_wait.c \
+ test-sys_wait.h init.sh test-init.sh test-time.c \
+ test-timespec.c macros.h test-unistd.c \
+ unistr/test-u8-mbtoucr.c macros.h unistr/test-u8-uctomb.c \
+ macros.h uniwidth/test-uc_width.c uniwidth/test-uc_width2.c \
+ uniwidth/test-uc_width2.sh macros.h test-unsetenv.c \
+ signature.h macros.h test-update-copyright.sh \
+ test-vasnprintf.c macros.h test-vasprintf.c signature.h \
+ macros.h test-vc-list-files-git.sh test-vc-list-files-cvs.sh \
+ test-verify.c test-verify.sh test-version-etc.c \
+ test-version-etc.sh test-wchar.c test-wcrtomb.sh \
+ test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh \
+ test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh \
+ test-wcrtomb-w32-5.sh test-wcrtomb-w32.c signature.h macros.h \
+ wctob.c wctomb-impl.h wctomb.c test-wctype-h.c macros.h \
+ test-wcwidth.c signature.h macros.h test-xalloc-die.c \
+ test-xalloc-die.sh test-xstrtol.c test-xstrtoul.c \
+ test-xstrtol.sh test-xstrtoumax.c test-xstrtoumax.sh \
+ test-xvasprintf.c macros.h
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+BUILT_SOURCES = arpa/inet.h $(NETINET_IN_H) arg-nonnull.h c++defs.h \
+ unused-parameter.h warn-on-use.h $(STDALIGN_H) sys/ioctl.h \
+ sys/select.h sys/socket.h sys/uio.h
+SUFFIXES =
+
+# This test expects compilation of test-verify.c to fail, and
+# each time it fails, the makefile rule does not perform the usual
+# "mv -f $name.Tpo $name.po, so tell make clean to remove that file.
+MOSTLYCLEANFILES = core *.stackdump arpa/inet.h arpa/inet.h-t \
+ t-c-stack.tmp t-c-stack2.tmp netinet/in.h netinet/in.h-t \
+ arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \
+ unused-parameter.h unused-parameter.h-t warn-on-use.h \
+ warn-on-use.h-t stdalign.h stdalign.h-t sys/ioctl.h \
+ sys/ioctl.h-t sys/select.h sys/select.h-t sys/socket.h \
+ sys/socket.h-t sys/uio.h sys/uio.h-t .deps/test-verify.Tpo
+MOSTLYCLEANDIRS = arpa netinet sys sys sys sys
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+AM_CPPFLAGS = \
+ -D@gltests_WITNESS@=1 \
+ -I. -I$(srcdir) \
+ -I.. -I$(srcdir)/.. \
+ -I../lib -I$(srcdir)/../lib
+
+LDADD = libtests.a ../lib/libdiffutils.a libtests.a $(LIBTESTS_LIBDEPS)
+libtests_a_SOURCES = dtotimespec.c hash-pjw.h hash-pjw.c sockets.h \
+ sockets.c sys_socket.c timespec-add.c timespec-sub.c
+libtests_a_LIBADD = $(gltests_LIBOBJS)
+libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
+EXTRA_libtests_a_SOURCES = accept.c bind.c connect.c fdopen.c \
+ ftruncate.c getcwd-lgpl.c getpagesize.c inet_pton.c ioctl.c \
+ listen.c nanosleep.c perror.c pipe.c putenv.c select.c \
+ setlocale.c setsockopt.c sleep.c snprintf.c socket.c \
+ strerror_r.c symlink.c wctob.c wctomb.c
+AM_LIBTOOLFLAGS = --preserve-dup-deps
+test_accept_LDADD = $(LDADD) @LIBSOCKET@
+test_argmatch_LDADD = $(LDADD) @LIBINTL@
+test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@
+test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+test_dirname_LDADD = $(LDADD) @LIBINTL@
+test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_filenamecat_LDADD = $(LDADD) @LIBINTL@
+test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL)
+test_getopt_LDADD = $(LDADD) $(LIBINTL)
+test_iconv_LDADD = $(LDADD) @LIBICONV@
+test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@
+test_listen_LDADD = $(LDADD) @LIBSOCKET@
+test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@
+test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD)
+test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB)
+test_select_fd_LDADD = $(LDADD) @LIB_SELECT@
+test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@
+test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@
+test_sh_quote_LDADD = $(LDADD) @LIBINTL@
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(top_srcdir)/build-aux/snippet/_Noreturn.h
+ARG_NONNULL_H = arg-nonnull.h
+CXXDEFS_H = c++defs.h
+UNUSED_PARAMETER_H = unused-parameter.h
+WARN_ON_USE_H = warn-on-use.h
+test_sockets_LDADD = $(LDADD) @LIBSOCKET@
+test_stat_LDADD = $(LDADD) $(LIBINTL)
+test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+test_striconv_LDADD = $(LDADD) @LIBICONV@
+test_u8_mbtoucr_SOURCES = unistr/test-u8-mbtoucr.c
+test_u8_mbtoucr_LDADD = $(LDADD) $(LIBUNISTRING)
+test_u8_uctomb_SOURCES = unistr/test-u8-uctomb.c
+test_u8_uctomb_LDADD = $(LDADD) $(LIBUNISTRING)
+test_uc_width_SOURCES = uniwidth/test-uc_width.c
+test_uc_width_LDADD = $(LDADD) $(LIBUNISTRING)
+test_uc_width2_SOURCES = uniwidth/test-uc_width2.c
+test_uc_width2_LDADD = $(LDADD) $(LIBUNISTRING)
+test_version_etc_LDADD = $(LDADD) @LIBINTL@
+test_xalloc_die_LDADD = $(LDADD) @LIBINTL@
+test_xstrtol_LDADD = $(LDADD) @LIBINTL@
+test_xstrtoul_LDADD = $(LDADD) @LIBINTL@
+test_xstrtoumax_LDADD = $(LDADD) @LIBINTL@
+test_xvasprintf_LDADD = $(LDADD) @LIBINTL@
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(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) --foreign gnulib-tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign gnulib-tests/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;
+$(srcdir)/gnulib.mk $(am__empty):
+
+$(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-checkLIBRARIES:
+ -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES)
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libtests.a
+ $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libtests.a
+
+clean-checkPROGRAMS:
+ -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+test-accept$(EXEEXT): $(test_accept_OBJECTS) $(test_accept_DEPENDENCIES) $(EXTRA_test_accept_DEPENDENCIES)
+ @rm -f test-accept$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_accept_OBJECTS) $(test_accept_LDADD) $(LIBS)
+
+test-alloca-opt$(EXEEXT): $(test_alloca_opt_OBJECTS) $(test_alloca_opt_DEPENDENCIES) $(EXTRA_test_alloca_opt_DEPENDENCIES)
+ @rm -f test-alloca-opt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_alloca_opt_OBJECTS) $(test_alloca_opt_LDADD) $(LIBS)
+
+test-areadlink$(EXEEXT): $(test_areadlink_OBJECTS) $(test_areadlink_DEPENDENCIES) $(EXTRA_test_areadlink_DEPENDENCIES)
+ @rm -f test-areadlink$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_areadlink_OBJECTS) $(test_areadlink_LDADD) $(LIBS)
+
+test-argmatch$(EXEEXT): $(test_argmatch_OBJECTS) $(test_argmatch_DEPENDENCIES) $(EXTRA_test_argmatch_DEPENDENCIES)
+ @rm -f test-argmatch$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_argmatch_OBJECTS) $(test_argmatch_LDADD) $(LIBS)
+
+test-arpa_inet$(EXEEXT): $(test_arpa_inet_OBJECTS) $(test_arpa_inet_DEPENDENCIES) $(EXTRA_test_arpa_inet_DEPENDENCIES)
+ @rm -f test-arpa_inet$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_arpa_inet_OBJECTS) $(test_arpa_inet_LDADD) $(LIBS)
+
+test-binary-io$(EXEEXT): $(test_binary_io_OBJECTS) $(test_binary_io_DEPENDENCIES) $(EXTRA_test_binary_io_DEPENDENCIES)
+ @rm -f test-binary-io$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_binary_io_OBJECTS) $(test_binary_io_LDADD) $(LIBS)
+
+test-bind$(EXEEXT): $(test_bind_OBJECTS) $(test_bind_DEPENDENCIES) $(EXTRA_test_bind_DEPENDENCIES)
+ @rm -f test-bind$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bind_OBJECTS) $(test_bind_LDADD) $(LIBS)
+
+test-bitrotate$(EXEEXT): $(test_bitrotate_OBJECTS) $(test_bitrotate_DEPENDENCIES) $(EXTRA_test_bitrotate_DEPENDENCIES)
+ @rm -f test-bitrotate$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bitrotate_OBJECTS) $(test_bitrotate_LDADD) $(LIBS)
+
+test-btowc$(EXEEXT): $(test_btowc_OBJECTS) $(test_btowc_DEPENDENCIES) $(EXTRA_test_btowc_DEPENDENCIES)
+ @rm -f test-btowc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_btowc_OBJECTS) $(test_btowc_LDADD) $(LIBS)
+
+test-c-ctype$(EXEEXT): $(test_c_ctype_OBJECTS) $(test_c_ctype_DEPENDENCIES) $(EXTRA_test_c_ctype_DEPENDENCIES)
+ @rm -f test-c-ctype$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_c_ctype_OBJECTS) $(test_c_ctype_LDADD) $(LIBS)
+
+test-c-stack$(EXEEXT): $(test_c_stack_OBJECTS) $(test_c_stack_DEPENDENCIES) $(EXTRA_test_c_stack_DEPENDENCIES)
+ @rm -f test-c-stack$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_c_stack_OBJECTS) $(test_c_stack_LDADD) $(LIBS)
+
+test-c-strcasecmp$(EXEEXT): $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_DEPENDENCIES) $(EXTRA_test_c_strcasecmp_DEPENDENCIES)
+ @rm -f test-c-strcasecmp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_LDADD) $(LIBS)
+
+test-c-strncasecmp$(EXEEXT): $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_DEPENDENCIES) $(EXTRA_test_c_strncasecmp_DEPENDENCIES)
+ @rm -f test-c-strncasecmp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_LDADD) $(LIBS)
+
+test-close$(EXEEXT): $(test_close_OBJECTS) $(test_close_DEPENDENCIES) $(EXTRA_test_close_DEPENDENCIES)
+ @rm -f test-close$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_close_OBJECTS) $(test_close_LDADD) $(LIBS)
+
+test-connect$(EXEEXT): $(test_connect_OBJECTS) $(test_connect_DEPENDENCIES) $(EXTRA_test_connect_DEPENDENCIES)
+ @rm -f test-connect$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_connect_OBJECTS) $(test_connect_LDADD) $(LIBS)
+
+test-ctype$(EXEEXT): $(test_ctype_OBJECTS) $(test_ctype_DEPENDENCIES) $(EXTRA_test_ctype_DEPENDENCIES)
+ @rm -f test-ctype$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ctype_OBJECTS) $(test_ctype_LDADD) $(LIBS)
+
+test-dirname$(EXEEXT): $(test_dirname_OBJECTS) $(test_dirname_DEPENDENCIES) $(EXTRA_test_dirname_DEPENDENCIES)
+ @rm -f test-dirname$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_dirname_OBJECTS) $(test_dirname_LDADD) $(LIBS)
+
+test-dup2$(EXEEXT): $(test_dup2_OBJECTS) $(test_dup2_DEPENDENCIES) $(EXTRA_test_dup2_DEPENDENCIES)
+ @rm -f test-dup2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_dup2_OBJECTS) $(test_dup2_LDADD) $(LIBS)
+
+test-environ$(EXEEXT): $(test_environ_OBJECTS) $(test_environ_DEPENDENCIES) $(EXTRA_test_environ_DEPENDENCIES)
+ @rm -f test-environ$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_environ_OBJECTS) $(test_environ_LDADD) $(LIBS)
+
+test-errno$(EXEEXT): $(test_errno_OBJECTS) $(test_errno_DEPENDENCIES) $(EXTRA_test_errno_DEPENDENCIES)
+ @rm -f test-errno$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_errno_OBJECTS) $(test_errno_LDADD) $(LIBS)
+
+test-exclude$(EXEEXT): $(test_exclude_OBJECTS) $(test_exclude_DEPENDENCIES) $(EXTRA_test_exclude_DEPENDENCIES)
+ @rm -f test-exclude$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_exclude_OBJECTS) $(test_exclude_LDADD) $(LIBS)
+
+test-fcntl$(EXEEXT): $(test_fcntl_OBJECTS) $(test_fcntl_DEPENDENCIES) $(EXTRA_test_fcntl_DEPENDENCIES)
+ @rm -f test-fcntl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fcntl_OBJECTS) $(test_fcntl_LDADD) $(LIBS)
+
+test-fcntl-h$(EXEEXT): $(test_fcntl_h_OBJECTS) $(test_fcntl_h_DEPENDENCIES) $(EXTRA_test_fcntl_h_DEPENDENCIES)
+ @rm -f test-fcntl-h$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fcntl_h_OBJECTS) $(test_fcntl_h_LDADD) $(LIBS)
+
+test-fdopen$(EXEEXT): $(test_fdopen_OBJECTS) $(test_fdopen_DEPENDENCIES) $(EXTRA_test_fdopen_DEPENDENCIES)
+ @rm -f test-fdopen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fdopen_OBJECTS) $(test_fdopen_LDADD) $(LIBS)
+
+test-fgetc$(EXEEXT): $(test_fgetc_OBJECTS) $(test_fgetc_DEPENDENCIES) $(EXTRA_test_fgetc_DEPENDENCIES)
+ @rm -f test-fgetc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fgetc_OBJECTS) $(test_fgetc_LDADD) $(LIBS)
+
+test-filenamecat$(EXEEXT): $(test_filenamecat_OBJECTS) $(test_filenamecat_DEPENDENCIES) $(EXTRA_test_filenamecat_DEPENDENCIES)
+ @rm -f test-filenamecat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_filenamecat_OBJECTS) $(test_filenamecat_LDADD) $(LIBS)
+
+test-float$(EXEEXT): $(test_float_OBJECTS) $(test_float_DEPENDENCIES) $(EXTRA_test_float_DEPENDENCIES)
+ @rm -f test-float$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_float_OBJECTS) $(test_float_LDADD) $(LIBS)
+
+test-fnmatch$(EXEEXT): $(test_fnmatch_OBJECTS) $(test_fnmatch_DEPENDENCIES) $(EXTRA_test_fnmatch_DEPENDENCIES)
+ @rm -f test-fnmatch$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fnmatch_OBJECTS) $(test_fnmatch_LDADD) $(LIBS)
+
+test-fputc$(EXEEXT): $(test_fputc_OBJECTS) $(test_fputc_DEPENDENCIES) $(EXTRA_test_fputc_DEPENDENCIES)
+ @rm -f test-fputc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fputc_OBJECTS) $(test_fputc_LDADD) $(LIBS)
+
+test-fread$(EXEEXT): $(test_fread_OBJECTS) $(test_fread_DEPENDENCIES) $(EXTRA_test_fread_DEPENDENCIES)
+ @rm -f test-fread$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fread_OBJECTS) $(test_fread_LDADD) $(LIBS)
+
+test-freopen$(EXEEXT): $(test_freopen_OBJECTS) $(test_freopen_DEPENDENCIES) $(EXTRA_test_freopen_DEPENDENCIES)
+ @rm -f test-freopen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_freopen_OBJECTS) $(test_freopen_LDADD) $(LIBS)
+
+test-freopen-safer$(EXEEXT): $(test_freopen_safer_OBJECTS) $(test_freopen_safer_DEPENDENCIES) $(EXTRA_test_freopen_safer_DEPENDENCIES)
+ @rm -f test-freopen-safer$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_freopen_safer_OBJECTS) $(test_freopen_safer_LDADD) $(LIBS)
+
+test-fstat$(EXEEXT): $(test_fstat_OBJECTS) $(test_fstat_DEPENDENCIES) $(EXTRA_test_fstat_DEPENDENCIES)
+ @rm -f test-fstat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fstat_OBJECTS) $(test_fstat_LDADD) $(LIBS)
+
+test-ftruncate$(EXEEXT): $(test_ftruncate_OBJECTS) $(test_ftruncate_DEPENDENCIES) $(EXTRA_test_ftruncate_DEPENDENCIES)
+ @rm -f test-ftruncate$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ftruncate_OBJECTS) $(test_ftruncate_LDADD) $(LIBS)
+
+test-fwrite$(EXEEXT): $(test_fwrite_OBJECTS) $(test_fwrite_DEPENDENCIES) $(EXTRA_test_fwrite_DEPENDENCIES)
+ @rm -f test-fwrite$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_fwrite_OBJECTS) $(test_fwrite_LDADD) $(LIBS)
+
+test-getcwd-lgpl$(EXEEXT): $(test_getcwd_lgpl_OBJECTS) $(test_getcwd_lgpl_DEPENDENCIES) $(EXTRA_test_getcwd_lgpl_DEPENDENCIES)
+ @rm -f test-getcwd-lgpl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_getcwd_lgpl_OBJECTS) $(test_getcwd_lgpl_LDADD) $(LIBS)
+
+test-getdtablesize$(EXEEXT): $(test_getdtablesize_OBJECTS) $(test_getdtablesize_DEPENDENCIES) $(EXTRA_test_getdtablesize_DEPENDENCIES)
+ @rm -f test-getdtablesize$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_getdtablesize_OBJECTS) $(test_getdtablesize_LDADD) $(LIBS)
+
+test-getopt$(EXEEXT): $(test_getopt_OBJECTS) $(test_getopt_DEPENDENCIES) $(EXTRA_test_getopt_DEPENDENCIES)
+ @rm -f test-getopt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_getopt_OBJECTS) $(test_getopt_LDADD) $(LIBS)
+
+test-gettimeofday$(EXEEXT): $(test_gettimeofday_OBJECTS) $(test_gettimeofday_DEPENDENCIES) $(EXTRA_test_gettimeofday_DEPENDENCIES)
+ @rm -f test-gettimeofday$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_gettimeofday_OBJECTS) $(test_gettimeofday_LDADD) $(LIBS)
+
+test-hash$(EXEEXT): $(test_hash_OBJECTS) $(test_hash_DEPENDENCIES) $(EXTRA_test_hash_DEPENDENCIES)
+ @rm -f test-hash$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_hash_OBJECTS) $(test_hash_LDADD) $(LIBS)
+
+test-iconv$(EXEEXT): $(test_iconv_OBJECTS) $(test_iconv_DEPENDENCIES) $(EXTRA_test_iconv_DEPENDENCIES)
+ @rm -f test-iconv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_iconv_OBJECTS) $(test_iconv_LDADD) $(LIBS)
+
+test-iconv-h$(EXEEXT): $(test_iconv_h_OBJECTS) $(test_iconv_h_DEPENDENCIES) $(EXTRA_test_iconv_h_DEPENDENCIES)
+ @rm -f test-iconv-h$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_iconv_h_OBJECTS) $(test_iconv_h_LDADD) $(LIBS)
+
+test-ignore-value$(EXEEXT): $(test_ignore_value_OBJECTS) $(test_ignore_value_DEPENDENCIES) $(EXTRA_test_ignore_value_DEPENDENCIES)
+ @rm -f test-ignore-value$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ignore_value_OBJECTS) $(test_ignore_value_LDADD) $(LIBS)
+
+test-inet_pton$(EXEEXT): $(test_inet_pton_OBJECTS) $(test_inet_pton_DEPENDENCIES) $(EXTRA_test_inet_pton_DEPENDENCIES)
+ @rm -f test-inet_pton$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_inet_pton_OBJECTS) $(test_inet_pton_LDADD) $(LIBS)
+
+test-intprops$(EXEEXT): $(test_intprops_OBJECTS) $(test_intprops_DEPENDENCIES) $(EXTRA_test_intprops_DEPENDENCIES)
+ @rm -f test-intprops$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_intprops_OBJECTS) $(test_intprops_LDADD) $(LIBS)
+
+test-inttostr$(EXEEXT): $(test_inttostr_OBJECTS) $(test_inttostr_DEPENDENCIES) $(EXTRA_test_inttostr_DEPENDENCIES)
+ @rm -f test-inttostr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_inttostr_OBJECTS) $(test_inttostr_LDADD) $(LIBS)
+
+test-inttypes$(EXEEXT): $(test_inttypes_OBJECTS) $(test_inttypes_DEPENDENCIES) $(EXTRA_test_inttypes_DEPENDENCIES)
+ @rm -f test-inttypes$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_inttypes_OBJECTS) $(test_inttypes_LDADD) $(LIBS)
+
+test-ioctl$(EXEEXT): $(test_ioctl_OBJECTS) $(test_ioctl_DEPENDENCIES) $(EXTRA_test_ioctl_DEPENDENCIES)
+ @rm -f test-ioctl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ioctl_OBJECTS) $(test_ioctl_LDADD) $(LIBS)
+
+test-isblank$(EXEEXT): $(test_isblank_OBJECTS) $(test_isblank_DEPENDENCIES) $(EXTRA_test_isblank_DEPENDENCIES)
+ @rm -f test-isblank$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_isblank_OBJECTS) $(test_isblank_LDADD) $(LIBS)
+
+test-iswblank$(EXEEXT): $(test_iswblank_OBJECTS) $(test_iswblank_DEPENDENCIES) $(EXTRA_test_iswblank_DEPENDENCIES)
+ @rm -f test-iswblank$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_iswblank_OBJECTS) $(test_iswblank_LDADD) $(LIBS)
+
+test-langinfo$(EXEEXT): $(test_langinfo_OBJECTS) $(test_langinfo_DEPENDENCIES) $(EXTRA_test_langinfo_DEPENDENCIES)
+ @rm -f test-langinfo$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_langinfo_OBJECTS) $(test_langinfo_LDADD) $(LIBS)
+
+test-listen$(EXEEXT): $(test_listen_OBJECTS) $(test_listen_DEPENDENCIES) $(EXTRA_test_listen_DEPENDENCIES)
+ @rm -f test-listen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_listen_OBJECTS) $(test_listen_LDADD) $(LIBS)
+
+test-locale$(EXEEXT): $(test_locale_OBJECTS) $(test_locale_DEPENDENCIES) $(EXTRA_test_locale_DEPENDENCIES)
+ @rm -f test-locale$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_locale_OBJECTS) $(test_locale_LDADD) $(LIBS)
+
+test-localeconv$(EXEEXT): $(test_localeconv_OBJECTS) $(test_localeconv_DEPENDENCIES) $(EXTRA_test_localeconv_DEPENDENCIES)
+ @rm -f test-localeconv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_localeconv_OBJECTS) $(test_localeconv_LDADD) $(LIBS)
+
+test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) $(EXTRA_test_lstat_DEPENDENCIES)
+ @rm -f test-lstat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_lstat_OBJECTS) $(test_lstat_LDADD) $(LIBS)
+
+test-malloca$(EXEEXT): $(test_malloca_OBJECTS) $(test_malloca_DEPENDENCIES) $(EXTRA_test_malloca_DEPENDENCIES)
+ @rm -f test-malloca$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_malloca_OBJECTS) $(test_malloca_LDADD) $(LIBS)
+
+test-mbrtowc$(EXEEXT): $(test_mbrtowc_OBJECTS) $(test_mbrtowc_DEPENDENCIES) $(EXTRA_test_mbrtowc_DEPENDENCIES)
+ @rm -f test-mbrtowc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbrtowc_OBJECTS) $(test_mbrtowc_LDADD) $(LIBS)
+
+test-mbrtowc-w32$(EXEEXT): $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_DEPENDENCIES) $(EXTRA_test_mbrtowc_w32_DEPENDENCIES)
+ @rm -f test-mbrtowc-w32$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_LDADD) $(LIBS)
+
+test-mbscasecmp$(EXEEXT): $(test_mbscasecmp_OBJECTS) $(test_mbscasecmp_DEPENDENCIES) $(EXTRA_test_mbscasecmp_DEPENDENCIES)
+ @rm -f test-mbscasecmp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbscasecmp_OBJECTS) $(test_mbscasecmp_LDADD) $(LIBS)
+
+test-mbsinit$(EXEEXT): $(test_mbsinit_OBJECTS) $(test_mbsinit_DEPENDENCIES) $(EXTRA_test_mbsinit_DEPENDENCIES)
+ @rm -f test-mbsinit$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbsinit_OBJECTS) $(test_mbsinit_LDADD) $(LIBS)
+
+test-mbsrtowcs$(EXEEXT): $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_DEPENDENCIES) $(EXTRA_test_mbsrtowcs_DEPENDENCIES)
+ @rm -f test-mbsrtowcs$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_LDADD) $(LIBS)
+
+test-mbsstr1$(EXEEXT): $(test_mbsstr1_OBJECTS) $(test_mbsstr1_DEPENDENCIES) $(EXTRA_test_mbsstr1_DEPENDENCIES)
+ @rm -f test-mbsstr1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbsstr1_OBJECTS) $(test_mbsstr1_LDADD) $(LIBS)
+
+test-mbsstr2$(EXEEXT): $(test_mbsstr2_OBJECTS) $(test_mbsstr2_DEPENDENCIES) $(EXTRA_test_mbsstr2_DEPENDENCIES)
+ @rm -f test-mbsstr2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbsstr2_OBJECTS) $(test_mbsstr2_LDADD) $(LIBS)
+
+test-mbsstr3$(EXEEXT): $(test_mbsstr3_OBJECTS) $(test_mbsstr3_DEPENDENCIES) $(EXTRA_test_mbsstr3_DEPENDENCIES)
+ @rm -f test-mbsstr3$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mbsstr3_OBJECTS) $(test_mbsstr3_LDADD) $(LIBS)
+
+test-memchr$(EXEEXT): $(test_memchr_OBJECTS) $(test_memchr_DEPENDENCIES) $(EXTRA_test_memchr_DEPENDENCIES)
+ @rm -f test-memchr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_memchr_OBJECTS) $(test_memchr_LDADD) $(LIBS)
+
+test-nanosleep$(EXEEXT): $(test_nanosleep_OBJECTS) $(test_nanosleep_DEPENDENCIES) $(EXTRA_test_nanosleep_DEPENDENCIES)
+ @rm -f test-nanosleep$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_nanosleep_OBJECTS) $(test_nanosleep_LDADD) $(LIBS)
+
+test-netinet_in$(EXEEXT): $(test_netinet_in_OBJECTS) $(test_netinet_in_DEPENDENCIES) $(EXTRA_test_netinet_in_DEPENDENCIES)
+ @rm -f test-netinet_in$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_netinet_in_OBJECTS) $(test_netinet_in_LDADD) $(LIBS)
+
+test-nl_langinfo$(EXEEXT): $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_DEPENDENCIES) $(EXTRA_test_nl_langinfo_DEPENDENCIES)
+ @rm -f test-nl_langinfo$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_LDADD) $(LIBS)
+
+test-open$(EXEEXT): $(test_open_OBJECTS) $(test_open_DEPENDENCIES) $(EXTRA_test_open_DEPENDENCIES)
+ @rm -f test-open$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_open_OBJECTS) $(test_open_LDADD) $(LIBS)
+
+test-pathmax$(EXEEXT): $(test_pathmax_OBJECTS) $(test_pathmax_DEPENDENCIES) $(EXTRA_test_pathmax_DEPENDENCIES)
+ @rm -f test-pathmax$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_pathmax_OBJECTS) $(test_pathmax_LDADD) $(LIBS)
+
+test-perror$(EXEEXT): $(test_perror_OBJECTS) $(test_perror_DEPENDENCIES) $(EXTRA_test_perror_DEPENDENCIES)
+ @rm -f test-perror$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_perror_OBJECTS) $(test_perror_LDADD) $(LIBS)
+
+test-perror2$(EXEEXT): $(test_perror2_OBJECTS) $(test_perror2_DEPENDENCIES) $(EXTRA_test_perror2_DEPENDENCIES)
+ @rm -f test-perror2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_perror2_OBJECTS) $(test_perror2_LDADD) $(LIBS)
+
+test-pipe$(EXEEXT): $(test_pipe_OBJECTS) $(test_pipe_DEPENDENCIES) $(EXTRA_test_pipe_DEPENDENCIES)
+ @rm -f test-pipe$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_pipe_OBJECTS) $(test_pipe_LDADD) $(LIBS)
+
+test-quotearg-simple$(EXEEXT): $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_DEPENDENCIES) $(EXTRA_test_quotearg_simple_DEPENDENCIES)
+ @rm -f test-quotearg-simple$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_LDADD) $(LIBS)
+
+test-raise$(EXEEXT): $(test_raise_OBJECTS) $(test_raise_DEPENDENCIES) $(EXTRA_test_raise_DEPENDENCIES)
+ @rm -f test-raise$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_raise_OBJECTS) $(test_raise_LDADD) $(LIBS)
+
+test-rawmemchr$(EXEEXT): $(test_rawmemchr_OBJECTS) $(test_rawmemchr_DEPENDENCIES) $(EXTRA_test_rawmemchr_DEPENDENCIES)
+ @rm -f test-rawmemchr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_rawmemchr_OBJECTS) $(test_rawmemchr_LDADD) $(LIBS)
+
+test-readlink$(EXEEXT): $(test_readlink_OBJECTS) $(test_readlink_DEPENDENCIES) $(EXTRA_test_readlink_DEPENDENCIES)
+ @rm -f test-readlink$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_readlink_OBJECTS) $(test_readlink_LDADD) $(LIBS)
+
+test-regex$(EXEEXT): $(test_regex_OBJECTS) $(test_regex_DEPENDENCIES) $(EXTRA_test_regex_DEPENDENCIES)
+ @rm -f test-regex$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_regex_OBJECTS) $(test_regex_LDADD) $(LIBS)
+
+test-select$(EXEEXT): $(test_select_OBJECTS) $(test_select_DEPENDENCIES) $(EXTRA_test_select_DEPENDENCIES)
+ @rm -f test-select$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_select_OBJECTS) $(test_select_LDADD) $(LIBS)
+
+test-select-fd$(EXEEXT): $(test_select_fd_OBJECTS) $(test_select_fd_DEPENDENCIES) $(EXTRA_test_select_fd_DEPENDENCIES)
+ @rm -f test-select-fd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_select_fd_OBJECTS) $(test_select_fd_LDADD) $(LIBS)
+
+test-select-stdin$(EXEEXT): $(test_select_stdin_OBJECTS) $(test_select_stdin_DEPENDENCIES) $(EXTRA_test_select_stdin_DEPENDENCIES)
+ @rm -f test-select-stdin$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_select_stdin_OBJECTS) $(test_select_stdin_LDADD) $(LIBS)
+
+test-setenv$(EXEEXT): $(test_setenv_OBJECTS) $(test_setenv_DEPENDENCIES) $(EXTRA_test_setenv_DEPENDENCIES)
+ @rm -f test-setenv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_setenv_OBJECTS) $(test_setenv_LDADD) $(LIBS)
+
+test-setlocale1$(EXEEXT): $(test_setlocale1_OBJECTS) $(test_setlocale1_DEPENDENCIES) $(EXTRA_test_setlocale1_DEPENDENCIES)
+ @rm -f test-setlocale1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_setlocale1_OBJECTS) $(test_setlocale1_LDADD) $(LIBS)
+
+test-setlocale2$(EXEEXT): $(test_setlocale2_OBJECTS) $(test_setlocale2_DEPENDENCIES) $(EXTRA_test_setlocale2_DEPENDENCIES)
+ @rm -f test-setlocale2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_setlocale2_OBJECTS) $(test_setlocale2_LDADD) $(LIBS)
+
+test-setsockopt$(EXEEXT): $(test_setsockopt_OBJECTS) $(test_setsockopt_DEPENDENCIES) $(EXTRA_test_setsockopt_DEPENDENCIES)
+ @rm -f test-setsockopt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_setsockopt_OBJECTS) $(test_setsockopt_LDADD) $(LIBS)
+
+test-sh-quote$(EXEEXT): $(test_sh_quote_OBJECTS) $(test_sh_quote_DEPENDENCIES) $(EXTRA_test_sh_quote_DEPENDENCIES)
+ @rm -f test-sh-quote$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sh_quote_OBJECTS) $(test_sh_quote_LDADD) $(LIBS)
+
+test-sigaction$(EXEEXT): $(test_sigaction_OBJECTS) $(test_sigaction_DEPENDENCIES) $(EXTRA_test_sigaction_DEPENDENCIES)
+ @rm -f test-sigaction$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sigaction_OBJECTS) $(test_sigaction_LDADD) $(LIBS)
+
+test-signal-h$(EXEEXT): $(test_signal_h_OBJECTS) $(test_signal_h_DEPENDENCIES) $(EXTRA_test_signal_h_DEPENDENCIES)
+ @rm -f test-signal-h$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_signal_h_OBJECTS) $(test_signal_h_LDADD) $(LIBS)
+
+test-sigprocmask$(EXEEXT): $(test_sigprocmask_OBJECTS) $(test_sigprocmask_DEPENDENCIES) $(EXTRA_test_sigprocmask_DEPENDENCIES)
+ @rm -f test-sigprocmask$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sigprocmask_OBJECTS) $(test_sigprocmask_LDADD) $(LIBS)
+
+test-sleep$(EXEEXT): $(test_sleep_OBJECTS) $(test_sleep_DEPENDENCIES) $(EXTRA_test_sleep_DEPENDENCIES)
+ @rm -f test-sleep$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sleep_OBJECTS) $(test_sleep_LDADD) $(LIBS)
+
+test-snprintf$(EXEEXT): $(test_snprintf_OBJECTS) $(test_snprintf_DEPENDENCIES) $(EXTRA_test_snprintf_DEPENDENCIES)
+ @rm -f test-snprintf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_snprintf_OBJECTS) $(test_snprintf_LDADD) $(LIBS)
+
+test-sockets$(EXEEXT): $(test_sockets_OBJECTS) $(test_sockets_DEPENDENCIES) $(EXTRA_test_sockets_DEPENDENCIES)
+ @rm -f test-sockets$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sockets_OBJECTS) $(test_sockets_LDADD) $(LIBS)
+
+test-stat$(EXEEXT): $(test_stat_OBJECTS) $(test_stat_DEPENDENCIES) $(EXTRA_test_stat_DEPENDENCIES)
+ @rm -f test-stat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stat_OBJECTS) $(test_stat_LDADD) $(LIBS)
+
+test-stat-time$(EXEEXT): $(test_stat_time_OBJECTS) $(test_stat_time_DEPENDENCIES) $(EXTRA_test_stat_time_DEPENDENCIES)
+ @rm -f test-stat-time$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stat_time_OBJECTS) $(test_stat_time_LDADD) $(LIBS)
+
+test-stdalign$(EXEEXT): $(test_stdalign_OBJECTS) $(test_stdalign_DEPENDENCIES) $(EXTRA_test_stdalign_DEPENDENCIES)
+ @rm -f test-stdalign$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stdalign_OBJECTS) $(test_stdalign_LDADD) $(LIBS)
+
+test-stdbool$(EXEEXT): $(test_stdbool_OBJECTS) $(test_stdbool_DEPENDENCIES) $(EXTRA_test_stdbool_DEPENDENCIES)
+ @rm -f test-stdbool$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stdbool_OBJECTS) $(test_stdbool_LDADD) $(LIBS)
+
+test-stddef$(EXEEXT): $(test_stddef_OBJECTS) $(test_stddef_DEPENDENCIES) $(EXTRA_test_stddef_DEPENDENCIES)
+ @rm -f test-stddef$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stddef_OBJECTS) $(test_stddef_LDADD) $(LIBS)
+
+test-stdint$(EXEEXT): $(test_stdint_OBJECTS) $(test_stdint_DEPENDENCIES) $(EXTRA_test_stdint_DEPENDENCIES)
+ @rm -f test-stdint$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stdint_OBJECTS) $(test_stdint_LDADD) $(LIBS)
+
+test-stdio$(EXEEXT): $(test_stdio_OBJECTS) $(test_stdio_DEPENDENCIES) $(EXTRA_test_stdio_DEPENDENCIES)
+ @rm -f test-stdio$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stdio_OBJECTS) $(test_stdio_LDADD) $(LIBS)
+
+test-stdlib$(EXEEXT): $(test_stdlib_OBJECTS) $(test_stdlib_DEPENDENCIES) $(EXTRA_test_stdlib_DEPENDENCIES)
+ @rm -f test-stdlib$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_stdlib_OBJECTS) $(test_stdlib_LDADD) $(LIBS)
+
+test-strerror$(EXEEXT): $(test_strerror_OBJECTS) $(test_strerror_DEPENDENCIES) $(EXTRA_test_strerror_DEPENDENCIES)
+ @rm -f test-strerror$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strerror_OBJECTS) $(test_strerror_LDADD) $(LIBS)
+
+test-strerror_r$(EXEEXT): $(test_strerror_r_OBJECTS) $(test_strerror_r_DEPENDENCIES) $(EXTRA_test_strerror_r_DEPENDENCIES)
+ @rm -f test-strerror_r$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strerror_r_OBJECTS) $(test_strerror_r_LDADD) $(LIBS)
+
+test-strftime$(EXEEXT): $(test_strftime_OBJECTS) $(test_strftime_DEPENDENCIES) $(EXTRA_test_strftime_DEPENDENCIES)
+ @rm -f test-strftime$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strftime_OBJECTS) $(test_strftime_LDADD) $(LIBS)
+
+test-striconv$(EXEEXT): $(test_striconv_OBJECTS) $(test_striconv_DEPENDENCIES) $(EXTRA_test_striconv_DEPENDENCIES)
+ @rm -f test-striconv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_striconv_OBJECTS) $(test_striconv_LDADD) $(LIBS)
+
+test-string$(EXEEXT): $(test_string_OBJECTS) $(test_string_DEPENDENCIES) $(EXTRA_test_string_DEPENDENCIES)
+ @rm -f test-string$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_string_OBJECTS) $(test_string_LDADD) $(LIBS)
+
+test-strings$(EXEEXT): $(test_strings_OBJECTS) $(test_strings_DEPENDENCIES) $(EXTRA_test_strings_DEPENDENCIES)
+ @rm -f test-strings$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strings_OBJECTS) $(test_strings_LDADD) $(LIBS)
+
+test-strnlen$(EXEEXT): $(test_strnlen_OBJECTS) $(test_strnlen_DEPENDENCIES) $(EXTRA_test_strnlen_DEPENDENCIES)
+ @rm -f test-strnlen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strnlen_OBJECTS) $(test_strnlen_LDADD) $(LIBS)
+
+test-strtoull$(EXEEXT): $(test_strtoull_OBJECTS) $(test_strtoull_DEPENDENCIES) $(EXTRA_test_strtoull_DEPENDENCIES)
+ @rm -f test-strtoull$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strtoull_OBJECTS) $(test_strtoull_LDADD) $(LIBS)
+
+test-strtoumax$(EXEEXT): $(test_strtoumax_OBJECTS) $(test_strtoumax_DEPENDENCIES) $(EXTRA_test_strtoumax_DEPENDENCIES)
+ @rm -f test-strtoumax$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_strtoumax_OBJECTS) $(test_strtoumax_LDADD) $(LIBS)
+
+test-symlink$(EXEEXT): $(test_symlink_OBJECTS) $(test_symlink_DEPENDENCIES) $(EXTRA_test_symlink_DEPENDENCIES)
+ @rm -f test-symlink$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_symlink_OBJECTS) $(test_symlink_LDADD) $(LIBS)
+
+test-sys_ioctl$(EXEEXT): $(test_sys_ioctl_OBJECTS) $(test_sys_ioctl_DEPENDENCIES) $(EXTRA_test_sys_ioctl_DEPENDENCIES)
+ @rm -f test-sys_ioctl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_ioctl_OBJECTS) $(test_sys_ioctl_LDADD) $(LIBS)
+
+test-sys_select$(EXEEXT): $(test_sys_select_OBJECTS) $(test_sys_select_DEPENDENCIES) $(EXTRA_test_sys_select_DEPENDENCIES)
+ @rm -f test-sys_select$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_select_OBJECTS) $(test_sys_select_LDADD) $(LIBS)
+
+test-sys_socket$(EXEEXT): $(test_sys_socket_OBJECTS) $(test_sys_socket_DEPENDENCIES) $(EXTRA_test_sys_socket_DEPENDENCIES)
+ @rm -f test-sys_socket$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_socket_OBJECTS) $(test_sys_socket_LDADD) $(LIBS)
+
+test-sys_stat$(EXEEXT): $(test_sys_stat_OBJECTS) $(test_sys_stat_DEPENDENCIES) $(EXTRA_test_sys_stat_DEPENDENCIES)
+ @rm -f test-sys_stat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_stat_OBJECTS) $(test_sys_stat_LDADD) $(LIBS)
+
+test-sys_time$(EXEEXT): $(test_sys_time_OBJECTS) $(test_sys_time_DEPENDENCIES) $(EXTRA_test_sys_time_DEPENDENCIES)
+ @rm -f test-sys_time$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_time_OBJECTS) $(test_sys_time_LDADD) $(LIBS)
+
+test-sys_types$(EXEEXT): $(test_sys_types_OBJECTS) $(test_sys_types_DEPENDENCIES) $(EXTRA_test_sys_types_DEPENDENCIES)
+ @rm -f test-sys_types$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_types_OBJECTS) $(test_sys_types_LDADD) $(LIBS)
+
+test-sys_uio$(EXEEXT): $(test_sys_uio_OBJECTS) $(test_sys_uio_DEPENDENCIES) $(EXTRA_test_sys_uio_DEPENDENCIES)
+ @rm -f test-sys_uio$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_uio_OBJECTS) $(test_sys_uio_LDADD) $(LIBS)
+
+test-sys_wait$(EXEEXT): $(test_sys_wait_OBJECTS) $(test_sys_wait_DEPENDENCIES) $(EXTRA_test_sys_wait_DEPENDENCIES)
+ @rm -f test-sys_wait$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_sys_wait_OBJECTS) $(test_sys_wait_LDADD) $(LIBS)
+
+test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) $(EXTRA_test_time_DEPENDENCIES)
+ @rm -f test-time$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_time_OBJECTS) $(test_time_LDADD) $(LIBS)
+
+test-timespec$(EXEEXT): $(test_timespec_OBJECTS) $(test_timespec_DEPENDENCIES) $(EXTRA_test_timespec_DEPENDENCIES)
+ @rm -f test-timespec$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_timespec_OBJECTS) $(test_timespec_LDADD) $(LIBS)
+unistr/$(am__dirstamp):
+ @$(MKDIR_P) unistr
+ @: > unistr/$(am__dirstamp)
+unistr/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) unistr/$(DEPDIR)
+ @: > unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/test-u8-mbtoucr.$(OBJEXT): unistr/$(am__dirstamp) \
+ unistr/$(DEPDIR)/$(am__dirstamp)
+
+test-u8-mbtoucr$(EXEEXT): $(test_u8_mbtoucr_OBJECTS) $(test_u8_mbtoucr_DEPENDENCIES) $(EXTRA_test_u8_mbtoucr_DEPENDENCIES)
+ @rm -f test-u8-mbtoucr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_u8_mbtoucr_OBJECTS) $(test_u8_mbtoucr_LDADD) $(LIBS)
+unistr/test-u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \
+ unistr/$(DEPDIR)/$(am__dirstamp)
+
+test-u8-uctomb$(EXEEXT): $(test_u8_uctomb_OBJECTS) $(test_u8_uctomb_DEPENDENCIES) $(EXTRA_test_u8_uctomb_DEPENDENCIES)
+ @rm -f test-u8-uctomb$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_u8_uctomb_OBJECTS) $(test_u8_uctomb_LDADD) $(LIBS)
+uniwidth/$(am__dirstamp):
+ @$(MKDIR_P) uniwidth
+ @: > uniwidth/$(am__dirstamp)
+uniwidth/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) uniwidth/$(DEPDIR)
+ @: > uniwidth/$(DEPDIR)/$(am__dirstamp)
+uniwidth/test-uc_width.$(OBJEXT): uniwidth/$(am__dirstamp) \
+ uniwidth/$(DEPDIR)/$(am__dirstamp)
+
+test-uc_width$(EXEEXT): $(test_uc_width_OBJECTS) $(test_uc_width_DEPENDENCIES) $(EXTRA_test_uc_width_DEPENDENCIES)
+ @rm -f test-uc_width$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_uc_width_OBJECTS) $(test_uc_width_LDADD) $(LIBS)
+uniwidth/test-uc_width2.$(OBJEXT): uniwidth/$(am__dirstamp) \
+ uniwidth/$(DEPDIR)/$(am__dirstamp)
+
+test-uc_width2$(EXEEXT): $(test_uc_width2_OBJECTS) $(test_uc_width2_DEPENDENCIES) $(EXTRA_test_uc_width2_DEPENDENCIES)
+ @rm -f test-uc_width2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_uc_width2_OBJECTS) $(test_uc_width2_LDADD) $(LIBS)
+
+test-unistd$(EXEEXT): $(test_unistd_OBJECTS) $(test_unistd_DEPENDENCIES) $(EXTRA_test_unistd_DEPENDENCIES)
+ @rm -f test-unistd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_unistd_OBJECTS) $(test_unistd_LDADD) $(LIBS)
+
+test-unsetenv$(EXEEXT): $(test_unsetenv_OBJECTS) $(test_unsetenv_DEPENDENCIES) $(EXTRA_test_unsetenv_DEPENDENCIES)
+ @rm -f test-unsetenv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_unsetenv_OBJECTS) $(test_unsetenv_LDADD) $(LIBS)
+
+test-vasnprintf$(EXEEXT): $(test_vasnprintf_OBJECTS) $(test_vasnprintf_DEPENDENCIES) $(EXTRA_test_vasnprintf_DEPENDENCIES)
+ @rm -f test-vasnprintf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_vasnprintf_OBJECTS) $(test_vasnprintf_LDADD) $(LIBS)
+
+test-vasprintf$(EXEEXT): $(test_vasprintf_OBJECTS) $(test_vasprintf_DEPENDENCIES) $(EXTRA_test_vasprintf_DEPENDENCIES)
+ @rm -f test-vasprintf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_vasprintf_OBJECTS) $(test_vasprintf_LDADD) $(LIBS)
+
+test-verify$(EXEEXT): $(test_verify_OBJECTS) $(test_verify_DEPENDENCIES) $(EXTRA_test_verify_DEPENDENCIES)
+ @rm -f test-verify$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_verify_OBJECTS) $(test_verify_LDADD) $(LIBS)
+
+test-version-etc$(EXEEXT): $(test_version_etc_OBJECTS) $(test_version_etc_DEPENDENCIES) $(EXTRA_test_version_etc_DEPENDENCIES)
+ @rm -f test-version-etc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_version_etc_OBJECTS) $(test_version_etc_LDADD) $(LIBS)
+
+test-wchar$(EXEEXT): $(test_wchar_OBJECTS) $(test_wchar_DEPENDENCIES) $(EXTRA_test_wchar_DEPENDENCIES)
+ @rm -f test-wchar$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wchar_OBJECTS) $(test_wchar_LDADD) $(LIBS)
+
+test-wcrtomb$(EXEEXT): $(test_wcrtomb_OBJECTS) $(test_wcrtomb_DEPENDENCIES) $(EXTRA_test_wcrtomb_DEPENDENCIES)
+ @rm -f test-wcrtomb$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wcrtomb_OBJECTS) $(test_wcrtomb_LDADD) $(LIBS)
+
+test-wcrtomb-w32$(EXEEXT): $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_DEPENDENCIES) $(EXTRA_test_wcrtomb_w32_DEPENDENCIES)
+ @rm -f test-wcrtomb-w32$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_LDADD) $(LIBS)
+
+test-wctype-h$(EXEEXT): $(test_wctype_h_OBJECTS) $(test_wctype_h_DEPENDENCIES) $(EXTRA_test_wctype_h_DEPENDENCIES)
+ @rm -f test-wctype-h$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wctype_h_OBJECTS) $(test_wctype_h_LDADD) $(LIBS)
+
+test-wcwidth$(EXEEXT): $(test_wcwidth_OBJECTS) $(test_wcwidth_DEPENDENCIES) $(EXTRA_test_wcwidth_DEPENDENCIES)
+ @rm -f test-wcwidth$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wcwidth_OBJECTS) $(test_wcwidth_LDADD) $(LIBS)
+
+test-xalloc-die$(EXEEXT): $(test_xalloc_die_OBJECTS) $(test_xalloc_die_DEPENDENCIES) $(EXTRA_test_xalloc_die_DEPENDENCIES)
+ @rm -f test-xalloc-die$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_xalloc_die_OBJECTS) $(test_xalloc_die_LDADD) $(LIBS)
+
+test-xstrtol$(EXEEXT): $(test_xstrtol_OBJECTS) $(test_xstrtol_DEPENDENCIES) $(EXTRA_test_xstrtol_DEPENDENCIES)
+ @rm -f test-xstrtol$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_xstrtol_OBJECTS) $(test_xstrtol_LDADD) $(LIBS)
+
+test-xstrtoul$(EXEEXT): $(test_xstrtoul_OBJECTS) $(test_xstrtoul_DEPENDENCIES) $(EXTRA_test_xstrtoul_DEPENDENCIES)
+ @rm -f test-xstrtoul$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_xstrtoul_OBJECTS) $(test_xstrtoul_LDADD) $(LIBS)
+
+test-xstrtoumax$(EXEEXT): $(test_xstrtoumax_OBJECTS) $(test_xstrtoumax_DEPENDENCIES) $(EXTRA_test_xstrtoumax_DEPENDENCIES)
+ @rm -f test-xstrtoumax$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_xstrtoumax_OBJECTS) $(test_xstrtoumax_LDADD) $(LIBS)
+
+test-xvasprintf$(EXEEXT): $(test_xvasprintf_OBJECTS) $(test_xvasprintf_DEPENDENCIES) $(EXTRA_test_xvasprintf_DEPENDENCIES)
+ @rm -f test-xvasprintf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_xvasprintf_OBJECTS) $(test_xvasprintf_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f unistr/*.$(OBJEXT)
+ -rm -f uniwidth/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bind.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpagesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-pjw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setlocale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setsockopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockets.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror_r.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys_socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-accept.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alloca-opt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-areadlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-argmatch.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-arpa_inet.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-binary-io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bind.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bitrotate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-btowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-ctype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-stack.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strcasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strncasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-connect.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-environ.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-exclude.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fdopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fgetc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-filenamecat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fnmatch.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fputc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freopen-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftruncate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fwrite.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getcwd-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getdtablesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettimeofday.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ignore-value.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inet_pton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ioctl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iswblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-listen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localeconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-malloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc-w32.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbscasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsinit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsrtowcs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nanosleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-netinet_in.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pathmax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quotearg-simple.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-raise.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rawmemchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-readlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-regex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-fd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-stdin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setsockopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sh-quote.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigaction.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigprocmask.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-snprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sockets.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdalign.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror_r.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strftime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-striconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strings.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strnlen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtoull.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtoumax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-symlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_ioctl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_uio.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timespec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unsetenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-version-etc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb-w32.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcwidth.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xalloc-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xstrtol.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xstrtoul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xstrtoumax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xvasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec-add.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec-sub.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctob.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/test-u8-mbtoucr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/test-u8-uctomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/test-uc_width.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/test-uc_width2.Po@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)$(am__set_depbase) && \
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $<; \
+@am__fastdepCC_TRUE@ if test $$? = 0; then $(am__mv) $$depbase.Tpo $$depbase.Po; \
+@am__fastdepCC_TRUE@ else rm -f $$depbase.Tpo; false; fi
+@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)$(am__set_depbase) && \
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $$($(CYGPATH_W) $<); \
+@am__fastdepCC_TRUE@ if test $$? = 0; then $(am__mv) $$depbase.Tpo $$depbase.Po; \
+@am__fastdepCC_TRUE@ else rm -f $$depbase.Tpo; false; fi
+@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) $<)
+
+# 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
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_LIBRARIES) $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+test-accept.log: test-accept$(EXEEXT)
+ @p='test-accept$(EXEEXT)'; \
+ b='test-accept'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-alloca-opt.log: test-alloca-opt$(EXEEXT)
+ @p='test-alloca-opt$(EXEEXT)'; \
+ b='test-alloca-opt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-areadlink.log: test-areadlink$(EXEEXT)
+ @p='test-areadlink$(EXEEXT)'; \
+ b='test-areadlink'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-argmatch.log: test-argmatch$(EXEEXT)
+ @p='test-argmatch$(EXEEXT)'; \
+ b='test-argmatch'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-arpa_inet.log: test-arpa_inet$(EXEEXT)
+ @p='test-arpa_inet$(EXEEXT)'; \
+ b='test-arpa_inet'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-binary-io.sh.log: test-binary-io.sh
+ @p='test-binary-io.sh'; \
+ b='test-binary-io.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-bind.log: test-bind$(EXEEXT)
+ @p='test-bind$(EXEEXT)'; \
+ b='test-bind'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-bitrotate.log: test-bitrotate$(EXEEXT)
+ @p='test-bitrotate$(EXEEXT)'; \
+ b='test-bitrotate'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-btowc1.sh.log: test-btowc1.sh
+ @p='test-btowc1.sh'; \
+ b='test-btowc1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-btowc2.sh.log: test-btowc2.sh
+ @p='test-btowc2.sh'; \
+ b='test-btowc2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-c-ctype.log: test-c-ctype$(EXEEXT)
+ @p='test-c-ctype$(EXEEXT)'; \
+ b='test-c-ctype'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-c-stack.sh.log: test-c-stack.sh
+ @p='test-c-stack.sh'; \
+ b='test-c-stack.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-c-stack2.sh.log: test-c-stack2.sh
+ @p='test-c-stack2.sh'; \
+ b='test-c-stack2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-c-strcase.sh.log: test-c-strcase.sh
+ @p='test-c-strcase.sh'; \
+ b='test-c-strcase.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-close.log: test-close$(EXEEXT)
+ @p='test-close$(EXEEXT)'; \
+ b='test-close'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-connect.log: test-connect$(EXEEXT)
+ @p='test-connect$(EXEEXT)'; \
+ b='test-connect'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ctype.log: test-ctype$(EXEEXT)
+ @p='test-ctype$(EXEEXT)'; \
+ b='test-ctype'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-dirname.log: test-dirname$(EXEEXT)
+ @p='test-dirname$(EXEEXT)'; \
+ b='test-dirname'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-dup2.log: test-dup2$(EXEEXT)
+ @p='test-dup2$(EXEEXT)'; \
+ b='test-dup2'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-environ.log: test-environ$(EXEEXT)
+ @p='test-environ$(EXEEXT)'; \
+ b='test-environ'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-errno.log: test-errno$(EXEEXT)
+ @p='test-errno$(EXEEXT)'; \
+ b='test-errno'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude1.sh.log: test-exclude1.sh
+ @p='test-exclude1.sh'; \
+ b='test-exclude1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude2.sh.log: test-exclude2.sh
+ @p='test-exclude2.sh'; \
+ b='test-exclude2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude3.sh.log: test-exclude3.sh
+ @p='test-exclude3.sh'; \
+ b='test-exclude3.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude4.sh.log: test-exclude4.sh
+ @p='test-exclude4.sh'; \
+ b='test-exclude4.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude5.sh.log: test-exclude5.sh
+ @p='test-exclude5.sh'; \
+ b='test-exclude5.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude6.sh.log: test-exclude6.sh
+ @p='test-exclude6.sh'; \
+ b='test-exclude6.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude7.sh.log: test-exclude7.sh
+ @p='test-exclude7.sh'; \
+ b='test-exclude7.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-exclude8.sh.log: test-exclude8.sh
+ @p='test-exclude8.sh'; \
+ b='test-exclude8.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fcntl-h.log: test-fcntl-h$(EXEEXT)
+ @p='test-fcntl-h$(EXEEXT)'; \
+ b='test-fcntl-h'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fcntl.log: test-fcntl$(EXEEXT)
+ @p='test-fcntl$(EXEEXT)'; \
+ b='test-fcntl'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fdopen.log: test-fdopen$(EXEEXT)
+ @p='test-fdopen$(EXEEXT)'; \
+ b='test-fdopen'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fgetc.log: test-fgetc$(EXEEXT)
+ @p='test-fgetc$(EXEEXT)'; \
+ b='test-fgetc'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-filenamecat.log: test-filenamecat$(EXEEXT)
+ @p='test-filenamecat$(EXEEXT)'; \
+ b='test-filenamecat'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-float.log: test-float$(EXEEXT)
+ @p='test-float$(EXEEXT)'; \
+ b='test-float'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fnmatch.log: test-fnmatch$(EXEEXT)
+ @p='test-fnmatch$(EXEEXT)'; \
+ b='test-fnmatch'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fputc.log: test-fputc$(EXEEXT)
+ @p='test-fputc$(EXEEXT)'; \
+ b='test-fputc'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fread.log: test-fread$(EXEEXT)
+ @p='test-fread$(EXEEXT)'; \
+ b='test-fread'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-freopen-safer.log: test-freopen-safer$(EXEEXT)
+ @p='test-freopen-safer$(EXEEXT)'; \
+ b='test-freopen-safer'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-freopen.log: test-freopen$(EXEEXT)
+ @p='test-freopen$(EXEEXT)'; \
+ b='test-freopen'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fstat.log: test-fstat$(EXEEXT)
+ @p='test-fstat$(EXEEXT)'; \
+ b='test-fstat'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ftruncate.sh.log: test-ftruncate.sh
+ @p='test-ftruncate.sh'; \
+ b='test-ftruncate.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fwrite.log: test-fwrite$(EXEEXT)
+ @p='test-fwrite$(EXEEXT)'; \
+ b='test-fwrite'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-getcwd-lgpl.log: test-getcwd-lgpl$(EXEEXT)
+ @p='test-getcwd-lgpl$(EXEEXT)'; \
+ b='test-getcwd-lgpl'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-getdtablesize.log: test-getdtablesize$(EXEEXT)
+ @p='test-getdtablesize$(EXEEXT)'; \
+ b='test-getdtablesize'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-getopt.log: test-getopt$(EXEEXT)
+ @p='test-getopt$(EXEEXT)'; \
+ b='test-getopt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-gettimeofday.log: test-gettimeofday$(EXEEXT)
+ @p='test-gettimeofday$(EXEEXT)'; \
+ b='test-gettimeofday'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-hash.log: test-hash$(EXEEXT)
+ @p='test-hash$(EXEEXT)'; \
+ b='test-hash'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iconv-h.log: test-iconv-h$(EXEEXT)
+ @p='test-iconv-h$(EXEEXT)'; \
+ b='test-iconv-h'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iconv.log: test-iconv$(EXEEXT)
+ @p='test-iconv$(EXEEXT)'; \
+ b='test-iconv'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ignore-value.log: test-ignore-value$(EXEEXT)
+ @p='test-ignore-value$(EXEEXT)'; \
+ b='test-ignore-value'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-inet_pton.log: test-inet_pton$(EXEEXT)
+ @p='test-inet_pton$(EXEEXT)'; \
+ b='test-inet_pton'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-intprops.log: test-intprops$(EXEEXT)
+ @p='test-intprops$(EXEEXT)'; \
+ b='test-intprops'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-inttostr.log: test-inttostr$(EXEEXT)
+ @p='test-inttostr$(EXEEXT)'; \
+ b='test-inttostr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-inttypes.log: test-inttypes$(EXEEXT)
+ @p='test-inttypes$(EXEEXT)'; \
+ b='test-inttypes'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ioctl.log: test-ioctl$(EXEEXT)
+ @p='test-ioctl$(EXEEXT)'; \
+ b='test-ioctl'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-isblank.log: test-isblank$(EXEEXT)
+ @p='test-isblank$(EXEEXT)'; \
+ b='test-isblank'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iswblank.log: test-iswblank$(EXEEXT)
+ @p='test-iswblank$(EXEEXT)'; \
+ b='test-iswblank'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-langinfo.log: test-langinfo$(EXEEXT)
+ @p='test-langinfo$(EXEEXT)'; \
+ b='test-langinfo'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-listen.log: test-listen$(EXEEXT)
+ @p='test-listen$(EXEEXT)'; \
+ b='test-listen'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-locale.log: test-locale$(EXEEXT)
+ @p='test-locale$(EXEEXT)'; \
+ b='test-locale'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-localeconv.log: test-localeconv$(EXEEXT)
+ @p='test-localeconv$(EXEEXT)'; \
+ b='test-localeconv'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-lstat.log: test-lstat$(EXEEXT)
+ @p='test-lstat$(EXEEXT)'; \
+ b='test-lstat'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-malloca.log: test-malloca$(EXEEXT)
+ @p='test-malloca$(EXEEXT)'; \
+ b='test-malloca'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc1.sh.log: test-mbrtowc1.sh
+ @p='test-mbrtowc1.sh'; \
+ b='test-mbrtowc1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc2.sh.log: test-mbrtowc2.sh
+ @p='test-mbrtowc2.sh'; \
+ b='test-mbrtowc2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc3.sh.log: test-mbrtowc3.sh
+ @p='test-mbrtowc3.sh'; \
+ b='test-mbrtowc3.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc4.sh.log: test-mbrtowc4.sh
+ @p='test-mbrtowc4.sh'; \
+ b='test-mbrtowc4.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc5.sh.log: test-mbrtowc5.sh
+ @p='test-mbrtowc5.sh'; \
+ b='test-mbrtowc5.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-1.sh.log: test-mbrtowc-w32-1.sh
+ @p='test-mbrtowc-w32-1.sh'; \
+ b='test-mbrtowc-w32-1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-2.sh.log: test-mbrtowc-w32-2.sh
+ @p='test-mbrtowc-w32-2.sh'; \
+ b='test-mbrtowc-w32-2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-3.sh.log: test-mbrtowc-w32-3.sh
+ @p='test-mbrtowc-w32-3.sh'; \
+ b='test-mbrtowc-w32-3.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-4.sh.log: test-mbrtowc-w32-4.sh
+ @p='test-mbrtowc-w32-4.sh'; \
+ b='test-mbrtowc-w32-4.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-5.sh.log: test-mbrtowc-w32-5.sh
+ @p='test-mbrtowc-w32-5.sh'; \
+ b='test-mbrtowc-w32-5.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbscasecmp.sh.log: test-mbscasecmp.sh
+ @p='test-mbscasecmp.sh'; \
+ b='test-mbscasecmp.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsinit.sh.log: test-mbsinit.sh
+ @p='test-mbsinit.sh'; \
+ b='test-mbsinit.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsrtowcs1.sh.log: test-mbsrtowcs1.sh
+ @p='test-mbsrtowcs1.sh'; \
+ b='test-mbsrtowcs1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsrtowcs2.sh.log: test-mbsrtowcs2.sh
+ @p='test-mbsrtowcs2.sh'; \
+ b='test-mbsrtowcs2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsrtowcs3.sh.log: test-mbsrtowcs3.sh
+ @p='test-mbsrtowcs3.sh'; \
+ b='test-mbsrtowcs3.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsrtowcs4.sh.log: test-mbsrtowcs4.sh
+ @p='test-mbsrtowcs4.sh'; \
+ b='test-mbsrtowcs4.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsstr1.log: test-mbsstr1$(EXEEXT)
+ @p='test-mbsstr1$(EXEEXT)'; \
+ b='test-mbsstr1'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsstr2.sh.log: test-mbsstr2.sh
+ @p='test-mbsstr2.sh'; \
+ b='test-mbsstr2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsstr3.sh.log: test-mbsstr3.sh
+ @p='test-mbsstr3.sh'; \
+ b='test-mbsstr3.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-memchr.log: test-memchr$(EXEEXT)
+ @p='test-memchr$(EXEEXT)'; \
+ b='test-memchr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-nanosleep.log: test-nanosleep$(EXEEXT)
+ @p='test-nanosleep$(EXEEXT)'; \
+ b='test-nanosleep'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-netinet_in.log: test-netinet_in$(EXEEXT)
+ @p='test-netinet_in$(EXEEXT)'; \
+ b='test-netinet_in'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-nl_langinfo.sh.log: test-nl_langinfo.sh
+ @p='test-nl_langinfo.sh'; \
+ b='test-nl_langinfo.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-open.log: test-open$(EXEEXT)
+ @p='test-open$(EXEEXT)'; \
+ b='test-open'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-pathmax.log: test-pathmax$(EXEEXT)
+ @p='test-pathmax$(EXEEXT)'; \
+ b='test-pathmax'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-perror.sh.log: test-perror.sh
+ @p='test-perror.sh'; \
+ b='test-perror.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-perror2.log: test-perror2$(EXEEXT)
+ @p='test-perror2$(EXEEXT)'; \
+ b='test-perror2'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-pipe.log: test-pipe$(EXEEXT)
+ @p='test-pipe$(EXEEXT)'; \
+ b='test-pipe'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-quotearg-simple.log: test-quotearg-simple$(EXEEXT)
+ @p='test-quotearg-simple$(EXEEXT)'; \
+ b='test-quotearg-simple'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-raise.log: test-raise$(EXEEXT)
+ @p='test-raise$(EXEEXT)'; \
+ b='test-raise'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-rawmemchr.log: test-rawmemchr$(EXEEXT)
+ @p='test-rawmemchr$(EXEEXT)'; \
+ b='test-rawmemchr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-readlink.log: test-readlink$(EXEEXT)
+ @p='test-readlink$(EXEEXT)'; \
+ b='test-readlink'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-regex.log: test-regex$(EXEEXT)
+ @p='test-regex$(EXEEXT)'; \
+ b='test-regex'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-select.log: test-select$(EXEEXT)
+ @p='test-select$(EXEEXT)'; \
+ b='test-select'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-select-in.sh.log: test-select-in.sh
+ @p='test-select-in.sh'; \
+ b='test-select-in.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-select-out.sh.log: test-select-out.sh
+ @p='test-select-out.sh'; \
+ b='test-select-out.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setenv.log: test-setenv$(EXEEXT)
+ @p='test-setenv$(EXEEXT)'; \
+ b='test-setenv'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setlocale1.sh.log: test-setlocale1.sh
+ @p='test-setlocale1.sh'; \
+ b='test-setlocale1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setlocale2.sh.log: test-setlocale2.sh
+ @p='test-setlocale2.sh'; \
+ b='test-setlocale2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setsockopt.log: test-setsockopt$(EXEEXT)
+ @p='test-setsockopt$(EXEEXT)'; \
+ b='test-setsockopt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sh-quote.log: test-sh-quote$(EXEEXT)
+ @p='test-sh-quote$(EXEEXT)'; \
+ b='test-sh-quote'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sigaction.log: test-sigaction$(EXEEXT)
+ @p='test-sigaction$(EXEEXT)'; \
+ b='test-sigaction'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-signal-h.log: test-signal-h$(EXEEXT)
+ @p='test-signal-h$(EXEEXT)'; \
+ b='test-signal-h'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sigprocmask.log: test-sigprocmask$(EXEEXT)
+ @p='test-sigprocmask$(EXEEXT)'; \
+ b='test-sigprocmask'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sleep.log: test-sleep$(EXEEXT)
+ @p='test-sleep$(EXEEXT)'; \
+ b='test-sleep'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-snprintf.log: test-snprintf$(EXEEXT)
+ @p='test-snprintf$(EXEEXT)'; \
+ b='test-snprintf'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sockets.log: test-sockets$(EXEEXT)
+ @p='test-sockets$(EXEEXT)'; \
+ b='test-sockets'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stat.log: test-stat$(EXEEXT)
+ @p='test-stat$(EXEEXT)'; \
+ b='test-stat'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stat-time.log: test-stat-time$(EXEEXT)
+ @p='test-stat-time$(EXEEXT)'; \
+ b='test-stat-time'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdalign.log: test-stdalign$(EXEEXT)
+ @p='test-stdalign$(EXEEXT)'; \
+ b='test-stdalign'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdbool.log: test-stdbool$(EXEEXT)
+ @p='test-stdbool$(EXEEXT)'; \
+ b='test-stdbool'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stddef.log: test-stddef$(EXEEXT)
+ @p='test-stddef$(EXEEXT)'; \
+ b='test-stddef'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdint.log: test-stdint$(EXEEXT)
+ @p='test-stdint$(EXEEXT)'; \
+ b='test-stdint'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdio.log: test-stdio$(EXEEXT)
+ @p='test-stdio$(EXEEXT)'; \
+ b='test-stdio'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdlib.log: test-stdlib$(EXEEXT)
+ @p='test-stdlib$(EXEEXT)'; \
+ b='test-stdlib'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strerror.log: test-strerror$(EXEEXT)
+ @p='test-strerror$(EXEEXT)'; \
+ b='test-strerror'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strerror_r.log: test-strerror_r$(EXEEXT)
+ @p='test-strerror_r$(EXEEXT)'; \
+ b='test-strerror_r'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strftime.log: test-strftime$(EXEEXT)
+ @p='test-strftime$(EXEEXT)'; \
+ b='test-strftime'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-striconv.log: test-striconv$(EXEEXT)
+ @p='test-striconv$(EXEEXT)'; \
+ b='test-striconv'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-string.log: test-string$(EXEEXT)
+ @p='test-string$(EXEEXT)'; \
+ b='test-string'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strings.log: test-strings$(EXEEXT)
+ @p='test-strings$(EXEEXT)'; \
+ b='test-strings'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strnlen.log: test-strnlen$(EXEEXT)
+ @p='test-strnlen$(EXEEXT)'; \
+ b='test-strnlen'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strtoull.log: test-strtoull$(EXEEXT)
+ @p='test-strtoull$(EXEEXT)'; \
+ b='test-strtoull'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strtoumax.log: test-strtoumax$(EXEEXT)
+ @p='test-strtoumax$(EXEEXT)'; \
+ b='test-strtoumax'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-symlink.log: test-symlink$(EXEEXT)
+ @p='test-symlink$(EXEEXT)'; \
+ b='test-symlink'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_ioctl.log: test-sys_ioctl$(EXEEXT)
+ @p='test-sys_ioctl$(EXEEXT)'; \
+ b='test-sys_ioctl'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_select.log: test-sys_select$(EXEEXT)
+ @p='test-sys_select$(EXEEXT)'; \
+ b='test-sys_select'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_socket.log: test-sys_socket$(EXEEXT)
+ @p='test-sys_socket$(EXEEXT)'; \
+ b='test-sys_socket'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_stat.log: test-sys_stat$(EXEEXT)
+ @p='test-sys_stat$(EXEEXT)'; \
+ b='test-sys_stat'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_time.log: test-sys_time$(EXEEXT)
+ @p='test-sys_time$(EXEEXT)'; \
+ b='test-sys_time'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_types.log: test-sys_types$(EXEEXT)
+ @p='test-sys_types$(EXEEXT)'; \
+ b='test-sys_types'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_uio.log: test-sys_uio$(EXEEXT)
+ @p='test-sys_uio$(EXEEXT)'; \
+ b='test-sys_uio'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_wait.log: test-sys_wait$(EXEEXT)
+ @p='test-sys_wait$(EXEEXT)'; \
+ b='test-sys_wait'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-init.sh.log: test-init.sh
+ @p='test-init.sh'; \
+ b='test-init.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-time.log: test-time$(EXEEXT)
+ @p='test-time$(EXEEXT)'; \
+ b='test-time'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-timespec.log: test-timespec$(EXEEXT)
+ @p='test-timespec$(EXEEXT)'; \
+ b='test-timespec'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-unistd.log: test-unistd$(EXEEXT)
+ @p='test-unistd$(EXEEXT)'; \
+ b='test-unistd'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-u8-mbtoucr.log: test-u8-mbtoucr$(EXEEXT)
+ @p='test-u8-mbtoucr$(EXEEXT)'; \
+ b='test-u8-mbtoucr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-u8-uctomb.log: test-u8-uctomb$(EXEEXT)
+ @p='test-u8-uctomb$(EXEEXT)'; \
+ b='test-u8-uctomb'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-uc_width.log: test-uc_width$(EXEEXT)
+ @p='test-uc_width$(EXEEXT)'; \
+ b='test-uc_width'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+uniwidth/test-uc_width2.sh.log: uniwidth/test-uc_width2.sh
+ @p='uniwidth/test-uc_width2.sh'; \
+ b='uniwidth/test-uc_width2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-unsetenv.log: test-unsetenv$(EXEEXT)
+ @p='test-unsetenv$(EXEEXT)'; \
+ b='test-unsetenv'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-update-copyright.sh.log: test-update-copyright.sh
+ @p='test-update-copyright.sh'; \
+ b='test-update-copyright.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-vasnprintf.log: test-vasnprintf$(EXEEXT)
+ @p='test-vasnprintf$(EXEEXT)'; \
+ b='test-vasnprintf'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-vasprintf.log: test-vasprintf$(EXEEXT)
+ @p='test-vasprintf$(EXEEXT)'; \
+ b='test-vasprintf'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-vc-list-files-git.sh.log: test-vc-list-files-git.sh
+ @p='test-vc-list-files-git.sh'; \
+ b='test-vc-list-files-git.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-vc-list-files-cvs.sh.log: test-vc-list-files-cvs.sh
+ @p='test-vc-list-files-cvs.sh'; \
+ b='test-vc-list-files-cvs.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-verify.log: test-verify$(EXEEXT)
+ @p='test-verify$(EXEEXT)'; \
+ b='test-verify'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-verify.sh.log: test-verify.sh
+ @p='test-verify.sh'; \
+ b='test-verify.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-version-etc.sh.log: test-version-etc.sh
+ @p='test-version-etc.sh'; \
+ b='test-version-etc.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wchar.log: test-wchar$(EXEEXT)
+ @p='test-wchar$(EXEEXT)'; \
+ b='test-wchar'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb.sh.log: test-wcrtomb.sh
+ @p='test-wcrtomb.sh'; \
+ b='test-wcrtomb.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-1.sh.log: test-wcrtomb-w32-1.sh
+ @p='test-wcrtomb-w32-1.sh'; \
+ b='test-wcrtomb-w32-1.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-2.sh.log: test-wcrtomb-w32-2.sh
+ @p='test-wcrtomb-w32-2.sh'; \
+ b='test-wcrtomb-w32-2.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-3.sh.log: test-wcrtomb-w32-3.sh
+ @p='test-wcrtomb-w32-3.sh'; \
+ b='test-wcrtomb-w32-3.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-4.sh.log: test-wcrtomb-w32-4.sh
+ @p='test-wcrtomb-w32-4.sh'; \
+ b='test-wcrtomb-w32-4.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-5.sh.log: test-wcrtomb-w32-5.sh
+ @p='test-wcrtomb-w32-5.sh'; \
+ b='test-wcrtomb-w32-5.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wctype-h.log: test-wctype-h$(EXEEXT)
+ @p='test-wctype-h$(EXEEXT)'; \
+ b='test-wctype-h'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcwidth.log: test-wcwidth$(EXEEXT)
+ @p='test-wcwidth$(EXEEXT)'; \
+ b='test-wcwidth'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-xalloc-die.sh.log: test-xalloc-die.sh
+ @p='test-xalloc-die.sh'; \
+ b='test-xalloc-die.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-xstrtol.sh.log: test-xstrtol.sh
+ @p='test-xstrtol.sh'; \
+ b='test-xstrtol.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-xstrtoumax.sh.log: test-xstrtoumax.sh
+ @p='test-xstrtoumax.sh'; \
+ b='test-xstrtoumax.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-xvasprintf.log: test-xvasprintf$(EXEEXT)
+ @p='test-xvasprintf$(EXEEXT)'; \
+ b='test-xvasprintf'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(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
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: 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)
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+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 unistr/$(DEPDIR)/$(am__dirstamp)
+ -rm -f unistr/$(am__dirstamp)
+ -rm -f uniwidth/$(DEPDIR)/$(am__dirstamp)
+ -rm -f uniwidth/$(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-checkLIBRARIES clean-checkPROGRAMS clean-generic \
+ clean-local clean-noinstLIBRARIES clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/accept.Po
+ -rm -f ./$(DEPDIR)/bind.Po
+ -rm -f ./$(DEPDIR)/connect.Po
+ -rm -f ./$(DEPDIR)/dtotimespec.Po
+ -rm -f ./$(DEPDIR)/fdopen.Po
+ -rm -f ./$(DEPDIR)/ftruncate.Po
+ -rm -f ./$(DEPDIR)/getcwd-lgpl.Po
+ -rm -f ./$(DEPDIR)/getpagesize.Po
+ -rm -f ./$(DEPDIR)/hash-pjw.Po
+ -rm -f ./$(DEPDIR)/inet_pton.Po
+ -rm -f ./$(DEPDIR)/ioctl.Po
+ -rm -f ./$(DEPDIR)/listen.Po
+ -rm -f ./$(DEPDIR)/nanosleep.Po
+ -rm -f ./$(DEPDIR)/perror.Po
+ -rm -f ./$(DEPDIR)/pipe.Po
+ -rm -f ./$(DEPDIR)/putenv.Po
+ -rm -f ./$(DEPDIR)/select.Po
+ -rm -f ./$(DEPDIR)/setlocale.Po
+ -rm -f ./$(DEPDIR)/setsockopt.Po
+ -rm -f ./$(DEPDIR)/sleep.Po
+ -rm -f ./$(DEPDIR)/snprintf.Po
+ -rm -f ./$(DEPDIR)/socket.Po
+ -rm -f ./$(DEPDIR)/sockets.Po
+ -rm -f ./$(DEPDIR)/strerror_r.Po
+ -rm -f ./$(DEPDIR)/symlink.Po
+ -rm -f ./$(DEPDIR)/sys_socket.Po
+ -rm -f ./$(DEPDIR)/test-accept.Po
+ -rm -f ./$(DEPDIR)/test-alloca-opt.Po
+ -rm -f ./$(DEPDIR)/test-areadlink.Po
+ -rm -f ./$(DEPDIR)/test-argmatch.Po
+ -rm -f ./$(DEPDIR)/test-arpa_inet.Po
+ -rm -f ./$(DEPDIR)/test-binary-io.Po
+ -rm -f ./$(DEPDIR)/test-bind.Po
+ -rm -f ./$(DEPDIR)/test-bitrotate.Po
+ -rm -f ./$(DEPDIR)/test-btowc.Po
+ -rm -f ./$(DEPDIR)/test-c-ctype.Po
+ -rm -f ./$(DEPDIR)/test-c-stack.Po
+ -rm -f ./$(DEPDIR)/test-c-strcasecmp.Po
+ -rm -f ./$(DEPDIR)/test-c-strncasecmp.Po
+ -rm -f ./$(DEPDIR)/test-close.Po
+ -rm -f ./$(DEPDIR)/test-connect.Po
+ -rm -f ./$(DEPDIR)/test-ctype.Po
+ -rm -f ./$(DEPDIR)/test-dirname.Po
+ -rm -f ./$(DEPDIR)/test-dup2.Po
+ -rm -f ./$(DEPDIR)/test-environ.Po
+ -rm -f ./$(DEPDIR)/test-errno.Po
+ -rm -f ./$(DEPDIR)/test-exclude.Po
+ -rm -f ./$(DEPDIR)/test-fcntl-h.Po
+ -rm -f ./$(DEPDIR)/test-fcntl.Po
+ -rm -f ./$(DEPDIR)/test-fdopen.Po
+ -rm -f ./$(DEPDIR)/test-fgetc.Po
+ -rm -f ./$(DEPDIR)/test-filenamecat.Po
+ -rm -f ./$(DEPDIR)/test-float.Po
+ -rm -f ./$(DEPDIR)/test-fnmatch.Po
+ -rm -f ./$(DEPDIR)/test-fputc.Po
+ -rm -f ./$(DEPDIR)/test-fread.Po
+ -rm -f ./$(DEPDIR)/test-freopen-safer.Po
+ -rm -f ./$(DEPDIR)/test-freopen.Po
+ -rm -f ./$(DEPDIR)/test-fstat.Po
+ -rm -f ./$(DEPDIR)/test-ftruncate.Po
+ -rm -f ./$(DEPDIR)/test-fwrite.Po
+ -rm -f ./$(DEPDIR)/test-getcwd-lgpl.Po
+ -rm -f ./$(DEPDIR)/test-getdtablesize.Po
+ -rm -f ./$(DEPDIR)/test-getopt.Po
+ -rm -f ./$(DEPDIR)/test-gettimeofday.Po
+ -rm -f ./$(DEPDIR)/test-hash.Po
+ -rm -f ./$(DEPDIR)/test-iconv-h.Po
+ -rm -f ./$(DEPDIR)/test-iconv.Po
+ -rm -f ./$(DEPDIR)/test-ignore-value.Po
+ -rm -f ./$(DEPDIR)/test-inet_pton.Po
+ -rm -f ./$(DEPDIR)/test-intprops.Po
+ -rm -f ./$(DEPDIR)/test-inttostr.Po
+ -rm -f ./$(DEPDIR)/test-inttypes.Po
+ -rm -f ./$(DEPDIR)/test-ioctl.Po
+ -rm -f ./$(DEPDIR)/test-isblank.Po
+ -rm -f ./$(DEPDIR)/test-iswblank.Po
+ -rm -f ./$(DEPDIR)/test-langinfo.Po
+ -rm -f ./$(DEPDIR)/test-listen.Po
+ -rm -f ./$(DEPDIR)/test-locale.Po
+ -rm -f ./$(DEPDIR)/test-localeconv.Po
+ -rm -f ./$(DEPDIR)/test-lstat.Po
+ -rm -f ./$(DEPDIR)/test-malloca.Po
+ -rm -f ./$(DEPDIR)/test-mbrtowc-w32.Po
+ -rm -f ./$(DEPDIR)/test-mbrtowc.Po
+ -rm -f ./$(DEPDIR)/test-mbscasecmp.Po
+ -rm -f ./$(DEPDIR)/test-mbsinit.Po
+ -rm -f ./$(DEPDIR)/test-mbsrtowcs.Po
+ -rm -f ./$(DEPDIR)/test-mbsstr1.Po
+ -rm -f ./$(DEPDIR)/test-mbsstr2.Po
+ -rm -f ./$(DEPDIR)/test-mbsstr3.Po
+ -rm -f ./$(DEPDIR)/test-memchr.Po
+ -rm -f ./$(DEPDIR)/test-nanosleep.Po
+ -rm -f ./$(DEPDIR)/test-netinet_in.Po
+ -rm -f ./$(DEPDIR)/test-nl_langinfo.Po
+ -rm -f ./$(DEPDIR)/test-open.Po
+ -rm -f ./$(DEPDIR)/test-pathmax.Po
+ -rm -f ./$(DEPDIR)/test-perror.Po
+ -rm -f ./$(DEPDIR)/test-perror2.Po
+ -rm -f ./$(DEPDIR)/test-pipe.Po
+ -rm -f ./$(DEPDIR)/test-quotearg-simple.Po
+ -rm -f ./$(DEPDIR)/test-raise.Po
+ -rm -f ./$(DEPDIR)/test-rawmemchr.Po
+ -rm -f ./$(DEPDIR)/test-readlink.Po
+ -rm -f ./$(DEPDIR)/test-regex.Po
+ -rm -f ./$(DEPDIR)/test-select-fd.Po
+ -rm -f ./$(DEPDIR)/test-select-stdin.Po
+ -rm -f ./$(DEPDIR)/test-select.Po
+ -rm -f ./$(DEPDIR)/test-setenv.Po
+ -rm -f ./$(DEPDIR)/test-setlocale1.Po
+ -rm -f ./$(DEPDIR)/test-setlocale2.Po
+ -rm -f ./$(DEPDIR)/test-setsockopt.Po
+ -rm -f ./$(DEPDIR)/test-sh-quote.Po
+ -rm -f ./$(DEPDIR)/test-sigaction.Po
+ -rm -f ./$(DEPDIR)/test-signal-h.Po
+ -rm -f ./$(DEPDIR)/test-sigprocmask.Po
+ -rm -f ./$(DEPDIR)/test-sleep.Po
+ -rm -f ./$(DEPDIR)/test-snprintf.Po
+ -rm -f ./$(DEPDIR)/test-sockets.Po
+ -rm -f ./$(DEPDIR)/test-stat-time.Po
+ -rm -f ./$(DEPDIR)/test-stat.Po
+ -rm -f ./$(DEPDIR)/test-stdalign.Po
+ -rm -f ./$(DEPDIR)/test-stdbool.Po
+ -rm -f ./$(DEPDIR)/test-stddef.Po
+ -rm -f ./$(DEPDIR)/test-stdint.Po
+ -rm -f ./$(DEPDIR)/test-stdio.Po
+ -rm -f ./$(DEPDIR)/test-stdlib.Po
+ -rm -f ./$(DEPDIR)/test-strerror.Po
+ -rm -f ./$(DEPDIR)/test-strerror_r.Po
+ -rm -f ./$(DEPDIR)/test-strftime.Po
+ -rm -f ./$(DEPDIR)/test-striconv.Po
+ -rm -f ./$(DEPDIR)/test-string.Po
+ -rm -f ./$(DEPDIR)/test-strings.Po
+ -rm -f ./$(DEPDIR)/test-strnlen.Po
+ -rm -f ./$(DEPDIR)/test-strtoull.Po
+ -rm -f ./$(DEPDIR)/test-strtoumax.Po
+ -rm -f ./$(DEPDIR)/test-symlink.Po
+ -rm -f ./$(DEPDIR)/test-sys_ioctl.Po
+ -rm -f ./$(DEPDIR)/test-sys_select.Po
+ -rm -f ./$(DEPDIR)/test-sys_socket.Po
+ -rm -f ./$(DEPDIR)/test-sys_stat.Po
+ -rm -f ./$(DEPDIR)/test-sys_time.Po
+ -rm -f ./$(DEPDIR)/test-sys_types.Po
+ -rm -f ./$(DEPDIR)/test-sys_uio.Po
+ -rm -f ./$(DEPDIR)/test-sys_wait.Po
+ -rm -f ./$(DEPDIR)/test-time.Po
+ -rm -f ./$(DEPDIR)/test-timespec.Po
+ -rm -f ./$(DEPDIR)/test-unistd.Po
+ -rm -f ./$(DEPDIR)/test-unsetenv.Po
+ -rm -f ./$(DEPDIR)/test-vasnprintf.Po
+ -rm -f ./$(DEPDIR)/test-vasprintf.Po
+ -rm -f ./$(DEPDIR)/test-verify.Po
+ -rm -f ./$(DEPDIR)/test-version-etc.Po
+ -rm -f ./$(DEPDIR)/test-wchar.Po
+ -rm -f ./$(DEPDIR)/test-wcrtomb-w32.Po
+ -rm -f ./$(DEPDIR)/test-wcrtomb.Po
+ -rm -f ./$(DEPDIR)/test-wctype-h.Po
+ -rm -f ./$(DEPDIR)/test-wcwidth.Po
+ -rm -f ./$(DEPDIR)/test-xalloc-die.Po
+ -rm -f ./$(DEPDIR)/test-xstrtol.Po
+ -rm -f ./$(DEPDIR)/test-xstrtoul.Po
+ -rm -f ./$(DEPDIR)/test-xstrtoumax.Po
+ -rm -f ./$(DEPDIR)/test-xvasprintf.Po
+ -rm -f ./$(DEPDIR)/timespec-add.Po
+ -rm -f ./$(DEPDIR)/timespec-sub.Po
+ -rm -f ./$(DEPDIR)/wctob.Po
+ -rm -f ./$(DEPDIR)/wctomb.Po
+ -rm -f unistr/$(DEPDIR)/test-u8-mbtoucr.Po
+ -rm -f unistr/$(DEPDIR)/test-u8-uctomb.Po
+ -rm -f uniwidth/$(DEPDIR)/test-uc_width.Po
+ -rm -f uniwidth/$(DEPDIR)/test-uc_width2.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ 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)/accept.Po
+ -rm -f ./$(DEPDIR)/bind.Po
+ -rm -f ./$(DEPDIR)/connect.Po
+ -rm -f ./$(DEPDIR)/dtotimespec.Po
+ -rm -f ./$(DEPDIR)/fdopen.Po
+ -rm -f ./$(DEPDIR)/ftruncate.Po
+ -rm -f ./$(DEPDIR)/getcwd-lgpl.Po
+ -rm -f ./$(DEPDIR)/getpagesize.Po
+ -rm -f ./$(DEPDIR)/hash-pjw.Po
+ -rm -f ./$(DEPDIR)/inet_pton.Po
+ -rm -f ./$(DEPDIR)/ioctl.Po
+ -rm -f ./$(DEPDIR)/listen.Po
+ -rm -f ./$(DEPDIR)/nanosleep.Po
+ -rm -f ./$(DEPDIR)/perror.Po
+ -rm -f ./$(DEPDIR)/pipe.Po
+ -rm -f ./$(DEPDIR)/putenv.Po
+ -rm -f ./$(DEPDIR)/select.Po
+ -rm -f ./$(DEPDIR)/setlocale.Po
+ -rm -f ./$(DEPDIR)/setsockopt.Po
+ -rm -f ./$(DEPDIR)/sleep.Po
+ -rm -f ./$(DEPDIR)/snprintf.Po
+ -rm -f ./$(DEPDIR)/socket.Po
+ -rm -f ./$(DEPDIR)/sockets.Po
+ -rm -f ./$(DEPDIR)/strerror_r.Po
+ -rm -f ./$(DEPDIR)/symlink.Po
+ -rm -f ./$(DEPDIR)/sys_socket.Po
+ -rm -f ./$(DEPDIR)/test-accept.Po
+ -rm -f ./$(DEPDIR)/test-alloca-opt.Po
+ -rm -f ./$(DEPDIR)/test-areadlink.Po
+ -rm -f ./$(DEPDIR)/test-argmatch.Po
+ -rm -f ./$(DEPDIR)/test-arpa_inet.Po
+ -rm -f ./$(DEPDIR)/test-binary-io.Po
+ -rm -f ./$(DEPDIR)/test-bind.Po
+ -rm -f ./$(DEPDIR)/test-bitrotate.Po
+ -rm -f ./$(DEPDIR)/test-btowc.Po
+ -rm -f ./$(DEPDIR)/test-c-ctype.Po
+ -rm -f ./$(DEPDIR)/test-c-stack.Po
+ -rm -f ./$(DEPDIR)/test-c-strcasecmp.Po
+ -rm -f ./$(DEPDIR)/test-c-strncasecmp.Po
+ -rm -f ./$(DEPDIR)/test-close.Po
+ -rm -f ./$(DEPDIR)/test-connect.Po
+ -rm -f ./$(DEPDIR)/test-ctype.Po
+ -rm -f ./$(DEPDIR)/test-dirname.Po
+ -rm -f ./$(DEPDIR)/test-dup2.Po
+ -rm -f ./$(DEPDIR)/test-environ.Po
+ -rm -f ./$(DEPDIR)/test-errno.Po
+ -rm -f ./$(DEPDIR)/test-exclude.Po
+ -rm -f ./$(DEPDIR)/test-fcntl-h.Po
+ -rm -f ./$(DEPDIR)/test-fcntl.Po
+ -rm -f ./$(DEPDIR)/test-fdopen.Po
+ -rm -f ./$(DEPDIR)/test-fgetc.Po
+ -rm -f ./$(DEPDIR)/test-filenamecat.Po
+ -rm -f ./$(DEPDIR)/test-float.Po
+ -rm -f ./$(DEPDIR)/test-fnmatch.Po
+ -rm -f ./$(DEPDIR)/test-fputc.Po
+ -rm -f ./$(DEPDIR)/test-fread.Po
+ -rm -f ./$(DEPDIR)/test-freopen-safer.Po
+ -rm -f ./$(DEPDIR)/test-freopen.Po
+ -rm -f ./$(DEPDIR)/test-fstat.Po
+ -rm -f ./$(DEPDIR)/test-ftruncate.Po
+ -rm -f ./$(DEPDIR)/test-fwrite.Po
+ -rm -f ./$(DEPDIR)/test-getcwd-lgpl.Po
+ -rm -f ./$(DEPDIR)/test-getdtablesize.Po
+ -rm -f ./$(DEPDIR)/test-getopt.Po
+ -rm -f ./$(DEPDIR)/test-gettimeofday.Po
+ -rm -f ./$(DEPDIR)/test-hash.Po
+ -rm -f ./$(DEPDIR)/test-iconv-h.Po
+ -rm -f ./$(DEPDIR)/test-iconv.Po
+ -rm -f ./$(DEPDIR)/test-ignore-value.Po
+ -rm -f ./$(DEPDIR)/test-inet_pton.Po
+ -rm -f ./$(DEPDIR)/test-intprops.Po
+ -rm -f ./$(DEPDIR)/test-inttostr.Po
+ -rm -f ./$(DEPDIR)/test-inttypes.Po
+ -rm -f ./$(DEPDIR)/test-ioctl.Po
+ -rm -f ./$(DEPDIR)/test-isblank.Po
+ -rm -f ./$(DEPDIR)/test-iswblank.Po
+ -rm -f ./$(DEPDIR)/test-langinfo.Po
+ -rm -f ./$(DEPDIR)/test-listen.Po
+ -rm -f ./$(DEPDIR)/test-locale.Po
+ -rm -f ./$(DEPDIR)/test-localeconv.Po
+ -rm -f ./$(DEPDIR)/test-lstat.Po
+ -rm -f ./$(DEPDIR)/test-malloca.Po
+ -rm -f ./$(DEPDIR)/test-mbrtowc-w32.Po
+ -rm -f ./$(DEPDIR)/test-mbrtowc.Po
+ -rm -f ./$(DEPDIR)/test-mbscasecmp.Po
+ -rm -f ./$(DEPDIR)/test-mbsinit.Po
+ -rm -f ./$(DEPDIR)/test-mbsrtowcs.Po
+ -rm -f ./$(DEPDIR)/test-mbsstr1.Po
+ -rm -f ./$(DEPDIR)/test-mbsstr2.Po
+ -rm -f ./$(DEPDIR)/test-mbsstr3.Po
+ -rm -f ./$(DEPDIR)/test-memchr.Po
+ -rm -f ./$(DEPDIR)/test-nanosleep.Po
+ -rm -f ./$(DEPDIR)/test-netinet_in.Po
+ -rm -f ./$(DEPDIR)/test-nl_langinfo.Po
+ -rm -f ./$(DEPDIR)/test-open.Po
+ -rm -f ./$(DEPDIR)/test-pathmax.Po
+ -rm -f ./$(DEPDIR)/test-perror.Po
+ -rm -f ./$(DEPDIR)/test-perror2.Po
+ -rm -f ./$(DEPDIR)/test-pipe.Po
+ -rm -f ./$(DEPDIR)/test-quotearg-simple.Po
+ -rm -f ./$(DEPDIR)/test-raise.Po
+ -rm -f ./$(DEPDIR)/test-rawmemchr.Po
+ -rm -f ./$(DEPDIR)/test-readlink.Po
+ -rm -f ./$(DEPDIR)/test-regex.Po
+ -rm -f ./$(DEPDIR)/test-select-fd.Po
+ -rm -f ./$(DEPDIR)/test-select-stdin.Po
+ -rm -f ./$(DEPDIR)/test-select.Po
+ -rm -f ./$(DEPDIR)/test-setenv.Po
+ -rm -f ./$(DEPDIR)/test-setlocale1.Po
+ -rm -f ./$(DEPDIR)/test-setlocale2.Po
+ -rm -f ./$(DEPDIR)/test-setsockopt.Po
+ -rm -f ./$(DEPDIR)/test-sh-quote.Po
+ -rm -f ./$(DEPDIR)/test-sigaction.Po
+ -rm -f ./$(DEPDIR)/test-signal-h.Po
+ -rm -f ./$(DEPDIR)/test-sigprocmask.Po
+ -rm -f ./$(DEPDIR)/test-sleep.Po
+ -rm -f ./$(DEPDIR)/test-snprintf.Po
+ -rm -f ./$(DEPDIR)/test-sockets.Po
+ -rm -f ./$(DEPDIR)/test-stat-time.Po
+ -rm -f ./$(DEPDIR)/test-stat.Po
+ -rm -f ./$(DEPDIR)/test-stdalign.Po
+ -rm -f ./$(DEPDIR)/test-stdbool.Po
+ -rm -f ./$(DEPDIR)/test-stddef.Po
+ -rm -f ./$(DEPDIR)/test-stdint.Po
+ -rm -f ./$(DEPDIR)/test-stdio.Po
+ -rm -f ./$(DEPDIR)/test-stdlib.Po
+ -rm -f ./$(DEPDIR)/test-strerror.Po
+ -rm -f ./$(DEPDIR)/test-strerror_r.Po
+ -rm -f ./$(DEPDIR)/test-strftime.Po
+ -rm -f ./$(DEPDIR)/test-striconv.Po
+ -rm -f ./$(DEPDIR)/test-string.Po
+ -rm -f ./$(DEPDIR)/test-strings.Po
+ -rm -f ./$(DEPDIR)/test-strnlen.Po
+ -rm -f ./$(DEPDIR)/test-strtoull.Po
+ -rm -f ./$(DEPDIR)/test-strtoumax.Po
+ -rm -f ./$(DEPDIR)/test-symlink.Po
+ -rm -f ./$(DEPDIR)/test-sys_ioctl.Po
+ -rm -f ./$(DEPDIR)/test-sys_select.Po
+ -rm -f ./$(DEPDIR)/test-sys_socket.Po
+ -rm -f ./$(DEPDIR)/test-sys_stat.Po
+ -rm -f ./$(DEPDIR)/test-sys_time.Po
+ -rm -f ./$(DEPDIR)/test-sys_types.Po
+ -rm -f ./$(DEPDIR)/test-sys_uio.Po
+ -rm -f ./$(DEPDIR)/test-sys_wait.Po
+ -rm -f ./$(DEPDIR)/test-time.Po
+ -rm -f ./$(DEPDIR)/test-timespec.Po
+ -rm -f ./$(DEPDIR)/test-unistd.Po
+ -rm -f ./$(DEPDIR)/test-unsetenv.Po
+ -rm -f ./$(DEPDIR)/test-vasnprintf.Po
+ -rm -f ./$(DEPDIR)/test-vasprintf.Po
+ -rm -f ./$(DEPDIR)/test-verify.Po
+ -rm -f ./$(DEPDIR)/test-version-etc.Po
+ -rm -f ./$(DEPDIR)/test-wchar.Po
+ -rm -f ./$(DEPDIR)/test-wcrtomb-w32.Po
+ -rm -f ./$(DEPDIR)/test-wcrtomb.Po
+ -rm -f ./$(DEPDIR)/test-wctype-h.Po
+ -rm -f ./$(DEPDIR)/test-wcwidth.Po
+ -rm -f ./$(DEPDIR)/test-xalloc-die.Po
+ -rm -f ./$(DEPDIR)/test-xstrtol.Po
+ -rm -f ./$(DEPDIR)/test-xstrtoul.Po
+ -rm -f ./$(DEPDIR)/test-xstrtoumax.Po
+ -rm -f ./$(DEPDIR)/test-xvasprintf.Po
+ -rm -f ./$(DEPDIR)/timespec-add.Po
+ -rm -f ./$(DEPDIR)/timespec-sub.Po
+ -rm -f ./$(DEPDIR)/wctob.Po
+ -rm -f ./$(DEPDIR)/wctomb.Po
+ -rm -f unistr/$(DEPDIR)/test-u8-mbtoucr.Po
+ -rm -f unistr/$(DEPDIR)/test-u8-uctomb.Po
+ -rm -f uniwidth/$(DEPDIR)/test-uc_width.Po
+ -rm -f uniwidth/$(DEPDIR)/test-uc_width2.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-local
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) all check check-am install install-am \
+ install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-TESTS check-am clean \
+ clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \
+ clean-local clean-noinstLIBRARIES clean-noinstPROGRAMS \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic 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 mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_at)$(MKDIR_P) arpa
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+ -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+ -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \
+ -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \
+ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+ -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
+ -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|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)/arpa_inet.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+@GL_GENERATE_NETINET_IN_H_TRUE@netinet/in.h: netinet_in.in.h $(top_builddir)/config.status
+@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_at)$(MKDIR_P) netinet
+@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_NETINET_IN_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_NETINET_IN_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ < $(srcdir)/netinet_in.in.h; \
+@GL_GENERATE_NETINET_IN_H_TRUE@ } > $@-t && \
+@GL_GENERATE_NETINET_IN_H_TRUE@ mv $@-t $@
+@GL_GENERATE_NETINET_IN_H_FALSE@netinet/in.h: $(top_builddir)/config.status
+@GL_GENERATE_NETINET_IN_H_FALSE@ rm -f $@
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_ARG_NONNULL/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ > $@-t && \
+ mv $@-t $@
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/_GL_CXXDEFS/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/c++defs.h \
+ > $@-t && \
+ mv $@-t $@
+# The unused-parameter.h that gets inserted into generated .h files is the same
+# as build-aux/snippet/unused-parameter.h, except that it has the copyright
+# header cut off.
+unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+ > $@-t && \
+ mv $@-t $@
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/^.ifndef/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+ > $@-t && \
+ 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDALIGN_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDALIGN_H_TRUE@ cat $(srcdir)/stdalign.in.h; \
+@GL_GENERATE_STDALIGN_H_TRUE@ } > $@-t && \
+@GL_GENERATE_STDALIGN_H_TRUE@ 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 <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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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''@/$(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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+ -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+ -e 's/@''GNULIB_PSELECT''@/$(GNULIB_PSELECT)/g' \
+ -e 's/@''GNULIB_SELECT''@/$(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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_SOCKET''@/$(GNULIB_SOCKET)/g' \
+ -e 's/@''GNULIB_CONNECT''@/$(GNULIB_CONNECT)/g' \
+ -e 's/@''GNULIB_ACCEPT''@/$(GNULIB_ACCEPT)/g' \
+ -e 's/@''GNULIB_BIND''@/$(GNULIB_BIND)/g' \
+ -e 's/@''GNULIB_GETPEERNAME''@/$(GNULIB_GETPEERNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKNAME''@/$(GNULIB_GETSOCKNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKOPT''@/$(GNULIB_GETSOCKOPT)/g' \
+ -e 's/@''GNULIB_LISTEN''@/$(GNULIB_LISTEN)/g' \
+ -e 's/@''GNULIB_RECV''@/$(GNULIB_RECV)/g' \
+ -e 's/@''GNULIB_SEND''@/$(GNULIB_SEND)/g' \
+ -e 's/@''GNULIB_RECVFROM''@/$(GNULIB_RECVFROM)/g' \
+ -e 's/@''GNULIB_SENDTO''@/$(GNULIB_SENDTO)/g' \
+ -e 's/@''GNULIB_SETSOCKOPT''@/$(GNULIB_SETSOCKOPT)/g' \
+ -e 's/@''GNULIB_SHUTDOWN''@/$(GNULIB_SHUTDOWN)/g' \
+ -e 's/@''GNULIB_ACCEPT4''@/$(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 && \
+ mv -f $@-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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_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 && \
+ mv -f $@-t $@
+
+# Clean up after Solaris cc.
+clean-local:
+ rm -rf SunWS_cache
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
+
+# 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/gnulib-tests/accept.c b/gnulib-tests/accept.c
new file mode 100644
index 0000000..bd0605e
--- /dev/null
+++ b/gnulib-tests/accept.c
@@ -0,0 +1,52 @@
+/* accept.c --- wrappers for Windows accept function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef accept
+
+int
+rpl_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+ SOCKET sock = FD_TO_SOCKET (fd);
+
+ if (sock == INVALID_SOCKET)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ else
+ {
+ SOCKET fh = accept (sock, addr, addrlen);
+ if (fh == INVALID_SOCKET)
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ return SOCKET_TO_FD (fh);
+ }
+}
diff --git a/gnulib-tests/arpa_inet.in.h b/gnulib-tests/arpa_inet.in.h
new file mode 100644
index 0000000..026c4dc
--- /dev/null
+++ b/gnulib-tests/arpa_inet.in.h
@@ -0,0 +1,140 @@
+/* A GNU-like <arpa/inet.h>.
+
+ Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_ARPA_INET_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
+/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and
+ for pulling in winsock2.h etc. under MinGW.
+ But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
+
+/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
+ But avoid namespace pollution on glibc systems. */
+#if defined __TANDEM && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
+#if @HAVE_ARPA_INET_H@
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_ARPA_INET_H
+#define _@GUARD_PREFIX@_ARPA_INET_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 @GNULIB_INET_NTOP@
+/* Converts an internet address from internal format to a printable,
+ presentable format.
+ AF is an internet address family, such as AF_INET or AF_INET6.
+ SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
+ (for AF_INET6).
+ DST points to a buffer having room for CNT bytes.
+ The printable representation of the address (in numeric form, not
+ surrounded by [...], no reverse DNS is done) is placed in DST, and
+ DST is returned. If an error occurs, the return value is NULL and
+ errno is set. If CNT bytes are not sufficient to hold the result,
+ the return value is NULL and errno is set to ENOSPC. A good value
+ for CNT is 46.
+
+ For more details, see the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
+# if @REPLACE_INET_NTOP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef inet_ntop
+# define inet_ntop rpl_inet_ntop
+# endif
+_GL_FUNCDECL_RPL (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt));
+# else
+# if !@HAVE_DECL_INET_NTOP@
+_GL_FUNCDECL_SYS (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+/* Need to cast, because on NonStop Kernel, the fourth parameter is
+ size_t cnt. */
+_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt));
+# endif
+_GL_CXXALIASWARN (inet_ntop);
+#elif defined GNULIB_POSIXCHECK
+# undef inet_ntop
+# if HAVE_RAW_DECL_INET_NTOP
+_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
+ "use gnulib module inet_ntop for portability");
+# endif
+#endif
+
+#if @GNULIB_INET_PTON@
+# if @REPLACE_INET_PTON@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef inet_pton
+# define inet_pton rpl_inet_pton
+# endif
+_GL_FUNCDECL_RPL (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst));
+# else
+# if !@HAVE_DECL_INET_PTON@
+_GL_FUNCDECL_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst));
+# endif
+_GL_CXXALIASWARN (inet_pton);
+#elif defined GNULIB_POSIXCHECK
+# undef inet_pton
+# if HAVE_RAW_DECL_INET_PTON
+_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
+ "use gnulib module inet_pton for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
+#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
diff --git a/gnulib-tests/bind.c b/gnulib-tests/bind.c
new file mode 100644
index 0000000..7f526e2
--- /dev/null
+++ b/gnulib-tests/bind.c
@@ -0,0 +1,49 @@
+/* bind.c --- wrappers for Windows bind function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef bind
+
+int
+rpl_bind (int fd, const struct sockaddr *sockaddr, socklen_t len)
+{
+ SOCKET sock = FD_TO_SOCKET (fd);
+
+ if (sock == INVALID_SOCKET)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ else
+ {
+ int r = bind (sock, sockaddr, len);
+ if (r < 0)
+ set_winsock_errno ();
+
+ return r;
+ }
+}
diff --git a/gnulib-tests/connect.c b/gnulib-tests/connect.c
new file mode 100644
index 0000000..1d42317
--- /dev/null
+++ b/gnulib-tests/connect.c
@@ -0,0 +1,56 @@
+/* connect.c --- wrappers for Windows connect function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef connect
+
+int
+rpl_connect (int fd, const struct sockaddr *sockaddr, socklen_t len)
+{
+ SOCKET sock = FD_TO_SOCKET (fd);
+
+ if (sock == INVALID_SOCKET)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ else
+ {
+ int r = connect (sock, sockaddr, len);
+ if (r < 0)
+ {
+ /* EINPROGRESS is not returned by WinSock 2.0; for backwards
+ compatibility, connect(2) uses EWOULDBLOCK. */
+ if (WSAGetLastError () == WSAEWOULDBLOCK)
+ WSASetLastError (WSAEINPROGRESS);
+
+ set_winsock_errno ();
+ }
+
+ return r;
+ }
+}
diff --git a/gnulib-tests/dtotimespec.c b/gnulib-tests/dtotimespec.c
new file mode 100644
index 0000000..9028044
--- /dev/null
+++ b/gnulib-tests/dtotimespec.c
@@ -0,0 +1,59 @@
+/* Convert double to timespec.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+/* Convert the double value SEC to a struct timespec. Round toward
+ positive infinity. On overflow, return an extremal value. */
+
+#include <config.h>
+
+#include "timespec.h"
+
+#include "intprops.h"
+
+struct timespec
+dtotimespec (double sec)
+{
+ double min_representable = TYPE_MINIMUM (time_t);
+ double max_representable =
+ ((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION
+ + (TIMESPEC_RESOLUTION - 1))
+ / TIMESPEC_RESOLUTION);
+
+ if (! (min_representable < sec))
+ return make_timespec (TYPE_MINIMUM (time_t), 0);
+ else if (! (sec < max_representable))
+ return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1);
+ else
+ {
+ time_t s = sec;
+ double frac = TIMESPEC_RESOLUTION * (sec - s);
+ long ns = frac;
+ ns += ns < frac;
+ s += ns / TIMESPEC_RESOLUTION;
+ ns %= TIMESPEC_RESOLUTION;
+
+ if (ns < 0)
+ {
+ s--;
+ ns += TIMESPEC_RESOLUTION;
+ }
+
+ return make_timespec (s, ns);
+ }
+}
diff --git a/gnulib-tests/fdopen.c b/gnulib-tests/fdopen.c
new file mode 100644
index 0000000..61fbfdf
--- /dev/null
+++ b/gnulib-tests/fdopen.c
@@ -0,0 +1,69 @@
+/* Open a stream with a given file descriptor.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef fdopen
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static FILE *
+fdopen_nothrow (int fd, const char *mode)
+{
+ FILE *result;
+
+ TRY_MSVC_INVAL
+ {
+ result = fdopen (fd, mode);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = NULL;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+#else
+# define fdopen_nothrow fdopen
+#endif
+
+FILE *
+rpl_fdopen (int fd, const char *mode)
+{
+ int saved_errno = errno;
+ FILE *fp;
+
+ errno = 0;
+ fp = fdopen_nothrow (fd, mode);
+ if (fp == NULL)
+ {
+ if (errno == 0)
+ errno = EBADF;
+ }
+ else
+ errno = saved_errno;
+
+ return fp;
+}
diff --git a/gnulib-tests/fpucw.h b/gnulib-tests/fpucw.h
new file mode 100644
index 0000000..05ee0ca
--- /dev/null
+++ b/gnulib-tests/fpucw.h
@@ -0,0 +1,108 @@
+/* Manipulating the FPU control word. -*- coding: utf-8 -*-
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _FPUCW_H
+#define _FPUCW_H
+
+/* The i386 floating point hardware (the 387 compatible FPU, not the modern
+ SSE/SSE2 hardware) has a controllable rounding precision. It is specified
+ through the 'PC' bits in the FPU control word ('fctrl' register). (See
+ the GNU libc i386 <fpu_control.h> header for details.)
+
+ On some platforms, such as Linux or Solaris, the default precision setting
+ is set to "extended precision". This means that 'long double' instructions
+ operate correctly, but 'double' computations often produce slightly
+ different results as on strictly IEEE 754 conforming systems.
+
+ On some platforms, such as NetBSD, the default precision is set to
+ "double precision". This means that 'long double' instructions will operate
+ only as 'double', i.e. lead to wrong results. Similarly on FreeBSD 6.4, at
+ least for the division of 'long double' numbers.
+
+ The FPU control word is under control of the application, i.e. it is
+ not required to be set either way by the ABI. (In fact, the i386 ABI
+ http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38
+ is not clear about it. But in any case, gcc treats the control word
+ like a "preserved" register: it emits code that assumes that the control
+ word is preserved across calls, and it restores the control word at the
+ end of functions that modify it.)
+
+ See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html
+ for a good explanation.
+ See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for
+ some argumentation which setting should be the default. */
+
+/* This header file provides the following facilities:
+ fpucw_t integral type holding the value of 'fctrl'
+ FPU_PC_MASK bit mask denoting the precision control
+ FPU_PC_DOUBLE precision control for 53 bits mantissa
+ FPU_PC_EXTENDED precision control for 64 bits mantissa
+ GET_FPUCW () yields the current FPU control word
+ SET_FPUCW (word) sets the FPU control word
+ DECL_LONG_DOUBLE_ROUNDING variable declaration for
+ BEGIN/END_LONG_DOUBLE_ROUNDING
+ BEGIN_LONG_DOUBLE_ROUNDING () starts a sequence of instructions with
+ 'long double' safe operation precision
+ END_LONG_DOUBLE_ROUNDING () ends a sequence of instructions with
+ 'long double' safe operation precision
+ */
+
+/* Inline assembler like this works only with GNU C. */
+#if (defined __i386__ || defined __x86_64__) && defined __GNUC__
+
+typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
+
+# define FPU_PC_MASK 0x0300
+# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */
+# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */
+
+# define GET_FPUCW() \
+ ({ fpucw_t _cw; \
+ __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \
+ _cw; \
+ })
+# define SET_FPUCW(word) \
+ (void)({ fpucw_t _ncw = (word); \
+ __asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \
+ })
+
+# define DECL_LONG_DOUBLE_ROUNDING \
+ fpucw_t oldcw;
+# define BEGIN_LONG_DOUBLE_ROUNDING() \
+ (void)(oldcw = GET_FPUCW (), \
+ SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED))
+# define END_LONG_DOUBLE_ROUNDING() \
+ SET_FPUCW (oldcw)
+
+#else
+
+typedef unsigned int fpucw_t;
+
+# define FPU_PC_MASK 0
+# define FPU_PC_DOUBLE 0
+# define FPU_PC_EXTENDED 0
+
+# define GET_FPUCW() 0
+# define SET_FPUCW(word) (void)(word)
+
+# define DECL_LONG_DOUBLE_ROUNDING
+# define BEGIN_LONG_DOUBLE_ROUNDING()
+# define END_LONG_DOUBLE_ROUNDING()
+
+#endif
+
+#endif /* _FPUCW_H */
diff --git a/gnulib-tests/ftruncate.c b/gnulib-tests/ftruncate.c
new file mode 100644
index 0000000..1b39c87
--- /dev/null
+++ b/gnulib-tests/ftruncate.c
@@ -0,0 +1,188 @@
+/* ftruncate emulations for native Windows.
+ Copyright (C) 1992-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if HAVE_CHSIZE
+/* A native Windows platform. */
+
+# include <errno.h>
+
+# if _GL_WINDOWS_64_BIT_OFF_T
+
+/* Large File Support: off_t is 64-bit, but chsize() takes only a 32-bit
+ argument. So, define a 64-bit safe SetFileSize function ourselves. */
+
+/* Ensure that <windows.h> declares GetFileSizeEx. */
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x500
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+
+static BOOL
+SetFileSize (HANDLE h, LONGLONG size)
+{
+ LARGE_INTEGER old_size;
+
+ if (!GetFileSizeEx (h, &old_size))
+ return FALSE;
+
+ if (size != old_size.QuadPart)
+ {
+ /* Duplicate the handle, so we are free to modify its file position. */
+ HANDLE curr_process = GetCurrentProcess ();
+ HANDLE tmph;
+
+ if (!DuplicateHandle (curr_process, /* SourceProcessHandle */
+ h, /* SourceHandle */
+ curr_process, /* TargetProcessHandle */
+ (PHANDLE) &tmph, /* TargetHandle */
+ (DWORD) 0, /* DesiredAccess */
+ FALSE, /* InheritHandle */
+ DUPLICATE_SAME_ACCESS)) /* Options */
+ return FALSE;
+
+ if (size < old_size.QuadPart)
+ {
+ /* Reduce the size. */
+ LONG size_hi = (LONG) (size >> 32);
+ if (SetFilePointer (tmph, (LONG) size, &size_hi, FILE_BEGIN)
+ == INVALID_SET_FILE_POINTER
+ && GetLastError() != NO_ERROR)
+ {
+ CloseHandle (tmph);
+ return FALSE;
+ }
+ if (!SetEndOfFile (tmph))
+ {
+ CloseHandle (tmph);
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* Increase the size by adding zero bytes at the end. */
+ static char zero_bytes[1024];
+ LONG pos_hi = 0;
+ LONG pos_lo = SetFilePointer (tmph, (LONG) 0, &pos_hi, FILE_END);
+ LONGLONG pos;
+ if (pos_lo == INVALID_SET_FILE_POINTER
+ && GetLastError() != NO_ERROR)
+ {
+ CloseHandle (tmph);
+ return FALSE;
+ }
+ pos = ((LONGLONG) pos_hi << 32) | (ULONGLONG) (ULONG) pos_lo;
+ while (pos < size)
+ {
+ DWORD written;
+ LONGLONG count = size - pos;
+ if (count > sizeof (zero_bytes))
+ count = sizeof (zero_bytes);
+ if (!WriteFile (tmph, zero_bytes, (DWORD) count, &written, NULL)
+ || written == 0)
+ {
+ CloseHandle (tmph);
+ return FALSE;
+ }
+ pos += (ULONGLONG) (ULONG) written;
+ }
+ }
+ /* Close the handle. */
+ CloseHandle (tmph);
+ }
+ return TRUE;
+}
+
+int
+ftruncate (int fd, off_t length)
+{
+ HANDLE handle = (HANDLE) _get_osfhandle (fd);
+
+ if (handle == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (length < 0)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ if (!SetFileSize (handle, length))
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_ACCESS_DENIED:
+ errno = EACCES;
+ break;
+ case ERROR_HANDLE_DISK_FULL:
+ case ERROR_DISK_FULL:
+ case ERROR_DISK_TOO_FRAGMENTED:
+ errno = ENOSPC;
+ break;
+ default:
+ errno = EIO;
+ break;
+ }
+ return -1;
+ }
+ return 0;
+}
+
+# else
+
+# include <io.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+static int
+chsize_nothrow (int fd, long length)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = chsize (fd, length);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ errno = EBADF;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# define chsize chsize_nothrow
+# endif
+
+int
+ftruncate (int fd, off_t length)
+{
+ return chsize (fd, length);
+}
+
+# endif
+#endif
diff --git a/gnulib-tests/getcwd-lgpl.c b/gnulib-tests/getcwd-lgpl.c
new file mode 100644
index 0000000..c553f7b
--- /dev/null
+++ b/gnulib-tests/getcwd-lgpl.c
@@ -0,0 +1,126 @@
+/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ This file is part of gnulib.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification */
+#include <unistd.h>
+
+#include <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
+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)
+ {
+ int saved_errno = errno;
+ free (buf);
+ errno = saved_errno;
+ }
+ 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)
+ {
+ int saved_errno = errno;
+ free (buf);
+ errno = saved_errno;
+ }
+ else
+ {
+ /* Trim to fit, if possible. */
+ result = realloc (buf, strlen (buf) + 1);
+ if (!result)
+ result = buf;
+ }
+ return result;
+}
+
+#endif
diff --git a/gnulib-tests/getpagesize.c b/gnulib-tests/getpagesize.c
new file mode 100644
index 0000000..dc4a200
--- /dev/null
+++ b/gnulib-tests/getpagesize.c
@@ -0,0 +1,39 @@
+/* getpagesize emulation for systems where it cannot be done in a C macro.
+
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible and Martin Lambers. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+/* This implementation is only for native Windows systems. */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+int
+getpagesize (void)
+{
+ SYSTEM_INFO system_info;
+ GetSystemInfo (&system_info);
+ return system_info.dwPageSize;
+}
+
+#endif
diff --git a/gnulib-tests/gnulib.mk b/gnulib-tests/gnulib.mk
new file mode 100644
index 0000000..76bf8d1
--- /dev/null
+++ b/gnulib-tests/gnulib.mk
@@ -0,0 +1,1841 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+## Process this file with automake to produce Makefile.in.
+# Copyright (C) 2002-2016 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 <http://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.
+
+AUTOMAKE_OPTIONS = 1.9.6 foreign subdir-objects
+
+SUBDIRS = .
+TESTS =
+XFAIL_TESTS =
+TESTS_ENVIRONMENT =
+noinst_PROGRAMS =
+check_PROGRAMS =
+noinst_HEADERS =
+noinst_LIBRARIES =
+check_LIBRARIES = libtests.a
+EXTRA_DIST =
+BUILT_SOURCES =
+SUFFIXES =
+MOSTLYCLEANFILES = core *.stackdump
+MOSTLYCLEANDIRS =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+
+AM_CPPFLAGS = \
+ -D@gltests_WITNESS@=1 \
+ -I. -I$(srcdir) \
+ -I.. -I$(srcdir)/.. \
+ -I../lib -I$(srcdir)/../lib
+
+LDADD = libtests.a ../lib/libdiffutils.a libtests.a $(LIBTESTS_LIBDEPS)
+
+libtests_a_SOURCES =
+libtests_a_LIBADD = $(gltests_LIBOBJS)
+libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
+EXTRA_libtests_a_SOURCES =
+AM_LIBTOOLFLAGS = --preserve-dup-deps
+
+TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)'
+
+## begin gnulib module accept
+
+
+EXTRA_DIST += accept.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += accept.c
+
+## end gnulib module accept
+
+## begin gnulib module accept-tests
+
+TESTS += test-accept
+check_PROGRAMS += test-accept
+test_accept_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-accept.c signature.h macros.h
+
+## end gnulib module accept-tests
+
+## begin gnulib module alloca-opt-tests
+
+TESTS += test-alloca-opt
+check_PROGRAMS += test-alloca-opt
+
+EXTRA_DIST += test-alloca-opt.c
+
+## end gnulib module alloca-opt-tests
+
+## begin gnulib module areadlink-tests
+
+TESTS += test-areadlink
+check_PROGRAMS += test-areadlink
+EXTRA_DIST += test-areadlink.h test-areadlink.c macros.h
+
+## end gnulib module areadlink-tests
+
+## begin gnulib module argmatch-tests
+
+TESTS += test-argmatch
+check_PROGRAMS += test-argmatch
+test_argmatch_LDADD = $(LDADD) @LIBINTL@
+
+EXTRA_DIST += test-argmatch.c macros.h
+
+## end gnulib module argmatch-tests
+
+## begin gnulib module arpa_inet
+
+BUILT_SOURCES += arpa/inet.h
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_at)$(MKDIR_P) arpa
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+ -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+ -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \
+ -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \
+ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+ -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
+ -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|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)/arpa_inet.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
+MOSTLYCLEANDIRS += arpa
+
+EXTRA_DIST += arpa_inet.in.h
+
+## end gnulib module arpa_inet
+
+## begin gnulib module arpa_inet-tests
+
+TESTS += test-arpa_inet
+check_PROGRAMS += test-arpa_inet
+EXTRA_DIST += test-arpa_inet.c
+
+## end gnulib module arpa_inet-tests
+
+## begin gnulib module binary-io-tests
+
+TESTS += test-binary-io.sh
+check_PROGRAMS += test-binary-io
+
+EXTRA_DIST += test-binary-io.sh test-binary-io.c macros.h
+
+## end gnulib module binary-io-tests
+
+## begin gnulib module bind
+
+
+EXTRA_DIST += bind.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += bind.c
+
+## end gnulib module bind
+
+## begin gnulib module bind-tests
+
+TESTS += test-bind
+check_PROGRAMS += test-bind
+test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+EXTRA_DIST += test-bind.c signature.h macros.h
+
+## end gnulib module bind-tests
+
+## begin gnulib module bitrotate-tests
+
+TESTS += test-bitrotate
+check_PROGRAMS += test-bitrotate
+EXTRA_DIST += test-bitrotate.c macros.h
+
+## end gnulib module bitrotate-tests
+
+## begin gnulib module btowc-tests
+
+TESTS += test-btowc1.sh test-btowc2.sh
+TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+check_PROGRAMS += test-btowc
+
+EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h
+
+## end gnulib module btowc-tests
+
+## begin gnulib module c-ctype-tests
+
+TESTS += test-c-ctype
+check_PROGRAMS += test-c-ctype
+EXTRA_DIST += test-c-ctype.c macros.h
+
+## end gnulib module c-ctype-tests
+
+## begin gnulib module c-stack-tests
+
+TESTS += test-c-stack.sh test-c-stack2.sh
+TESTS_ENVIRONMENT += LIBSIGSEGV='@LIBSIGSEGV@'
+check_PROGRAMS += test-c-stack
+test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@
+MOSTLYCLEANFILES += t-c-stack.tmp t-c-stack2.tmp
+EXTRA_DIST += test-c-stack.c test-c-stack.sh test-c-stack2.sh macros.h
+
+## end gnulib module c-stack-tests
+
+## begin gnulib module c-strcase-tests
+
+TESTS += test-c-strcase.sh
+TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
+check_PROGRAMS += test-c-strcasecmp test-c-strncasecmp
+EXTRA_DIST += test-c-strcase.sh test-c-strcasecmp.c test-c-strncasecmp.c macros.h
+
+## end gnulib module c-strcase-tests
+
+## begin gnulib module close-tests
+
+TESTS += test-close
+check_PROGRAMS += test-close
+EXTRA_DIST += test-close.c signature.h macros.h
+
+## end gnulib module close-tests
+
+## begin gnulib module connect
+
+
+EXTRA_DIST += connect.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += connect.c
+
+## end gnulib module connect
+
+## begin gnulib module connect-tests
+
+TESTS += test-connect
+check_PROGRAMS += test-connect
+test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+EXTRA_DIST += test-connect.c signature.h macros.h
+
+## end gnulib module connect-tests
+
+## begin gnulib module ctype-tests
+
+TESTS += test-ctype
+check_PROGRAMS += test-ctype
+EXTRA_DIST += test-ctype.c
+
+## end gnulib module ctype-tests
+
+## begin gnulib module dirname-tests
+
+TESTS += test-dirname
+check_PROGRAMS += test-dirname
+test_dirname_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-dirname.c
+
+## end gnulib module dirname-tests
+
+## begin gnulib module dtotimespec
+
+libtests_a_SOURCES += dtotimespec.c
+
+## end gnulib module dtotimespec
+
+## begin gnulib module dup2-tests
+
+TESTS += test-dup2
+check_PROGRAMS += test-dup2
+EXTRA_DIST += test-dup2.c signature.h macros.h
+
+## end gnulib module dup2-tests
+
+## begin gnulib module environ-tests
+
+TESTS += test-environ
+check_PROGRAMS += test-environ
+
+EXTRA_DIST += test-environ.c
+
+## end gnulib module environ-tests
+
+## begin gnulib module errno-tests
+
+TESTS += test-errno
+check_PROGRAMS += test-errno
+
+EXTRA_DIST += test-errno.c
+
+## end gnulib module errno-tests
+
+## begin gnulib module exclude-tests
+
+TESTS += \
+ test-exclude1.sh\
+ test-exclude2.sh\
+ test-exclude3.sh\
+ test-exclude4.sh\
+ test-exclude5.sh\
+ test-exclude6.sh\
+ test-exclude7.sh\
+ test-exclude8.sh
+
+check_PROGRAMS += test-exclude
+test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+EXTRA_DIST += test-exclude.c test-exclude1.sh test-exclude2.sh test-exclude3.sh test-exclude4.sh test-exclude5.sh test-exclude6.sh test-exclude7.sh test-exclude8.sh
+
+## end gnulib module exclude-tests
+
+## begin gnulib module fcntl-h-tests
+
+TESTS += test-fcntl-h
+check_PROGRAMS += test-fcntl-h
+EXTRA_DIST += test-fcntl-h.c
+
+## end gnulib module fcntl-h-tests
+
+## begin gnulib module fcntl-tests
+
+TESTS += test-fcntl
+check_PROGRAMS += test-fcntl
+EXTRA_DIST += test-fcntl.c signature.h macros.h
+
+## end gnulib module fcntl-tests
+
+## begin gnulib module fdopen
+
+
+EXTRA_DIST += fdopen.c
+
+EXTRA_libtests_a_SOURCES += fdopen.c
+
+## end gnulib module fdopen
+
+## begin gnulib module fdopen-tests
+
+TESTS += test-fdopen
+check_PROGRAMS += test-fdopen
+EXTRA_DIST += test-fdopen.c signature.h macros.h
+
+## end gnulib module fdopen-tests
+
+## begin gnulib module fgetc-tests
+
+TESTS += test-fgetc
+check_PROGRAMS += test-fgetc
+EXTRA_DIST += test-fgetc.c signature.h macros.h
+
+## end gnulib module fgetc-tests
+
+## begin gnulib module filenamecat-tests
+
+TESTS += test-filenamecat
+check_PROGRAMS += test-filenamecat
+test_filenamecat_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-filenamecat.c
+
+## end gnulib module filenamecat-tests
+
+## begin gnulib module float-tests
+
+TESTS += test-float
+check_PROGRAMS += test-float
+EXTRA_DIST += test-float.c macros.h
+
+## end gnulib module float-tests
+
+## begin gnulib module fnmatch-tests
+
+TESTS += test-fnmatch
+check_PROGRAMS += test-fnmatch
+EXTRA_DIST += test-fnmatch.c signature.h macros.h
+
+## end gnulib module fnmatch-tests
+
+## begin gnulib module fpucw
+
+
+EXTRA_DIST += fpucw.h
+
+## end gnulib module fpucw
+
+## begin gnulib module fputc-tests
+
+TESTS += test-fputc
+check_PROGRAMS += test-fputc
+EXTRA_DIST += test-fputc.c signature.h macros.h
+
+## end gnulib module fputc-tests
+
+## begin gnulib module fread-tests
+
+TESTS += test-fread
+check_PROGRAMS += test-fread
+EXTRA_DIST += test-fread.c signature.h macros.h
+
+## end gnulib module fread-tests
+
+## begin gnulib module freopen-safer-tests
+
+TESTS += test-freopen-safer
+check_PROGRAMS += test-freopen-safer
+EXTRA_DIST += test-freopen-safer.c macros.h
+
+## end gnulib module freopen-safer-tests
+
+## begin gnulib module freopen-tests
+
+TESTS += test-freopen
+check_PROGRAMS += test-freopen
+
+EXTRA_DIST += test-freopen.c signature.h macros.h
+
+## end gnulib module freopen-tests
+
+## begin gnulib module fstat-tests
+
+TESTS += test-fstat
+check_PROGRAMS += test-fstat
+EXTRA_DIST += test-fstat.c signature.h macros.h
+
+## end gnulib module fstat-tests
+
+## begin gnulib module ftruncate
+
+
+EXTRA_DIST += ftruncate.c
+
+EXTRA_libtests_a_SOURCES += ftruncate.c
+
+## end gnulib module ftruncate
+
+## begin gnulib module ftruncate-tests
+
+TESTS += test-ftruncate.sh
+check_PROGRAMS += test-ftruncate
+EXTRA_DIST += test-ftruncate.c test-ftruncate.sh signature.h macros.h
+
+## end gnulib module ftruncate-tests
+
+## begin gnulib module fwrite-tests
+
+TESTS += test-fwrite
+check_PROGRAMS += test-fwrite
+EXTRA_DIST += test-fwrite.c signature.h macros.h
+
+## end gnulib module fwrite-tests
+
+## begin gnulib module getcwd-lgpl
+
+
+EXTRA_DIST += getcwd-lgpl.c
+
+EXTRA_libtests_a_SOURCES += getcwd-lgpl.c
+
+## end gnulib module getcwd-lgpl
+
+## begin gnulib module getcwd-lgpl-tests
+
+TESTS += test-getcwd-lgpl
+check_PROGRAMS += test-getcwd-lgpl
+test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL)
+EXTRA_DIST += test-getcwd-lgpl.c signature.h macros.h
+
+## end gnulib module getcwd-lgpl-tests
+
+## begin gnulib module getdtablesize-tests
+
+TESTS += test-getdtablesize
+check_PROGRAMS += test-getdtablesize
+EXTRA_DIST += test-getdtablesize.c signature.h macros.h
+
+## end gnulib module getdtablesize-tests
+
+## begin gnulib module getopt-posix-tests
+
+TESTS += test-getopt
+check_PROGRAMS += test-getopt
+test_getopt_LDADD = $(LDADD) $(LIBINTL)
+EXTRA_DIST += macros.h signature.h test-getopt.c test-getopt.h test-getopt_long.h
+
+## end gnulib module getopt-posix-tests
+
+## begin gnulib module getpagesize
+
+
+EXTRA_DIST += getpagesize.c
+
+EXTRA_libtests_a_SOURCES += getpagesize.c
+
+## end gnulib module getpagesize
+
+## begin gnulib module gettimeofday-tests
+
+TESTS += test-gettimeofday
+check_PROGRAMS += test-gettimeofday
+
+EXTRA_DIST += signature.h test-gettimeofday.c
+
+## end gnulib module gettimeofday-tests
+
+## begin gnulib module hash-pjw
+
+libtests_a_SOURCES += hash-pjw.h hash-pjw.c
+
+## end gnulib module hash-pjw
+
+## begin gnulib module hash-tests
+
+TESTS += test-hash
+check_PROGRAMS += test-hash
+EXTRA_DIST += test-hash.c macros.h
+
+## end gnulib module hash-tests
+
+## begin gnulib module iconv-h-tests
+
+TESTS += test-iconv-h
+check_PROGRAMS += test-iconv-h
+EXTRA_DIST += test-iconv-h.c
+
+## end gnulib module iconv-h-tests
+
+## begin gnulib module iconv-tests
+
+TESTS += test-iconv
+check_PROGRAMS += test-iconv
+test_iconv_LDADD = $(LDADD) @LIBICONV@
+
+EXTRA_DIST += test-iconv.c signature.h macros.h
+
+## end gnulib module iconv-tests
+
+## begin gnulib module ignore-value-tests
+
+TESTS += test-ignore-value
+check_PROGRAMS += test-ignore-value
+EXTRA_DIST += test-ignore-value.c
+
+## end gnulib module ignore-value-tests
+
+## begin gnulib module inet_pton
+
+
+EXTRA_DIST += inet_pton.c
+
+EXTRA_libtests_a_SOURCES += inet_pton.c
+
+## end gnulib module inet_pton
+
+## begin gnulib module inet_pton-tests
+
+TESTS += test-inet_pton
+check_PROGRAMS += test-inet_pton
+test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@
+EXTRA_DIST += test-inet_pton.c signature.h macros.h
+
+## end gnulib module inet_pton-tests
+
+## begin gnulib module intprops-tests
+
+TESTS += test-intprops
+check_PROGRAMS += test-intprops
+EXTRA_DIST += test-intprops.c macros.h
+
+## end gnulib module intprops-tests
+
+## begin gnulib module inttostr-tests
+
+TESTS += test-inttostr
+check_PROGRAMS += test-inttostr
+EXTRA_DIST += macros.h test-inttostr.c
+
+## end gnulib module inttostr-tests
+
+## begin gnulib module inttypes-tests
+
+TESTS += test-inttypes
+check_PROGRAMS += test-inttypes
+EXTRA_DIST += test-inttypes.c
+
+## end gnulib module inttypes-tests
+
+## begin gnulib module ioctl
+
+
+EXTRA_DIST += ioctl.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += ioctl.c
+
+## end gnulib module ioctl
+
+## begin gnulib module ioctl-tests
+
+TESTS += test-ioctl
+check_PROGRAMS += test-ioctl
+EXTRA_DIST += test-ioctl.c signature.h macros.h
+
+## end gnulib module ioctl-tests
+
+## begin gnulib module isblank-tests
+
+TESTS += test-isblank
+check_PROGRAMS += test-isblank
+EXTRA_DIST += test-isblank.c signature.h macros.h
+
+## end gnulib module isblank-tests
+
+## begin gnulib module iswblank-tests
+
+TESTS += test-iswblank
+check_PROGRAMS += test-iswblank
+EXTRA_DIST += test-iswblank.c macros.h
+
+## end gnulib module iswblank-tests
+
+## begin gnulib module langinfo-tests
+
+TESTS += test-langinfo
+check_PROGRAMS += test-langinfo
+EXTRA_DIST += test-langinfo.c
+
+## end gnulib module langinfo-tests
+
+## begin gnulib module listen
+
+
+EXTRA_DIST += listen.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += listen.c
+
+## end gnulib module listen
+
+## begin gnulib module listen-tests
+
+TESTS += test-listen
+check_PROGRAMS += test-listen
+test_listen_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-listen.c signature.h macros.h
+
+## end gnulib module listen-tests
+
+## begin gnulib module locale-tests
+
+TESTS += test-locale
+check_PROGRAMS += test-locale
+EXTRA_DIST += test-locale.c
+
+## end gnulib module locale-tests
+
+## begin gnulib module localeconv-tests
+
+TESTS += test-localeconv
+check_PROGRAMS += test-localeconv
+EXTRA_DIST += test-localeconv.c signature.h macros.h
+
+## end gnulib module localeconv-tests
+
+## begin gnulib module lstat-tests
+
+TESTS += test-lstat
+check_PROGRAMS += test-lstat
+EXTRA_DIST += test-lstat.h test-lstat.c signature.h macros.h
+
+## end gnulib module lstat-tests
+
+## begin gnulib module malloca-tests
+
+TESTS += test-malloca
+check_PROGRAMS += test-malloca
+
+EXTRA_DIST += test-malloca.c
+
+## end gnulib module malloca-tests
+
+## begin gnulib module mbrtowc-tests
+
+TESTS += \
+ test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \
+ test-mbrtowc5.sh \
+ test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh \
+ test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-mbrtowc test-mbrtowc-w32
+EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h
+
+## end gnulib module mbrtowc-tests
+
+## begin gnulib module mbscasecmp-tests
+
+TESTS += test-mbscasecmp.sh
+TESTS_ENVIRONMENT += LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
+check_PROGRAMS += test-mbscasecmp
+
+EXTRA_DIST += test-mbscasecmp.sh test-mbscasecmp.c macros.h
+
+## end gnulib module mbscasecmp-tests
+
+## begin gnulib module mbsinit-tests
+
+TESTS += test-mbsinit.sh
+TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+check_PROGRAMS += test-mbsinit
+
+EXTRA_DIST += test-mbsinit.sh test-mbsinit.c signature.h macros.h
+
+## end gnulib module mbsinit-tests
+
+## begin gnulib module mbsrtowcs-tests
+
+TESTS += test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-mbsrtowcs
+
+EXTRA_DIST += test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh test-mbsrtowcs.c signature.h macros.h
+
+## end gnulib module mbsrtowcs-tests
+
+## begin gnulib module mbsstr-tests
+
+TESTS += test-mbsstr1 test-mbsstr2.sh test-mbsstr3.sh
+TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-mbsstr1 test-mbsstr2 test-mbsstr3
+
+EXTRA_DIST += test-mbsstr1.c test-mbsstr2.sh test-mbsstr2.c test-mbsstr3.sh test-mbsstr3.c macros.h
+
+## end gnulib module mbsstr-tests
+
+## begin gnulib module memchr-tests
+
+TESTS += test-memchr
+check_PROGRAMS += test-memchr
+EXTRA_DIST += test-memchr.c zerosize-ptr.h signature.h macros.h
+
+## end gnulib module memchr-tests
+
+## begin gnulib module nanosleep
+
+
+EXTRA_DIST += nanosleep.c
+
+EXTRA_libtests_a_SOURCES += nanosleep.c
+
+## end gnulib module nanosleep
+
+## begin gnulib module nanosleep-tests
+
+TESTS += test-nanosleep
+check_PROGRAMS += test-nanosleep
+test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+EXTRA_DIST += test-nanosleep.c signature.h macros.h
+
+## end gnulib module nanosleep-tests
+
+## begin gnulib module netinet_in
+
+BUILT_SOURCES += $(NETINET_IN_H)
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+if GL_GENERATE_NETINET_IN_H
+netinet/in.h: netinet_in.in.h $(top_builddir)/config.status
+ $(AM_V_at)$(MKDIR_P) netinet
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+ < $(srcdir)/netinet_in.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+netinet/in.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
+MOSTLYCLEANDIRS += netinet
+
+EXTRA_DIST += netinet_in.in.h
+
+## end gnulib module netinet_in
+
+## begin gnulib module netinet_in-tests
+
+TESTS += test-netinet_in
+check_PROGRAMS += test-netinet_in
+EXTRA_DIST += test-netinet_in.c
+
+## end gnulib module netinet_in-tests
+
+## begin gnulib module nl_langinfo-tests
+
+TESTS += test-nl_langinfo.sh
+TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+check_PROGRAMS += test-nl_langinfo
+EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c signature.h macros.h
+
+## end gnulib module nl_langinfo-tests
+
+## begin gnulib module open-tests
+
+TESTS += test-open
+check_PROGRAMS += test-open
+EXTRA_DIST += test-open.h test-open.c signature.h macros.h
+
+## end gnulib module open-tests
+
+## begin gnulib module pathmax-tests
+
+TESTS += test-pathmax
+check_PROGRAMS += test-pathmax
+EXTRA_DIST += test-pathmax.c
+
+## end gnulib module pathmax-tests
+
+## begin gnulib module perror
+
+
+EXTRA_DIST += perror.c
+
+EXTRA_libtests_a_SOURCES += perror.c
+
+## end gnulib module perror
+
+## begin gnulib module perror-tests
+
+TESTS += test-perror.sh test-perror2
+check_PROGRAMS += test-perror test-perror2
+EXTRA_DIST += macros.h signature.h test-perror.c test-perror2.c test-perror.sh
+
+## end gnulib module perror-tests
+
+## begin gnulib module pipe-posix
+
+
+EXTRA_DIST += pipe.c
+
+EXTRA_libtests_a_SOURCES += pipe.c
+
+## end gnulib module pipe-posix
+
+## begin gnulib module pipe-posix-tests
+
+TESTS += test-pipe
+check_PROGRAMS += test-pipe
+EXTRA_DIST += test-pipe.c signature.h macros.h
+
+## end gnulib module pipe-posix-tests
+
+## begin gnulib module putenv
+
+
+EXTRA_DIST += putenv.c
+
+EXTRA_libtests_a_SOURCES += putenv.c
+
+## end gnulib module putenv
+
+## begin gnulib module quotearg-simple-tests
+
+TESTS += test-quotearg-simple
+check_PROGRAMS += test-quotearg-simple
+test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-quotearg-simple.c test-quotearg.h macros.h zerosize-ptr.h
+
+## end gnulib module quotearg-simple-tests
+
+## begin gnulib module raise-tests
+
+TESTS += test-raise
+check_PROGRAMS += test-raise
+EXTRA_DIST += test-raise.c signature.h macros.h
+
+## end gnulib module raise-tests
+
+## begin gnulib module rawmemchr-tests
+
+TESTS += test-rawmemchr
+check_PROGRAMS += test-rawmemchr
+EXTRA_DIST += test-rawmemchr.c zerosize-ptr.h signature.h macros.h
+
+## end gnulib module rawmemchr-tests
+
+## begin gnulib module readlink-tests
+
+TESTS += test-readlink
+check_PROGRAMS += test-readlink
+EXTRA_DIST += test-readlink.h test-readlink.c signature.h macros.h
+
+## end gnulib module readlink-tests
+
+## begin gnulib module regex-tests
+
+TESTS += test-regex
+check_PROGRAMS += test-regex
+test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD)
+EXTRA_DIST += test-regex.c macros.h
+
+## end gnulib module regex-tests
+
+## begin gnulib module same-inode
+
+
+EXTRA_DIST += same-inode.h
+
+## end gnulib module same-inode
+
+## begin gnulib module select
+
+
+EXTRA_DIST += select.c
+
+EXTRA_libtests_a_SOURCES += select.c
+
+## end gnulib module select
+
+## begin gnulib module select-tests
+
+TESTS += test-select test-select-in.sh test-select-out.sh
+# test-select-stdin has to be run by hand.
+check_PROGRAMS += test-select test-select-fd test-select-stdin
+test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB)
+test_select_fd_LDADD = $(LDADD) @LIB_SELECT@
+test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@
+EXTRA_DIST += macros.h signature.h test-select.c test-select.h test-select-fd.c test-select-in.sh test-select-out.sh test-select-stdin.c
+
+## end gnulib module select-tests
+
+## begin gnulib module setenv-tests
+
+TESTS += test-setenv
+check_PROGRAMS += test-setenv
+EXTRA_DIST += test-setenv.c signature.h macros.h
+
+## end gnulib module setenv-tests
+
+## begin gnulib module setlocale
+
+
+EXTRA_DIST += setlocale.c
+
+EXTRA_libtests_a_SOURCES += setlocale.c
+
+## end gnulib module setlocale
+
+## begin gnulib module setlocale-tests
+
+TESTS += test-setlocale1.sh test-setlocale2.sh
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-setlocale1 test-setlocale2
+EXTRA_DIST += test-setlocale1.sh test-setlocale1.c test-setlocale2.sh test-setlocale2.c signature.h macros.h
+
+## end gnulib module setlocale-tests
+
+## begin gnulib module setsockopt
+
+
+EXTRA_DIST += setsockopt.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += setsockopt.c
+
+## end gnulib module setsockopt
+
+## begin gnulib module setsockopt-tests
+
+TESTS += test-setsockopt
+check_PROGRAMS += test-setsockopt
+test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-setsockopt.c signature.h macros.h
+
+## end gnulib module setsockopt-tests
+
+## begin gnulib module sh-quote-tests
+
+TESTS += test-sh-quote
+check_PROGRAMS += test-sh-quote
+test_sh_quote_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-sh-quote.c
+
+## end gnulib module sh-quote-tests
+
+## begin gnulib module sigaction-tests
+
+TESTS += test-sigaction
+check_PROGRAMS += test-sigaction
+EXTRA_DIST += test-sigaction.c signature.h macros.h
+
+## end gnulib module sigaction-tests
+
+## begin gnulib module signal-h-tests
+
+TESTS += test-signal-h
+check_PROGRAMS += test-signal-h
+EXTRA_DIST += test-signal-h.c
+
+## end gnulib module signal-h-tests
+
+## begin gnulib module sigprocmask-tests
+
+TESTS += test-sigprocmask
+check_PROGRAMS += test-sigprocmask
+EXTRA_DIST += test-sigprocmask.c signature.h macros.h
+
+## end gnulib module sigprocmask-tests
+
+## begin gnulib module sleep
+
+
+EXTRA_DIST += sleep.c
+
+EXTRA_libtests_a_SOURCES += sleep.c
+
+## end gnulib module sleep
+
+## begin gnulib module sleep-tests
+
+TESTS += test-sleep
+check_PROGRAMS += test-sleep
+EXTRA_DIST += test-sleep.c signature.h macros.h
+
+## end gnulib module sleep-tests
+
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+## end gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_ARG_NONNULL/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+
+## end gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/_GL_CXXDEFS/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/c++defs.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+
+## end gnulib module snippet/c++defs
+
+## begin gnulib module snippet/unused-parameter
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += unused-parameter.h
+# The unused-parameter.h that gets inserted into generated .h files is the same
+# as build-aux/snippet/unused-parameter.h, except that it has the copyright
+# header cut off.
+unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+
+UNUSED_PARAMETER_H=unused-parameter.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h
+
+## end gnulib module snippet/unused-parameter
+
+## begin gnulib module snippet/warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/^.ifndef/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+
+## end gnulib module snippet/warn-on-use
+
+## begin gnulib module snprintf
+
+
+EXTRA_DIST += snprintf.c
+
+EXTRA_libtests_a_SOURCES += snprintf.c
+
+## end gnulib module snprintf
+
+## begin gnulib module snprintf-tests
+
+TESTS += test-snprintf
+check_PROGRAMS += test-snprintf
+
+EXTRA_DIST += test-snprintf.c signature.h macros.h
+
+## end gnulib module snprintf-tests
+
+## begin gnulib module socket
+
+
+EXTRA_DIST += socket.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += socket.c
+
+## end gnulib module socket
+
+## begin gnulib module sockets
+
+libtests_a_SOURCES += sockets.h sockets.c
+
+EXTRA_DIST += w32sock.h
+
+## end gnulib module sockets
+
+## begin gnulib module sockets-tests
+
+TESTS += test-sockets
+check_PROGRAMS += test-sockets
+test_sockets_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-sockets.c
+
+## end gnulib module sockets-tests
+
+## begin gnulib module stat-tests
+
+TESTS += test-stat
+check_PROGRAMS += test-stat
+test_stat_LDADD = $(LDADD) $(LIBINTL)
+EXTRA_DIST += test-stat.h test-stat.c signature.h macros.h
+
+## end gnulib module stat-tests
+
+## begin gnulib module stat-time-tests
+
+TESTS += test-stat-time
+check_PROGRAMS += test-stat-time
+test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+EXTRA_DIST += test-stat-time.c macros.h nap.h
+
+## end gnulib module stat-time-tests
+
+## 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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/stdalign.in.h; \
+ } > $@-t && \
+ 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 stdalign-tests
+
+TESTS += test-stdalign
+check_PROGRAMS += test-stdalign
+EXTRA_DIST += test-stdalign.c macros.h
+
+## end gnulib module stdalign-tests
+
+## begin gnulib module stdbool-tests
+
+TESTS += test-stdbool
+check_PROGRAMS += test-stdbool
+EXTRA_DIST += test-stdbool.c
+
+## end gnulib module stdbool-tests
+
+## begin gnulib module stddef-tests
+
+TESTS += test-stddef
+check_PROGRAMS += test-stddef
+EXTRA_DIST += test-stddef.c
+
+## end gnulib module stddef-tests
+
+## begin gnulib module stdint-tests
+
+TESTS += test-stdint
+check_PROGRAMS += test-stdint
+EXTRA_DIST += test-stdint.c
+
+## end gnulib module stdint-tests
+
+## begin gnulib module stdio-tests
+
+TESTS += test-stdio
+check_PROGRAMS += test-stdio
+EXTRA_DIST += test-stdio.c
+
+## end gnulib module stdio-tests
+
+## begin gnulib module stdlib-tests
+
+TESTS += test-stdlib
+check_PROGRAMS += test-stdlib
+EXTRA_DIST += test-stdlib.c test-sys_wait.h
+
+## end gnulib module stdlib-tests
+
+## begin gnulib module strerror-tests
+
+TESTS += test-strerror
+check_PROGRAMS += test-strerror
+EXTRA_DIST += test-strerror.c signature.h macros.h
+
+## end gnulib module strerror-tests
+
+## begin gnulib module strerror_r-posix
+
+
+EXTRA_DIST += strerror_r.c
+
+EXTRA_libtests_a_SOURCES += strerror_r.c
+
+## end gnulib module strerror_r-posix
+
+## begin gnulib module strerror_r-posix-tests
+
+TESTS += test-strerror_r
+check_PROGRAMS += test-strerror_r
+EXTRA_DIST += test-strerror_r.c signature.h macros.h
+
+## end gnulib module strerror_r-posix-tests
+
+## begin gnulib module strftime-tests
+
+TESTS += test-strftime
+check_PROGRAMS += test-strftime
+EXTRA_DIST += test-strftime.c macros.h
+
+## end gnulib module strftime-tests
+
+## begin gnulib module striconv-tests
+
+TESTS += test-striconv
+check_PROGRAMS += test-striconv
+test_striconv_LDADD = $(LDADD) @LIBICONV@
+
+EXTRA_DIST += test-striconv.c macros.h
+
+## end gnulib module striconv-tests
+
+## begin gnulib module string-tests
+
+TESTS += test-string
+check_PROGRAMS += test-string
+EXTRA_DIST += test-string.c
+
+## end gnulib module string-tests
+
+## begin gnulib module strings-tests
+
+TESTS += test-strings
+check_PROGRAMS += test-strings
+EXTRA_DIST += test-strings.c
+
+## end gnulib module strings-tests
+
+## begin gnulib module strnlen-tests
+
+TESTS += test-strnlen
+check_PROGRAMS += test-strnlen
+EXTRA_DIST += test-strnlen.c zerosize-ptr.h signature.h macros.h
+
+## end gnulib module strnlen-tests
+
+## begin gnulib module strtoull-tests
+
+TESTS += test-strtoull
+check_PROGRAMS += test-strtoull
+EXTRA_DIST += test-strtoull.c signature.h macros.h
+
+## end gnulib module strtoull-tests
+
+## begin gnulib module strtoumax-tests
+
+TESTS += test-strtoumax
+check_PROGRAMS += test-strtoumax
+EXTRA_DIST += test-strtoumax.c signature.h macros.h
+
+## end gnulib module strtoumax-tests
+
+## begin gnulib module symlink
+
+
+EXTRA_DIST += symlink.c
+
+EXTRA_libtests_a_SOURCES += symlink.c
+
+## end gnulib module symlink
+
+## begin gnulib module symlink-tests
+
+TESTS += test-symlink
+check_PROGRAMS += test-symlink
+EXTRA_DIST += test-symlink.h test-symlink.c signature.h macros.h
+
+## end gnulib module symlink-tests
+
+## 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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''@/$(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 && \
+ 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_ioctl-tests
+
+TESTS += test-sys_ioctl
+check_PROGRAMS += test-sys_ioctl
+EXTRA_DIST += test-sys_ioctl.c
+
+## end gnulib module sys_ioctl-tests
+
+## 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+ -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+ -e 's/@''GNULIB_PSELECT''@/$(GNULIB_PSELECT)/g' \
+ -e 's/@''GNULIB_SELECT''@/$(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 && \
+ 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_select-tests
+
+TESTS += test-sys_select
+check_PROGRAMS += test-sys_select
+EXTRA_DIST += test-sys_select.c signature.h
+
+## end gnulib module sys_select-tests
+
+## begin gnulib module sys_socket
+
+BUILT_SOURCES += sys/socket.h
+libtests_a_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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_SOCKET''@/$(GNULIB_SOCKET)/g' \
+ -e 's/@''GNULIB_CONNECT''@/$(GNULIB_CONNECT)/g' \
+ -e 's/@''GNULIB_ACCEPT''@/$(GNULIB_ACCEPT)/g' \
+ -e 's/@''GNULIB_BIND''@/$(GNULIB_BIND)/g' \
+ -e 's/@''GNULIB_GETPEERNAME''@/$(GNULIB_GETPEERNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKNAME''@/$(GNULIB_GETSOCKNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKOPT''@/$(GNULIB_GETSOCKOPT)/g' \
+ -e 's/@''GNULIB_LISTEN''@/$(GNULIB_LISTEN)/g' \
+ -e 's/@''GNULIB_RECV''@/$(GNULIB_RECV)/g' \
+ -e 's/@''GNULIB_SEND''@/$(GNULIB_SEND)/g' \
+ -e 's/@''GNULIB_RECVFROM''@/$(GNULIB_RECVFROM)/g' \
+ -e 's/@''GNULIB_SENDTO''@/$(GNULIB_SENDTO)/g' \
+ -e 's/@''GNULIB_SETSOCKOPT''@/$(GNULIB_SETSOCKOPT)/g' \
+ -e 's/@''GNULIB_SHUTDOWN''@/$(GNULIB_SHUTDOWN)/g' \
+ -e 's/@''GNULIB_ACCEPT4''@/$(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 && \
+ mv -f $@-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_socket-tests
+
+TESTS += test-sys_socket
+check_PROGRAMS += test-sys_socket
+EXTRA_DIST += test-sys_socket.c
+
+## end gnulib module sys_socket-tests
+
+## begin gnulib module sys_stat-tests
+
+TESTS += test-sys_stat
+check_PROGRAMS += test-sys_stat
+EXTRA_DIST += test-sys_stat.c
+
+## end gnulib module sys_stat-tests
+
+## begin gnulib module sys_time-tests
+
+TESTS += test-sys_time
+check_PROGRAMS += test-sys_time
+EXTRA_DIST += test-sys_time.c
+
+## end gnulib module sys_time-tests
+
+## begin gnulib module sys_types-tests
+
+TESTS += test-sys_types
+check_PROGRAMS += test-sys_types
+EXTRA_DIST += test-sys_types.c
+
+## end gnulib module sys_types-tests
+
+## 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_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 && \
+ mv -f $@-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 sys_uio-tests
+
+TESTS += test-sys_uio
+check_PROGRAMS += test-sys_uio
+EXTRA_DIST += test-sys_uio.c
+
+## end gnulib module sys_uio-tests
+
+## begin gnulib module sys_wait-tests
+
+TESTS += test-sys_wait
+check_PROGRAMS += test-sys_wait
+EXTRA_DIST += test-sys_wait.c test-sys_wait.h
+
+## end gnulib module sys_wait-tests
+
+## begin gnulib module test-framework-sh-tests
+
+TESTS += test-init.sh
+EXTRA_DIST += init.sh
+EXTRA_DIST += test-init.sh
+
+## end gnulib module test-framework-sh-tests
+
+## begin gnulib module time-tests
+
+TESTS += test-time
+check_PROGRAMS += test-time
+EXTRA_DIST += test-time.c
+
+## end gnulib module time-tests
+
+## begin gnulib module timespec-add
+
+libtests_a_SOURCES += timespec-add.c
+
+## end gnulib module timespec-add
+
+## begin gnulib module timespec-sub
+
+libtests_a_SOURCES += timespec-sub.c
+
+## end gnulib module timespec-sub
+
+## begin gnulib module timespec-tests
+
+TESTS += test-timespec
+check_PROGRAMS += test-timespec
+EXTRA_DIST += test-timespec.c macros.h
+
+## end gnulib module timespec-tests
+
+## begin gnulib module unistd-tests
+
+TESTS += test-unistd
+check_PROGRAMS += test-unistd
+EXTRA_DIST += test-unistd.c
+
+## end gnulib module unistd-tests
+
+## begin gnulib module unistr/u8-mbtoucr-tests
+
+TESTS += test-u8-mbtoucr
+check_PROGRAMS += test-u8-mbtoucr
+test_u8_mbtoucr_SOURCES = unistr/test-u8-mbtoucr.c
+test_u8_mbtoucr_LDADD = $(LDADD) $(LIBUNISTRING)
+EXTRA_DIST += unistr/test-u8-mbtoucr.c macros.h
+
+## end gnulib module unistr/u8-mbtoucr-tests
+
+## begin gnulib module unistr/u8-uctomb-tests
+
+TESTS += test-u8-uctomb
+check_PROGRAMS += test-u8-uctomb
+test_u8_uctomb_SOURCES = unistr/test-u8-uctomb.c
+test_u8_uctomb_LDADD = $(LDADD) $(LIBUNISTRING)
+EXTRA_DIST += unistr/test-u8-uctomb.c macros.h
+
+## end gnulib module unistr/u8-uctomb-tests
+
+## begin gnulib module uniwidth/width-tests
+
+TESTS += test-uc_width uniwidth/test-uc_width2.sh
+check_PROGRAMS += test-uc_width test-uc_width2
+test_uc_width_SOURCES = uniwidth/test-uc_width.c
+test_uc_width_LDADD = $(LDADD) $(LIBUNISTRING)
+test_uc_width2_SOURCES = uniwidth/test-uc_width2.c
+test_uc_width2_LDADD = $(LDADD) $(LIBUNISTRING)
+EXTRA_DIST += uniwidth/test-uc_width.c uniwidth/test-uc_width2.c uniwidth/test-uc_width2.sh macros.h
+
+## end gnulib module uniwidth/width-tests
+
+## begin gnulib module unsetenv-tests
+
+TESTS += test-unsetenv
+check_PROGRAMS += test-unsetenv
+EXTRA_DIST += test-unsetenv.c signature.h macros.h
+
+## end gnulib module unsetenv-tests
+
+## begin gnulib module update-copyright-tests
+
+TESTS += test-update-copyright.sh
+TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)'
+EXTRA_DIST += test-update-copyright.sh
+
+## end gnulib module update-copyright-tests
+
+## begin gnulib module vasnprintf-tests
+
+TESTS += test-vasnprintf
+check_PROGRAMS += test-vasnprintf
+
+EXTRA_DIST += test-vasnprintf.c macros.h
+
+## end gnulib module vasnprintf-tests
+
+## begin gnulib module vasprintf-tests
+
+TESTS += test-vasprintf
+check_PROGRAMS += test-vasprintf
+
+EXTRA_DIST += test-vasprintf.c signature.h macros.h
+
+## end gnulib module vasprintf-tests
+
+## begin gnulib module vc-list-files-tests
+
+TESTS += test-vc-list-files-git.sh
+TESTS += test-vc-list-files-cvs.sh
+TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)'
+EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh
+
+## end gnulib module vc-list-files-tests
+
+## begin gnulib module verify-tests
+
+TESTS_ENVIRONMENT += MAKE='$(MAKE)'
+TESTS += test-verify test-verify.sh
+check_PROGRAMS += test-verify
+
+# This test expects compilation of test-verify.c to fail, and
+# each time it fails, the makefile rule does not perform the usual
+# "mv -f $name.Tpo $name.po, so tell make clean to remove that file.
+MOSTLYCLEANFILES += .deps/test-verify.Tpo
+EXTRA_DIST += test-verify.c test-verify.sh
+
+## end gnulib module verify-tests
+
+## begin gnulib module version-etc-tests
+
+TESTS += test-version-etc.sh
+check_PROGRAMS += test-version-etc
+test_version_etc_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-version-etc.c test-version-etc.sh
+
+## end gnulib module version-etc-tests
+
+## begin gnulib module wchar-tests
+
+TESTS += test-wchar
+check_PROGRAMS += test-wchar
+EXTRA_DIST += test-wchar.c
+
+## end gnulib module wchar-tests
+
+## begin gnulib module wcrtomb-tests
+
+TESTS += \
+ test-wcrtomb.sh \
+ test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \
+ test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-wcrtomb test-wcrtomb-w32
+
+EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c signature.h macros.h
+
+## end gnulib module wcrtomb-tests
+
+## begin gnulib module wctob
+
+
+EXTRA_DIST += wctob.c
+
+EXTRA_libtests_a_SOURCES += wctob.c
+
+## end gnulib module wctob
+
+## begin gnulib module wctomb
+
+
+EXTRA_DIST += wctomb-impl.h wctomb.c
+
+EXTRA_libtests_a_SOURCES += wctomb.c
+
+## end gnulib module wctomb
+
+## begin gnulib module wctype-h-tests
+
+TESTS += test-wctype-h
+check_PROGRAMS += test-wctype-h
+EXTRA_DIST += test-wctype-h.c macros.h
+
+## end gnulib module wctype-h-tests
+
+## begin gnulib module wcwidth-tests
+
+TESTS += test-wcwidth
+check_PROGRAMS += test-wcwidth
+
+EXTRA_DIST += test-wcwidth.c signature.h macros.h
+
+## end gnulib module wcwidth-tests
+
+## begin gnulib module xalloc-die-tests
+
+TESTS += test-xalloc-die.sh
+check_PROGRAMS += test-xalloc-die
+test_xalloc_die_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-xalloc-die.c test-xalloc-die.sh
+
+## end gnulib module xalloc-die-tests
+
+## begin gnulib module xstrtol-tests
+
+TESTS += test-xstrtol.sh
+check_PROGRAMS += test-xstrtol test-xstrtoul
+test_xstrtol_LDADD = $(LDADD) @LIBINTL@
+test_xstrtoul_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-xstrtol.c test-xstrtoul.c test-xstrtol.sh
+
+## end gnulib module xstrtol-tests
+
+## begin gnulib module xstrtoumax-tests
+
+TESTS += test-xstrtoumax.sh
+check_PROGRAMS += test-xstrtoumax
+test_xstrtoumax_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-xstrtoumax.c test-xstrtoumax.sh
+
+## end gnulib module xstrtoumax-tests
+
+## begin gnulib module xvasprintf-tests
+
+TESTS += test-xvasprintf
+check_PROGRAMS += test-xvasprintf
+test_xvasprintf_LDADD = $(LDADD) @LIBINTL@
+
+EXTRA_DIST += test-xvasprintf.c macros.h
+
+## end gnulib module xvasprintf-tests
+
+# Clean up after Solaris cc.
+clean-local:
+ rm -rf SunWS_cache
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
diff --git a/gnulib-tests/hash-pjw.c b/gnulib-tests/hash-pjw.c
new file mode 100644
index 0000000..7796238
--- /dev/null
+++ b/gnulib-tests/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-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "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 http://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/gnulib-tests/hash-pjw.h b/gnulib-tests/hash-pjw.h
new file mode 100644
index 0000000..ae537d1
--- /dev/null
+++ b/gnulib-tests/hash-pjw.h
@@ -0,0 +1,23 @@
+/* hash-pjw.h -- declaration for a simple hash function
+ Copyright (C) 2001, 2003, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <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/gnulib-tests/inet_pton.c b/gnulib-tests/inet_pton.c
new file mode 100644
index 0000000..3cddfb1
--- /dev/null
+++ b/gnulib-tests/inet_pton.c
@@ -0,0 +1,268 @@
+/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
+
+ Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/*
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <config.h>
+
+/* Specification. */
+#include <arpa/inet.h>
+
+#if HAVE_DECL_INET_PTON
+
+# undef inet_pton
+
+int
+rpl_inet_pton (int af, const char *restrict src, void *restrict dst)
+{
+ return inet_pton (af, src, dst);
+}
+
+#else
+
+# include <c-ctype.h>
+# include <string.h>
+# include <errno.h>
+
+# define NS_INADDRSZ 4
+# define NS_IN6ADDRSZ 16
+# define NS_INT16SZ 2
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static int inet_pton4 (const char *src, unsigned char *dst);
+# if HAVE_IPV6
+static int inet_pton6 (const char *src, unsigned char *dst);
+# endif
+
+/* int
+ * inet_pton(af, src, dst)
+ * convert from presentation format (which usually means ASCII printable)
+ * to network format (which is usually some kind of binary format).
+ * return:
+ * 1 if the address was valid for the specified address family
+ * 0 if the address wasn't valid ('dst' is untouched in this case)
+ * -1 if some other error occurred ('dst' is untouched in this case, too)
+ * author:
+ * Paul Vixie, 1996.
+ */
+int
+inet_pton (int af, const char *restrict src, void *restrict dst)
+{
+ switch (af)
+ {
+ case AF_INET:
+ return (inet_pton4 (src, dst));
+
+# if HAVE_IPV6
+ case AF_INET6:
+ return (inet_pton6 (src, dst));
+# endif
+
+ default:
+ errno = EAFNOSUPPORT;
+ return (-1);
+ }
+ /* NOTREACHED */
+}
+
+/* int
+ * inet_pton4(src, dst)
+ * like inet_aton() but without all the hexadecimal, octal (with the
+ * exception of 0) and shorthand.
+ * return:
+ * 1 if 'src' is a valid dotted quad, else 0.
+ * notice:
+ * does not touch 'dst' unless it's returning 1.
+ * author:
+ * Paul Vixie, 1996.
+ */
+static int
+inet_pton4 (const char *restrict src, unsigned char *restrict dst)
+{
+ int saw_digit, octets, ch;
+ unsigned char tmp[NS_INADDRSZ], *tp;
+
+ saw_digit = 0;
+ octets = 0;
+ *(tp = tmp) = 0;
+ while ((ch = *src++) != '\0')
+ {
+
+ if (ch >= '0' && ch <= '9')
+ {
+ unsigned new = *tp * 10 + (ch - '0');
+
+ if (saw_digit && *tp == 0)
+ return (0);
+ if (new > 255)
+ return (0);
+ *tp = new;
+ if (!saw_digit)
+ {
+ if (++octets > 4)
+ return (0);
+ saw_digit = 1;
+ }
+ }
+ else if (ch == '.' && saw_digit)
+ {
+ if (octets == 4)
+ return (0);
+ *++tp = 0;
+ saw_digit = 0;
+ }
+ else
+ return (0);
+ }
+ if (octets < 4)
+ return (0);
+ memcpy (dst, tmp, NS_INADDRSZ);
+ return (1);
+}
+
+# if HAVE_IPV6
+
+/* int
+ * inet_pton6(src, dst)
+ * convert presentation level address to network order binary form.
+ * return:
+ * 1 if 'src' is a valid [RFC1884 2.2] address, else 0.
+ * notice:
+ * (1) does not touch 'dst' unless it's returning 1.
+ * (2) :: in a full address is silently ignored.
+ * credit:
+ * inspired by Mark Andrews.
+ * author:
+ * Paul Vixie, 1996.
+ */
+static int
+inet_pton6 (const char *restrict src, unsigned char *restrict dst)
+{
+ static const char xdigits[] = "0123456789abcdef";
+ unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *curtok;
+ int ch, saw_xdigit;
+ unsigned val;
+
+ tp = memset (tmp, '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
+ colonp = NULL;
+ /* Leading :: requires some special handling. */
+ if (*src == ':')
+ if (*++src != ':')
+ return (0);
+ curtok = src;
+ saw_xdigit = 0;
+ val = 0;
+ while ((ch = c_tolower (*src++)) != '\0')
+ {
+ const char *pch;
+
+ pch = strchr (xdigits, ch);
+ if (pch != NULL)
+ {
+ val <<= 4;
+ val |= (pch - xdigits);
+ if (val > 0xffff)
+ return (0);
+ saw_xdigit = 1;
+ continue;
+ }
+ if (ch == ':')
+ {
+ curtok = src;
+ if (!saw_xdigit)
+ {
+ if (colonp)
+ return (0);
+ colonp = tp;
+ continue;
+ }
+ else if (*src == '\0')
+ {
+ return (0);
+ }
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ saw_xdigit = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+ inet_pton4 (curtok, tp) > 0)
+ {
+ tp += NS_INADDRSZ;
+ saw_xdigit = 0;
+ break; /* '\0' was seen by inet_pton4(). */
+ }
+ return (0);
+ }
+ if (saw_xdigit)
+ {
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ }
+ if (colonp != NULL)
+ {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+ const int n = tp - colonp;
+ int i;
+
+ if (tp == endp)
+ return (0);
+ for (i = 1; i <= n; i++)
+ {
+ endp[-i] = colonp[n - i];
+ colonp[n - i] = 0;
+ }
+ tp = endp;
+ }
+ if (tp != endp)
+ return (0);
+ memcpy (dst, tmp, NS_IN6ADDRSZ);
+ return (1);
+}
+
+# endif
+
+#endif
diff --git a/gnulib-tests/init.sh b/gnulib-tests/init.sh
new file mode 100644
index 0000000..09b0739
--- /dev/null
+++ b/gnulib-tests/init.sh
@@ -0,0 +1,624 @@
+# source this file; set up for tests
+
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Using this file in a test
+# =========================
+#
+# The typical skeleton of a test looks like this:
+#
+# #!/bin/sh
+# . "${srcdir=.}/init.sh"; path_prepend_ .
+# Execute some commands.
+# Note that these commands are executed in a subdirectory, therefore you
+# need to prepend "../" to relative filenames in the build directory.
+# Note that the "path_prepend_ ." is useful only if the body of your
+# test invokes programs residing in the initial directory.
+# For example, if the programs you want to test are in src/, and this test
+# script is named tests/test-1, then you would use "path_prepend_ ../src",
+# or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
+# to all tests via automake's TESTS_ENVIRONMENT.
+# Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
+# Use the skip_ and fail_ functions to print a diagnostic and then exit
+# with the corresponding exit code.
+# Exit $?
+
+# Executing a test that uses this file
+# ====================================
+#
+# Running a single test:
+# $ make check TESTS=test-foo.sh
+#
+# Running a single test, with verbose output:
+# $ make check TESTS=test-foo.sh VERBOSE=yes
+#
+# Running a single test, with single-stepping:
+# 1. Go into a sub-shell:
+# $ bash
+# 2. Set relevant environment variables from TESTS_ENVIRONMENT in the
+# Makefile:
+# $ export srcdir=../../tests # this is an example
+# 3. Execute the commands from the test, copy&pasting them one by one:
+# $ . "$srcdir/init.sh"; path_prepend_ .
+# ...
+# 4. Finally
+# $ exit
+
+ME_=`expr "./$0" : '.*/\(.*\)$'`
+
+# We use a trap below for cleanup. This requires us to go through
+# hoops to get the right exit status transported through the handler.
+# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function.
+Exit () { set +e; (exit $1); exit $1; }
+
+# Print warnings (e.g., about skipped and failed tests) to this file number.
+# Override by defining to say, 9, in init.cfg, and putting say,
+# export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2
+# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file.
+# This is useful when using automake's parallel tests mode, to print
+# the reason for skip/failure to console, rather than to the .log files.
+: ${stderr_fileno_=2}
+
+# Note that correct expansion of "$*" depends on IFS starting with ' '.
+# Always write the full diagnostic to stderr.
+# When stderr_fileno_ is not 2, also emit the first line of the
+# diagnostic to that file descriptor.
+warn_ ()
+{
+ # If IFS does not start with ' ', set it and emit the warning in a subshell.
+ case $IFS in
+ ' '*) printf '%s\n' "$*" >&2
+ test $stderr_fileno_ = 2 \
+ || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
+ *) (IFS=' '; warn_ "$@");;
+ esac
+}
+fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
+skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
+fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
+framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
+
+# This is used to simplify checking of the return value
+# which is useful when ensuring a command fails as desired.
+# I.e., just doing `command ... &&fail=1` will not catch
+# a segfault in command for example. With this helper you
+# instead check an explicit exit code like
+# returns_ 1 command ... || fail
+returns_ () {
+ # Disable tracing so it doesn't interfere with stderr of the wrapped command
+ { set +x; } 2>/dev/null
+
+ local exp_exit="$1"
+ shift
+ "$@"
+ test $? -eq $exp_exit && ret_=0 || ret_=1
+
+ if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then
+ set -x
+ fi
+ { return $ret_; } 2>/dev/null
+}
+
+# Sanitize this shell to POSIX mode, if possible.
+DUALCASE=1; export DUALCASE
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+ esac
+fi
+
+# We require $(...) support unconditionally.
+# We require non-surprising "local" semantics (this eliminates dash).
+# This takes the admittedly draconian step of eliminating dash, because the
+# assignment tab=$(printf '\t') works fine, yet preceding it with "local "
+# transforms it into an assignment that sets the variable to the empty string.
+# That is too counter-intuitive, and can lead to subtle run-time malfunction.
+# The example below is less subtle in that with dash, it evokes the run-time
+# exception "dash: 1: local: 1: bad variable name".
+# We require a few additional shell features only when $EXEEXT is nonempty,
+# in order to support automatic $EXEEXT emulation:
+# - hyphen-containing alias names
+# - we prefer to use ${var#...} substitution, rather than having
+# to work around lack of support for that feature.
+# The following code attempts to find a shell with support for these features.
+# If the current shell passes the test, we're done. Otherwise, test other
+# shells until we find one that passes. If one is found, re-exec it.
+# If no acceptable shell is found, skip the current test.
+#
+# The "...set -x; P=1 true 2>err..." test is to disqualify any shell that
+# emits "P=1" into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do.
+#
+# Use "9" to indicate success (rather than 0), in case some shell acts
+# like Solaris 10's /bin/sh but exits successfully instead of with status 2.
+
+# Eval this code in a subshell to determine a shell's suitability.
+# 10 - passes all tests; ok to use
+# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
+# ? - not ok
+gl_shell_test_script_='
+test $(echo y) = y || exit 1
+f_local_() { local v=1; }; f_local_ || exit 1
+f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_
+score_=10
+if test "$VERBOSE" = yes; then
+ test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9
+fi
+test -z "$EXEEXT" && exit $score_
+shopt -s expand_aliases
+alias a-b="echo zoo"
+v=abx
+ test ${v%x} = ab \
+ && test ${v#a} = bx \
+ && test $(a-b) = zoo \
+ && exit $score_
+'
+
+if test "x$1" = "x--no-reexec"; then
+ shift
+else
+ # Assume a working shell. Export to subshells (setup_ needs this).
+ gl_set_x_corrupts_stderr_=false
+ export gl_set_x_corrupts_stderr_
+
+ # Record the first marginally acceptable shell.
+ marginal_=
+
+ # Search for a shell that meets our requirements.
+ for re_shell_ in __current__ "${CONFIG_SHELL:-no_shell}" \
+ /bin/sh bash dash zsh pdksh fail
+ do
+ test "$re_shell_" = no_shell && continue
+
+ # If we've made it all the way to the sentinel, "fail" without
+ # finding even a marginal shell, skip this test.
+ if test "$re_shell_" = fail; then
+ test -z "$marginal_" && skip_ failed to find an adequate shell
+ re_shell_=$marginal_
+ break
+ fi
+
+ # When testing the current shell, simply "eval" the test code.
+ # Otherwise, run it via $re_shell_ -c ...
+ if test "$re_shell_" = __current__; then
+ # 'eval'ing this code makes Solaris 10's /bin/sh exit with
+ # $? set to 2. It does not evaluate any of the code after the
+ # "unexpected" first '('. Thus, we must run it in a subshell.
+ ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
+ else
+ "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
+ fi
+
+ st_=$?
+
+ # $re_shell_ works just fine. Use it.
+ if test $st_ = 10; then
+ gl_set_x_corrupts_stderr_=false
+ break
+ fi
+
+ # If this is our first marginally acceptable shell, remember it.
+ if test "$st_:$marginal_" = 9: ; then
+ marginal_="$re_shell_"
+ gl_set_x_corrupts_stderr_=true
+ fi
+ done
+
+ if test "$re_shell_" != __current__; then
+ # Found a usable shell. Preserve -v and -x.
+ case $- in
+ *v*x* | *x*v*) opts_=-vx ;;
+ *v*) opts_=-v ;;
+ *x*) opts_=-x ;;
+ *) opts_= ;;
+ esac
+ re_shell=$re_shell_
+ export re_shell
+ exec "$re_shell_" $opts_ "$0" --no-reexec "$@"
+ echo "$ME_: exec failed" 1>&2
+ exit 127
+ fi
+fi
+
+# If this is bash, turn off all aliases.
+test -n "$BASH_VERSION" && unalias -a
+
+# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
+# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
+# That is part of the shell-selection test above. Why use aliases rather
+# than functions? Because support for hyphen-containing aliases is more
+# widespread than that for hyphen-containing function names.
+test -n "$EXEEXT" && shopt -s expand_aliases
+
+# Enable glibc's malloc-perturbing option.
+# This is useful for exposing code that depends on the fact that
+# malloc-related functions often return memory that is mostly zeroed.
+# If you have the time and cycles, use valgrind to do an even better job.
+: ${MALLOC_PERTURB_=87}
+export MALLOC_PERTURB_
+
+# This is a stub function that is run upon trap (upon regular exit and
+# interrupt). Override it with a per-test function, e.g., to unmount
+# a partition, or to undo any other global state changes.
+cleanup_ () { :; }
+
+# Emit a header similar to that from diff -u; Print the simulated "diff"
+# command so that the order of arguments is clear. Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+ printf '%s\n' "diff -u $*" \
+ "--- $1 1970-01-01" \
+ "+++ $2 1970-01-01"
+}
+
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+ test $# = 2 || return 2
+
+ if test "x$1" = x/dev/null; then
+ test -s "$2" || return 0
+ emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
+ return 1
+ fi
+
+ if test "x$2" = x/dev/null; then
+ test -s "$1" || return 0
+ emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
+ return 1
+ fi
+
+ return 2
+}
+
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+ && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+ # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+ # extra space on column 1 of every content line.
+ if test -z "$diff_out_"; then
+ compare_ () { diff -u "$@"; }
+ else
+ compare_ ()
+ {
+ if diff -u "$@" > diff.out; then
+ # No differences were found, but Solaris 'diff' produces output
+ # "No differences encountered". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif
+ for diff_opt_ in -U3 -c '' no; do
+ test "$diff_opt_" = no && break
+ diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" </dev/null` && break
+ done
+ test "$diff_opt_" != no
+then
+ if test -z "$diff_out_"; then
+ compare_ () { diff $diff_opt_ "$@"; }
+ else
+ compare_ ()
+ {
+ if diff $diff_opt_ "$@" > diff.out; then
+ # No differences were found, but AIX and HP-UX 'diff' produce output
+ # "No differences encountered" or "There are no differences between the
+ # files.". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif cmp -s /dev/null /dev/null 2>/dev/null; then
+ compare_ () { cmp -s "$@"; }
+else
+ compare_ () { cmp "$@"; }
+fi
+
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+ # This looks like it can be factored to use a simple "case $?"
+ # after unchecked compare_dev_null_ invocation, but that would
+ # fail in a "set -e" environment.
+ if compare_dev_null_ "$@"; then
+ return 0
+ else
+ case $? in
+ 1) return 1;;
+ *) compare_ "$@";;
+ esac
+ fi
+}
+
+# An arbitrary prefix to help distinguish test directories.
+testdir_prefix_ () { printf gt; }
+
+# Run the user-overridable cleanup_ function, remove the temporary
+# directory and exit with the incoming value of $?.
+remove_tmp_ ()
+{
+ __st=$?
+ cleanup_
+ # cd out of the directory we're about to remove
+ cd "$initial_cwd_" || cd / || cd /tmp
+ chmod -R u+rwx "$test_dir_"
+ # If removal fails and exit status was to be 0, then change it to 1.
+ rm -rf "$test_dir_" || { test $__st = 0 && __st=1; }
+ exit $__st
+}
+
+# Given a directory name, DIR, if every entry in it that matches *.exe
+# contains only the specified bytes (see the case stmt below), then print
+# a space-separated list of those names and return 0. Otherwise, don't
+# print anything and return 1. Naming constraints apply also to DIR.
+find_exe_basenames_ ()
+{
+ feb_dir_=$1
+ feb_fail_=0
+ feb_result_=
+ feb_sp_=
+ for feb_file_ in $feb_dir_/*.exe; do
+ # If there was no *.exe file, or there existed a file named "*.exe" that
+ # was deleted between the above glob expansion and the existence test
+ # below, just skip it.
+ test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
+ && continue
+ # Exempt [.exe, since we can't create a function by that name, yet
+ # we can't invoke [ by PATH search anyways due to shell builtins.
+ test "x$feb_file_" = "x$feb_dir_/[.exe" && continue
+ case $feb_file_ in
+ *[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
+ *) # Remove leading file name components as well as the .exe suffix.
+ feb_file_=${feb_file_##*/}
+ feb_file_=${feb_file_%.exe}
+ feb_result_="$feb_result_$feb_sp_$feb_file_";;
+ esac
+ feb_sp_=' '
+ done
+ test $feb_fail_ = 0 && printf %s "$feb_result_"
+ return $feb_fail_
+}
+
+# Consider the files in directory, $1.
+# For each file name of the form PROG.exe, create an alias named
+# PROG that simply invokes PROG.exe, then return 0. If any selected
+# file name or the directory name, $1, contains an unexpected character,
+# define no alias and return 1.
+create_exe_shims_ ()
+{
+ case $EXEEXT in
+ '') return 0 ;;
+ .exe) ;;
+ *) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;;
+ esac
+
+ base_names_=`find_exe_basenames_ $1` \
+ || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; }
+
+ if test -n "$base_names_"; then
+ for base_ in $base_names_; do
+ alias "$base_"="$base_$EXEEXT"
+ done
+ fi
+
+ return 0
+}
+
+# Use this function to prepend to PATH an absolute name for each
+# specified, possibly-$initial_cwd_-relative, directory.
+path_prepend_ ()
+{
+ while test $# != 0; do
+ path_dir_=$1
+ case $path_dir_ in
+ '') fail_ "invalid path dir: '$1'";;
+ /*) abs_path_dir_=$path_dir_;;
+ *) abs_path_dir_=$initial_cwd_/$path_dir_;;
+ esac
+ case $abs_path_dir_ in
+ *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
+ esac
+ PATH="$abs_path_dir_:$PATH"
+
+ # Create an alias, FOO, for each FOO.exe in this directory.
+ create_exe_shims_ "$abs_path_dir_" \
+ || fail_ "something failed (above): $abs_path_dir_"
+ shift
+ done
+ export PATH
+}
+
+setup_ ()
+{
+ if test "$VERBOSE" = yes; then
+ # Test whether set -x may cause the selected shell to corrupt an
+ # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh
+ # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5.
+ # If enabling verbose output this way would cause trouble, simply
+ # issue a warning and refrain.
+ if $gl_set_x_corrupts_stderr_; then
+ warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr"
+ else
+ set -x
+ fi
+ fi
+
+ initial_cwd_=$PWD
+
+ pfx_=`testdir_prefix_`
+ test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
+ || fail_ "failed to create temporary directory in $initial_cwd_"
+ cd "$test_dir_" || fail_ "failed to cd to temporary directory"
+
+ # As autoconf-generated configure scripts do, ensure that IFS
+ # is defined initially, so that saving and restoring $IFS works.
+ gl_init_sh_nl_='
+'
+ IFS=" "" $gl_init_sh_nl_"
+
+ # This trap statement, along with a trap on 0 below, ensure that the
+ # temporary directory, $test_dir_, is removed upon exit as well as
+ # upon receipt of any of the listed signals.
+ for sig_ in 1 2 3 13 15; do
+ eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+ done
+}
+
+# Create a temporary directory, much like mktemp -d does.
+# Written by Jim Meyering.
+#
+# Usage: mktempd_ /tmp phoey.XXXXXXXXXX
+#
+# First, try to use the mktemp program.
+# Failing that, we'll roll our own mktemp-like function:
+# - try to get random bytes from /dev/urandom
+# - failing that, generate output from a combination of quickly-varying
+# sources and gzip. Ignore non-varying gzip header, and extract
+# "random" bits from there.
+# - given those bits, map to file-name bytes using tr, and try to create
+# the desired directory.
+# - make only $MAX_TRIES_ attempts
+
+# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9.
+rand_bytes_ ()
+{
+ n_=$1
+
+ # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first?
+ # But if they have openssl, they probably have mktemp, too.
+
+ chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+ dev_rand_=/dev/urandom
+ if test -r "$dev_rand_"; then
+ # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
+ dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
+ | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+ return
+ fi
+
+ n_plus_50_=`expr $n_ + 50`
+ cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
+ data_=` (eval "$cmds_") 2>&1 | gzip `
+
+ # Ensure that $data_ has length at least 50+$n_
+ while :; do
+ len_=`echo "$data_"|wc -c`
+ test $n_plus_50_ -le $len_ && break;
+ data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip `
+ done
+
+ echo "$data_" \
+ | dd bs=1 skip=50 count=$n_ 2>/dev/null \
+ | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+}
+
+mktempd_ ()
+{
+ case $# in
+ 2);;
+ *) fail_ "Usage: mktempd_ DIR TEMPLATE";;
+ esac
+
+ destdir_=$1
+ template_=$2
+
+ MAX_TRIES_=4
+
+ # Disallow any trailing slash on specified destdir:
+ # it would subvert the post-mktemp "case"-based destdir test.
+ case $destdir_ in
+ / | //) destdir_slash_=$destdir;;
+ */) fail_ "invalid destination dir: remove trailing slash(es)";;
+ *) destdir_slash_=$destdir_/;;
+ esac
+
+ case $template_ in
+ *XXXX) ;;
+ *) fail_ \
+ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+ esac
+
+ # First, try to use mktemp.
+ d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
+
+ # The resulting name must be in the specified directory.
+ case $d in "$destdir_slash_"*) :;; *) false;; esac &&
+
+ # It must have created the directory.
+ test -d "$d" &&
+
+ # It must have 0700 permissions. Handle sticky "S" bits.
+ perms=`ls -dgo "$d" 2>/dev/null` &&
+ case $perms in drwx--[-S]---*) :;; *) false;; esac && {
+ echo "$d"
+ return
+ }
+
+ # If we reach this point, we'll have to create a directory manually.
+
+ # Get a copy of the template without its suffix of X's.
+ base_template_=`echo "$template_"|sed 's/XX*$//'`
+
+ # Calculate how many X's we've just removed.
+ template_length_=`echo "$template_" | wc -c`
+ nx_=`echo "$base_template_" | wc -c`
+ nx_=`expr $template_length_ - $nx_`
+
+ err_=
+ i_=1
+ while :; do
+ X_=`rand_bytes_ $nx_`
+ candidate_dir_="$destdir_slash_$base_template_$X_"
+ err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
+ && { echo "$candidate_dir_"; return; }
+ test $MAX_TRIES_ -le $i_ && break;
+ i_=`expr $i_ + 1`
+ done
+ fail_ "$err_"
+}
+
+# If you want to override the testdir_prefix_ function,
+# or to add more utility functions, use this file.
+test -f "$srcdir/init.cfg" \
+ && . "$srcdir/init.cfg"
+
+setup_ "$@"
+# This trap is here, rather than in the setup_ function, because some
+# shells run the exit trap at shell function exit, rather than script exit.
+trap remove_tmp_ 0
diff --git a/gnulib-tests/ioctl.c b/gnulib-tests/ioctl.c
new file mode 100644
index 0000000..bd3a198
--- /dev/null
+++ b/gnulib-tests/ioctl.c
@@ -0,0 +1,88 @@
+/* ioctl.c --- wrappers for Windows ioctl function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#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. */
+# include "msvc-nothrow.h"
+
+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/gnulib-tests/listen.c b/gnulib-tests/listen.c
new file mode 100644
index 0000000..fd59f75
--- /dev/null
+++ b/gnulib-tests/listen.c
@@ -0,0 +1,49 @@
+/* listen.c --- wrappers for Windows listen function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef listen
+
+int
+rpl_listen (int fd, int backlog)
+{
+ SOCKET sock = FD_TO_SOCKET (fd);
+
+ if (sock == INVALID_SOCKET)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ else
+ {
+ int r = listen (sock, backlog);
+ if (r < 0)
+ set_winsock_errno ();
+
+ return r;
+ }
+}
diff --git a/gnulib-tests/macros.h b/gnulib-tests/macros.h
new file mode 100644
index 0000000..578bfe7
--- /dev/null
+++ b/gnulib-tests/macros.h
@@ -0,0 +1,73 @@
+/* Common macros used by gnulib tests.
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* This file contains macros that are used by many gnulib tests.
+ Put here only frequently used macros, say, used by 10 tests or more. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Define ASSERT_STREAM before including this file if ASSERT must
+ target a stream other than stderr. */
+#ifndef ASSERT_STREAM
+# define ASSERT_STREAM stderr
+#endif
+
+/* ASSERT (condition);
+ verifies that the specified condition is fulfilled. If not, a message
+ is printed to ASSERT_STREAM if defined (defaulting to stderr if
+ undefined) and the program is terminated with an error code.
+
+ This macro has the following properties:
+ - The programmer specifies the expected condition, not the failure
+ condition. This simplifies thinking.
+ - The condition is tested always, regardless of compilation flags.
+ (Unlike the macro from <assert.h>.)
+ - On Unix platforms, the tester can debug the test program with a
+ debugger (provided core dumps are enabled: "ulimit -c unlimited").
+ - For the sake of platforms where no debugger is available (such as
+ some mingw systems), an error message is printed on the error
+ stream that includes the source location of the ASSERT invocation.
+ */
+#define ASSERT(expr) \
+ do \
+ { \
+ if (!(expr)) \
+ { \
+ fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n", \
+ __FILE__, __LINE__, #expr); \
+ fflush (ASSERT_STREAM); \
+ abort (); \
+ } \
+ } \
+ while (0)
+
+/* SIZEOF (array)
+ returns the number of elements of an array. It works for arrays that are
+ declared outside functions and for local variables of array type. It does
+ *not* work for function parameters of array type, because they are actually
+ parameters of pointer type. */
+#define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
+
+/* STREQ (str1, str2)
+ Return true if two strings compare equal. */
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
+/* Some numbers in the interval [0,1). */
+extern const float randomf[1000];
+extern const double randomd[1000];
+extern const long double randoml[1000];
diff --git a/gnulib-tests/nanosleep.c b/gnulib-tests/nanosleep.c
new file mode 100644
index 0000000..a3116c2
--- /dev/null
+++ b/gnulib-tests/nanosleep.c
@@ -0,0 +1,276 @@
+/* Provide a replacement for the POSIX nanosleep function.
+
+ Copyright (C) 1999-2000, 2002, 2004-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering
+ and Bruno Haible for the native Windows part */
+
+#include <config.h>
+
+#include <time.h>
+
+#include "intprops.h"
+#include "sig-handler.h"
+#include "verify.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <signal.h>
+
+#include <sys/time.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 __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
+/* Unix platforms lacking nanosleep. */
+
+/* Some systems (MSDOS) don't have SIGCONT.
+ Using SIGTERM here turns the signal-handling code below
+ into a no-op on such systems. */
+# ifndef SIGCONT
+# define SIGCONT SIGTERM
+# endif
+
+static sig_atomic_t volatile suspended;
+
+/* Handle SIGCONT. */
+
+static void
+sighandler (int sig)
+{
+ suspended = 1;
+}
+
+/* Suspend execution for at least *TS_DELAY seconds. */
+
+static int
+my_usleep (const struct timespec *ts_delay)
+{
+ struct timeval tv_delay;
+ tv_delay.tv_sec = ts_delay->tv_sec;
+ tv_delay.tv_usec = (ts_delay->tv_nsec + 999) / 1000;
+ if (tv_delay.tv_usec == 1000000)
+ {
+ if (tv_delay.tv_sec == TYPE_MAXIMUM (time_t))
+ tv_delay.tv_usec = 1000000 - 1; /* close enough */
+ else
+ {
+ tv_delay.tv_sec++;
+ tv_delay.tv_usec = 0;
+ }
+ }
+ return select (0, NULL, NULL, NULL, &tv_delay);
+}
+
+/* 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)
+{
+ static bool initialized;
+
+ if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* set up sig handler */
+ if (! initialized)
+ {
+ struct sigaction oldact;
+
+ sigaction (SIGCONT, NULL, &oldact);
+ if (get_handler (&oldact) != SIG_IGN)
+ {
+ struct sigaction newact;
+
+ newact.sa_handler = sighandler;
+ sigemptyset (&newact.sa_mask);
+ newact.sa_flags = 0;
+ sigaction (SIGCONT, &newact, NULL);
+ }
+ initialized = true;
+ }
+
+ suspended = 0;
+
+ if (my_usleep (requested_delay) == -1)
+ {
+ if (suspended)
+ {
+ /* Calculate time remaining. */
+ /* FIXME: the code in sleep doesn't use this, so there's no
+ rush to implement it. */
+
+ errno = EINTR;
+ }
+ return -1;
+ }
+
+ /* FIXME: Restore sig handler? */
+
+ return 0;
+}
+#endif
diff --git a/gnulib-tests/nap.h b/gnulib-tests/nap.h
new file mode 100644
index 0000000..6d46a36
--- /dev/null
+++ b/gnulib-tests/nap.h
@@ -0,0 +1,128 @@
+/* Assist in file system timestamp tests.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#ifndef GLTEST_NAP_H
+# define GLTEST_NAP_H
+
+# include <limits.h>
+# include <stdbool.h>
+
+/* File descriptor used for the witness file. */
+static int nap_fd = -1;
+
+/* Return A - B, in ns.
+ Return 0 if the true result would be negative.
+ Return INT_MAX if the true result would be greater than INT_MAX. */
+static int
+diff_timespec (struct timespec a, struct timespec b)
+{
+ time_t as = a.tv_sec;
+ time_t bs = b.tv_sec;
+ int ans = a.tv_nsec;
+ int bns = b.tv_nsec;
+
+ if (! (bs < as || (bs == as && bns < ans)))
+ return 0;
+ if (as - bs <= INT_MAX / 1000000000)
+ {
+ int sdiff = (as - bs) * 1000000000;
+ int usdiff = ans - bns;
+ if (usdiff < INT_MAX - sdiff)
+ return sdiff + usdiff;
+ }
+ return INT_MAX;
+}
+
+static void
+get_stat (int fd, struct stat *st, int do_write)
+{
+ if (do_write)
+ ASSERT (write (fd, "\n", 1) == 1);
+ ASSERT (fstat (fd, st) == 0);
+}
+
+/* Given a file whose descriptor is FD, see whether delaying by DELAY
+ nanoseconds causes a change in a file's ctime and mtime.
+ OLD_ST is the file's status, recently gotten. */
+static bool
+nap_works (int fd, int delay, struct stat old_st)
+{
+ struct stat st;
+ struct timespec delay_spec;
+ delay_spec.tv_sec = delay / 1000000000;
+ delay_spec.tv_nsec = delay % 1000000000;
+ ASSERT (nanosleep (&delay_spec, 0) == 0);
+ get_stat (fd, &st, 1);
+
+ if ( diff_timespec (get_stat_ctime (&st), get_stat_ctime (&old_st))
+ && diff_timespec (get_stat_mtime (&st), get_stat_mtime (&old_st)))
+ return true;
+
+ return false;
+}
+
+#define TEMPFILE BASE "nap.tmp"
+
+static void
+clear_temp_file (void)
+{
+ if (0 <= nap_fd)
+ {
+ ASSERT (close (nap_fd) != -1);
+ ASSERT (unlink (TEMPFILE) != -1);
+ }
+}
+
+/* Sleep long enough to notice a timestamp difference on the file
+ system in the current directory. Use an adaptive approach, trying
+ to find the smallest delay which works on the current file system
+ to make the timestamp difference appear. Assert a maximum delay of
+ ~2 seconds, more precisely sum(2^n) from 0 to 30 = 2^31 - 1 = 2.1s.
+ Assumes that BASE is defined, and requires that the test module
+ depends on nanosleep. */
+static void
+nap (void)
+{
+ struct stat old_st;
+ static int delay = 1;
+
+ if (-1 == nap_fd)
+ {
+ atexit (clear_temp_file);
+ ASSERT ((nap_fd = creat (TEMPFILE, 0600)) != -1);
+ get_stat (nap_fd, &old_st, 0);
+ }
+ else
+ {
+ ASSERT (0 <= nap_fd);
+ get_stat (nap_fd, &old_st, 1);
+ }
+
+ if (1 < delay)
+ delay = delay / 2; /* Try half of the previous delay. */
+ ASSERT (0 < delay);
+
+ for ( ; delay <= 2147483647; delay = delay * 2)
+ if (nap_works (nap_fd, delay, old_st))
+ return;
+
+ /* Bummer: even the highest nap delay didn't work. */
+ ASSERT (0);
+}
+
+#endif /* GLTEST_NAP_H */
diff --git a/gnulib-tests/netinet_in.in.h b/gnulib-tests/netinet_in.in.h
new file mode 100644
index 0000000..54e1ec0
--- /dev/null
+++ b/gnulib-tests/netinet_in.in.h
@@ -0,0 +1,47 @@
+/* Substitute for <netinet/in.h>.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_NETINET_IN_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_NETINET_IN_H@
+
+/* On many platforms, <netinet/in.h> assumes prior inclusion of
+ <sys/types.h>. */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_NETINET_IN_H
+#define _@GUARD_PREFIX@_NETINET_IN_H
+
+#if !@HAVE_NETINET_IN_H@
+
+/* A platform that lacks <netinet/in.h>. */
+
+# include <sys/socket.h>
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_NETINET_IN_H */
+#endif /* _@GUARD_PREFIX@_NETINET_IN_H */
diff --git a/gnulib-tests/perror.c b/gnulib-tests/perror.c
new file mode 100644
index 0000000..09dafb6
--- /dev/null
+++ b/gnulib-tests/perror.c
@@ -0,0 +1,49 @@
+/* Print a message describing error code.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible and Simon Josefsson.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "strerror-override.h"
+
+/* Use the system functions, not the gnulib overrides in this file. */
+#undef fprintf
+
+void
+perror (const char *string)
+{
+ char stackbuf[STACKBUF_LEN];
+ int ret;
+
+ /* Our implementation guarantees that this will be a non-empty
+ string, even if it returns EINVAL; and stackbuf should be sized
+ large enough to avoid ERANGE. */
+ ret = strerror_r (errno, stackbuf, sizeof stackbuf);
+ if (ret == ERANGE)
+ abort ();
+
+ if (string != NULL && *string != '\0')
+ fprintf (stderr, "%s: %s\n", string, stackbuf);
+ else
+ fprintf (stderr, "%s\n", stackbuf);
+}
diff --git a/gnulib-tests/pipe.c b/gnulib-tests/pipe.c
new file mode 100644
index 0000000..cc8e184
--- /dev/null
+++ b/gnulib-tests/pipe.c
@@ -0,0 +1,50 @@
+/* Create a pipe.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if (defined _WIN32 || 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/gnulib-tests/putenv.c b/gnulib-tests/putenv.c
new file mode 100644
index 0000000..e67712d
--- /dev/null
+++ b/gnulib-tests/putenv.c
@@ -0,0 +1,194 @@
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2016 Free Software
+ Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C
+ Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 3 of the License, or any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <stddef.h>
+
+/* Include errno.h *after* sys/types.h to work around header problems
+ on AIX 3.2.5. */
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#if _LIBC
+# if HAVE_GNU_LD
+# define environ __environ
+# else
+extern char **environ;
+# endif
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+static int
+_unsetenv (const char *name)
+{
+ size_t len;
+#if !HAVE_DECL__PUTENV
+ char **ep;
+#endif
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ len = strlen (name);
+
+#if HAVE_DECL__PUTENV
+ {
+ int putenv_result, putenv_errno;
+ char *name_ = malloc (len + 2);
+ memcpy (name_, name, len);
+ name_[len] = '=';
+ name_[len + 1] = 0;
+ putenv_result = _putenv (name_);
+ putenv_errno = errno;
+ free (name_);
+ __set_errno (putenv_errno);
+ return putenv_result;
+ }
+#else
+
+ LOCK;
+
+ ep = environ;
+ while (*ep != NULL)
+ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+ {
+ /* Found it. Remove this pointer by moving later ones back. */
+ char **dp = ep;
+
+ do
+ dp[0] = dp[1];
+ while (*dp++);
+ /* Continue the loop in case NAME appears again. */
+ }
+ else
+ ++ep;
+
+ UNLOCK;
+
+ return 0;
+#endif
+}
+
+
+/* Put STRING, which is of the form "NAME=VALUE", in the environment.
+ If STRING contains no '=', then remove STRING from the environment. */
+int
+putenv (char *string)
+{
+ const char *name_end = strchr (string, '=');
+ char **ep;
+
+ if (name_end == NULL)
+ {
+ /* Remove the variable from the environment. */
+ return _unsetenv (string);
+ }
+
+#if HAVE_DECL__PUTENV
+ /* Rely on _putenv to allocate the new environment. If other
+ parts of the application use _putenv, the !HAVE_DECL__PUTENV code
+ would fight over who owns the environ vector, causing a crash. */
+ if (name_end[1])
+ return _putenv (string);
+ else
+ {
+ /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
+ to allocate the environ vector and then replace the new
+ entry with "NAME=". */
+ int putenv_result, putenv_errno;
+ char *name_x = malloc (name_end - string + sizeof "= ");
+ if (!name_x)
+ return -1;
+ memcpy (name_x, string, name_end - string + 1);
+ name_x[name_end - string + 1] = ' ';
+ name_x[name_end - string + 2] = 0;
+ putenv_result = _putenv (name_x);
+ putenv_errno = errno;
+ for (ep = environ; *ep; ep++)
+ if (strcmp (*ep, name_x) == 0)
+ {
+ *ep = string;
+ break;
+ }
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ if (putenv_result == 0)
+ {
+ /* _putenv propagated "NAME= " into the subprocess environment;
+ fix that by calling SetEnvironmentVariable directly. */
+ name_x[name_end - string] = 0;
+ putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
+ putenv_errno = ENOMEM; /* ENOMEM is the only way to fail. */
+ }
+# endif
+ free (name_x);
+ __set_errno (putenv_errno);
+ return putenv_result;
+ }
+#else
+ for (ep = environ; *ep; ep++)
+ if (strncmp (*ep, string, name_end - string) == 0
+ && (*ep)[name_end - string] == '=')
+ break;
+
+ if (*ep)
+ *ep = string;
+ else
+ {
+ static char **last_environ = NULL;
+ size_t size = ep - environ;
+ char **new_environ = malloc ((size + 2) * sizeof *new_environ);
+ if (! new_environ)
+ return -1;
+ new_environ[0] = string;
+ memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ);
+ free (last_environ);
+ last_environ = new_environ;
+ environ = new_environ;
+ }
+
+ return 0;
+#endif
+}
diff --git a/gnulib-tests/same-inode.h b/gnulib-tests/same-inode.h
new file mode 100644
index 0000000..bf45635
--- /dev/null
+++ b/gnulib-tests/same-inode.h
@@ -0,0 +1,33 @@
+/* Determine whether two stat buffers refer to the same file.
+
+ Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef SAME_INODE_H
+# define SAME_INODE_H 1
+
+# ifdef __VMS
+# 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)
+# else
+# define SAME_INODE(a, b) \
+ ((a).st_ino == (b).st_ino \
+ && (a).st_dev == (b).st_dev)
+# endif
+
+#endif
diff --git a/gnulib-tests/select.c b/gnulib-tests/select.c
new file mode 100644
index 0000000..73abcf3
--- /dev/null
+++ b/gnulib-tests/select.c
@@ -0,0 +1,575 @@
+/* Emulation for select(2)
+ Contributed by Paolo Bonzini.
+
+ Copyright 2008-2016 Free Software Foundation, Inc.
+
+ This file is part of gnulib.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <alloca.h>
+#include <assert.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Native Windows. */
+
+#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>
+
+#include "msvc-nothrow.h"
+
+#undef select
+
+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. */
+ WSAEventSelect ((SOCKET) h, NULL, 0);
+ if (FD_ISSET (h, &handle_rfds))
+ FD_SET (i, rfds);
+ if (FD_ISSET (h, &handle_wfds))
+ FD_SET (i, wfds);
+ if (FD_ISSET (h, &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 <sys/select.h>
+#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/gnulib-tests/setlocale.c b/gnulib-tests/setlocale.c
new file mode 100644
index 0000000..7d366ed
--- /dev/null
+++ b/gnulib-tests/setlocale.c
@@ -0,0 +1,939 @@
+/* Set the current locale. -*- coding: utf-8 -*-
+ Copyright (C) 2009, 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <config.h>
+
+/* Override setlocale() so that when the default locale is requested
+ (locale = ""), the environment variables LC_ALL, LC_*, and LANG are
+ considered.
+ Also include all the functionality from libintl's setlocale() override. */
+
+/* Please keep this file in sync with
+ gettext/gettext-runtime/intl/setlocale.c ! */
+
+/* Specification. */
+#include <locale.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "localename.h"
+
+#if 1
+
+# undef setlocale
+
+/* Return string representation of locale category CATEGORY. */
+static const char *
+category_to_name (int category)
+{
+ const char *retval;
+
+ switch (category)
+ {
+ case LC_COLLATE:
+ retval = "LC_COLLATE";
+ break;
+ case LC_CTYPE:
+ retval = "LC_CTYPE";
+ break;
+ case LC_MONETARY:
+ retval = "LC_MONETARY";
+ break;
+ case LC_NUMERIC:
+ retval = "LC_NUMERIC";
+ break;
+ case LC_TIME:
+ retval = "LC_TIME";
+ break;
+ case LC_MESSAGES:
+ retval = "LC_MESSAGES";
+ break;
+ default:
+ /* If you have a better idea for a default value let me know. */
+ retval = "LC_XXX";
+ }
+
+ return retval;
+}
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* The native Windows setlocale() function expects locale names of the form
+ "German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need
+ to convert the names from the form with ISO 639 language code and ISO 3166
+ country code to the form with English names or with three-letter identifier.
+ The three-letter identifiers known by a Windows XP SP2 or SP3 are:
+ AFK Afrikaans_South Africa.1252
+ ARA Arabic_Saudi Arabia.1256
+ ARB Arabic_Lebanon.1256
+ ARE Arabic_Egypt.1256
+ ARG Arabic_Algeria.1256
+ ARH Arabic_Bahrain.1256
+ ARI Arabic_Iraq.1256
+ ARJ Arabic_Jordan.1256
+ ARK Arabic_Kuwait.1256
+ ARL Arabic_Libya.1256
+ ARM Arabic_Morocco.1256
+ ARO Arabic_Oman.1256
+ ARQ Arabic_Qatar.1256
+ ARS Arabic_Syria.1256
+ ART Arabic_Tunisia.1256
+ ARU Arabic_U.A.E..1256
+ ARY Arabic_Yemen.1256
+ AZE Azeri (Latin)_Azerbaijan.1254
+ BEL Belarusian_Belarus.1251
+ BGR Bulgarian_Bulgaria.1251
+ BSB Bosnian_Bosnia and Herzegovina.1250
+ BSC Bosnian (Cyrillic)_Bosnia and Herzegovina.1250 (wrong encoding!)
+ CAT Catalan_Spain.1252
+ CHH Chinese_Hong Kong S.A.R..950
+ CHI Chinese_Singapore.936
+ CHS Chinese_People's Republic of China.936
+ CHT Chinese_Taiwan.950
+ CSY Czech_Czech Republic.1250
+ CYM Welsh_United Kingdom.1252
+ DAN Danish_Denmark.1252
+ DEA German_Austria.1252
+ DEC German_Liechtenstein.1252
+ DEL German_Luxembourg.1252
+ DES German_Switzerland.1252
+ DEU German_Germany.1252
+ ELL Greek_Greece.1253
+ ENA English_Australia.1252
+ ENB English_Caribbean.1252
+ ENC English_Canada.1252
+ ENG English_United Kingdom.1252
+ ENI English_Ireland.1252
+ ENJ English_Jamaica.1252
+ ENL English_Belize.1252
+ ENP English_Republic of the Philippines.1252
+ ENS English_South Africa.1252
+ ENT English_Trinidad and Tobago.1252
+ ENU English_United States.1252
+ ENW English_Zimbabwe.1252
+ ENZ English_New Zealand.1252
+ ESA Spanish_Panama.1252
+ ESB Spanish_Bolivia.1252
+ ESC Spanish_Costa Rica.1252
+ ESD Spanish_Dominican Republic.1252
+ ESE Spanish_El Salvador.1252
+ ESF Spanish_Ecuador.1252
+ ESG Spanish_Guatemala.1252
+ ESH Spanish_Honduras.1252
+ ESI Spanish_Nicaragua.1252
+ ESL Spanish_Chile.1252
+ ESM Spanish_Mexico.1252
+ ESN Spanish_Spain.1252
+ ESO Spanish_Colombia.1252
+ ESP Spanish_Spain.1252
+ ESR Spanish_Peru.1252
+ ESS Spanish_Argentina.1252
+ ESU Spanish_Puerto Rico.1252
+ ESV Spanish_Venezuela.1252
+ ESY Spanish_Uruguay.1252
+ ESZ Spanish_Paraguay.1252
+ ETI Estonian_Estonia.1257
+ EUQ Basque_Spain.1252
+ FAR Farsi_Iran.1256
+ FIN Finnish_Finland.1252
+ FOS Faroese_Faroe Islands.1252
+ FPO Filipino_Philippines.1252
+ FRA French_France.1252
+ FRB French_Belgium.1252
+ FRC French_Canada.1252
+ FRL French_Luxembourg.1252
+ FRM French_Principality of Monaco.1252
+ FRS French_Switzerland.1252
+ FYN Frisian_Netherlands.1252
+ GLC Galician_Spain.1252
+ HEB Hebrew_Israel.1255
+ HRB Croatian_Bosnia and Herzegovina.1250
+ HRV Croatian_Croatia.1250
+ HUN Hungarian_Hungary.1250
+ IND Indonesian_Indonesia.1252
+ IRE Irish_Ireland.1252
+ ISL Icelandic_Iceland.1252
+ ITA Italian_Italy.1252
+ ITS Italian_Switzerland.1252
+ IUK Inuktitut (Latin)_Canada.1252
+ JPN Japanese_Japan.932
+ KKZ Kazakh_Kazakhstan.1251
+ KOR Korean_Korea.949
+ KYR Kyrgyz_Kyrgyzstan.1251
+ LBX Luxembourgish_Luxembourg.1252
+ LTH Lithuanian_Lithuania.1257
+ LVI Latvian_Latvia.1257
+ MKI FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251
+ MON Mongolian_Mongolia.1251
+ MPD Mapudungun_Chile.1252
+ MSB Malay_Brunei Darussalam.1252
+ MSL Malay_Malaysia.1252
+ MWK Mohawk_Canada.1252
+ NLB Dutch_Belgium.1252
+ NLD Dutch_Netherlands.1252
+ NON Norwegian-Nynorsk_Norway.1252
+ NOR Norwegian (Bokmål)_Norway.1252
+ NSO Northern Sotho_South Africa.1252
+ PLK Polish_Poland.1250
+ PTB Portuguese_Brazil.1252
+ PTG Portuguese_Portugal.1252
+ QUB Quechua_Bolivia.1252
+ QUE Quechua_Ecuador.1252
+ QUP Quechua_Peru.1252
+ RMC Romansh_Switzerland.1252
+ ROM Romanian_Romania.1250
+ RUS Russian_Russia.1251
+ SKY Slovak_Slovakia.1250
+ SLV Slovenian_Slovenia.1250
+ SMA Sami (Southern)_Norway.1252
+ SMB Sami (Southern)_Sweden.1252
+ SME Sami (Northern)_Norway.1252
+ SMF Sami (Northern)_Sweden.1252
+ SMG Sami (Northern)_Finland.1252
+ SMJ Sami (Lule)_Norway.1252
+ SMK Sami (Lule)_Sweden.1252
+ SMN Sami (Inari)_Finland.1252
+ SMS Sami (Skolt)_Finland.1252
+ SQI Albanian_Albania.1250
+ SRB Serbian (Cyrillic)_Serbia and Montenegro.1251
+ SRL Serbian (Latin)_Serbia and Montenegro.1250
+ SRN Serbian (Cyrillic)_Bosnia and Herzegovina.1251
+ SRS Serbian (Latin)_Bosnia and Herzegovina.1250
+ SVE Swedish_Sweden.1252
+ SVF Swedish_Finland.1252
+ SWK Swahili_Kenya.1252
+ THA Thai_Thailand.874
+ TRK Turkish_Turkey.1254
+ TSN Tswana_South Africa.1252
+ TTT Tatar_Russia.1251
+ UKR Ukrainian_Ukraine.1251
+ URD Urdu_Islamic Republic of Pakistan.1256
+ USA English_United States.1252
+ UZB Uzbek (Latin)_Uzbekistan.1254
+ VIT Vietnamese_Viet Nam.1258
+ XHO Xhosa_South Africa.1252
+ ZHH Chinese_Hong Kong S.A.R..950
+ ZHI Chinese_Singapore.936
+ ZHM Chinese_Macau S.A.R..950
+ ZUL Zulu_South Africa.1252
+ */
+
+/* Table from ISO 639 language code, optionally with country or script suffix,
+ to English name.
+ Keep in sync with the gl_locale_name_from_win32_LANGID function in
+ localename.c! */
+struct table_entry
+{
+ const char *code;
+ const char *english;
+};
+static const struct table_entry language_table[] =
+ {
+ { "af", "Afrikaans" },
+ { "am", "Amharic" },
+ { "ar", "Arabic" },
+ { "arn", "Mapudungun" },
+ { "as", "Assamese" },
+ { "az@cyrillic", "Azeri (Cyrillic)" },
+ { "az@latin", "Azeri (Latin)" },
+ { "ba", "Bashkir" },
+ { "be", "Belarusian" },
+ { "ber", "Tamazight" },
+ { "ber@arabic", "Tamazight (Arabic)" },
+ { "ber@latin", "Tamazight (Latin)" },
+ { "bg", "Bulgarian" },
+ { "bin", "Edo" },
+ { "bn", "Bengali" },
+ { "bn_BD", "Bengali (Bangladesh)" },
+ { "bn_IN", "Bengali (India)" },
+ { "bnt", "Sutu" },
+ { "bo", "Tibetan" },
+ { "br", "Breton" },
+ { "bs", "BSB" }, /* "Bosnian (Latin)" */
+ { "bs@cyrillic", "BSC" }, /* Bosnian (Cyrillic) */
+ { "ca", "Catalan" },
+ { "chr", "Cherokee" },
+ { "co", "Corsican" },
+ { "cpe", "Hawaiian" },
+ { "cs", "Czech" },
+ { "cy", "Welsh" },
+ { "da", "Danish" },
+ { "de", "German" },
+ { "dsb", "Lower Sorbian" },
+ { "dv", "Divehi" },
+ { "el", "Greek" },
+ { "en", "English" },
+ { "es", "Spanish" },
+ { "et", "Estonian" },
+ { "eu", "Basque" },
+ { "fa", "Farsi" },
+ { "ff", "Fulfulde" },
+ { "fi", "Finnish" },
+ { "fo", "Faroese" }, /* "Faeroese" does not work */
+ { "fr", "French" },
+ { "fy", "Frisian" },
+ { "ga", "IRE" }, /* Gaelic (Ireland) */
+ { "gd", "Gaelic (Scotland)" },
+ { "gd", "Scottish Gaelic" },
+ { "gl", "Galician" },
+ { "gn", "Guarani" },
+ { "gsw", "Alsatian" },
+ { "gu", "Gujarati" },
+ { "ha", "Hausa" },
+ { "he", "Hebrew" },
+ { "hi", "Hindi" },
+ { "hr", "Croatian" },
+ { "hsb", "Upper Sorbian" },
+ { "hu", "Hungarian" },
+ { "hy", "Armenian" },
+ { "id", "Indonesian" },
+ { "ig", "Igbo" },
+ { "ii", "Yi" },
+ { "is", "Icelandic" },
+ { "it", "Italian" },
+ { "iu", "IUK" }, /* Inuktitut */
+ { "ja", "Japanese" },
+ { "ka", "Georgian" },
+ { "kk", "Kazakh" },
+ { "kl", "Greenlandic" },
+ { "km", "Cambodian" },
+ { "km", "Khmer" },
+ { "kn", "Kannada" },
+ { "ko", "Korean" },
+ { "kok", "Konkani" },
+ { "kr", "Kanuri" },
+ { "ks", "Kashmiri" },
+ { "ks_IN", "Kashmiri_India" },
+ { "ks_PK", "Kashmiri (Arabic)_Pakistan" },
+ { "ky", "Kyrgyz" },
+ { "la", "Latin" },
+ { "lb", "Luxembourgish" },
+ { "lo", "Lao" },
+ { "lt", "Lithuanian" },
+ { "lv", "Latvian" },
+ { "mi", "Maori" },
+ { "mk", "FYRO Macedonian" },
+ { "mk", "Macedonian" },
+ { "ml", "Malayalam" },
+ { "mn", "Mongolian" },
+ { "mni", "Manipuri" },
+ { "moh", "Mohawk" },
+ { "mr", "Marathi" },
+ { "ms", "Malay" },
+ { "mt", "Maltese" },
+ { "my", "Burmese" },
+ { "nb", "NOR" }, /* Norwegian Bokmål */
+ { "ne", "Nepali" },
+ { "nic", "Ibibio" },
+ { "nl", "Dutch" },
+ { "nn", "NON" }, /* Norwegian Nynorsk */
+ { "no", "Norwegian" },
+ { "nso", "Northern Sotho" },
+ { "nso", "Sepedi" },
+ { "oc", "Occitan" },
+ { "om", "Oromo" },
+ { "or", "Oriya" },
+ { "pa", "Punjabi" },
+ { "pap", "Papiamentu" },
+ { "pl", "Polish" },
+ { "prs", "Dari" },
+ { "ps", "Pashto" },
+ { "pt", "Portuguese" },
+ { "qu", "Quechua" },
+ { "qut", "K'iche'" },
+ { "rm", "Romansh" },
+ { "ro", "Romanian" },
+ { "ru", "Russian" },
+ { "rw", "Kinyarwanda" },
+ { "sa", "Sanskrit" },
+ { "sah", "Yakut" },
+ { "sd", "Sindhi" },
+ { "se", "Sami (Northern)" },
+ { "se", "Northern Sami" },
+ { "si", "Sinhalese" },
+ { "sk", "Slovak" },
+ { "sl", "Slovenian" },
+ { "sma", "Sami (Southern)" },
+ { "sma", "Southern Sami" },
+ { "smj", "Sami (Lule)" },
+ { "smj", "Lule Sami" },
+ { "smn", "Sami (Inari)" },
+ { "smn", "Inari Sami" },
+ { "sms", "Sami (Skolt)" },
+ { "sms", "Skolt Sami" },
+ { "so", "Somali" },
+ { "sq", "Albanian" },
+ { "sr", "Serbian (Latin)" },
+ { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */
+ { "sv", "Swedish" },
+ { "sw", "Swahili" },
+ { "syr", "Syriac" },
+ { "ta", "Tamil" },
+ { "te", "Telugu" },
+ { "tg", "Tajik" },
+ { "th", "Thai" },
+ { "ti", "Tigrinya" },
+ { "tk", "Turkmen" },
+ { "tl", "Filipino" },
+ { "tn", "Tswana" },
+ { "tr", "Turkish" },
+ { "ts", "Tsonga" },
+ { "tt", "Tatar" },
+ { "ug", "Uighur" },
+ { "uk", "Ukrainian" },
+ { "ur", "Urdu" },
+ { "uz", "Uzbek" },
+ { "uz", "Uzbek (Latin)" },
+ { "uz@cyrillic", "Uzbek (Cyrillic)" },
+ { "ve", "Venda" },
+ { "vi", "Vietnamese" },
+ { "wen", "Sorbian" },
+ { "wo", "Wolof" },
+ { "xh", "Xhosa" },
+ { "yi", "Yiddish" },
+ { "yo", "Yoruba" },
+ { "zh", "Chinese" },
+ { "zu", "Zulu" }
+ };
+
+/* Table from ISO 3166 country code to English name.
+ Keep in sync with the gl_locale_name_from_win32_LANGID function in
+ localename.c! */
+static const struct table_entry country_table[] =
+ {
+ { "AE", "U.A.E." },
+ { "AF", "Afghanistan" },
+ { "AL", "Albania" },
+ { "AM", "Armenia" },
+ { "AN", "Netherlands Antilles" },
+ { "AR", "Argentina" },
+ { "AT", "Austria" },
+ { "AU", "Australia" },
+ { "AZ", "Azerbaijan" },
+ { "BA", "Bosnia and Herzegovina" },
+ { "BD", "Bangladesh" },
+ { "BE", "Belgium" },
+ { "BG", "Bulgaria" },
+ { "BH", "Bahrain" },
+ { "BN", "Brunei Darussalam" },
+ { "BO", "Bolivia" },
+ { "BR", "Brazil" },
+ { "BT", "Bhutan" },
+ { "BY", "Belarus" },
+ { "BZ", "Belize" },
+ { "CA", "Canada" },
+ { "CG", "Congo" },
+ { "CH", "Switzerland" },
+ { "CI", "Cote d'Ivoire" },
+ { "CL", "Chile" },
+ { "CM", "Cameroon" },
+ { "CN", "People's Republic of China" },
+ { "CO", "Colombia" },
+ { "CR", "Costa Rica" },
+ { "CS", "Serbia and Montenegro" },
+ { "CZ", "Czech Republic" },
+ { "DE", "Germany" },
+ { "DK", "Denmark" },
+ { "DO", "Dominican Republic" },
+ { "DZ", "Algeria" },
+ { "EC", "Ecuador" },
+ { "EE", "Estonia" },
+ { "EG", "Egypt" },
+ { "ER", "Eritrea" },
+ { "ES", "Spain" },
+ { "ET", "Ethiopia" },
+ { "FI", "Finland" },
+ { "FO", "Faroe Islands" },
+ { "FR", "France" },
+ { "GB", "United Kingdom" },
+ { "GD", "Caribbean" },
+ { "GE", "Georgia" },
+ { "GL", "Greenland" },
+ { "GR", "Greece" },
+ { "GT", "Guatemala" },
+ { "HK", "Hong Kong" },
+ { "HK", "Hong Kong S.A.R." },
+ { "HN", "Honduras" },
+ { "HR", "Croatia" },
+ { "HT", "Haiti" },
+ { "HU", "Hungary" },
+ { "ID", "Indonesia" },
+ { "IE", "Ireland" },
+ { "IL", "Israel" },
+ { "IN", "India" },
+ { "IQ", "Iraq" },
+ { "IR", "Iran" },
+ { "IS", "Iceland" },
+ { "IT", "Italy" },
+ { "JM", "Jamaica" },
+ { "JO", "Jordan" },
+ { "JP", "Japan" },
+ { "KE", "Kenya" },
+ { "KG", "Kyrgyzstan" },
+ { "KH", "Cambodia" },
+ { "KR", "South Korea" },
+ { "KW", "Kuwait" },
+ { "KZ", "Kazakhstan" },
+ { "LA", "Laos" },
+ { "LB", "Lebanon" },
+ { "LI", "Liechtenstein" },
+ { "LK", "Sri Lanka" },
+ { "LT", "Lithuania" },
+ { "LU", "Luxembourg" },
+ { "LV", "Latvia" },
+ { "LY", "Libya" },
+ { "MA", "Morocco" },
+ { "MC", "Principality of Monaco" },
+ { "MD", "Moldava" },
+ { "MD", "Moldova" },
+ { "ME", "Montenegro" },
+ { "MK", "Former Yugoslav Republic of Macedonia" },
+ { "ML", "Mali" },
+ { "MM", "Myanmar" },
+ { "MN", "Mongolia" },
+ { "MO", "Macau S.A.R." },
+ { "MT", "Malta" },
+ { "MV", "Maldives" },
+ { "MX", "Mexico" },
+ { "MY", "Malaysia" },
+ { "NG", "Nigeria" },
+ { "NI", "Nicaragua" },
+ { "NL", "Netherlands" },
+ { "NO", "Norway" },
+ { "NP", "Nepal" },
+ { "NZ", "New Zealand" },
+ { "OM", "Oman" },
+ { "PA", "Panama" },
+ { "PE", "Peru" },
+ { "PH", "Philippines" },
+ { "PK", "Islamic Republic of Pakistan" },
+ { "PL", "Poland" },
+ { "PR", "Puerto Rico" },
+ { "PT", "Portugal" },
+ { "PY", "Paraguay" },
+ { "QA", "Qatar" },
+ { "RE", "Reunion" },
+ { "RO", "Romania" },
+ { "RS", "Serbia" },
+ { "RU", "Russia" },
+ { "RW", "Rwanda" },
+ { "SA", "Saudi Arabia" },
+ { "SE", "Sweden" },
+ { "SG", "Singapore" },
+ { "SI", "Slovenia" },
+ { "SK", "Slovak" },
+ { "SN", "Senegal" },
+ { "SO", "Somalia" },
+ { "SR", "Suriname" },
+ { "SV", "El Salvador" },
+ { "SY", "Syria" },
+ { "TH", "Thailand" },
+ { "TJ", "Tajikistan" },
+ { "TM", "Turkmenistan" },
+ { "TN", "Tunisia" },
+ { "TR", "Turkey" },
+ { "TT", "Trinidad and Tobago" },
+ { "TW", "Taiwan" },
+ { "TZ", "Tanzania" },
+ { "UA", "Ukraine" },
+ { "US", "United States" },
+ { "UY", "Uruguay" },
+ { "VA", "Vatican" },
+ { "VE", "Venezuela" },
+ { "VN", "Viet Nam" },
+ { "YE", "Yemen" },
+ { "ZA", "South Africa" },
+ { "ZW", "Zimbabwe" }
+ };
+
+/* Given a string STRING, find the set of indices i such that TABLE[i].code is
+ the given STRING. It is a range [lo,hi-1]. */
+typedef struct { size_t lo; size_t hi; } range_t;
+static void
+search (const struct table_entry *table, size_t table_size, const char *string,
+ range_t *result)
+{
+ /* 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].code, string) < 0,
+ for i >= hi, strcmp (table[i].code, string) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].code, string);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (language_table[i].code, string) == 0.
+ Find the entire interval of such i. */
+ {
+ size_t i;
+
+ for (i = mid; i > lo; )
+ {
+ i--;
+ if (strcmp (table[i].code, string) < 0)
+ {
+ lo = i + 1;
+ break;
+ }
+ }
+ }
+ {
+ size_t i;
+
+ for (i = mid; i < hi; i++)
+ {
+ if (strcmp (table[i].code, string) > 0)
+ {
+ hi = i;
+ break;
+ }
+ }
+ }
+ /* The set of i with
+ strcmp (language_table[i].code, string) == 0
+ is the interval [lo, hi-1]. */
+ break;
+ }
+ }
+ result->lo = lo;
+ result->hi = hi;
+}
+
+/* Like setlocale, but accept also locale names in the form ll or ll_CC,
+ where ll is an ISO 639 language code and CC is an ISO 3166 country code. */
+static char *
+setlocale_unixlike (int category, const char *locale)
+{
+ char *result;
+ char llCC_buf[64];
+ char ll_buf[64];
+ char CC_buf[64];
+
+ /* First, try setlocale with the original argument unchanged. */
+ result = setlocale (category, locale);
+ if (result != NULL)
+ return result;
+
+ /* Otherwise, assume the argument is in the form
+ language[_territory][.codeset][@modifier]
+ and try to map it using the tables. */
+ if (strlen (locale) < sizeof (llCC_buf))
+ {
+ /* Second try: Remove the codeset part. */
+ {
+ const char *p = locale;
+ char *q = llCC_buf;
+
+ /* Copy the part before the dot. */
+ for (; *p != '\0' && *p != '.'; p++, q++)
+ *q = *p;
+ if (*p == '.')
+ /* Skip the part up to the '@', if any. */
+ for (; *p != '\0' && *p != '@'; p++)
+ ;
+ /* Copy the part starting with '@', if any. */
+ for (; *p != '\0'; p++, q++)
+ *q = *p;
+ *q = '\0';
+ }
+ /* llCC_buf now contains
+ language[_territory][@modifier]
+ */
+ if (strcmp (llCC_buf, locale) != 0)
+ {
+ result = setlocale (category, llCC_buf);
+ if (result != NULL)
+ return result;
+ }
+ /* Look it up in language_table. */
+ {
+ range_t range;
+ size_t i;
+
+ search (language_table,
+ sizeof (language_table) / sizeof (language_table[0]),
+ llCC_buf,
+ &range);
+
+ for (i = range.lo; i < range.hi; i++)
+ {
+ /* Try the replacement in language_table[i]. */
+ result = setlocale (category, language_table[i].english);
+ if (result != NULL)
+ return result;
+ }
+ }
+ /* Split language[_territory][@modifier]
+ into ll_buf = language[@modifier]
+ and CC_buf = territory
+ */
+ {
+ const char *underscore = strchr (llCC_buf, '_');
+ if (underscore != NULL)
+ {
+ const char *territory_start = underscore + 1;
+ const char *territory_end = strchr (territory_start, '@');
+ if (territory_end == NULL)
+ territory_end = territory_start + strlen (territory_start);
+
+ memcpy (ll_buf, llCC_buf, underscore - llCC_buf);
+ strcpy (ll_buf + (underscore - llCC_buf), territory_end);
+
+ memcpy (CC_buf, territory_start, territory_end - territory_start);
+ CC_buf[territory_end - territory_start] = '\0';
+
+ {
+ /* Look up ll_buf in language_table
+ and CC_buf in country_table. */
+ range_t language_range;
+
+ search (language_table,
+ sizeof (language_table) / sizeof (language_table[0]),
+ ll_buf,
+ &language_range);
+ if (language_range.lo < language_range.hi)
+ {
+ range_t country_range;
+
+ search (country_table,
+ sizeof (country_table) / sizeof (country_table[0]),
+ CC_buf,
+ &country_range);
+ if (country_range.lo < country_range.hi)
+ {
+ size_t i;
+ size_t j;
+
+ for (i = language_range.lo; i < language_range.hi; i++)
+ for (j = country_range.lo; j < country_range.hi; j++)
+ {
+ /* Concatenate the replacements. */
+ const char *part1 = language_table[i].english;
+ size_t part1_len = strlen (part1);
+ const char *part2 = country_table[j].english;
+ size_t part2_len = strlen (part2) + 1;
+ char buf[64+64];
+
+ if (!(part1_len + 1 + part2_len <= sizeof (buf)))
+ abort ();
+ memcpy (buf, part1, part1_len);
+ buf[part1_len] = '_';
+ memcpy (buf + part1_len + 1, part2, part2_len);
+
+ /* Try the concatenated replacements. */
+ result = setlocale (category, buf);
+ if (result != NULL)
+ return result;
+ }
+ }
+
+ /* Try omitting the country entirely. This may set a locale
+ corresponding to the wrong country, but is better than
+ failing entirely. */
+ {
+ size_t i;
+
+ for (i = language_range.lo; i < language_range.hi; i++)
+ {
+ /* Try only the language replacement. */
+ result =
+ setlocale (category, language_table[i].english);
+ if (result != NULL)
+ return result;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Failed. */
+ return NULL;
+}
+
+# else
+# define setlocale_unixlike setlocale
+# endif
+
+# if LC_MESSAGES == 1729
+
+/* The system does not store an LC_MESSAGES locale category. Do it here. */
+static char lc_messages_name[64] = "C";
+
+/* Like setlocale, but support also LC_MESSAGES. */
+static char *
+setlocale_single (int category, const char *locale)
+{
+ if (category == LC_MESSAGES)
+ {
+ if (locale != NULL)
+ {
+ lc_messages_name[sizeof (lc_messages_name) - 1] = '\0';
+ strncpy (lc_messages_name, locale, sizeof (lc_messages_name) - 1);
+ }
+ return lc_messages_name;
+ }
+ else
+ return setlocale_unixlike (category, locale);
+}
+
+# else
+# define setlocale_single setlocale_unixlike
+# endif
+
+char *
+rpl_setlocale (int category, const char *locale)
+{
+ if (locale != NULL && locale[0] == '\0')
+ {
+ /* A request to the set the current locale to the default locale. */
+ if (category == LC_ALL)
+ {
+ /* Set LC_CTYPE first. Then the other categories. */
+ static int const categories[] =
+ {
+ LC_NUMERIC,
+ LC_TIME,
+ LC_COLLATE,
+ LC_MONETARY,
+ LC_MESSAGES
+ };
+ char *saved_locale;
+ const char *base_name;
+ unsigned int i;
+
+ /* Back up the old locale, in case one of the steps fails. */
+ saved_locale = setlocale (LC_ALL, NULL);
+ if (saved_locale == NULL)
+ return NULL;
+ saved_locale = strdup (saved_locale);
+ if (saved_locale == NULL)
+ return NULL;
+
+ /* Set LC_CTYPE category. Set all other categories (except possibly
+ LC_MESSAGES) to the same value in the same call; this is likely to
+ save calls. */
+ base_name =
+ gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE));
+ if (base_name == NULL)
+ base_name = gl_locale_name_default ();
+
+ if (setlocale_unixlike (LC_ALL, base_name) == NULL)
+ goto fail;
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows, setlocale(LC_ALL,...) may succeed but set the
+ LC_CTYPE category to an invalid value ("C") when it does not
+ support the specified encoding. Report a failure instead. */
+ if (strchr (base_name, '.') != NULL
+ && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ goto fail;
+# endif
+
+ for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
+ {
+ int cat = categories[i];
+ const char *name;
+
+ name = gl_locale_name_environ (cat, category_to_name (cat));
+ if (name == NULL)
+ name = gl_locale_name_default ();
+
+ /* If name is the same as base_name, it has already been set
+ through the setlocale call before the loop. */
+ if (strcmp (name, base_name) != 0
+# if LC_MESSAGES == 1729
+ || cat == LC_MESSAGES
+# endif
+ )
+ if (setlocale_single (cat, name) == NULL)
+ goto fail;
+ }
+
+ /* All steps were successful. */
+ free (saved_locale);
+ return setlocale (LC_ALL, NULL);
+
+ fail:
+ if (saved_locale[0] != '\0') /* don't risk an endless recursion */
+ setlocale (LC_ALL, saved_locale);
+ free (saved_locale);
+ return NULL;
+ }
+ else
+ {
+ const char *name =
+ gl_locale_name_environ (category, category_to_name (category));
+ if (name == NULL)
+ name = gl_locale_name_default ();
+
+ return setlocale_single (category, name);
+ }
+ }
+ else
+ {
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL)
+ {
+ char *saved_locale;
+
+ /* Back up the old locale. */
+ saved_locale = setlocale (LC_ALL, NULL);
+ if (saved_locale == NULL)
+ return NULL;
+ saved_locale = strdup (saved_locale);
+ if (saved_locale == NULL)
+ return NULL;
+
+ if (setlocale_unixlike (LC_ALL, locale) == NULL)
+ {
+ free (saved_locale);
+ return NULL;
+ }
+
+ /* On native Windows, setlocale(LC_ALL,...) may succeed but set the
+ LC_CTYPE category to an invalid value ("C") when it does not
+ support the specified encoding. Report a failure instead. */
+ if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ {
+ if (saved_locale[0] != '\0') /* don't risk an endless recursion */
+ setlocale (LC_ALL, saved_locale);
+ free (saved_locale);
+ return NULL;
+ }
+
+ /* It was really successful. */
+ free (saved_locale);
+ return setlocale (LC_ALL, NULL);
+ }
+ else
+# endif
+ return setlocale_single (category, locale);
+ }
+}
+
+#endif
diff --git a/gnulib-tests/setsockopt.c b/gnulib-tests/setsockopt.c
new file mode 100644
index 0000000..af09f32
--- /dev/null
+++ b/gnulib-tests/setsockopt.c
@@ -0,0 +1,65 @@
+/* setsockopt.c --- wrappers for Windows setsockopt function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get struct timeval. */
+#include <sys/time.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef setsockopt
+
+int
+rpl_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen)
+{
+ SOCKET sock = FD_TO_SOCKET (fd);
+ int r;
+
+ if (sock == INVALID_SOCKET)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ else
+ {
+ if (level == SOL_SOCKET
+ && (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO))
+ {
+ const struct timeval *tv = optval;
+ int milliseconds = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+ optval = &milliseconds;
+ r = setsockopt (sock, level, optname, optval, sizeof (int));
+ }
+ else
+ {
+ r = setsockopt (sock, level, optname, optval, optlen);
+ }
+
+ if (r < 0)
+ set_winsock_errno ();
+
+ return r;
+ }
+}
diff --git a/gnulib-tests/signature.h b/gnulib-tests/signature.h
new file mode 100644
index 0000000..2df8067
--- /dev/null
+++ b/gnulib-tests/signature.h
@@ -0,0 +1,48 @@
+/* Macro for checking that a function declaration is compliant.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef SIGNATURE_CHECK
+
+/* Check that the function FN takes the specified arguments ARGS with
+ a return type of RET. This header is designed to be included after
+ <config.h> and the one system header that is supposed to contain
+ the function being checked, but prior to any other system headers
+ that are necessary for the unit test. Therefore, this file does
+ not include any system headers, nor reference anything outside of
+ the macro arguments. For an example, if foo.h should provide:
+
+ extern int foo (char, float);
+
+ then the unit test named test-foo.c would start out with:
+
+ #include <config.h>
+ #include <foo.h>
+ #include "signature.h"
+ SIGNATURE_CHECK (foo, int, (char, float));
+ #include <other.h>
+ ...
+*/
+# define SIGNATURE_CHECK(fn, ret, args) \
+ SIGNATURE_CHECK1 (fn, ret, args, __LINE__)
+
+/* Necessary to allow multiple SIGNATURE_CHECK lines in a unit test.
+ Note that the checks must not occupy the same line. */
+# define SIGNATURE_CHECK1(fn, ret, args, id) \
+ SIGNATURE_CHECK2 (fn, ret, args, id) /* macroexpand line */
+# define SIGNATURE_CHECK2(fn, ret, args, id) \
+ static ret (* _GL_UNUSED signature_check ## id) args = fn
+
+#endif /* SIGNATURE_CHECK */
diff --git a/gnulib-tests/sleep.c b/gnulib-tests/sleep.c
new file mode 100644
index 0000000..997285e
--- /dev/null
+++ b/gnulib-tests/sleep.c
@@ -0,0 +1,76 @@
+/* Pausing execution of the current thread.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <limits.h>
+
+#include "verify.h"
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+unsigned int
+sleep (unsigned int seconds)
+{
+ unsigned int remaining;
+
+ /* Sleep for 1 second many times, because
+ 1. Sleep is not interruptible by Ctrl-C,
+ 2. we want to avoid arithmetic overflow while multiplying with 1000. */
+ for (remaining = seconds; remaining > 0; remaining--)
+ Sleep (1000);
+
+ return remaining;
+}
+
+#elif HAVE_SLEEP
+
+# undef sleep
+
+/* Guarantee unlimited sleep and a reasonable return value. Cygwin
+ 1.5.x rejects attempts to sleep more than 49.7 days (2**32
+ milliseconds), but uses uninitialized memory which results in a
+ garbage answer. Similarly, Linux 2.6.9 with glibc 2.3.4 has a too
+ small return value when asked to sleep more than 24.85 days. */
+unsigned int
+rpl_sleep (unsigned int seconds)
+{
+ /* This requires int larger than 16 bits. */
+ verify (UINT_MAX / 24 / 24 / 60 / 60);
+ const unsigned int limit = 24 * 24 * 60 * 60;
+ while (limit < seconds)
+ {
+ unsigned int result;
+ seconds -= limit;
+ result = sleep (limit);
+ if (result)
+ return seconds + result;
+ }
+ return sleep (seconds);
+}
+
+#else /* !HAVE_SLEEP */
+
+ #error "Please port gnulib sleep.c to your platform, possibly using usleep() or select(), then report this to bug-gnulib."
+
+#endif
diff --git a/gnulib-tests/snprintf.c b/gnulib-tests/snprintf.c
new file mode 100644
index 0000000..7cd89af
--- /dev/null
+++ b/gnulib-tests/snprintf.c
@@ -0,0 +1,71 @@
+/* Formatted output to strings.
+ Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
+ Written by Simon Josefsson and Paul Eggert.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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 sprintf, 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
+snprintf (char *str, size_t size, const char *format, ...)
+{
+ char *output;
+ size_t len;
+ size_t lenbuf = size;
+ va_list args;
+
+ va_start (args, format);
+ output = vasnprintf (str, &lenbuf, format, args);
+ len = lenbuf;
+ va_end (args);
+
+ 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 (INT_MAX < len)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ return len;
+}
diff --git a/gnulib-tests/socket.c b/gnulib-tests/socket.c
new file mode 100644
index 0000000..4ccec4b
--- /dev/null
+++ b/gnulib-tests/socket.c
@@ -0,0 +1,49 @@
+/* socket.c --- wrappers for Windows socket function
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#include "sockets.h"
+
+int
+rpl_socket (int domain, int type, int protocol)
+{
+ SOCKET fh;
+
+ gl_sockets_startup (SOCKETS_1_1);
+
+ /* We have to use WSASocket() to create non-overlapped IO sockets.
+ Overlapped IO sockets cannot be used with read/write. */
+ fh = WSASocket (domain, type, protocol, NULL, 0, 0);
+
+ if (fh == INVALID_SOCKET)
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ return SOCKET_TO_FD (fh);
+}
diff --git a/gnulib-tests/sockets.c b/gnulib-tests/sockets.c
new file mode 100644
index 0000000..abfab02
--- /dev/null
+++ b/gnulib-tests/sockets.c
@@ -0,0 +1,157 @@
+/* sockets.c --- wrappers for Windows socket functions
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson */
+
+#include <config.h>
+
+/* Specification. */
+#include "sockets.h"
+
+#if WINDOWS_SOCKETS
+
+/* This includes winsock2.h on MinGW. */
+# include <sys/socket.h>
+
+# include "fd-hook.h"
+# include "msvc-nothrow.h"
+
+/* 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 (int version _GL_UNUSED)
+{
+#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/gnulib-tests/sockets.h b/gnulib-tests/sockets.h
new file mode 100644
index 0000000..01a68d0
--- /dev/null
+++ b/gnulib-tests/sockets.h
@@ -0,0 +1,62 @@
+/* sockets.h - wrappers for Windows socket functions
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson */
+
+#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)
+#if !WINDOWS_SOCKETS
+ _GL_ATTRIBUTE_CONST
+#endif
+ ;
+
+int gl_sockets_cleanup (void)
+#if !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. */
+#if WINDOWS_SOCKETS
+
+#include <sys/socket.h>
+
+#include "msvc-nothrow.h"
+
+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/gnulib-tests/stdalign.in.h b/gnulib-tests/stdalign.in.h
new file mode 100644
index 0000000..12f8a15
--- /dev/null
+++ b/gnulib-tests/stdalign.in.h
@@ -0,0 +1,121 @@
+/* A substitute for ISO C11 <stdalign.h>.
+
+ Copyright 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* 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 __alignof__ operator, which can yield a
+ better-performing alignment for an object of that type. For
+ example, on x86 with GCC, __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
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9)))
+# 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 __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || 061200 <= __HP_cc || 061200 <= __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/gnulib-tests/strerror_r.c b/gnulib-tests/strerror_r.c
new file mode 100644
index 0000000..07a00cf
--- /dev/null
+++ b/gnulib-tests/strerror_r.c
@@ -0,0 +1,338 @@
+/* strerror_r.c --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
+
+#include <config.h>
+
+/* Enable declaration of sys_nerr and sys_errlist in <errno.h> on NetBSD. */
+#define _NETBSD_SOURCE 1
+
+/* Specification. */
+#include <string.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "strerror-override.h"
+
+#if (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4, cygwin >= 1.7.9 */
+
+# define USE_XPG_STRERROR_R 1
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
+
+#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
+
+/* The system's strerror_r function is OK, except that its third argument
+ is 'int', not 'size_t', or its return type is wrong. */
+
+# include <limits.h>
+
+# define USE_SYSTEM_STRERROR_R 1
+
+#else /* (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) */
+
+/* Use the system's strerror(). Exclude glibc and cygwin because the
+ system strerror_r has the wrong return type, and cygwin 1.7.9
+ strerror_r clobbers strerror. */
+# undef strerror
+
+# define USE_SYSTEM_STRERROR 1
+
+# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
+
+/* No locking needed. */
+
+/* Get catgets internationalization functions. */
+# if HAVE_CATGETS
+# include <nl_types.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Get sys_nerr, sys_errlist on HP-UX (otherwise only declared in C++ mode).
+ Get sys_nerr, sys_errlist on IRIX (otherwise only declared with _SGIAPI). */
+# if defined __hpux || defined __sgi
+extern int sys_nerr;
+extern char *sys_errlist[];
+# endif
+
+/* Get sys_nerr on Solaris. */
+# if defined __sun && !defined _LP64
+extern int sys_nerr;
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+# else
+
+# include "glthread/lock.h"
+
+/* This lock protects the buffer returned by strerror(). We assume that
+ no other uses of strerror() exist in the program. */
+gl_lock_define_initialized(static, strerror_lock)
+
+# endif
+
+#endif
+
+/* On MSVC, there is no snprintf() function, just a _snprintf().
+ It is of lower quality, but sufficient for the simple use here.
+ We only have to make sure to NUL terminate the result (_snprintf
+ does not NUL terminate, like strncpy). */
+#if !HAVE_SNPRINTF
+static int
+local_snprintf (char *buf, size_t buflen, const char *format, ...)
+{
+ va_list args;
+ int result;
+
+ va_start (args, format);
+ result = _vsnprintf (buf, buflen, format, args);
+ va_end (args);
+ if (buflen > 0 && (result < 0 || result >= buflen))
+ buf[buflen - 1] = '\0';
+ return result;
+}
+# define snprintf local_snprintf
+#endif
+
+/* Copy as much of MSG into BUF as possible, without corrupting errno.
+ Return 0 if MSG fit in BUFLEN, otherwise return ERANGE. */
+static int
+safe_copy (char *buf, size_t buflen, const char *msg)
+{
+ size_t len = strlen (msg);
+ int ret;
+
+ if (len < buflen)
+ {
+ /* Although POSIX allows memcpy() to corrupt errno, we don't
+ know of any implementation where this is a real problem. */
+ memcpy (buf, msg, len + 1);
+ ret = 0;
+ }
+ else
+ {
+ memcpy (buf, msg, buflen - 1);
+ buf[buflen - 1] = '\0';
+ ret = ERANGE;
+ }
+ return ret;
+}
+
+
+int
+strerror_r (int errnum, char *buf, size_t buflen)
+#undef strerror_r
+{
+ /* Filter this out now, so that rest of this replacement knows that
+ there is room for a non-empty message and trailing NUL. */
+ if (buflen <= 1)
+ {
+ if (buflen)
+ *buf = '\0';
+ return ERANGE;
+ }
+ *buf = '\0';
+
+ /* Check for gnulib overrides. */
+ {
+ char const *msg = strerror_override (errnum);
+
+ if (msg)
+ return safe_copy (buf, buflen, msg);
+ }
+
+ {
+ int ret;
+ int saved_errno = errno;
+
+#if USE_XPG_STRERROR_R
+
+ {
+ ret = __xpg_strerror_r (errnum, buf, buflen);
+ if (ret < 0)
+ ret = errno;
+ if (!*buf)
+ {
+ /* glibc 2.13 would not touch buf on err, so we have to fall
+ back to GNU strerror_r which always returns a thread-safe
+ untruncated string to (partially) copy into our buf. */
+ safe_copy (buf, buflen, strerror_r (errnum, buf, buflen));
+ }
+ }
+
+#elif USE_SYSTEM_STRERROR_R
+
+ if (buflen > INT_MAX)
+ buflen = INT_MAX;
+
+# ifdef __hpux
+ /* On HP-UX 11.31, strerror_r always fails when buflen < 80; it
+ also fails to change buf on EINVAL. */
+ {
+ char stackbuf[80];
+
+ if (buflen < sizeof stackbuf)
+ {
+ ret = strerror_r (errnum, stackbuf, sizeof stackbuf);
+ if (ret == 0)
+ ret = safe_copy (buf, buflen, stackbuf);
+ }
+ else
+ ret = strerror_r (errnum, buf, buflen);
+ }
+# else
+ ret = strerror_r (errnum, buf, buflen);
+
+ /* Some old implementations may return (-1, EINVAL) instead of EINVAL. */
+ if (ret < 0)
+ ret = errno;
+# endif
+
+# ifdef _AIX
+ /* AIX returns 0 rather than ERANGE when truncating strings; try
+ again until we are sure we got the entire string. */
+ if (!ret && strlen (buf) == buflen - 1)
+ {
+ char stackbuf[STACKBUF_LEN];
+ size_t len;
+ strerror_r (errnum, stackbuf, sizeof stackbuf);
+ len = strlen (stackbuf);
+ /* STACKBUF_LEN should have been large enough. */
+ if (len + 1 == sizeof stackbuf)
+ abort ();
+ if (buflen <= len)
+ ret = ERANGE;
+ }
+# else
+ /* Solaris 10 does not populate buf on ERANGE. OpenBSD 4.7
+ truncates early on ERANGE rather than return a partial integer.
+ We prefer the maximal string. We set buf[0] earlier, and we
+ know of no implementation that modifies buf to be an
+ unterminated string, so this strlen should be portable in
+ practice (rather than pulling in a safer strnlen). */
+ if (ret == ERANGE && strlen (buf) < buflen - 1)
+ {
+ char stackbuf[STACKBUF_LEN];
+
+ /* STACKBUF_LEN should have been large enough. */
+ if (strerror_r (errnum, stackbuf, sizeof stackbuf) == ERANGE)
+ abort ();
+ safe_copy (buf, buflen, stackbuf);
+ }
+# endif
+
+#else /* USE_SYSTEM_STRERROR */
+
+ /* Try to do what strerror (errnum) does, but without clobbering the
+ buffer used by strerror(). */
+
+# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Windows, Cygwin */
+
+ /* NetBSD: sys_nerr, sys_errlist are declared through _NETBSD_SOURCE
+ and <errno.h> above.
+ HP-UX: sys_nerr, sys_errlist are declared explicitly above.
+ native Windows: sys_nerr, sys_errlist are declared in <stdlib.h>.
+ Cygwin: sys_nerr, sys_errlist are declared in <errno.h>. */
+ if (errnum >= 0 && errnum < sys_nerr)
+ {
+# if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
+# if defined __NetBSD__
+ nl_catd catd = catopen ("libc", NL_CAT_LOCALE);
+ const char *errmsg =
+ (catd != (nl_catd)-1
+ ? catgets (catd, 1, errnum, sys_errlist[errnum])
+ : sys_errlist[errnum]);
+# endif
+# if defined __hpux
+ nl_catd catd = catopen ("perror", NL_CAT_LOCALE);
+ const char *errmsg =
+ (catd != (nl_catd)-1
+ ? catgets (catd, 1, 1 + errnum, sys_errlist[errnum])
+ : sys_errlist[errnum]);
+# endif
+# else
+ const char *errmsg = sys_errlist[errnum];
+# endif
+ if (errmsg == NULL || *errmsg == '\0')
+ ret = EINVAL;
+ else
+ ret = safe_copy (buf, buflen, errmsg);
+# if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
+ if (catd != (nl_catd)-1)
+ catclose (catd);
+# endif
+ }
+ else
+ ret = EINVAL;
+
+# elif defined __sgi || (defined __sun && !defined _LP64) /* IRIX, Solaris <= 9 32-bit */
+
+ /* For a valid error number, the system's strerror() function returns
+ a pointer to a not copied string, not to a buffer. */
+ if (errnum >= 0 && errnum < sys_nerr)
+ {
+ char *errmsg = strerror (errnum);
+
+ if (errmsg == NULL || *errmsg == '\0')
+ ret = EINVAL;
+ else
+ ret = safe_copy (buf, buflen, errmsg);
+ }
+ else
+ ret = EINVAL;
+
+# else
+
+ gl_lock_lock (strerror_lock);
+
+ {
+ char *errmsg = strerror (errnum);
+
+ /* For invalid error numbers, strerror() on
+ - IRIX 6.5 returns NULL,
+ - HP-UX 11 returns an empty string. */
+ if (errmsg == NULL || *errmsg == '\0')
+ ret = EINVAL;
+ else
+ ret = safe_copy (buf, buflen, errmsg);
+ }
+
+ gl_lock_unlock (strerror_lock);
+
+# endif
+
+#endif
+
+ if (ret == EINVAL && !*buf)
+ snprintf (buf, buflen, "Unknown error %d", errnum);
+
+ errno = saved_errno;
+ return ret;
+ }
+}
diff --git a/gnulib-tests/symlink.c b/gnulib-tests/symlink.c
new file mode 100644
index 0000000..d8684b6
--- /dev/null
+++ b/gnulib-tests/symlink.c
@@ -0,0 +1,57 @@
+/* Stub for symlink().
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+
+
+#if HAVE_SYMLINK
+
+# undef symlink
+
+/* Create a symlink, but reject trailing slash. */
+int
+rpl_symlink (char const *contents, char const *name)
+{
+ size_t len = strlen (name);
+ if (len && name[len - 1] == '/')
+ {
+ struct stat st;
+ if (lstat (name, &st) == 0)
+ errno = EEXIST;
+ return -1;
+ }
+ return symlink (contents, name);
+}
+
+#else /* !HAVE_SYMLINK */
+
+/* The system does not support symlinks. */
+int
+symlink (char const *contents _GL_UNUSED,
+ char const *name _GL_UNUSED)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+#endif /* !HAVE_SYMLINK */
diff --git a/gnulib-tests/sys_ioctl.in.h b/gnulib-tests/sys_ioctl.in.h
new file mode 100644
index 0000000..a07dc97
--- /dev/null
+++ b/gnulib-tests/sys_ioctl.in.h
@@ -0,0 +1,78 @@
+/* Substitute for and wrapper around <sys/ioctl.h>.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_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>.
+ 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/gnulib-tests/sys_select.in.h b/gnulib-tests/sys_select.in.h
new file mode 100644
index 0000000..9a2622f
--- /dev/null
+++ b/gnulib-tests/sys_select.in.h
@@ -0,0 +1,319 @@
+/* Substitute for <sys/select.h>.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+# 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, <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 __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.
+ 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 __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
+# else
+ _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
+#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
+_GL_CXXALIAS_SYS (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,
+ struct timeval *restrict));
+# else
+_GL_CXXALIAS_SYS (select, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ struct 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/gnulib-tests/sys_socket.c b/gnulib-tests/sys_socket.c
new file mode 100644
index 0000000..3b261da
--- /dev/null
+++ b/gnulib-tests/sys_socket.c
@@ -0,0 +1,4 @@
+#include <config.h>
+#define _GL_SYS_SOCKET_INLINE _GL_EXTERN_INLINE
+#include "sys/socket.h"
+typedef int dummy;
diff --git a/gnulib-tests/sys_socket.in.h b/gnulib-tests/sys_socket.in.h
new file mode 100644
index 0000000..a627dd4
--- /dev/null
+++ b/gnulib-tests/sys_socket.in.h
@@ -0,0 +1,692 @@
+/* Provide a sys/socket header file for systems lacking it (read: MinGW)
+ and for systems where it is incomplete.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* This 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
+typedef unsigned short sa_family_t;
+# 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
+
+#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
+ <http://msdn.microsoft.com/en-us/library/ms738520>
+ 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 !GNULIB_defined_socklen_t
+typedef int socklen_t;
+# define GNULIB_defined_socklen_t 1
+# endif
+
+# 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
+
+/* 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
+# else
+ _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 *addr, socklen_t *addrlen));
+_GL_CXXALIAS_RPL (accept, int,
+ (int fd, struct sockaddr *addr, socklen_t *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 *addr, socklen_t *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 *addr, socklen_t *addrlen)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getpeername, int,
+ (int fd, struct sockaddr *addr, socklen_t *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 *addr, socklen_t *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 *addr, socklen_t *addrlen)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getsockname, int,
+ (int fd, struct sockaddr *addr, socklen_t *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 *addr, socklen_t *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 *optval, socklen_t *optlen)
+ _GL_ARG_NONNULL ((4, 5)));
+_GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname,
+ void *optval, socklen_t *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 *optval, socklen_t *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
+_GL_CXXALIAS_SYS (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
+_GL_CXXALIAS_SYS (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 *buf, size_t len, int flags,
+ struct sockaddr *from, socklen_t *fromlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recvfrom, ssize_t,
+ (int fd, void *buf, size_t len, int flags,
+ struct sockaddr *from, socklen_t *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 *buf, size_t len, int flags,
+ struct sockaddr *from, socklen_t *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
+ <http://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/gnulib-tests/sys_uio.in.h b/gnulib-tests/sys_uio.in.h
new file mode 100644
index 0000000..e70663f
--- /dev/null
+++ b/gnulib-tests/sys_uio.in.h
@@ -0,0 +1,63 @@
+/* Substitute for <sys/uio.h>.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+# 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/gnulib-tests/test-accept.c b/gnulib-tests/test-accept.c
new file mode 100644
index 0000000..9d510a6
--- /dev/null
+++ b/gnulib-tests/test-accept.c
@@ -0,0 +1,56 @@
+/* Test accepting a connection to a server socket.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (accept, int, (int, struct sockaddr *, socklen_t *));
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+ (void) gl_sockets_startup (SOCKETS_1_1);
+
+ /* Test behaviour for invalid file descriptors. */
+ {
+ struct sockaddr_in addr;
+ socklen_t addrlen = sizeof (addr);
+
+ errno = 0;
+ ASSERT (accept (-1, (struct sockaddr *) &addr, &addrlen) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ struct sockaddr_in addr;
+ socklen_t addrlen = sizeof (addr);
+
+ close (99);
+ errno = 0;
+ ASSERT (accept (99, (struct sockaddr *) &addr, &addrlen) == -1);
+ ASSERT (errno == EBADF);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-alloca-opt.c b/gnulib-tests/test-alloca-opt.c
new file mode 100644
index 0000000..b9aaa4a
--- /dev/null
+++ b/gnulib-tests/test-alloca-opt.c
@@ -0,0 +1,62 @@
+/* Test of optional automatic memory allocation.
+ Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <alloca.h>
+
+#if HAVE_ALLOCA
+
+static void
+do_allocation (int n)
+{
+ void *ptr = alloca (n);
+ (void) ptr;
+}
+
+void (*func) (int) = do_allocation;
+
+#endif
+
+int
+main ()
+{
+#if HAVE_ALLOCA
+ int i;
+
+ /* Repeat a lot of times, to make sure there's no memory leak. */
+ for (i = 0; i < 100000; i++)
+ {
+ /* Try various values.
+ n = 0 gave a crash on Alpha with gcc-2.5.8.
+ Some versions of Mac OS X have a stack size limit of 512 KB. */
+ func (34);
+ func (134);
+ func (399);
+ func (510823);
+ func (129321);
+ func (0);
+ func (4070);
+ func (4095);
+ func (1);
+ func (16582);
+ }
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-areadlink.c b/gnulib-tests/test-areadlink.c
new file mode 100644
index 0000000..738a498
--- /dev/null
+++ b/gnulib-tests/test-areadlink.c
@@ -0,0 +1,53 @@
+/* Tests of areadlink.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include "areadlink.h"
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "ignore-value.h"
+#include "macros.h"
+
+#define BASE "test-areadlink.t"
+
+#include "test-areadlink.h"
+
+/* Wrapper for testing areadlink. */
+static char *
+do_areadlink (char const *name, size_t ignored _GL_UNUSED)
+{
+ return areadlink (name);
+}
+
+int
+main (void)
+{
+ /* Remove any leftovers from a previous partial run. */
+ ignore_value (system ("rm -rf " BASE "*"));
+
+ return test_areadlink (do_areadlink, true);
+}
diff --git a/gnulib-tests/test-areadlink.h b/gnulib-tests/test-areadlink.h
new file mode 100644
index 0000000..3251ca2
--- /dev/null
+++ b/gnulib-tests/test-areadlink.h
@@ -0,0 +1,83 @@
+/* Tests of areadlink and friends.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+/* This file is designed to test areadlink(a),
+ areadlink_with_size(a,b), and areadlinkat(AT_FDCWD,a). FUNC is the
+ function to test; a length is always supplied, but may be ignored.
+ Assumes that BASE and ASSERT are already defined, and that
+ appropriate headers are already included. If PRINT, warn before
+ skipping symlink tests with status 77. */
+
+static int
+test_areadlink (char * (*func) (char const *, size_t), bool print)
+{
+ /* Sanity checks of failures. Mingw lacks symlink, but areadlink can
+ still distinguish between various errors. */
+ errno = 0;
+ ASSERT (func ("no_such", 1) == NULL);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("no_such/", 1) == NULL);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("", 1) == NULL);
+ ASSERT (errno == ENOENT || errno == EINVAL);
+ errno = 0;
+ ASSERT (func (".", 1) == NULL);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (func ("./", 1) == NULL);
+ ASSERT (errno == EINVAL);
+ ASSERT (close (creat (BASE "file", 0600)) == 0);
+ errno = 0;
+ ASSERT (func (BASE "file", 1) == NULL);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (func (BASE "file/", 1) == NULL);
+ ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */
+ ASSERT (unlink (BASE "file") == 0);
+
+ /* Now test actual symlinks. */
+ if (symlink (BASE "dir", BASE "link"))
+ {
+ if (print)
+ fputs ("skipping test: symlinks not supported on this file system\n",
+ stderr);
+ return 77;
+ }
+ ASSERT (mkdir (BASE "dir", 0700) == 0);
+ errno = 0;
+ ASSERT (func (BASE "link/", 1) == NULL);
+ ASSERT (errno == EINVAL);
+ {
+ /* Too small a guess is okay. */
+ char *buf = func (BASE "link", 1);
+ ASSERT (buf);
+ ASSERT (strcmp (buf, BASE "dir") == 0);
+ free (buf);
+ /* Too large a guess is okay. */
+ buf = func (BASE "link", 10000000);
+ ASSERT (buf);
+ ASSERT (strcmp (buf, BASE "dir") == 0);
+ free (buf);
+ }
+ ASSERT (rmdir (BASE "dir") == 0);
+ ASSERT (unlink (BASE "link") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-argmatch.c b/gnulib-tests/test-argmatch.c
new file mode 100644
index 0000000..9a3a4a9
--- /dev/null
+++ b/gnulib-tests/test-argmatch.c
@@ -0,0 +1,101 @@
+/* Test of exact or abbreviated match search.
+ Copyright (C) 1990, 1998-1999, 2001-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007, based on test code
+ by David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#include <config.h>
+
+#include "argmatch.h"
+
+#include <stdlib.h>
+
+#include "progname.h"
+#include "macros.h"
+
+/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and
+ thus must link with a definition of that function. Provide it here. */
+#ifdef ARGMATCH_DIE_DECL
+
+_Noreturn ARGMATCH_DIE_DECL;
+ARGMATCH_DIE_DECL { exit (1); }
+
+#endif
+
+enum backup_type
+{
+ no_backups,
+ simple_backups,
+ numbered_existing_backups,
+ numbered_backups
+};
+
+static const char *const backup_args[] =
+{
+ "no", "none", "off",
+ "simple", "never", "single",
+ "existing", "nil", "numbered-existing",
+ "numbered", "t", "newstyle",
+ NULL
+};
+
+static const enum backup_type backup_vals[] =
+{
+ no_backups, no_backups, no_backups,
+ simple_backups, simple_backups, simple_backups,
+ numbered_existing_backups, numbered_existing_backups, numbered_existing_backups,
+ numbered_backups, numbered_backups, numbered_backups
+};
+
+int
+main (int argc, char *argv[])
+{
+ set_program_name (argv[0]);
+
+ /* Not found. */
+ ASSERT (ARGMATCH ("klingon", backup_args, backup_vals) == -1);
+
+ /* Exact match. */
+ ASSERT (ARGMATCH ("none", backup_args, backup_vals) == 1);
+ ASSERT (ARGMATCH ("nil", backup_args, backup_vals) == 7);
+
+ /* Too long. */
+ ASSERT (ARGMATCH ("nilpotent", backup_args, backup_vals) == -1);
+
+ /* Abbreviated. */
+ ASSERT (ARGMATCH ("simpl", backup_args, backup_vals) == 3);
+ ASSERT (ARGMATCH ("simp", backup_args, backup_vals) == 3);
+ ASSERT (ARGMATCH ("sim", backup_args, backup_vals) == 3);
+
+ /* Exact match and abbreviated. */
+ ASSERT (ARGMATCH ("numbered", backup_args, backup_vals) == 9);
+ ASSERT (ARGMATCH ("numbere", backup_args, backup_vals) == -2);
+ ASSERT (ARGMATCH ("number", backup_args, backup_vals) == -2);
+ ASSERT (ARGMATCH ("numbe", backup_args, backup_vals) == -2);
+ ASSERT (ARGMATCH ("numb", backup_args, backup_vals) == -2);
+ ASSERT (ARGMATCH ("num", backup_args, backup_vals) == -2);
+ ASSERT (ARGMATCH ("nu", backup_args, backup_vals) == -2);
+ ASSERT (ARGMATCH ("n", backup_args, backup_vals) == -2);
+
+ /* Ambiguous abbreviated. */
+ ASSERT (ARGMATCH ("ne", backup_args, backup_vals) == -2);
+
+ /* Ambiguous abbreviated, but same value. */
+ ASSERT (ARGMATCH ("si", backup_args, backup_vals) == 3);
+ ASSERT (ARGMATCH ("s", backup_args, backup_vals) == 3);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-arpa_inet.c b/gnulib-tests/test-arpa_inet.c
new file mode 100644
index 0000000..5fc6cdd
--- /dev/null
+++ b/gnulib-tests/test-arpa_inet.c
@@ -0,0 +1,27 @@
+/* Test of <arpa/inet.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <arpa/inet.h>
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-binary-io.c b/gnulib-tests/test-binary-io.c
new file mode 100644
index 0000000..6801e96
--- /dev/null
+++ b/gnulib-tests/test-binary-io.c
@@ -0,0 +1,69 @@
+/* Test of binary mode I/O.
+ Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
+
+#include <config.h>
+
+#include "binary-io.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ /* Test the O_BINARY macro. */
+ {
+ int fd =
+ open ("t-bin-out0.tmp", O_CREAT | O_TRUNC | O_RDWR | O_BINARY, 0600);
+ if (write (fd, "Hello\n", 6) < 0)
+ exit (1);
+ close (fd);
+ }
+ {
+ struct stat statbuf;
+ if (stat ("t-bin-out0.tmp", &statbuf) < 0)
+ exit (1);
+ ASSERT (statbuf.st_size == 6);
+ }
+
+ switch (argv[1][0])
+ {
+ case '1':
+ /* Test the set_binary_mode() function. */
+ set_binary_mode (1, O_BINARY);
+ fputs ("Hello\n", stdout);
+ break;
+
+ case '2':
+ /* Test the SET_BINARY macro. */
+ SET_BINARY (1);
+ fputs ("Hello\n", stdout);
+ break;
+
+ default:
+ break;
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-binary-io.sh b/gnulib-tests/test-binary-io.sh
new file mode 100755
index 0000000..c4dd6e9
--- /dev/null
+++ b/gnulib-tests/test-binary-io.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles t-bin-out0.tmp t-bin-out1.tmp t-bin-out2.tmp"
+./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1
+cmp t-bin-out0.tmp t-bin-out1.tmp > /dev/null || exit 1
+./test-binary-io${EXEEXT} 2 > t-bin-out2.tmp || exit 1
+cmp t-bin-out0.tmp t-bin-out2.tmp > /dev/null || exit 1
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/gnulib-tests/test-bind.c b/gnulib-tests/test-bind.c
new file mode 100644
index 0000000..4885519
--- /dev/null
+++ b/gnulib-tests/test-bind.c
@@ -0,0 +1,58 @@
+/* Test binding a server socket to a port.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (bind, int, (int, const struct sockaddr *, socklen_t));
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+ (void) gl_sockets_startup (SOCKETS_1_1);
+
+ /* Test behaviour for invalid file descriptors. */
+ {
+ struct sockaddr_in addr;
+
+ addr.sin_family = AF_INET;
+ inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr);
+ addr.sin_port = htons (80);
+ {
+ errno = 0;
+ ASSERT (bind (-1, (const struct sockaddr *) &addr, sizeof (addr)) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ close (99);
+ errno = 0;
+ ASSERT (bind (99, (const struct sockaddr *) &addr, sizeof (addr)) == -1);
+ ASSERT (errno == EBADF);
+ }
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-bitrotate.c b/gnulib-tests/test-bitrotate.c
new file mode 100644
index 0000000..f3df469
--- /dev/null
+++ b/gnulib-tests/test-bitrotate.c
@@ -0,0 +1,279 @@
+/* Test of <bitrotate.h> substitute.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson <simon@josefsson.org>, 2008. */
+
+#include <config.h>
+
+#include "bitrotate.h"
+
+#include "macros.h"
+
+int
+main (void)
+{
+ ASSERT (rotl8 (42, 0) == 42);
+ ASSERT (rotl8 (42, 1) == 84);
+ ASSERT (rotl8 (42, 2) == 168);
+ ASSERT (rotl8 (42, 3) == 81);
+ ASSERT (rotl8 (42, 4) == 162);
+ ASSERT (rotl8 (42, 5) == 69);
+ ASSERT (rotl8 (42, 6) == 138);
+ ASSERT (rotl8 (42, 7) == 21);
+ ASSERT (rotl8 (42, 8) == 42);
+
+ ASSERT (rotr8 (42, 0) == 42);
+ ASSERT (rotr8 (42, 1) == 21);
+ ASSERT (rotr8 (42, 2) == 138);
+ ASSERT (rotr8 (42, 3) == 69);
+ ASSERT (rotr8 (42, 4) == 162);
+ ASSERT (rotr8 (42, 5) == 81);
+ ASSERT (rotr8 (42, 6) == 168);
+ ASSERT (rotr8 (42, 7) == 84);
+ ASSERT (rotr8 (42, 8) == 42);
+
+ ASSERT (rotl16 (43981, 0) == 43981);
+ ASSERT (rotl16 (43981, 1) == 22427);
+ ASSERT (rotl16 (43981, 2) == 44854);
+ ASSERT (rotl16 (43981, 3) == 24173);
+ ASSERT (rotl16 (43981, 4) == 48346);
+ ASSERT (rotl16 (43981, 5) == 31157);
+ ASSERT (rotl16 (43981, 6) == 62314);
+ ASSERT (rotl16 (43981, 7) == 59093);
+ ASSERT (rotl16 (43981, 8) == 52651);
+ ASSERT (rotl16 (43981, 9) == 39767);
+ ASSERT (rotl16 (43981, 10) == 13999);
+ ASSERT (rotl16 (43981, 11) == 27998);
+ ASSERT (rotl16 (43981, 12) == 55996);
+ ASSERT (rotl16 (43981, 13) == 46457);
+ ASSERT (rotl16 (43981, 14) == 27379);
+ ASSERT (rotl16 (43981, 15) == 54758);
+ ASSERT (rotl16 (43981, 16) == 43981);
+
+ ASSERT (rotr16 (43981, 0) == 43981);
+ ASSERT (rotr16 (43981, 1) == 54758);
+ ASSERT (rotr16 (43981, 2) == 27379);
+ ASSERT (rotr16 (43981, 3) == 46457);
+ ASSERT (rotr16 (43981, 4) == 55996);
+ ASSERT (rotr16 (43981, 5) == 27998);
+ ASSERT (rotr16 (43981, 6) == 13999);
+ ASSERT (rotr16 (43981, 7) == 39767);
+ ASSERT (rotr16 (43981, 8) == 52651);
+ ASSERT (rotr16 (43981, 9) == 59093);
+ ASSERT (rotr16 (43981, 10) == 62314);
+ ASSERT (rotr16 (43981, 11) == 31157);
+ ASSERT (rotr16 (43981, 12) == 48346);
+ ASSERT (rotr16 (43981, 13) == 24173);
+ ASSERT (rotr16 (43981, 14) == 44854);
+ ASSERT (rotr16 (43981, 15) == 22427);
+ ASSERT (rotr16 (43981, 16) == 43981);
+
+ ASSERT (rotl32 (2309737967U, 1) == 324508639U);
+ ASSERT (rotl32 (2309737967U, 2) == 649017278U);
+ ASSERT (rotl32 (2309737967U, 3) == 1298034556U);
+ ASSERT (rotl32 (2309737967U, 4) == 2596069112U);
+ ASSERT (rotl32 (2309737967U, 5) == 897170929U);
+ ASSERT (rotl32 (2309737967U, 6) == 1794341858U);
+ ASSERT (rotl32 (2309737967U, 7) == 3588683716U);
+ ASSERT (rotl32 (2309737967U, 8) == 2882400137U);
+ ASSERT (rotl32 (2309737967U, 9) == 1469832979U);
+ ASSERT (rotl32 (2309737967U, 10) == 2939665958U);
+ ASSERT (rotl32 (2309737967U, 11) == 1584364621U);
+ ASSERT (rotl32 (2309737967U, 12) == 3168729242U);
+ ASSERT (rotl32 (2309737967U, 13) == 2042491189U);
+ ASSERT (rotl32 (2309737967U, 14) == 4084982378U);
+ ASSERT (rotl32 (2309737967U, 15) == 3874997461U);
+ ASSERT (rotl32 (2309737967U, 16) == 3455027627U);
+ ASSERT (rotl32 (2309737967U, 17) == 2615087959U);
+ ASSERT (rotl32 (2309737967U, 18) == 935208623U);
+ ASSERT (rotl32 (2309737967U, 19) == 1870417246U);
+ ASSERT (rotl32 (2309737967U, 20) == 3740834492U);
+ ASSERT (rotl32 (2309737967U, 21) == 3186701689U);
+ ASSERT (rotl32 (2309737967U, 22) == 2078436083U);
+ ASSERT (rotl32 (2309737967U, 23) == 4156872166U);
+ ASSERT (rotl32 (2309737967U, 24) == 4018777037U);
+ ASSERT (rotl32 (2309737967U, 25) == 3742586779U);
+ ASSERT (rotl32 (2309737967U, 26) == 3190206263U);
+ ASSERT (rotl32 (2309737967U, 27) == 2085445231U);
+ ASSERT (rotl32 (2309737967U, 28) == 4170890462U);
+ ASSERT (rotl32 (2309737967U, 29) == 4046813629U);
+ ASSERT (rotl32 (2309737967U, 30) == 3798659963U);
+ ASSERT (rotl32 (2309737967U, 31) == 3302352631U);
+
+ ASSERT (rotr32 (2309737967U, 1) == 3302352631lU);
+ ASSERT (rotr32 (2309737967U, 2) == 3798659963lU);
+ ASSERT (rotr32 (2309737967U, 3) == 4046813629lU);
+ ASSERT (rotr32 (2309737967U, 4) == 4170890462lU);
+ ASSERT (rotr32 (2309737967U, 5) == 2085445231lU);
+ ASSERT (rotr32 (2309737967U, 6) == 3190206263lU);
+ ASSERT (rotr32 (2309737967U, 7) == 3742586779lU);
+ ASSERT (rotr32 (2309737967U, 8) == 4018777037lU);
+ ASSERT (rotr32 (2309737967U, 9) == 4156872166lU);
+ ASSERT (rotr32 (2309737967U, 10) == 2078436083lU);
+ ASSERT (rotr32 (2309737967U, 11) == 3186701689lU);
+ ASSERT (rotr32 (2309737967U, 12) == 3740834492lU);
+ ASSERT (rotr32 (2309737967U, 13) == 1870417246lU);
+ ASSERT (rotr32 (2309737967U, 14) == 935208623lU);
+ ASSERT (rotr32 (2309737967U, 15) == 2615087959lU);
+ ASSERT (rotr32 (2309737967U, 16) == 3455027627lU);
+ ASSERT (rotr32 (2309737967U, 17) == 3874997461lU);
+ ASSERT (rotr32 (2309737967U, 18) == 4084982378lU);
+ ASSERT (rotr32 (2309737967U, 19) == 2042491189lU);
+ ASSERT (rotr32 (2309737967U, 20) == 3168729242lU);
+ ASSERT (rotr32 (2309737967U, 21) == 1584364621lU);
+ ASSERT (rotr32 (2309737967U, 22) == 2939665958lU);
+ ASSERT (rotr32 (2309737967U, 23) == 1469832979lU);
+ ASSERT (rotr32 (2309737967U, 24) == 2882400137lU);
+ ASSERT (rotr32 (2309737967U, 25) == 3588683716lU);
+ ASSERT (rotr32 (2309737967U, 26) == 1794341858lU);
+ ASSERT (rotr32 (2309737967U, 27) == 897170929lU);
+ ASSERT (rotr32 (2309737967U, 28) == 2596069112lU);
+ ASSERT (rotr32 (2309737967U, 29) == 1298034556lU);
+ ASSERT (rotr32 (2309737967U, 30) == 649017278lU);
+ ASSERT (rotr32 (2309737967U, 31) == 324508639lU);
+
+#ifdef UINT64_MAX
+ ASSERT (rotl64 (16045690984503098046ULL, 1) == 13644637895296644477ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 2) == 8842531716883737339ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 3) == 17685063433767474678ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 4) == 16923382793825397741ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 5) == 15400021513941243867ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 6) == 12353298954172936119ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 7) == 6259853834636320623ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 8) == 12519707669272641246ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 9) == 6592671264835730877ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 10) == 13185342529671461754ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 11) == 7923940985633371893ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 12) == 15847881971266743786ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 13) == 13249019868823935957ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 14) == 8051295663938320299ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 15) == 16102591327876640598ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 16) == 13758438582043729581ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 17) == 9070133090377907547ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 18) == 18140266180755815094ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 19) == 17833788287802078573ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 20) == 17220832501894605531ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 21) == 15994920930079659447ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 22) == 13543097786449767279ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 23) == 8639451499189982943ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 24) == 17278902998379965886ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 25) == 16111061923050380157ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 26) == 13775379772391208699ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 27) == 9104015471072865783ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 28) == 18208030942145731566ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 29) == 17969317810581911517ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 30) == 17491891547454271419ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 31) == 16537039021198991223ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 32) == 14627333968688430831ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 33) == 10807923863667310047ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 34) == 3169103653625068479ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 35) == 6338207307250136958ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 36) == 12676414614500273916ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 37) == 6906085155290996217ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 38) == 13812170310581992434ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 39) == 9177596547454433253ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 40) == 18355193094908866506ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 41) == 18263642116108181397ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 42) == 18080540158506811179ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 43) == 17714336243304070743ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 44) == 16981928412898589871ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 45) == 15517112752087628127ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 46) == 12587481430465704639ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 47) == 6728218787221857663ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 48) == 13456437574443715326ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 49) == 8466131075177879037ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 50) == 16932262150355758074ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 51) == 15417780227001964533ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 52) == 12388816380294377451ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 53) == 6330888686879203287ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 54) == 12661777373758406574ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 55) == 6876810673807261533ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 56) == 13753621347614523066ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 57) == 9060498621519494517ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 58) == 18120997243038989034ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 59) == 17795250412368426453ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 60) == 17143756751027301291ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 61) == 15840769428345050967ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 62) == 13234794782980550319ULL);
+ ASSERT (rotl64 (16045690984503098046ULL, 63) == 8022845492251549023ULL);
+
+ ASSERT (rotr64 (16045690984503098046ULL, 1) == 8022845492251549023ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 2) == 13234794782980550319ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 3) == 15840769428345050967ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 4) == 17143756751027301291ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 5) == 17795250412368426453ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 6) == 18120997243038989034ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 7) == 9060498621519494517ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 8) == 13753621347614523066ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 9) == 6876810673807261533ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 10) == 12661777373758406574ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 11) == 6330888686879203287ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 12) == 12388816380294377451ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 13) == 15417780227001964533ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 14) == 16932262150355758074ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 15) == 8466131075177879037ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 16) == 13456437574443715326ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 17) == 6728218787221857663ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 18) == 12587481430465704639ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 19) == 15517112752087628127ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 20) == 16981928412898589871ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 21) == 17714336243304070743ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 22) == 18080540158506811179ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 23) == 18263642116108181397ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 24) == 18355193094908866506ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 25) == 9177596547454433253ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 26) == 13812170310581992434ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 27) == 6906085155290996217ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 28) == 12676414614500273916ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 29) == 6338207307250136958ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 30) == 3169103653625068479ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 31) == 10807923863667310047ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 32) == 14627333968688430831ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 33) == 16537039021198991223ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 34) == 17491891547454271419ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 35) == 17969317810581911517ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 36) == 18208030942145731566ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 37) == 9104015471072865783ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 38) == 13775379772391208699ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 39) == 16111061923050380157ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 40) == 17278902998379965886ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 41) == 8639451499189982943ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 42) == 13543097786449767279ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 43) == 15994920930079659447ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 44) == 17220832501894605531ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 45) == 17833788287802078573ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 46) == 18140266180755815094ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 47) == 9070133090377907547ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 48) == 13758438582043729581ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 49) == 16102591327876640598ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 50) == 8051295663938320299ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 51) == 13249019868823935957ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 52) == 15847881971266743786ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 53) == 7923940985633371893ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 54) == 13185342529671461754ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 55) == 6592671264835730877ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 56) == 12519707669272641246ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 57) == 6259853834636320623ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 58) == 12353298954172936119ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 59) == 15400021513941243867ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 60) == 16923382793825397741ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 61) == 17685063433767474678ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 62) == 8842531716883737339ULL);
+ ASSERT (rotr64 (16045690984503098046ULL, 63) == 13644637895296644477ULL);
+#endif /* UINT64_MAX */
+
+ return 0;
+}
diff --git a/gnulib-tests/test-btowc.c b/gnulib-tests/test-btowc.c
new file mode 100644
index 0000000..9953ac4
--- /dev/null
+++ b/gnulib-tests/test-btowc.c
@@ -0,0 +1,63 @@
+/* Test of conversion of unibyte character to wide character.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (btowc, wint_t, (int));
+
+#include <locale.h>
+#include <stdio.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ int c;
+
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ ASSERT (btowc (EOF) == WEOF);
+
+ if (argc > 1)
+ switch (argv[1][0])
+ {
+ case '1':
+ /* Locale encoding is ISO-8859-1 or ISO-8859-15. */
+ for (c = 0; c < 0x80; c++)
+ ASSERT (btowc (c) == c);
+ for (c = 0xA0; c < 0x100; c++)
+ ASSERT (btowc (c) != WEOF);
+ return 0;
+
+ case '2':
+ /* Locale encoding is UTF-8. */
+ for (c = 0; c < 0x80; c++)
+ ASSERT (btowc (c) == c);
+ for (c = 0x80; c < 0x100; c++)
+ ASSERT (btowc (c) == WEOF);
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/gnulib-tests/test-btowc1.sh b/gnulib-tests/test-btowc1.sh
new file mode 100755
index 0000000..aaef48d
--- /dev/null
+++ b/gnulib-tests/test-btowc1.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional french locale is installed"
+ else
+ echo "Skipping test: no traditional french locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+./test-btowc${EXEEXT} 1
diff --git a/gnulib-tests/test-btowc2.sh b/gnulib-tests/test-btowc2.sh
new file mode 100755
index 0000000..2e06038
--- /dev/null
+++ b/gnulib-tests/test-btowc2.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no french Unicode locale is installed"
+ else
+ echo "Skipping test: no french Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+./test-btowc${EXEEXT} 2
diff --git a/gnulib-tests/test-c-ctype.c b/gnulib-tests/test-c-ctype.c
new file mode 100644
index 0000000..184cdec
--- /dev/null
+++ b/gnulib-tests/test-c-ctype.c
@@ -0,0 +1,228 @@
+/* Test of character handling in C locale.
+ Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
+
+#include <config.h>
+
+#include "c-ctype.h"
+
+#include <ctype.h>
+#include <limits.h>
+#include <locale.h>
+
+#include "macros.h"
+
+static void
+test_agree_with_C_locale (void)
+{
+ int c;
+
+ for (c = 0; c <= UCHAR_MAX; c++)
+ {
+ ASSERT (c_isascii (c) == (isascii (c) != 0));
+ if (c_isascii (c))
+ {
+ ASSERT (c_isalnum (c) == (isalnum (c) != 0));
+ ASSERT (c_isalpha (c) == (isalpha (c) != 0));
+ ASSERT (c_isblank (c) == (isblank (c) != 0));
+ ASSERT (c_iscntrl (c) == (iscntrl (c) != 0));
+ ASSERT (c_isdigit (c) == (isdigit (c) != 0));
+ ASSERT (c_islower (c) == (islower (c) != 0));
+ ASSERT (c_isgraph (c) == (isgraph (c) != 0));
+ ASSERT (c_isprint (c) == (isprint (c) != 0));
+ ASSERT (c_ispunct (c) == (ispunct (c) != 0));
+ ASSERT (c_isspace (c) == (isspace (c) != 0));
+ ASSERT (c_isupper (c) == (isupper (c) != 0));
+ ASSERT (c_isxdigit (c) == (isxdigit (c) != 0));
+ ASSERT (c_tolower (c) == tolower (c));
+ ASSERT (c_toupper (c) == toupper (c));
+ }
+ }
+}
+
+static void
+test_all (void)
+{
+ int c;
+ int n_isascii = 0;
+
+ for (c = CHAR_MIN; c <= UCHAR_MAX; c++)
+ {
+ if (! (0 <= c && c <= CHAR_MAX))
+ {
+ ASSERT (! c_isascii (c));
+ ASSERT (! c_isalnum (c));
+ ASSERT (! c_isalpha (c));
+ ASSERT (! c_isblank (c));
+ ASSERT (! c_iscntrl (c));
+ ASSERT (! c_isdigit (c));
+ ASSERT (! c_islower (c));
+ ASSERT (! c_isgraph (c));
+ ASSERT (! c_isprint (c));
+ ASSERT (! c_ispunct (c));
+ ASSERT (! c_isspace (c));
+ ASSERT (! c_isupper (c));
+ ASSERT (! c_isxdigit (c));
+ ASSERT (c_tolower (c) == c);
+ ASSERT (c_toupper (c) == c);
+ }
+
+ n_isascii += c_isascii (c);
+
+#ifdef C_CTYPE_ASCII
+ ASSERT (c_isascii (c) == (0 <= c && c <= 0x7f));
+#endif
+
+ ASSERT (c_isascii (c) == (c_isprint (c) || c_iscntrl (c)));
+
+ ASSERT (c_isalnum (c) == (c_isalpha (c) || c_isdigit (c)));
+
+ ASSERT (c_isalpha (c) == (c_islower (c) || c_isupper (c)));
+
+ switch (c)
+ {
+ case '\t': case ' ':
+ ASSERT (c_isblank (c) == 1);
+ break;
+ default:
+ ASSERT (c_isblank (c) == 0);
+ break;
+ }
+
+#ifdef C_CTYPE_ASCII
+ ASSERT (c_iscntrl (c) == ((c >= 0 && c < 0x20) || c == 0x7f));
+#endif
+
+ switch (c)
+ {
+ case '\a': case '\b': case '\f': case '\n':
+ case '\r': case '\t': case '\v':
+ ASSERT (c_iscntrl (c));
+ break;
+ }
+
+ ASSERT (! (c_iscntrl (c) && c_isprint (c)));
+
+ switch (c)
+ {
+ case '0': case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ ASSERT (c_isdigit (c) == 1);
+ break;
+ default:
+ ASSERT (c_isdigit (c) == 0);
+ break;
+ }
+
+ switch (c)
+ {
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ ASSERT (c_islower (c) == 1);
+ ASSERT (c_toupper (c) == c - 'a' + 'A');
+ break;
+ default:
+ ASSERT (c_islower (c) == 0);
+ ASSERT (c_toupper (c) == c);
+ break;
+ }
+
+#ifdef C_CTYPE_ASCII
+ ASSERT (c_isgraph (c) == ((c >= 0x20 && c < 0x7f) && c != ' '));
+
+ ASSERT (c_isprint (c) == (c >= 0x20 && c < 0x7f));
+#endif
+
+ ASSERT (c_isgraph (c) == (c_isalnum (c) || c_ispunct (c)));
+
+ ASSERT (c_isprint (c) == (c_isgraph (c) || c == ' '));
+
+ switch (c)
+ {
+ case '!': case '"': case '#': case '$': case '%': case '&': case '\'':
+ case '(': case ')': case '*': case '+': case ',': case '-': case '.':
+ case '/': case ':': case ';': case '<': case '=': case '>': case '?':
+ case '@': case '[': case'\\': case ']': case '^': case '_': case '`':
+ case '{': case '|': case '}': case '~':
+ ASSERT (c_ispunct (c) == 1);
+ break;
+ default:
+ ASSERT (c_ispunct (c) == 0);
+ break;
+ }
+
+ switch (c)
+ {
+ case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
+ ASSERT (c_isspace (c) == 1);
+ break;
+ default:
+ ASSERT (c_isspace (c) == 0);
+ break;
+ }
+
+ switch (c)
+ {
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ ASSERT (c_isupper (c) == 1);
+ ASSERT (c_tolower (c) == c - 'A' + 'a');
+ break;
+ default:
+ ASSERT (c_isupper (c) == 0);
+ ASSERT (c_tolower (c) == c);
+ break;
+ }
+
+ switch (c)
+ {
+ case '0': case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ ASSERT (c_isxdigit (c) == 1);
+ break;
+ default:
+ ASSERT (c_isxdigit (c) == 0);
+ break;
+ }
+ }
+
+ ASSERT (n_isascii == 128);
+}
+
+int
+main ()
+{
+ test_agree_with_C_locale ();
+
+ test_all ();
+
+ setlocale (LC_ALL, "de_DE");
+ test_all ();
+
+ setlocale (LC_ALL, "ja_JP.EUC-JP");
+ test_all ();
+
+ return 0;
+}
diff --git a/gnulib-tests/test-c-stack.c b/gnulib-tests/test-c-stack.c
new file mode 100644
index 0000000..073f1c6
--- /dev/null
+++ b/gnulib-tests/test-c-stack.c
@@ -0,0 +1,76 @@
+/* Test of c-stack module.
+ Copyright (C) 2002, 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "c-stack.h"
+
+#include "exitfail.h"
+#include <stdio.h>
+#if HAVE_SETRLIMIT
+/* At least FreeBSD 5.0 needs extra headers before <sys/resource.h>
+ will compile. */
+# include <sys/types.h>
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif
+
+#include "macros.h"
+
+char *program_name;
+
+static volatile int *
+recurse_1 (volatile int n, volatile int *p)
+{
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+}
+
+static int
+recurse (volatile int n)
+{
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+}
+
+int
+main (int argc, char **argv)
+{
+#if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly to the
+ user's machine. On some Linux 2.2.x systems, there is no stack
+ limit for user processes at all. We don't want to kill such
+ systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+#endif
+
+ program_name = argv[0];
+ if (c_stack_action (NULL) == 0)
+ {
+ if (1 < argc)
+ {
+ exit_failure = 77;
+ ++*argv[argc]; /* Intentionally dereference NULL. */
+ }
+ return recurse (0);
+ }
+ fputs ("skipping test: ", stderr);
+ perror ("c_stack_action");
+ return 77;
+}
diff --git a/gnulib-tests/test-c-stack.sh b/gnulib-tests/test-c-stack.sh
new file mode 100755
index 0000000..f979065
--- /dev/null
+++ b/gnulib-tests/test-c-stack.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="t-c-stack.tmp"
+./test-c-stack${EXEEXT} 2> t-c-stack.tmp
+case $? in
+ 77) cat t-c-stack.tmp >&2; (exit 77); exit 77 ;;
+ 1) ;;
+ *) (exit 1); exit 1 ;;
+esac
+if grep 'stack overflow' t-c-stack.tmp >/dev/null ; then
+ :
+else
+ (exit 1); exit 1
+fi
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/gnulib-tests/test-c-stack2.sh b/gnulib-tests/test-c-stack2.sh
new file mode 100755
index 0000000..0cd49c9
--- /dev/null
+++ b/gnulib-tests/test-c-stack2.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="t-c-stack2.tmp"
+
+# Sanitize exit status within a subshell, since some shells fail to
+# redirect stderr on their message about death due to signal.
+(./test-c-stack${EXEEXT} 1; exit $?) 2> t-c-stack2.tmp
+
+case $? in
+ 77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then
+ if test -z "$LIBSIGSEGV"; then
+ echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2
+ exit 77
+ else
+ echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2
+ exit 1
+ fi
+ else
+ cat t-c-stack2.tmp >&2
+ exit 77
+ fi
+ ;;
+ 0) (exit 1); exit 1 ;;
+esac
+if grep 'program error' t-c-stack2.tmp >/dev/null ; then
+ :
+else
+ (exit 1); exit 1
+fi
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/gnulib-tests/test-c-strcase.sh b/gnulib-tests/test-c-strcase.sh
new file mode 100755
index 0000000..5fcf906
--- /dev/null
+++ b/gnulib-tests/test-c-strcase.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Test in the C locale.
+./test-c-strcasecmp${EXEEXT} || exit 1
+./test-c-strncasecmp${EXEEXT} || exit 1
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR != none; then
+ LC_ALL=$LOCALE_FR ./test-c-strcasecmp${EXEEXT} locale || exit 1
+ LC_ALL=$LOCALE_FR ./test-c-strncasecmp${EXEEXT} locale || exit 1
+fi
+
+# Test in a Turkish UTF-8 locale.
+: ${LOCALE_TR_UTF8=tr_TR.UTF-8}
+if test $LOCALE_TR_UTF8 != none; then
+ LC_ALL=$LOCALE_TR_UTF8 ./test-c-strcasecmp${EXEEXT} locale || exit 1
+ LC_ALL=$LOCALE_TR_UTF8 ./test-c-strncasecmp${EXEEXT} locale || exit 1
+fi
+
+exit 0
diff --git a/gnulib-tests/test-c-strcasecmp.c b/gnulib-tests/test-c-strcasecmp.c
new file mode 100644
index 0000000..37f9431
--- /dev/null
+++ b/gnulib-tests/test-c-strcasecmp.c
@@ -0,0 +1,65 @@
+/* Test of case-insensitive string comparison function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include "c-strcase.h"
+
+#include <locale.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1)
+ {
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+ }
+
+ ASSERT (c_strcasecmp ("paragraph", "Paragraph") == 0);
+
+ ASSERT (c_strcasecmp ("paragrapH", "parAgRaph") == 0);
+
+ ASSERT (c_strcasecmp ("paragraph", "paraLyzed") < 0);
+ ASSERT (c_strcasecmp ("paraLyzed", "paragraph") > 0);
+
+ ASSERT (c_strcasecmp ("para", "paragraph") < 0);
+ ASSERT (c_strcasecmp ("paragraph", "para") > 0);
+
+ /* The following tests shows how c_strcasecmp() is different from
+ strcasecmp(). */
+
+ ASSERT (c_strcasecmp ("\311mile", "\351mile") < 0);
+ ASSERT (c_strcasecmp ("\351mile", "\311mile") > 0);
+
+ /* The following tests shows how c_strcasecmp() is different from
+ mbscasecmp(). */
+
+ ASSERT (c_strcasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R") > 0); /* özgür */
+ ASSERT (c_strcasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r") < 0); /* özgür */
+
+ /* This test shows how strings of different size cannot compare equal. */
+ ASSERT (c_strcasecmp ("turkish", "TURK\304\260SH") < 0);
+ ASSERT (c_strcasecmp ("TURK\304\260SH", "turkish") > 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-c-strncasecmp.c b/gnulib-tests/test-c-strncasecmp.c
new file mode 100644
index 0000000..1ca42d8
--- /dev/null
+++ b/gnulib-tests/test-c-strncasecmp.c
@@ -0,0 +1,79 @@
+/* Test of case-insensitive string comparison function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include "c-strcase.h"
+
+#include <locale.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1)
+ {
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+ }
+
+ ASSERT (c_strncasecmp ("paragraph", "Paragraph", 1000000) == 0);
+ ASSERT (c_strncasecmp ("paragraph", "Paragraph", 9) == 0);
+
+ ASSERT (c_strncasecmp ("paragrapH", "parAgRaph", 1000000) == 0);
+ ASSERT (c_strncasecmp ("paragrapH", "parAgRaph", 9) == 0);
+
+ ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 10) < 0);
+ ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 9) < 0);
+ ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 5) < 0);
+ ASSERT (c_strncasecmp ("paragraph", "paraLyzed", 4) == 0);
+ ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 10) > 0);
+ ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 9) > 0);
+ ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 5) > 0);
+ ASSERT (c_strncasecmp ("paraLyzed", "paragraph", 4) == 0);
+
+ ASSERT (c_strncasecmp ("para", "paragraph", 10) < 0);
+ ASSERT (c_strncasecmp ("para", "paragraph", 9) < 0);
+ ASSERT (c_strncasecmp ("para", "paragraph", 5) < 0);
+ ASSERT (c_strncasecmp ("para", "paragraph", 4) == 0);
+ ASSERT (c_strncasecmp ("paragraph", "para", 10) > 0);
+ ASSERT (c_strncasecmp ("paragraph", "para", 9) > 0);
+ ASSERT (c_strncasecmp ("paragraph", "para", 5) > 0);
+ ASSERT (c_strncasecmp ("paragraph", "para", 4) == 0);
+
+ /* The following tests shows how c_strncasecmp() is different from
+ strncasecmp(). */
+
+ ASSERT (c_strncasecmp ("\311mily", "\351mile", 4) < 0);
+ ASSERT (c_strncasecmp ("\351mile", "\311mily", 4) > 0);
+
+ /* The following tests shows how c_strncasecmp() is different from
+ mbsncasecmp(). */
+
+ ASSERT (c_strncasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R", 99) > 0); /* özgür */
+ ASSERT (c_strncasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r", 99) < 0); /* özgür */
+
+ /* This test shows how strings of different size cannot compare equal. */
+ ASSERT (c_strncasecmp ("turkish", "TURK\304\260SH", 7) < 0);
+ ASSERT (c_strncasecmp ("TURK\304\260SH", "turkish", 7) > 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-close.c b/gnulib-tests/test-close.c
new file mode 100644
index 0000000..a0428e0
--- /dev/null
+++ b/gnulib-tests/test-close.c
@@ -0,0 +1,45 @@
+/* Test closing a file or socket.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (close, int, (int));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ /* Test behaviour for invalid file descriptors. */
+ {
+ errno = 0;
+ ASSERT (close (-1) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ close (99);
+ errno = 0;
+ ASSERT (close (99) == -1);
+ ASSERT (errno == EBADF);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-connect.c b/gnulib-tests/test-connect.c
new file mode 100644
index 0000000..efe419e
--- /dev/null
+++ b/gnulib-tests/test-connect.c
@@ -0,0 +1,60 @@
+/* Test connecting a client socket.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (connect, int, (int, const struct sockaddr *, socklen_t));
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+ (void) gl_sockets_startup (SOCKETS_1_1);
+
+ /* Test behaviour for invalid file descriptors. */
+ {
+ struct sockaddr_in addr;
+
+ addr.sin_family = AF_INET;
+ inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr);
+ addr.sin_port = htons (80);
+ {
+ errno = 0;
+ ASSERT (connect (-1, (const struct sockaddr *) &addr, sizeof (addr))
+ == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ close (99);
+ errno = 0;
+ ASSERT (connect (99, (const struct sockaddr *) &addr, sizeof (addr))
+ == -1);
+ ASSERT (errno == EBADF);
+ }
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-ctype.c b/gnulib-tests/test-ctype.c
new file mode 100644
index 0000000..570fbdb
--- /dev/null
+++ b/gnulib-tests/test-ctype.c
@@ -0,0 +1,27 @@
+/* Test of <ctype.h> substitute.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <ctype.h>
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-dirname.c b/gnulib-tests/test-dirname.c
new file mode 100644
index 0000000..b9b876a
--- /dev/null
+++ b/gnulib-tests/test-dirname.c
@@ -0,0 +1,193 @@
+/* Test the gnulib dirname module.
+ Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+struct test {
+ const char *name; /* Name under test. */
+ const char *dir; /* dir_name (name). */
+ const char *last; /* last_component (name). */
+ const char *base; /* base_name (name). */
+ const char *stripped; /* name after strip_trailing_slashes (name). */
+ bool modified; /* result of strip_trailing_slashes (name). */
+ bool absolute; /* IS_ABSOLUTE_FILE_NAME (name). */
+};
+
+static struct test tests[] = {
+ {"d/f", "d", "f", "f", "d/f", false, false},
+ {"/d/f", "/d", "f", "f", "/d/f", false, true},
+ {"d/f/", "d", "f/", "f/", "d/f", true, false},
+ {"d/f//", "d", "f//", "f/", "d/f", true, false},
+ {"f", ".", "f", "f", "f", false, false},
+ {"/", "/", "", "/", "/", false, true},
+#if DOUBLE_SLASH_IS_DISTINCT_ROOT
+ {"//", "//", "", "//", "//", false, true},
+ {"//d", "//", "d", "d", "//d", false, true},
+#else
+ {"//", "/", "", "/", "/", true, true},
+ {"//d", "/", "d", "d", "//d", false, true},
+#endif
+ {"///", "/", "", "/", "/", true, true},
+ {"///a///", "/", "a///", "a/", "///a", true, true},
+ /* POSIX requires dirname("") and basename("") to both return ".",
+ but dir_name and base_name are defined differently. */
+ {"", ".", "", "", "", false, false},
+ {".", ".", ".", ".", ".", false, false},
+ {"..", ".", "..", "..", "..", false, false},
+#if ISSLASH ('\\')
+ {"a\\", ".", "a\\", "a\\", "a", true, false},
+ {"a\\b", "a", "b", "b", "a\\b", false, false},
+ {"\\", "\\", "", "\\", "\\", false, true},
+ {"\\/\\", "\\", "", "\\", "\\", true, true},
+ {"\\\\/", "\\", "", "\\", "\\", true, true},
+ {"\\//", "\\", "", "\\", "\\", true, true},
+ {"//\\", "/", "", "/", "/", true, true},
+#else
+ {"a\\", ".", "a\\", "a\\", "a\\", false, false},
+ {"a\\b", ".", "a\\b", "a\\b", "a\\b", false, false},
+ {"\\", ".", "\\", "\\", "\\", false, false},
+ {"\\/\\", "\\", "\\", "\\", "\\/\\",false, false},
+ {"\\\\/", ".", "\\\\/","\\\\/","\\\\", true, false},
+ {"\\//", ".", "\\//", "\\/", "\\", true, false},
+# if DOUBLE_SLASH_IS_DISTINCT_ROOT
+ {"//\\", "//", "\\", "\\", "//\\", false, true},
+# else
+ {"//\\", "/", "\\", "\\", "//\\", false, true},
+# endif
+#endif
+#if ISSLASH ('\\')
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ {"c:", "c:", "", "c:", "c:", false, false},
+ {"c:/", "c:/", "", "c:/", "c:/", false, true},
+ {"c://", "c:/", "", "c:/", "c:/", true, true},
+ {"c:/d", "c:/", "d", "d", "c:/d", false, true},
+ {"c://d", "c:/", "d", "d", "c://d",false, true},
+ {"c:/d/", "c:/", "d/", "d/", "c:/d", true, true},
+ {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, true},
+ {"c:d", "c:.", "d", "d", "c:d", false, false},
+ {"c:d/", "c:.", "d/", "d/", "c:d", true, false},
+ {"c:d/f", "c:d", "f", "f", "c:d/f",false, false},
+ {"a:b:c", "a:.", "b:c", "./b:c","a:b:c",false, false},
+ {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false},
+ {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false},
+# else /* ! FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE */
+ {"c:", "c:", "", "c:", "c:", false, true},
+ {"c:/", "c:", "", "c:", "c:", true, true},
+ {"c://", "c:", "", "c:", "c:", true, true},
+ {"c:/d", "c:", "d", "d", "c:/d", false, true},
+ {"c://d", "c:", "d", "d", "c://d",false, true},
+ {"c:/d/", "c:", "d/", "d/", "c:/d", true, true},
+ {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, true},
+ {"c:d", "c:", "d", "d", "c:d", false, true},
+ {"c:d/", "c:", "d/", "d/", "c:d", true, true},
+ {"c:d/f", "c:d", "f", "f", "c:d/f",false, true},
+ {"a:b:c", "a:", "b:c", "./b:c","a:b:c",false, true},
+ {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false},
+ {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false},
+# endif
+#else /* ! ISSLASH ('\\') */
+ {"c:", ".", "c:", "c:", "c:", false, false},
+ {"c:/", ".", "c:/", "c:/", "c:", true, false},
+ {"c://", ".", "c://", "c:/", "c:", true, false},
+ {"c:/d", "c:", "d", "d", "c:/d", false, false},
+ {"c://d", "c:", "d", "d", "c://d",false, false},
+ {"c:/d/", "c:", "d/", "d/", "c:/d", true, false},
+ {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, false},
+ {"c:d", ".", "c:d", "c:d", "c:d", false, false},
+ {"c:d/", ".", "c:d/", "c:d/", "c:d", true, false},
+ {"c:d/f", "c:d", "f", "f", "c:d/f",false, false},
+ {"a:b:c", ".", "a:b:c","a:b:c","a:b:c",false, false},
+ {"a/b:c", "a", "b:c", "b:c", "a/b:c",false, false},
+ {"a/b:c/", "a", "b:c/", "b:c/", "a/b:c",true, false},
+#endif
+ {"1:", ".", "1:", "1:", "1:", false, false},
+ {"1:/", ".", "1:/", "1:/", "1:", true, false},
+ {"/:", "/", ":", ":", "/:", false, true},
+ {"/:/", "/", ":/", ":/", "/:", true, true},
+ /* End sentinel. */
+ {NULL, NULL, NULL, NULL, NULL, false, false}
+};
+
+int
+main (void)
+{
+ struct test *t;
+ bool ok = true;
+
+ for (t = tests; t->name; t++)
+ {
+ char *dir = dir_name (t->name);
+ int dirlen = dir_len (t->name);
+ char *last = last_component (t->name);
+ char *base = base_name (t->name);
+ int baselen = base_len (base);
+ char *stripped = strdup (t->name);
+ bool modified = strip_trailing_slashes (stripped);
+ bool absolute = IS_ABSOLUTE_FILE_NAME (t->name);
+ if (! (strcmp (dir, t->dir) == 0
+ && (dirlen == strlen (dir)
+ || (dirlen + 1 == strlen (dir) && dir[dirlen] == '.'))))
+ {
+ ok = false;
+ printf ("dir_name '%s': got '%s' len %d,"
+ " expected '%s' len %lu\n",
+ t->name, dir, dirlen,
+ t->dir, (unsigned long) strlen (t->dir));
+ }
+ if (strcmp (last, t->last))
+ {
+ ok = false;
+ printf ("last_component '%s': got '%s', expected '%s'\n",
+ t->name, last, t->last);
+ }
+ if (! (strcmp (base, t->base) == 0
+ && (baselen == strlen (base)
+ || (baselen + 1 == strlen (base)
+ && ISSLASH (base[baselen])))))
+ {
+ ok = false;
+ printf ("base_name '%s': got '%s' len %d,"
+ " expected '%s' len %lu\n",
+ t->name, base, baselen,
+ t->base, (unsigned long) strlen (t->base));
+ }
+ if (strcmp (stripped, t->stripped) || modified != t->modified)
+ {
+ ok = false;
+ printf ("strip_trailing_slashes '%s': got %s %s, expected %s %s\n",
+ t->name, stripped, modified ? "changed" : "unchanged",
+ t->stripped, t->modified ? "changed" : "unchanged");
+ }
+ if (t->absolute != absolute)
+ {
+ ok = false;
+ printf ("'%s': got %s, expected %s\n", t->name,
+ absolute ? "absolute" : "relative",
+ t->absolute ? "absolute" : "relative");
+ }
+ free (dir);
+ free (base);
+ free (stripped);
+ }
+ return ok ? 0 : 1;
+}
diff --git a/gnulib-tests/test-dup2.c b/gnulib-tests/test-dup2.c
new file mode 100644
index 0000000..5da6812
--- /dev/null
+++ b/gnulib-tests/test-dup2.c
@@ -0,0 +1,218 @@
+/* Test duplicating file descriptors.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (dup2, int, (int, int));
+
+#include <errno.h>
+#include <fcntl.h>
+
+#if HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
+
+#include "binary-io.h"
+
+#if GNULIB_TEST_CLOEXEC
+# include "cloexec.h"
+#endif
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+#endif
+
+#include "macros.h"
+
+/* Return non-zero if FD is open. */
+static int
+is_open (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows, the initial state of unassigned standard file
+ descriptors is that they are open but point to an
+ INVALID_HANDLE_VALUE, and there is no fcntl. */
+ 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
+}
+
+#if GNULIB_TEST_CLOEXEC
+/* Return non-zero if FD is open and inheritable across exec/spawn. */
+static int
+is_inheritable (int fd)
+{
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows, the initial state of unassigned standard file
+ descriptors is that they are open but point to an
+ INVALID_HANDLE_VALUE, and there is no fcntl. */
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ DWORD flags;
+ if (h == INVALID_HANDLE_VALUE || GetHandleInformation (h, &flags) == 0)
+ return 0;
+ return (flags & HANDLE_FLAG_INHERIT) != 0;
+# else
+# ifndef F_GETFD
+# error Please port fcntl to your platform
+# endif
+ int i = fcntl (fd, F_GETFD);
+ return 0 <= i && (i & FD_CLOEXEC) == 0;
+# endif
+}
+#endif /* GNULIB_TEST_CLOEXEC */
+
+#if !O_BINARY
+# define setmode(f,m) zero ()
+static int zero (void) { return 0; }
+#endif
+
+/* Return non-zero if FD is open in the given MODE, which is either
+ O_TEXT or O_BINARY. */
+static int
+is_mode (int fd, int mode)
+{
+ int value = setmode (fd, O_BINARY);
+ setmode (fd, value);
+ return mode == value;
+}
+
+int
+main (void)
+{
+ const char *file = "test-dup2.tmp";
+ char buffer[1];
+ int bad_fd = getdtablesize ();
+ int fd = open (file, O_CREAT | O_TRUNC | O_RDWR, 0600);
+
+ /* Assume std descriptors were provided by invoker. */
+ ASSERT (STDERR_FILENO < fd);
+ ASSERT (is_open (fd));
+ /* Ignore any other fd's leaked into this process. */
+ close (fd + 1);
+ close (fd + 2);
+ ASSERT (!is_open (fd + 1));
+ ASSERT (!is_open (fd + 2));
+
+ /* Assigning to self must be a no-op. */
+ ASSERT (dup2 (fd, fd) == fd);
+ ASSERT (is_open (fd));
+
+ /* The source must be valid. */
+ errno = 0;
+ ASSERT (dup2 (-1, fd) == -1);
+ ASSERT (errno == EBADF);
+ close (99);
+ errno = 0;
+ ASSERT (dup2 (99, fd) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (dup2 (AT_FDCWD, fd) == -1);
+ ASSERT (errno == EBADF);
+ ASSERT (is_open (fd));
+
+ /* If the source is not open, then the destination is unaffected. */
+ errno = 0;
+ ASSERT (dup2 (fd + 1, fd + 1) == -1);
+ ASSERT (errno == EBADF);
+ ASSERT (!is_open (fd + 1));
+ errno = 0;
+ ASSERT (dup2 (fd + 1, fd) == -1);
+ ASSERT (errno == EBADF);
+ ASSERT (is_open (fd));
+
+ /* The destination must be valid. */
+ errno = 0;
+ ASSERT (dup2 (fd, -2) == -1);
+ ASSERT (errno == EBADF);
+ if (bad_fd > 256)
+ {
+ ASSERT (dup2 (fd, 255) == 255);
+ ASSERT (dup2 (fd, 256) == 256);
+ ASSERT (close (255) == 0);
+ ASSERT (close (256) == 0);
+ }
+ ASSERT (dup2 (fd, bad_fd - 1) == bad_fd - 1);
+ ASSERT (close (bad_fd - 1) == 0);
+ errno = 0;
+ ASSERT (dup2 (fd, bad_fd) == -1);
+ ASSERT (errno == EBADF);
+
+ /* Using dup2 can skip fds. */
+ ASSERT (dup2 (fd, fd + 2) == fd + 2);
+ ASSERT (is_open (fd));
+ ASSERT (!is_open (fd + 1));
+ ASSERT (is_open (fd + 2));
+
+ /* Verify that dup2 closes the previous occupant of a fd. */
+ ASSERT (open ("/dev/null", O_WRONLY, 0600) == fd + 1);
+ ASSERT (dup2 (fd + 1, fd) == fd);
+ ASSERT (close (fd + 1) == 0);
+ ASSERT (write (fd, "1", 1) == 1);
+ ASSERT (dup2 (fd + 2, fd) == fd);
+ ASSERT (lseek (fd, 0, SEEK_END) == 0);
+ ASSERT (write (fd + 2, "2", 1) == 1);
+ ASSERT (lseek (fd, 0, SEEK_SET) == 0);
+ ASSERT (read (fd, buffer, 1) == 1);
+ ASSERT (*buffer == '2');
+
+#if GNULIB_TEST_CLOEXEC
+ /* Any new fd created by dup2 must not be cloexec. */
+ ASSERT (close (fd + 2) == 0);
+ ASSERT (dup_cloexec (fd) == fd + 1);
+ ASSERT (!is_inheritable (fd + 1));
+ ASSERT (dup2 (fd + 1, fd + 1) == fd + 1);
+ ASSERT (!is_inheritable (fd + 1));
+ ASSERT (dup2 (fd + 1, fd + 2) == fd + 2);
+ ASSERT (!is_inheritable (fd + 1));
+ ASSERT (is_inheritable (fd + 2));
+ errno = 0;
+ ASSERT (dup2 (fd + 1, -1) == -1);
+ ASSERT (errno == EBADF);
+ ASSERT (!is_inheritable (fd + 1));
+#endif
+
+ /* On systems that distinguish between text and binary mode, dup2
+ reuses the mode of the source. */
+ setmode (fd, O_BINARY);
+ ASSERT (is_mode (fd, O_BINARY));
+ ASSERT (dup2 (fd, fd + 1) == fd + 1);
+ ASSERT (is_mode (fd + 1, O_BINARY));
+ setmode (fd, O_TEXT);
+ ASSERT (is_mode (fd, O_TEXT));
+ ASSERT (dup2 (fd, fd + 1) == fd + 1);
+ ASSERT (is_mode (fd + 1, O_TEXT));
+
+ /* Clean up. */
+ ASSERT (close (fd + 2) == 0);
+ ASSERT (close (fd + 1) == 0);
+ ASSERT (close (fd) == 0);
+ ASSERT (unlink (file) == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-environ.c b/gnulib-tests/test-environ.c
new file mode 100644
index 0000000..0047246
--- /dev/null
+++ b/gnulib-tests/test-environ.c
@@ -0,0 +1,44 @@
+/* Test of environ variable.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <string.h>
+
+int
+main ()
+{
+ /* The environment variables that are set even in the weirdest situations
+ are HOME and PATH.
+ POSIX says that HOME is initialized by the system, and that PATH may be
+ unset. But in practice it's more frequent to see HOME unset and PATH
+ set. So we test the presence of PATH. */
+ char **remaining_variables = environ;
+ char *string;
+
+ for (; (string = *remaining_variables) != NULL; remaining_variables++)
+ {
+ if (strncmp (string, "PATH=", 5) == 0)
+ /* Found the PATH environment variable. */
+ return 0;
+ }
+ /* Failed to find the PATH environment variable. */
+ return 1;
+}
diff --git a/gnulib-tests/test-errno.c b/gnulib-tests/test-errno.c
new file mode 100644
index 0000000..1e0bb6d
--- /dev/null
+++ b/gnulib-tests/test-errno.c
@@ -0,0 +1,119 @@
+/* Test of <errno.h> substitute.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <errno.h>
+
+/* Verify that the POSIX mandated errno values exist and can be used as
+ initializers outside of a function.
+ The variable names happen to match the Linux/x86 error numbers. */
+int e1 = EPERM;
+int e2 = ENOENT;
+int e3 = ESRCH;
+int e4 = EINTR;
+int e5 = EIO;
+int e6 = ENXIO;
+int e7 = E2BIG;
+int e8 = ENOEXEC;
+int e9 = EBADF;
+int e10 = ECHILD;
+int e11 = EAGAIN;
+int e11a = EWOULDBLOCK;
+int e12 = ENOMEM;
+int e13 = EACCES;
+int e14 = EFAULT;
+int e16 = EBUSY;
+int e17 = EEXIST;
+int e18 = EXDEV;
+int e19 = ENODEV;
+int e20 = ENOTDIR;
+int e21 = EISDIR;
+int e22 = EINVAL;
+int e23 = ENFILE;
+int e24 = EMFILE;
+int e25 = ENOTTY;
+int e26 = ETXTBSY;
+int e27 = EFBIG;
+int e28 = ENOSPC;
+int e29 = ESPIPE;
+int e30 = EROFS;
+int e31 = EMLINK;
+int e32 = EPIPE;
+int e33 = EDOM;
+int e34 = ERANGE;
+int e35 = EDEADLK;
+int e36 = ENAMETOOLONG;
+int e37 = ENOLCK;
+int e38 = ENOSYS;
+int e39 = ENOTEMPTY;
+int e40 = ELOOP;
+int e42 = ENOMSG;
+int e43 = EIDRM;
+int e67 = ENOLINK;
+int e71 = EPROTO;
+int e72 = EMULTIHOP;
+int e74 = EBADMSG;
+int e75 = EOVERFLOW;
+int e84 = EILSEQ;
+int e88 = ENOTSOCK;
+int e89 = EDESTADDRREQ;
+int e90 = EMSGSIZE;
+int e91 = EPROTOTYPE;
+int e92 = ENOPROTOOPT;
+int e93 = EPROTONOSUPPORT;
+int e95 = EOPNOTSUPP;
+int e95a = ENOTSUP;
+int e97 = EAFNOSUPPORT;
+int e98 = EADDRINUSE;
+int e99 = EADDRNOTAVAIL;
+int e100 = ENETDOWN;
+int e101 = ENETUNREACH;
+int e102 = ENETRESET;
+int e103 = ECONNABORTED;
+int e104 = ECONNRESET;
+int e105 = ENOBUFS;
+int e106 = EISCONN;
+int e107 = ENOTCONN;
+int e110 = ETIMEDOUT;
+int e111 = ECONNREFUSED;
+int e113 = EHOSTUNREACH;
+int e114 = EALREADY;
+int e115 = EINPROGRESS;
+int e116 = ESTALE;
+int e122 = EDQUOT;
+int e125 = ECANCELED;
+int e130 = EOWNERDEAD;
+int e131 = ENOTRECOVERABLE;
+
+/* Don't verify that these errno values are all different, except for possibly
+ EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has
+ ENOTSUP == EOPNOTSUPP. */
+
+int
+main ()
+{
+ /* Verify that errno can be assigned. */
+ errno = EOVERFLOW;
+
+ /* snprintf() callers want to distinguish EINVAL and EOVERFLOW. */
+ if (errno == EINVAL)
+ return 1;
+
+ return 0;
+}
diff --git a/gnulib-tests/test-exclude.c b/gnulib-tests/test-exclude.c
new file mode 100644
index 0000000..9b20ba5
--- /dev/null
+++ b/gnulib-tests/test-exclude.c
@@ -0,0 +1,129 @@
+/* Test suite for exclude.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ This file is part of the GNUlib Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <stdbool.h>
+#include <fnmatch.h>
+
+#include "exclude.h"
+#include "progname.h"
+#include "error.h"
+#include "argmatch.h"
+
+#ifndef FNM_CASEFOLD
+# define FNM_CASEFOLD 0
+#endif
+#ifndef FNM_LEADING_DIR
+# define FNM_LEADING_DIR 0
+#endif
+
+char const * const exclude_keywords[] = {
+ "noescape",
+ "pathname",
+ "period",
+ "leading_dir",
+ "casefold",
+ "anchored",
+ "include",
+ "wildcards",
+ NULL
+};
+
+int exclude_flags[] = {
+ FNM_NOESCAPE,
+ FNM_PATHNAME,
+ FNM_PERIOD,
+ FNM_LEADING_DIR,
+ FNM_CASEFOLD,
+ EXCLUDE_ANCHORED,
+ EXCLUDE_INCLUDE,
+ EXCLUDE_WILDCARDS
+};
+
+ARGMATCH_VERIFY (exclude_keywords, exclude_flags);
+
+/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and
+ thus must link with a definition of that function. Provide it here. */
+#ifdef ARGMATCH_DIE_DECL
+
+_Noreturn ARGMATCH_DIE_DECL;
+ARGMATCH_DIE_DECL { exit (1); }
+
+#endif
+
+int
+main (int argc, char **argv)
+{
+ int exclude_options = 0;
+ struct exclude *exclude = new_exclude ();
+
+ set_program_name (argv[0]);
+
+ if (argc == 1)
+ error (1, 0, "usage: %s file -- words...", argv[0]);
+
+ while (--argc)
+ {
+ char *opt = *++argv;
+ if (opt[0] == '-')
+ {
+ int neg = 0;
+ int flag;
+ char *s = opt + 1;
+
+ if (opt[1] == '-' && opt[2] == 0)
+ {
+ argc--;
+ break;
+ }
+ if (strlen (s) > 3 && memcmp (s, "no-", 3) == 0)
+ {
+ neg = 1;
+ s += 3;
+ }
+ flag = XARGMATCH (opt, s, exclude_keywords, exclude_flags);
+ if (neg)
+ exclude_options &= ~flag;
+ else
+ exclude_options |= flag;
+
+ /* Skip this test if invoked with -leading-dir on a system that
+ lacks support for FNM_LEADING_DIR. */
+ if (strcmp (s, "leading_dir") == 0 && FNM_LEADING_DIR == 0)
+ exit (77);
+
+ /* Likewise for -casefold and FNM_CASEFOLD. */
+ if (strcmp (s, "casefold") == 0 && FNM_CASEFOLD == 0)
+ exit (77);
+ }
+ else if (add_exclude_file (add_exclude, exclude, opt,
+ exclude_options, '\n') != 0)
+ error (1, errno, "error loading %s", opt);
+ }
+
+ for (; argc; --argc)
+ {
+ char *word = *++argv;
+
+ printf ("%s: %d\n", word, excluded_file_name (exclude, word));
+ }
+ return 0;
+}
diff --git a/gnulib-tests/test-exclude1.sh b/gnulib-tests/test-exclude1.sh
new file mode 100755
index 0000000..6f6252e
--- /dev/null
+++ b/gnulib-tests/test-exclude1.sh
@@ -0,0 +1,50 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test literal matches
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+cat > expected <<EOT
+foo: 0
+foo*: 1
+bar: 1
+foobar: 0
+baz: 0
+bar/qux: 0
+EOT
+
+test-exclude in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude2.sh b/gnulib-tests/test-exclude2.sh
new file mode 100755
index 0000000..c488109
--- /dev/null
+++ b/gnulib-tests/test-exclude2.sh
@@ -0,0 +1,50 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+# Test case-insensitive literal matches
+
+cat > expected <<EOT
+foo: 0
+foo*: 1
+bar: 1
+foobar: 0
+baz: 1
+bar/qux: 0
+EOT
+
+test-exclude -casefold in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude3.sh b/gnulib-tests/test-exclude3.sh
new file mode 100755
index 0000000..c2376cc
--- /dev/null
+++ b/gnulib-tests/test-exclude3.sh
@@ -0,0 +1,50 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test include
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+cat > expected <<EOT
+foo: 1
+foo*: 0
+bar: 0
+foobar: 1
+baz: 1
+bar/qux: 1
+EOT
+
+test-exclude -include in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude4.sh b/gnulib-tests/test-exclude4.sh
new file mode 100755
index 0000000..4c22db4
--- /dev/null
+++ b/gnulib-tests/test-exclude4.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test wildcard matching
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+cat > expected <<EOT
+foobar: 1
+EOT
+
+test-exclude -wildcards in -- foobar > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude5.sh b/gnulib-tests/test-exclude5.sh
new file mode 100755
index 0000000..ba53a43
--- /dev/null
+++ b/gnulib-tests/test-exclude5.sh
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test FNM_LEADING_DIR
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+cat > expected <<EOT
+bar: 1
+bar/qux: 1
+barz: 0
+foo/bar: 1
+EOT
+
+test-exclude -leading_dir in -- bar bar/qux barz foo/bar > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude6.sh b/gnulib-tests/test-exclude6.sh
new file mode 100755
index 0000000..53368dc
--- /dev/null
+++ b/gnulib-tests/test-exclude6.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test anchored
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+cat > expected <<EOT
+bar: 1
+foo/bar: 0
+EOT
+
+test-exclude -anchored in -- bar foo/bar > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude7.sh b/gnulib-tests/test-exclude7.sh
new file mode 100755
index 0000000..4a92ff5
--- /dev/null
+++ b/gnulib-tests/test-exclude7.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test exclude precedence
+
+cat > in <<EOT
+foo*
+bar
+Baz
+EOT
+
+cat > expected <<EOT
+bar: 0
+bar: 1
+EOT
+
+test-exclude in -include in -- bar > out || exit $?
+test-exclude -include in -no-include in -- bar >> out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-exclude8.sh b/gnulib-tests/test-exclude8.sh
new file mode 100755
index 0000000..91644ea
--- /dev/null
+++ b/gnulib-tests/test-exclude8.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Test suite for exclude.
+# Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
+
+# Test escaped metacharacters.
+
+cat > in <<'EOT'
+f\*e
+b[a\*]r
+EOT
+
+cat > expected <<'EOT'
+f*e: 1
+file: 0
+bar: 1
+EOT
+
+test-exclude -wildcards in -- 'f*e' 'file' 'bar' > out || exit $?
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
diff --git a/gnulib-tests/test-fcntl-h.c b/gnulib-tests/test-fcntl-h.c
new file mode 100644
index 0000000..aef1661
--- /dev/null
+++ b/gnulib-tests/test-fcntl-h.c
@@ -0,0 +1,130 @@
+/* Test of <fcntl.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <fcntl.h>
+
+/* Check that the various O_* macros are defined. */
+int o = (O_DIRECT | O_DIRECTORY | O_DSYNC | O_IGNORE_CTTY | O_NDELAY | O_NOATIME
+ | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS
+ | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT);
+
+/* Check that the various SEEK_* macros are defined. */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
+
+/* Check that the FD_* macros are defined. */
+int i = FD_CLOEXEC;
+
+/* Check that the types are all defined. */
+pid_t t1;
+off_t t2;
+mode_t t3;
+
+int
+main (void)
+{
+ /* Ensure no overlap in SEEK_*. */
+ switch (0)
+ {
+ case SEEK_CUR:
+ case SEEK_END:
+ case SEEK_SET:
+ ;
+ }
+
+ /* Ensure no dangerous overlap in non-zero gnulib-defined replacements. */
+ switch (O_RDONLY)
+ {
+ /* Access modes */
+ case O_RDONLY:
+ case O_WRONLY:
+ case O_RDWR:
+#if O_EXEC && O_EXEC != O_RDONLY
+ case O_EXEC:
+#endif
+#if O_SEARCH && O_EXEC != O_SEARCH && O_SEARCH != O_RDONLY
+ case O_SEARCH:
+#endif
+ i = ! (~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH));
+ break;
+
+ /* Everyone should have these */
+ case O_CREAT:
+ case O_EXCL:
+ case O_TRUNC:
+ case O_APPEND:
+ break;
+
+ /* These might be 0 or O_RDONLY, only test non-zero versions. */
+#if O_CLOEXEC
+ case O_CLOEXEC:
+#endif
+#if O_DIRECT
+ case O_DIRECT:
+#endif
+#if O_DIRECTORY
+ case O_DIRECTORY:
+#endif
+#if O_DSYNC
+ case O_DSYNC:
+#endif
+#if O_IGNORE_CTTY
+ case O_IGNORE_CTTY:
+#endif
+#if O_NOATIME
+ case O_NOATIME:
+#endif
+#if O_NONBLOCK
+ case O_NONBLOCK:
+#endif
+#if O_NOCTTY
+ case O_NOCTTY:
+#endif
+#if O_NOFOLLOW
+ case O_NOFOLLOW:
+#endif
+#if O_NOLINK
+ case O_NOLINK:
+#endif
+#if O_NOLINKS
+ case O_NOLINKS:
+#endif
+#if O_NOTRANS
+ case O_NOTRANS:
+#endif
+#if O_RSYNC && O_RSYNC != O_DSYNC
+ case O_RSYNC:
+#endif
+#if O_SYNC && O_SYNC != O_DSYNC && O_SYNC != O_RSYNC
+ case O_SYNC:
+#endif
+#if O_TTY_INIT
+ case O_TTY_INIT:
+#endif
+#if O_BINARY
+ case O_BINARY:
+#endif
+#if O_TEXT
+ case O_TEXT:
+#endif
+ ;
+ }
+
+ return !i;
+}
diff --git a/gnulib-tests/test-fcntl.c b/gnulib-tests/test-fcntl.c
new file mode 100644
index 0000000..974ee33
--- /dev/null
+++ b/gnulib-tests/test-fcntl.c
@@ -0,0 +1,409 @@
+/* Test of fcntl(2).
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+/* Specification. */
+#include <fcntl.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fcntl, int, (int, int, ...));
+
+/* Helpers. */
+#include <errno.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+#endif
+
+#include "binary-io.h"
+#include "macros.h"
+
+#if !O_BINARY
+# define setmode(f,m) zero ()
+static int zero (void) { return 0; }
+#endif
+
+/* Return true if FD is open. */
+static bool
+is_open (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows, the initial state of unassigned standard file
+ descriptors is that they are open but point to an
+ INVALID_HANDLE_VALUE, and there is no fcntl. */
+ 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
+}
+
+/* Return true if FD is open and inheritable across exec/spawn. */
+static bool
+is_inheritable (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows, the initial state of unassigned standard file
+ descriptors is that they are open but point to an
+ INVALID_HANDLE_VALUE, and there is no fcntl. */
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ DWORD flags;
+ if (h == INVALID_HANDLE_VALUE || GetHandleInformation (h, &flags) == 0)
+ return false;
+ return (flags & HANDLE_FLAG_INHERIT) != 0;
+#else
+# ifndef F_GETFD
+# error Please port fcntl to your platform
+# endif
+ int i = fcntl (fd, F_GETFD);
+ return 0 <= i && (i & FD_CLOEXEC) == 0;
+#endif
+}
+
+/* Return non-zero if FD is open in the given MODE, which is either
+ O_TEXT or O_BINARY. */
+static bool
+is_mode (int fd, int mode)
+{
+ int value = setmode (fd, O_BINARY);
+ setmode (fd, value);
+ return mode == value;
+}
+
+/* Since native fcntl can have more supported operations than our
+ replacement is aware of, and since various operations assign
+ different types to the vararg argument, a wrapper around fcntl must
+ be able to pass a vararg of unknown type on through to the original
+ fcntl. Make sure that this works properly: func1 behaves like the
+ original fcntl interpreting the vararg as an int or a pointer to a
+ struct, and func2 behaves like rpl_fcntl that doesn't know what
+ type to forward. */
+struct dummy_struct
+{
+ long filler;
+ int value;
+};
+static int
+func1 (int a, ...)
+{
+ va_list arg;
+ int i;
+ va_start (arg, a);
+ if (a < 4)
+ i = va_arg (arg, int);
+ else
+ {
+ struct dummy_struct *s = va_arg (arg, struct dummy_struct *);
+ i = s->value;
+ }
+ va_end (arg);
+ return i;
+}
+static int
+func2 (int a, ...)
+{
+ va_list arg;
+ void *p;
+ va_start (arg, a);
+ p = va_arg (arg, void *);
+ va_end (arg);
+ return func1 (a, p);
+}
+
+/* Ensure that all supported fcntl actions are distinct, and
+ usable in preprocessor expressions. */
+static void
+check_flags (void)
+{
+ switch (0)
+ {
+ case F_DUPFD:
+#if F_DUPFD
+#endif
+
+ case F_DUPFD_CLOEXEC:
+#if F_DUPFD_CLOEXEC
+#endif
+
+ case F_GETFD:
+#if F_GETFD
+#endif
+
+#ifdef F_SETFD
+ case F_SETFD:
+# if F_SETFD
+# endif
+#endif
+
+#ifdef F_GETFL
+ case F_GETFL:
+# if F_GETFL
+# endif
+#endif
+
+#ifdef F_SETFL
+ case F_SETFL:
+# if F_SETFL
+# endif
+#endif
+
+#ifdef F_GETOWN
+ case F_GETOWN:
+# if F_GETOWN
+# endif
+#endif
+
+#ifdef F_SETOWN
+ case F_SETOWN:
+# if F_SETOWN
+# endif
+#endif
+
+#ifdef F_GETLK
+ case F_GETLK:
+# if F_GETLK
+# endif
+#endif
+
+#ifdef F_SETLK
+ case F_SETLK:
+# if F_SETLK
+# endif
+#endif
+
+#ifdef F_SETLKW
+ case F_SETLKW:
+# if F_SETLKW
+# endif
+#endif
+
+ ;
+ }
+}
+
+int
+main (void)
+{
+ const char *file = "test-fcntl.tmp";
+ int fd;
+ int bad_fd = getdtablesize ();
+
+ /* Sanity check that rpl_fcntl is likely to work. */
+ ASSERT (func2 (1, 2) == 2);
+ ASSERT (func2 (2, -2) == -2);
+ ASSERT (func2 (3, 0x80000000) == 0x80000000);
+ {
+ struct dummy_struct s = { 0L, 4 };
+ ASSERT (func2 (4, &s) == 4);
+ }
+ check_flags ();
+
+ /* Assume std descriptors were provided by invoker, and ignore fds
+ that might have been inherited. */
+ fd = creat (file, 0600);
+ ASSERT (STDERR_FILENO < fd);
+ close (fd + 1);
+ close (fd + 2);
+
+ /* For F_DUPFD*, the source must be valid. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_DUPFD, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_DUPFD, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_DUPFD, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (-1, F_DUPFD_CLOEXEC, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_DUPFD_CLOEXEC, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_DUPFD_CLOEXEC, 0) == -1);
+ ASSERT (errno == EBADF);
+
+ /* For F_DUPFD*, the destination must be valid. */
+ errno = 0;
+ ASSERT (fcntl (fd, F_DUPFD, -1) == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (fcntl (fd, F_DUPFD, bad_fd) == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, -1) == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, bad_fd) == -1);
+ ASSERT (errno == EINVAL);
+
+ /* For F_DUPFD*, check for correct inheritance, as well as
+ preservation of text vs. binary. */
+ setmode (fd, O_BINARY);
+ ASSERT (is_open (fd));
+ ASSERT (!is_open (fd + 1));
+ ASSERT (!is_open (fd + 2));
+ ASSERT (is_inheritable (fd));
+ ASSERT (is_mode (fd, O_BINARY));
+
+ ASSERT (fcntl (fd, F_DUPFD, fd) == fd + 1);
+ ASSERT (is_open (fd));
+ ASSERT (is_open (fd + 1));
+ ASSERT (!is_open (fd + 2));
+ ASSERT (is_inheritable (fd + 1));
+ ASSERT (is_mode (fd, O_BINARY));
+ ASSERT (is_mode (fd + 1, O_BINARY));
+ ASSERT (close (fd + 1) == 0);
+
+ ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, fd + 2) == fd + 2);
+ ASSERT (is_open (fd));
+ ASSERT (!is_open (fd + 1));
+ ASSERT (is_open (fd + 2));
+ ASSERT (is_inheritable (fd));
+ ASSERT (!is_inheritable (fd + 2));
+ ASSERT (is_mode (fd, O_BINARY));
+ ASSERT (is_mode (fd + 2, O_BINARY));
+ ASSERT (close (fd) == 0);
+
+ setmode (fd + 2, O_TEXT);
+ ASSERT (fcntl (fd + 2, F_DUPFD, fd + 1) == fd + 1);
+ ASSERT (!is_open (fd));
+ ASSERT (is_open (fd + 1));
+ ASSERT (is_open (fd + 2));
+ ASSERT (is_inheritable (fd + 1));
+ ASSERT (!is_inheritable (fd + 2));
+ ASSERT (is_mode (fd + 1, O_TEXT));
+ ASSERT (is_mode (fd + 2, O_TEXT));
+ ASSERT (close (fd + 1) == 0);
+
+ ASSERT (fcntl (fd + 2, F_DUPFD_CLOEXEC, 0) == fd);
+ ASSERT (is_open (fd));
+ ASSERT (!is_open (fd + 1));
+ ASSERT (is_open (fd + 2));
+ ASSERT (!is_inheritable (fd));
+ ASSERT (!is_inheritable (fd + 2));
+ ASSERT (is_mode (fd, O_TEXT));
+ ASSERT (is_mode (fd + 2, O_TEXT));
+ ASSERT (close (fd + 2) == 0);
+
+ /* Test F_GETFD on invalid file descriptors. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_GETFD) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_GETFD) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_GETFD) == -1);
+ ASSERT (errno == EBADF);
+
+ /* Test F_GETFD, the FD_CLOEXEC bit. */
+ {
+ int result = fcntl (fd, F_GETFD);
+ ASSERT (0 <= result);
+ ASSERT ((result & FD_CLOEXEC) == FD_CLOEXEC);
+ ASSERT (dup (fd) == fd + 1);
+ result = fcntl (fd + 1, F_GETFD);
+ ASSERT (0 <= result);
+ ASSERT ((result & FD_CLOEXEC) == 0);
+ ASSERT (close (fd + 1) == 0);
+ }
+
+#ifdef F_SETFD
+ /* Test F_SETFD on invalid file descriptors. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_SETFD, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_SETFD, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_SETFD, 0) == -1);
+ ASSERT (errno == EBADF);
+#endif
+
+#ifdef F_GETFL
+ /* Test F_GETFL on invalid file descriptors. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_GETFL) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_GETFL) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_GETFL) == -1);
+ ASSERT (errno == EBADF);
+#endif
+
+#ifdef F_SETFL
+ /* Test F_SETFL on invalid file descriptors. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_SETFL, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_SETFL, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_SETFL, 0) == -1);
+ ASSERT (errno == EBADF);
+#endif
+
+#ifdef F_GETOWN
+ /* Test F_GETOWN on invalid file descriptors. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_GETOWN) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_GETOWN) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_GETOWN) == -1);
+ ASSERT (errno == EBADF);
+#endif
+
+#ifdef F_SETOWN
+ /* Test F_SETFL on invalid file descriptors. */
+ errno = 0;
+ ASSERT (fcntl (-1, F_SETOWN, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (fd + 1, F_SETOWN, 0) == -1);
+ ASSERT (errno == EBADF);
+ errno = 0;
+ ASSERT (fcntl (bad_fd, F_SETOWN, 0) == -1);
+ ASSERT (errno == EBADF);
+#endif
+
+ /* Cleanup. */
+ ASSERT (close (fd) == 0);
+ ASSERT (unlink (file) == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-fdopen.c b/gnulib-tests/test-fdopen.c
new file mode 100644
index 0000000..55b49a6
--- /dev/null
+++ b/gnulib-tests/test-fdopen.c
@@ -0,0 +1,49 @@
+/* Test opening a stream with a file descriptor.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fdopen, FILE *, (int, const char *));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ /* Test behavior on failure. POSIX makes it hard to check for
+ failure, since the behavior is not well-defined on invalid file
+ descriptors, so try fdopen 1000 times and if that's not enough to
+ fail due to EMFILE, so be it. */
+
+ int i;
+ for (i = 0; i < 1000; i++)
+ {
+ errno = 0;
+ if (! fdopen (STDOUT_FILENO, "w"))
+ {
+ ASSERT (errno != 0);
+ break;
+ }
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-fgetc.c b/gnulib-tests/test-fgetc.c
new file mode 100644
index 0000000..c62e70c
--- /dev/null
+++ b/gnulib-tests/test-fgetc.c
@@ -0,0 +1,97 @@
+/* Test of fgetc() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fgetc, int, (FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+ const char *filename = "test-fgetc.txt";
+
+ /* We don't have an fgetc() function that installs an invalid parameter
+ handler so far. So install that handler here, explicitly. */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+ gl_msvc_inval_ensure_handler ();
+#endif
+
+ /* Prepare a file. */
+ {
+ const char text[] = "hello world";
+ int fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600);
+ ASSERT (fd >= 0);
+ ASSERT (write (fd, text, sizeof (text)) == sizeof (text));
+ ASSERT (close (fd) == 0);
+ }
+
+ /* Test that fgetc() sets errno if someone else closes the stream
+ fd behind the back of stdio. */
+ {
+ FILE *fp = fopen (filename, "r");
+ ASSERT (fp != NULL);
+ ASSERT (close (fileno (fp)) == 0);
+ errno = 0;
+ ASSERT (fgetc (fp) == EOF);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+
+ /* Test that fgetc() sets errno if the stream was constructed with
+ an invalid file descriptor. */
+ {
+ FILE *fp = fdopen (-1, "r");
+ if (fp != NULL)
+ {
+ errno = 0;
+ ASSERT (fgetc (fp) == EOF);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+ {
+ FILE *fp;
+ close (99);
+ fp = fdopen (99, "r");
+ if (fp != NULL)
+ {
+ errno = 0;
+ ASSERT (fgetc (fp) == EOF);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+
+ /* Clean up. */
+ unlink (filename);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-filenamecat.c b/gnulib-tests/test-filenamecat.c
new file mode 100644
index 0000000..79f752f
--- /dev/null
+++ b/gnulib-tests/test-filenamecat.c
@@ -0,0 +1,66 @@
+/* Test of concatenation of two arbitrary file names.
+
+ Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "filenamecat.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "progname.h"
+
+int
+main (int argc _GL_UNUSED, char *argv[])
+{
+ static char const *const tests[][3] =
+ {
+ {"a", "b", "a/b"},
+ {"a/", "b", "a/b"},
+ {"a/", "/b", "a/b"},
+ {"a", "/b", "a/b"},
+
+ {"/", "b", "/b"},
+ {"/", "/b", "/b"},
+ {"/", "/", "/"},
+ {"a", "/", "a/"}, /* this might deserve a diagnostic */
+ {"/a", "/", "/a/"}, /* this might deserve a diagnostic */
+ {"a", "//b", "a/b"},
+ {"", "a", "a"}, /* this might deserve a diagnostic */
+ };
+ unsigned int i;
+ bool fail = false;
+
+ set_program_name (argv[0]);
+
+ for (i = 0; i < sizeof tests / sizeof tests[0]; i++)
+ {
+ char *base_in_result;
+ char const *const *t = tests[i];
+ char *res = file_name_concat (t[0], t[1], &base_in_result);
+ if (strcmp (res, t[2]) != 0)
+ {
+ fprintf (stderr, "test #%u: got %s, expected %s\n", i, res, t[2]);
+ fail = true;
+ }
+ }
+ exit (fail ? EXIT_FAILURE : EXIT_SUCCESS);
+}
diff --git a/gnulib-tests/test-float.c b/gnulib-tests/test-float.c
new file mode 100644
index 0000000..a5f33b6
--- /dev/null
+++ b/gnulib-tests/test-float.c
@@ -0,0 +1,384 @@
+/* Test of <float.h> substitute.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011. */
+
+#include <config.h>
+
+#include <float.h>
+
+#include "fpucw.h"
+#include "macros.h"
+
+/* Check that FLT_RADIX is a constant expression. */
+int a[] = { FLT_RADIX };
+
+#if FLT_RADIX == 2
+
+/* Return 2^n. */
+static float
+pow2f (int n)
+{
+ int k = n;
+ volatile float x = 1;
+ volatile float y = 2;
+ /* Invariant: 2^n == x * y^k. */
+ if (k < 0)
+ {
+ y = 0.5f;
+ k = - k;
+ }
+ while (k > 0)
+ {
+ if (k != 2 * (k / 2))
+ {
+ x = x * y;
+ k = k - 1;
+ }
+ if (k == 0)
+ break;
+ y = y * y;
+ k = k / 2;
+ }
+ /* Now k == 0, hence x == 2^n. */
+ return x;
+}
+
+/* Return 2^n. */
+static double
+pow2d (int n)
+{
+ int k = n;
+ volatile double x = 1;
+ volatile double y = 2;
+ /* Invariant: 2^n == x * y^k. */
+ if (k < 0)
+ {
+ y = 0.5;
+ k = - k;
+ }
+ while (k > 0)
+ {
+ if (k != 2 * (k / 2))
+ {
+ x = x * y;
+ k = k - 1;
+ }
+ if (k == 0)
+ break;
+ y = y * y;
+ k = k / 2;
+ }
+ /* Now k == 0, hence x == 2^n. */
+ return x;
+}
+
+/* Return 2^n. */
+static long double
+pow2l (int n)
+{
+ int k = n;
+ volatile long double x = 1;
+ volatile long double y = 2;
+ /* Invariant: 2^n == x * y^k. */
+ if (k < 0)
+ {
+ y = 0.5L;
+ k = - k;
+ }
+ while (k > 0)
+ {
+ if (k != 2 * (k / 2))
+ {
+ x = x * y;
+ k = k - 1;
+ }
+ if (k == 0)
+ break;
+ y = y * y;
+ k = k / 2;
+ }
+ /* Now k == 0, hence x == 2^n. */
+ return x;
+}
+
+/* ----------------------- Check macros for 'float' ----------------------- */
+
+/* Check that the FLT_* macros expand to constant expressions. */
+int fb[] =
+ {
+ FLT_MANT_DIG, FLT_MIN_EXP, FLT_MAX_EXP,
+ FLT_DIG, FLT_MIN_10_EXP, FLT_MAX_10_EXP
+ };
+float fc[] = { FLT_EPSILON, FLT_MIN, FLT_MAX };
+
+static void
+test_float (void)
+{
+ /* Check that the value of FLT_MIN_EXP is well parenthesized. */
+ ASSERT ((FLT_MIN_EXP % 101111) == (FLT_MIN_EXP) % 101111);
+
+ /* Check that the value of DBL_MIN_10_EXP is well parenthesized. */
+ ASSERT ((FLT_MIN_10_EXP % 101111) == (FLT_MIN_10_EXP) % 101111);
+
+ /* Check that 'float' is as specified in IEEE 754. */
+ ASSERT (FLT_MANT_DIG == 24);
+ ASSERT (FLT_MIN_EXP == -125);
+ ASSERT (FLT_MAX_EXP == 128);
+
+ /* Check the value of FLT_MIN_10_EXP. */
+ ASSERT (FLT_MIN_10_EXP == - (int) (- (FLT_MIN_EXP - 1) * 0.30103));
+
+ /* Check the value of FLT_DIG. */
+ ASSERT (FLT_DIG == (int) ((FLT_MANT_DIG - 1) * 0.30103));
+
+ /* Check the value of FLT_MIN_10_EXP. */
+ ASSERT (FLT_MIN_10_EXP == - (int) (- (FLT_MIN_EXP - 1) * 0.30103));
+
+ /* Check the value of FLT_MAX_10_EXP. */
+ ASSERT (FLT_MAX_10_EXP == (int) (FLT_MAX_EXP * 0.30103));
+
+ /* Check the value of FLT_MAX. */
+ {
+ volatile float m = FLT_MAX;
+ int n;
+
+ ASSERT (m + m > m);
+ for (n = 0; n <= 2 * FLT_MANT_DIG; n++)
+ {
+ volatile float pow2_n = pow2f (n); /* 2^n */
+ volatile float x = m + (m / pow2_n);
+ if (x > m)
+ ASSERT (x + x == x);
+ else
+ ASSERT (!(x + x == x));
+ }
+ }
+
+ /* Check the value of FLT_MIN. */
+ {
+ volatile float m = FLT_MIN;
+ volatile float x = pow2f (FLT_MIN_EXP - 1);
+ ASSERT (m == x);
+ }
+
+ /* Check the value of FLT_EPSILON. */
+ {
+ volatile float e = FLT_EPSILON;
+ volatile float me;
+ int n;
+
+ me = 1.0f + e;
+ ASSERT (me > 1.0f);
+ ASSERT (me - 1.0f == e);
+ for (n = 0; n <= 2 * FLT_MANT_DIG; n++)
+ {
+ volatile float half_n = pow2f (- n); /* 2^-n */
+ volatile float x = me - half_n;
+ if (x < me)
+ ASSERT (x <= 1.0f);
+ }
+ }
+}
+
+/* ----------------------- Check macros for 'double' ----------------------- */
+
+/* Check that the DBL_* macros expand to constant expressions. */
+int db[] =
+ {
+ DBL_MANT_DIG, DBL_MIN_EXP, DBL_MAX_EXP,
+ DBL_DIG, DBL_MIN_10_EXP, DBL_MAX_10_EXP
+ };
+double dc[] = { DBL_EPSILON, DBL_MIN, DBL_MAX };
+
+static void
+test_double (void)
+{
+ /* Check that the value of DBL_MIN_EXP is well parenthesized. */
+ ASSERT ((DBL_MIN_EXP % 101111) == (DBL_MIN_EXP) % 101111);
+
+ /* Check that the value of DBL_MIN_10_EXP is well parenthesized. */
+ ASSERT ((DBL_MIN_10_EXP % 101111) == (DBL_MIN_10_EXP) % 101111);
+
+ /* Check that 'double' is as specified in IEEE 754. */
+ ASSERT (DBL_MANT_DIG == 53);
+ ASSERT (DBL_MIN_EXP == -1021);
+ ASSERT (DBL_MAX_EXP == 1024);
+
+ /* Check the value of DBL_MIN_10_EXP. */
+ ASSERT (DBL_MIN_10_EXP == - (int) (- (DBL_MIN_EXP - 1) * 0.30103));
+
+ /* Check the value of DBL_DIG. */
+ ASSERT (DBL_DIG == (int) ((DBL_MANT_DIG - 1) * 0.30103));
+
+ /* Check the value of DBL_MIN_10_EXP. */
+ ASSERT (DBL_MIN_10_EXP == - (int) (- (DBL_MIN_EXP - 1) * 0.30103));
+
+ /* Check the value of DBL_MAX_10_EXP. */
+ ASSERT (DBL_MAX_10_EXP == (int) (DBL_MAX_EXP * 0.30103));
+
+ /* Check the value of DBL_MAX. */
+ {
+ volatile double m = DBL_MAX;
+ int n;
+
+ ASSERT (m + m > m);
+ for (n = 0; n <= 2 * DBL_MANT_DIG; n++)
+ {
+ volatile double pow2_n = pow2d (n); /* 2^n */
+ volatile double x = m + (m / pow2_n);
+ if (x > m)
+ ASSERT (x + x == x);
+ else
+ ASSERT (!(x + x == x));
+ }
+ }
+
+ /* Check the value of DBL_MIN. */
+ {
+ volatile double m = DBL_MIN;
+ volatile double x = pow2d (DBL_MIN_EXP - 1);
+ ASSERT (m == x);
+ }
+
+ /* Check the value of DBL_EPSILON. */
+ {
+ volatile double e = DBL_EPSILON;
+ volatile double me;
+ int n;
+
+ me = 1.0 + e;
+ ASSERT (me > 1.0);
+ ASSERT (me - 1.0 == e);
+ for (n = 0; n <= 2 * DBL_MANT_DIG; n++)
+ {
+ volatile double half_n = pow2d (- n); /* 2^-n */
+ volatile double x = me - half_n;
+ if (x < me)
+ ASSERT (x <= 1.0);
+ }
+ }
+}
+
+/* -------------------- Check macros for 'long double' -------------------- */
+
+/* Check that the LDBL_* macros expand to constant expressions. */
+int lb[] =
+ {
+ LDBL_MANT_DIG, LDBL_MIN_EXP, LDBL_MAX_EXP,
+ LDBL_DIG, LDBL_MIN_10_EXP, LDBL_MAX_10_EXP
+ };
+long double lc1 = LDBL_EPSILON;
+long double lc2 = LDBL_MIN;
+#if 0 /* LDBL_MAX is not a constant expression on some platforms. */
+long double lc3 = LDBL_MAX;
+#endif
+
+static void
+test_long_double (void)
+{
+ /* Check that the value of LDBL_MIN_EXP is well parenthesized. */
+ ASSERT ((LDBL_MIN_EXP % 101111) == (LDBL_MIN_EXP) % 101111);
+
+ /* Check that the value of LDBL_MIN_10_EXP is well parenthesized. */
+ ASSERT ((LDBL_MIN_10_EXP % 101111) == (LDBL_MIN_10_EXP) % 101111);
+
+ /* Check that 'long double' is at least as wide as 'double'. */
+ ASSERT (LDBL_MANT_DIG >= DBL_MANT_DIG);
+ ASSERT (LDBL_MIN_EXP - LDBL_MANT_DIG <= DBL_MIN_EXP - DBL_MANT_DIG);
+ ASSERT (LDBL_MAX_EXP >= DBL_MAX_EXP);
+
+ /* Check the value of LDBL_DIG. */
+ ASSERT (LDBL_DIG == (int)((LDBL_MANT_DIG - 1) * 0.30103));
+
+ /* Check the value of LDBL_MIN_10_EXP. */
+ ASSERT (LDBL_MIN_10_EXP == - (int) (- (LDBL_MIN_EXP - 1) * 0.30103));
+
+ /* Check the value of LDBL_MAX_10_EXP. */
+ ASSERT (LDBL_MAX_10_EXP == (int) (LDBL_MAX_EXP * 0.30103));
+
+ /* Check the value of LDBL_MAX. */
+ {
+ volatile long double m = LDBL_MAX;
+ int n;
+
+ ASSERT (m + m > m);
+ for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
+ {
+ volatile long double pow2_n = pow2l (n); /* 2^n */
+ volatile long double x = m + (m / pow2_n);
+ if (x > m)
+ ASSERT (x + x == x);
+ else
+ ASSERT (!(x + x == x));
+ }
+ }
+
+ /* Check the value of LDBL_MIN. */
+ {
+ volatile long double m = LDBL_MIN;
+ volatile long double x = pow2l (LDBL_MIN_EXP - 1);
+ ASSERT (m == x);
+ }
+
+ /* Check the value of LDBL_EPSILON. */
+ {
+ volatile long double e = LDBL_EPSILON;
+ volatile long double me;
+ int n;
+
+ me = 1.0L + e;
+ ASSERT (me > 1.0L);
+ ASSERT (me - 1.0L == e);
+ for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
+ {
+ volatile long double half_n = pow2l (- n); /* 2^-n */
+ volatile long double x = me - half_n;
+ if (x < me)
+ ASSERT (x <= 1.0L);
+ }
+ }
+}
+
+int
+main ()
+{
+ test_float ();
+ test_double ();
+
+ {
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ test_long_double ();
+
+ END_LONG_DOUBLE_ROUNDING ();
+ }
+
+ return 0;
+}
+
+#else
+
+int
+main ()
+{
+ fprintf (stderr, "Skipping test: FLT_RADIX is not 2.\n");
+ return 77;
+}
+
+#endif
diff --git a/gnulib-tests/test-fnmatch.c b/gnulib-tests/test-fnmatch.c
new file mode 100644
index 0000000..c110409
--- /dev/null
+++ b/gnulib-tests/test-fnmatch.c
@@ -0,0 +1,56 @@
+/* Test of fnmatch string matching function.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson <simon@josefsson.org>, 2009. */
+
+#include <config.h>
+
+#include <fnmatch.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fnmatch, int, (char const *, char const *, int));
+
+#include "macros.h"
+
+int
+main ()
+{
+ int res;
+
+ ASSERT (res = fnmatch ("", "", 0) == 0);
+
+ ASSERT (res = fnmatch ("*", "", 0) == 0);
+ ASSERT (res = fnmatch ("*", "foo", 0) == 0);
+ ASSERT (res = fnmatch ("*", "bar", 0) == 0);
+ ASSERT (res = fnmatch ("*", "*", 0) == 0);
+ ASSERT (res = fnmatch ("**", "f", 0) == 0);
+ ASSERT (res = fnmatch ("**", "foo.txt", 0) == 0);
+ ASSERT (res = fnmatch ("*.*", "foo.txt", 0) == 0);
+
+ ASSERT (res = fnmatch ("foo*.txt", "foobar.txt", 0) == 0);
+
+ ASSERT (res = fnmatch ("foo.txt", "foo.txt", 0) == 0);
+ ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", 0) == 0);
+ ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", FNM_NOESCAPE) == FNM_NOMATCH);
+
+ /* Verify that an unmatched [ is treated as a literal, as POSIX
+ requires. This test ensures that glibc Bugzilla bug #12378 stays
+ fixed.
+ */
+ ASSERT (res = fnmatch ("[/b", "[/b", 0) == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-fputc.c b/gnulib-tests/test-fputc.c
new file mode 100644
index 0000000..95a1cb6
--- /dev/null
+++ b/gnulib-tests/test-fputc.c
@@ -0,0 +1,91 @@
+/* Test of fputc() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fputc, int, (int, FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+ const char *filename = "test-fputc.txt";
+
+ /* We don't have an fputc() function that installs an invalid parameter
+ handler so far. So install that handler here, explicitly. */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+ gl_msvc_inval_ensure_handler ();
+#endif
+
+ /* Test that fputc() on an unbuffered stream sets errno if someone else
+ closes the stream fd behind the back of stdio. */
+ {
+ FILE *fp = fopen (filename, "w");
+ ASSERT (fp != NULL);
+ setvbuf (fp, NULL, _IONBF, 0);
+ ASSERT (close (fileno (fp)) == 0);
+ errno = 0;
+ ASSERT (fputc ('x', fp) == EOF);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+
+ /* Test that fputc() on an unbuffered stream sets errno if the stream
+ was constructed with an invalid file descriptor. */
+ {
+ FILE *fp = fdopen (-1, "w");
+ if (fp != NULL)
+ {
+ setvbuf (fp, NULL, _IONBF, 0);
+ errno = 0;
+ ASSERT (fputc ('x', fp) == EOF);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+ {
+ FILE *fp;
+ close (99);
+ fp = fdopen (99, "w");
+ if (fp != NULL)
+ {
+ setvbuf (fp, NULL, _IONBF, 0);
+ errno = 0;
+ ASSERT (fputc ('x', fp) == EOF);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+
+ /* Clean up. */
+ unlink (filename);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-fread.c b/gnulib-tests/test-fread.c
new file mode 100644
index 0000000..b9fc72a
--- /dev/null
+++ b/gnulib-tests/test-fread.c
@@ -0,0 +1,100 @@
+/* Test of fread() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fread, size_t, (void *, size_t, size_t, FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+ const char *filename = "test-fread.txt";
+
+ /* We don't have an fread() function that installs an invalid parameter
+ handler so far. So install that handler here, explicitly. */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+ gl_msvc_inval_ensure_handler ();
+#endif
+
+ /* Prepare a file. */
+ {
+ const char text[] = "hello world";
+ int fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600);
+ ASSERT (fd >= 0);
+ ASSERT (write (fd, text, sizeof (text)) == sizeof (text));
+ ASSERT (close (fd) == 0);
+ }
+
+ /* Test that fread() sets errno if someone else closes the stream
+ fd behind the back of stdio. */
+ {
+ FILE *fp = fopen (filename, "r");
+ char buf[5];
+ ASSERT (fp != NULL);
+ ASSERT (close (fileno (fp)) == 0);
+ errno = 0;
+ ASSERT (fread (buf, 1, sizeof (buf), fp) == 0);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+
+ /* Test that fread() sets errno if the stream was constructed with
+ an invalid file descriptor. */
+ {
+ FILE *fp = fdopen (-1, "r");
+ if (fp != NULL)
+ {
+ char buf[1];
+ errno = 0;
+ ASSERT (fread (buf, 1, 1, fp) == 0);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+ {
+ FILE *fp;
+ close (99);
+ fp = fdopen (99, "r");
+ if (fp != NULL)
+ {
+ char buf[1];
+ errno = 0;
+ ASSERT (fread (buf, 1, 1, fp) == 0);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+
+ /* Clean up. */
+ unlink (filename);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-freopen-safer.c b/gnulib-tests/test-freopen-safer.c
new file mode 100644
index 0000000..980f19b
--- /dev/null
+++ b/gnulib-tests/test-freopen-safer.c
@@ -0,0 +1,97 @@
+/* Test of reopening a stream.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+/* Specification. */
+#include "stdio--.h"
+
+/* Helpers. */
+#include <unistd.h>
+
+/* This test intentionally closes stderr. So, we arrange to have fd 10
+ (outside the range of interesting fd's during the test) set up to
+ duplicate the original stderr. */
+
+#define BACKUP_STDERR_FILENO 10
+#define ASSERT_STREAM myerr
+#include "macros.h"
+
+static FILE *myerr;
+
+int
+main (void)
+{
+ FILE *fp;
+
+ /* We close fd 2 later, so save it in fd 10. */
+ if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO
+ || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL)
+ return 2;
+
+ {
+ FILE *tmp;
+ ASSERT (tmp = fopen ("/dev/null", "r"));
+ ASSERT (STDERR_FILENO < fileno (tmp));
+ ASSERT (fp = fopen ("/dev/null", "w"));
+ ASSERT (fileno (tmp) < fileno (fp));
+ ASSERT (fclose (tmp) == 0);
+ }
+
+ /* Gap in fds. */
+ ASSERT (freopen ("/dev/null", "r+", fp) == fp);
+ ASSERT (STDERR_FILENO < fileno (fp));
+
+ ASSERT (freopen ("/dev/null", "r", stdin) == stdin);
+ ASSERT (STDIN_FILENO == fileno (stdin));
+
+ ASSERT (freopen ("/dev/null", "w", stdout) == stdout);
+ ASSERT (STDOUT_FILENO == fileno (stdout));
+
+ ASSERT (freopen ("/dev/null", "w", stderr) == stderr);
+ ASSERT (STDERR_FILENO == fileno (stderr));
+
+ /* fd 0 closed. */
+ ASSERT (close (STDIN_FILENO) == 0);
+
+ ASSERT (freopen ("/dev/null", "w", stdout) == stdout);
+ ASSERT (STDOUT_FILENO == fileno (stdout));
+
+ ASSERT (freopen ("/dev/null", "w", stderr) == stderr);
+ ASSERT (STDERR_FILENO == fileno (stderr));
+
+ ASSERT (freopen ("/dev/null", "a", fp) == fp);
+ ASSERT (STDERR_FILENO < fileno (fp));
+
+ /* fd 1 closed. */
+ ASSERT (close (STDOUT_FILENO) == 0);
+
+ ASSERT (freopen ("/dev/null", "w", stderr) == stderr);
+ ASSERT (STDERR_FILENO == fileno (stderr));
+
+ ASSERT (freopen ("/dev/null", "a+", fp) == fp);
+ ASSERT (STDERR_FILENO < fileno (fp));
+
+ /* fd 2 closed. */
+ ASSERT (close (STDERR_FILENO) == 0);
+
+ ASSERT (freopen ("/dev/null", "w+", fp) == fp);
+ ASSERT (STDERR_FILENO < fileno (fp));
+
+ return 0;
+}
diff --git a/gnulib-tests/test-freopen.c b/gnulib-tests/test-freopen.c
new file mode 100644
index 0000000..80453bf
--- /dev/null
+++ b/gnulib-tests/test-freopen.c
@@ -0,0 +1,82 @@
+/* Test of opening a file stream.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (freopen, FILE *, (char const *, char const *, FILE *));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+ const char *filename = "test-freopen.txt";
+
+ ASSERT (freopen ("/dev/null", "r", stdin) != NULL);
+
+#if 0 /* freopen (NULL, ...) is unsupported on most platforms. */
+ /* Test that freopen() sets errno if someone else closes the stream
+ fd behind the back of stdio. */
+ {
+ FILE *fp = fopen (filename, "w+");
+ ASSERT (fp != NULL);
+ ASSERT (close (fileno (fp)) == 0);
+ errno = 0;
+ ASSERT (freopen (NULL, "r", fp) == NULL);
+ perror("freopen");
+ ASSERT (errno == EBADF);
+ fclose (fp);
+ }
+
+ /* Test that freopen() sets errno if the stream was constructed with
+ an invalid file descriptor. */
+ {
+ FILE *fp = fdopen (-1, "w+");
+ if (fp != NULL)
+ {
+ errno = 0;
+ ASSERT (freopen (NULL, "r", fp) == NULL);
+ ASSERT (errno == EBADF);
+ fclose (fp);
+ }
+ }
+ {
+ FILE *fp;
+ close (99);
+ fp = fdopen (99, "w+");
+ if (fp != NULL)
+ {
+ errno = 0;
+ ASSERT (freopen (NULL, "r", fp) == NULL);
+ ASSERT (errno == EBADF);
+ fclose (fp);
+ }
+ }
+#endif
+
+ /* Clean up. */
+ unlink (filename);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-fstat.c b/gnulib-tests/test-fstat.c
new file mode 100644
index 0000000..c9ac749
--- /dev/null
+++ b/gnulib-tests/test-fstat.c
@@ -0,0 +1,50 @@
+/* Tests of fstat() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fstat, int, (int, struct stat *));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ /* Test behaviour for invalid file descriptors. */
+ {
+ struct stat statbuf;
+
+ errno = 0;
+ ASSERT (fstat (-1, &statbuf) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ struct stat statbuf;
+
+ close (99);
+ errno = 0;
+ ASSERT (fstat (99, &statbuf) == -1);
+ ASSERT (errno == EBADF);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-ftruncate.c b/gnulib-tests/test-ftruncate.c
new file mode 100644
index 0000000..09f175e
--- /dev/null
+++ b/gnulib-tests/test-ftruncate.c
@@ -0,0 +1,60 @@
+/* Test truncating a file.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (ftruncate, int, (int, off_t));
+
+#include <errno.h>
+#include <fcntl.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ const char *filename = argv[1];
+
+ /* Test behaviour for invalid file descriptors. */
+ {
+ errno = 0;
+ ASSERT (ftruncate (-1, 0) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ close (99);
+ errno = 0;
+ ASSERT (ftruncate (99, 0) == -1);
+ ASSERT (errno == EBADF);
+ }
+
+ /* Test behaviour for read-only file descriptors. */
+ {
+ int fd = open (filename, O_RDONLY);
+ ASSERT (fd >= 0);
+ errno = 0;
+ ASSERT (ftruncate (fd, 0) == -1);
+ ASSERT (errno == EBADF || errno == EINVAL
+ || errno == EACCES /* seen on mingw */
+ );
+ close (fd);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-ftruncate.sh b/gnulib-tests/test-ftruncate.sh
new file mode 100755
index 0000000..d7394d2
--- /dev/null
+++ b/gnulib-tests/test-ftruncate.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec ./test-ftruncate${EXEEXT} "$srcdir/test-ftruncate.sh"
diff --git a/gnulib-tests/test-fwrite.c b/gnulib-tests/test-fwrite.c
new file mode 100644
index 0000000..bc285f3
--- /dev/null
+++ b/gnulib-tests/test-fwrite.c
@@ -0,0 +1,94 @@
+/* Test of fwrite() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fwrite, size_t, (const void *, size_t, size_t, FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+ const char *filename = "test-fwrite.txt";
+
+ /* We don't have an fwrite() function that installs an invalid parameter
+ handler so far. So install that handler here, explicitly. */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+ gl_msvc_inval_ensure_handler ();
+#endif
+
+ /* Test that fwrite() on an unbuffered stream sets errno if someone else
+ closes the stream fd behind the back of stdio. */
+ {
+ FILE *fp = fopen (filename, "w");
+ char buf[5] = "world";
+ ASSERT (fp != NULL);
+ setvbuf (fp, NULL, _IONBF, 0);
+ ASSERT (close (fileno (fp)) == 0);
+ errno = 0;
+ ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+
+ /* Test that fwrite() on an unbuffered stream sets errno if the stream
+ was constructed with an invalid file descriptor. */
+ {
+ FILE *fp = fdopen (-1, "w");
+ if (fp != NULL)
+ {
+ char buf[5] = "world";
+ setvbuf (fp, NULL, _IONBF, 0);
+ errno = 0;
+ ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+ {
+ FILE *fp;
+ close (99);
+ fp = fdopen (99, "w");
+ if (fp != NULL)
+ {
+ char buf[5] = "world";
+ setvbuf (fp, NULL, _IONBF, 0);
+ errno = 0;
+ ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0);
+ ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
+ fclose (fp);
+ }
+ }
+
+ /* Clean up. */
+ unlink (filename);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-getcwd-lgpl.c b/gnulib-tests/test-getcwd-lgpl.c
new file mode 100644
index 0000000..6bea7b7
--- /dev/null
+++ b/gnulib-tests/test-getcwd-lgpl.c
@@ -0,0 +1,102 @@
+/* Test of getcwd() function.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getcwd, char *, (char *, size_t));
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+ char *pwd1;
+ char *pwd2;
+ /* If the user provides an argument, attempt to chdir there first. */
+ if (1 < argc)
+ {
+ if (chdir (argv[1]) == 0)
+ printf ("changed to directory %s\n", argv[1]);
+ }
+
+ pwd1 = getcwd (NULL, 0);
+ ASSERT (pwd1 && *pwd1);
+ if (1 < argc)
+ printf ("cwd=%s\n", pwd1);
+
+ /* Make sure the result is usable. */
+ ASSERT (chdir (pwd1) == 0);
+ ASSERT (chdir (".//./.") == 0);
+
+ /* Make sure that result is normalized. */
+ pwd2 = getcwd (NULL, 0);
+ ASSERT (pwd2);
+ ASSERT (strcmp (pwd1, pwd2) == 0);
+ free (pwd2);
+ {
+ size_t len = strlen (pwd1);
+ ssize_t i = len - 10;
+ if (i < 1)
+ i = 1;
+ pwd2 = getcwd (NULL, len + 1);
+ ASSERT (pwd2);
+ free (pwd2);
+ pwd2 = malloc (len + 2);
+ for ( ; i <= len; i++)
+ {
+ char *tmp;
+ errno = 0;
+ ASSERT (getcwd (pwd2, i) == NULL);
+ ASSERT (errno == ERANGE);
+ /* Allow either glibc or BSD behavior, since POSIX allows both. */
+ errno = 0;
+ tmp = getcwd (NULL, i);
+ if (tmp)
+ {
+ ASSERT (strcmp (pwd1, tmp) == 0);
+ free (tmp);
+ }
+ else
+ {
+ ASSERT (errno == ERANGE);
+ }
+ }
+ ASSERT (getcwd (pwd2, len + 1) == pwd2);
+ pwd2[len] = '/';
+ pwd2[len + 1] = '\0';
+ }
+ ASSERT (strstr (pwd2, "/./") == NULL);
+ ASSERT (strstr (pwd2, "/../") == NULL);
+ ASSERT (strstr (pwd2 + 1 + (pwd2[1] == '/'), "//") == NULL);
+
+ /* Validate a POSIX requirement on size. */
+ errno = 0;
+ ASSERT (getcwd(pwd2, 0) == NULL);
+ ASSERT (errno == EINVAL);
+
+ free (pwd1);
+ free (pwd2);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-getdtablesize.c b/gnulib-tests/test-getdtablesize.c
new file mode 100644
index 0000000..54efa04
--- /dev/null
+++ b/gnulib-tests/test-getdtablesize.c
@@ -0,0 +1,36 @@
+/* Test of getdtablesize() function.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getdtablesize, int, (void));
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ ASSERT (getdtablesize () >= 3);
+ ASSERT (dup2 (0, getdtablesize() - 1) == getdtablesize () - 1);
+ ASSERT (dup2 (0, getdtablesize()) == -1);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-getopt.c b/gnulib-tests/test-getopt.c
new file mode 100644
index 0000000..505cb2a
--- /dev/null
+++ b/gnulib-tests/test-getopt.c
@@ -0,0 +1,99 @@
+/* Test of command line argument processing.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <config.h>
+
+/* None of the files accessed by this test are large, so disable the
+ ftell link warning if we are not using the gnulib ftell module. */
+#define _GL_NO_LARGE_FILES
+
+#if GNULIB_TEST_GETOPT_GNU
+# include <getopt.h>
+
+# ifndef __getopt_argv_const
+# define __getopt_argv_const const
+# endif
+# include "signature.h"
+SIGNATURE_CHECK (getopt_long, int, (int, char *__getopt_argv_const *,
+ char const *, struct option const *,
+ int *));
+SIGNATURE_CHECK (getopt_long_only, int, (int, char *__getopt_argv_const *,
+ char const *, struct option const *,
+ int *));
+
+#endif
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getopt, int, (int, char * const[], char const *));
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* This test intentionally remaps stderr. So, we arrange to have fd 10
+ (outside the range of interesting fd's during the test) set up to
+ duplicate the original stderr. */
+
+#define BACKUP_STDERR_FILENO 10
+#define ASSERT_STREAM myerr
+#include "macros.h"
+
+static FILE *myerr;
+
+#include "test-getopt.h"
+#if GNULIB_TEST_GETOPT_GNU
+# include "test-getopt_long.h"
+#endif
+
+int
+main (void)
+{
+ /* This test validates that stderr is used correctly, so move the
+ original into fd 10. */
+ if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO
+ || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL)
+ return 2;
+
+ ASSERT (freopen ("test-getopt.tmp", "w", stderr) == stderr);
+
+ /* These default values are required by POSIX. */
+ ASSERT (optind == 1);
+ ASSERT (opterr != 0);
+
+ setenv ("POSIXLY_CORRECT", "1", 1);
+ test_getopt ();
+
+#if GNULIB_TEST_GETOPT_GNU
+ test_getopt_long_posix ();
+#endif
+
+ unsetenv ("POSIXLY_CORRECT");
+ test_getopt ();
+
+#if GNULIB_TEST_GETOPT_GNU
+ test_getopt_long ();
+ test_getopt_long_only ();
+#endif
+
+ ASSERT (fclose (stderr) == 0);
+ ASSERT (remove ("test-getopt.tmp") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-getopt.h b/gnulib-tests/test-getopt.h
new file mode 100644
index 0000000..8e61eb2
--- /dev/null
+++ b/gnulib-tests/test-getopt.h
@@ -0,0 +1,1391 @@
+/* Test of command line argument processing.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <stdbool.h>
+
+/* The glibc/gnulib implementation of getopt supports setting optind =
+ 0, but not all other implementations do. This matters for getopt.
+ But for getopt_long, we require GNU compatibility. */
+#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2 && !defined __UCLIBC__)
+# define OPTIND_MIN 0
+#elif HAVE_DECL_OPTRESET
+# define OPTIND_MIN (optreset = 1)
+#else
+# define OPTIND_MIN 1
+#endif
+
+static void
+getopt_loop (int argc, const char **argv,
+ const char *options,
+ int *a_seen, int *b_seen,
+ const char **p_value, const char **q_value,
+ int *non_options_count, const char **non_options,
+ int *unrecognized, bool *message_issued)
+{
+ int c;
+ int pos = ftell (stderr);
+
+ while ((c = getopt (argc, (char **) argv, options)) != -1)
+ {
+ switch (c)
+ {
+ case 'a':
+ (*a_seen)++;
+ break;
+ case 'b':
+ (*b_seen)++;
+ break;
+ case 'p':
+ *p_value = optarg;
+ break;
+ case 'q':
+ *q_value = optarg;
+ break;
+ case '\1':
+ /* Must only happen with option '-' at the beginning. */
+ ASSERT (options[0] == '-');
+ non_options[(*non_options_count)++] = optarg;
+ break;
+ case ':':
+ /* Must only happen with option ':' at the beginning. */
+ ASSERT (options[0] == ':'
+ || ((options[0] == '-' || options[0] == '+')
+ && options[1] == ':'));
+ /* fall through */
+ case '?':
+ *unrecognized = optopt;
+ break;
+ default:
+ *unrecognized = c;
+ break;
+ }
+ }
+
+ *message_issued = pos < ftell (stderr);
+}
+
+static void
+test_getopt (void)
+{
+ int start;
+ bool posixly = !!getenv ("POSIXLY_CORRECT");
+ /* See comment in getopt.c:
+ glibc gets a LSB-compliant getopt.
+ Standalone applications get a POSIX-compliant getopt. */
+#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
+ /* Using getopt from gnulib or from a non-glibc system. */
+ posixly = true;
+#endif
+
+ /* Test processing of boolean options. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-a";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "ab",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-b";
+ argv[argc++] = "-a";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "ab",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ba";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "ab",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ab";
+ argv[argc++] = "-a";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "ab",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 2);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ ASSERT (!output);
+ }
+
+ /* Test processing of options with arguments. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-pfoo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "p:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "p:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ab";
+ argv[argc++] = "-q";
+ argv[argc++] = "baz";
+ argv[argc++] = "-pfoo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ ASSERT (!output);
+ }
+
+#if GNULIB_TEST_GETOPT_GNU
+ /* Test processing of options with optional arguments. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-pfoo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "p::q::",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "p::q::",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp::q::",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ ASSERT (!output);
+ }
+#endif /* GNULIB_TEST_GETOPT_GNU */
+
+ /* Check that invalid options are recognized; and that both opterr
+ and leading ':' can silence output. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-x";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 42;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'x');
+ ASSERT (optind == 5);
+ ASSERT (output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-x";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 0;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'x');
+ ASSERT (optind == 5);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-x";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, ":abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'x');
+ ASSERT (optind == 5);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-:";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 42;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == ':');
+ ASSERT (optind == 5);
+ ASSERT (output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-:";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 0;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == ':');
+ ASSERT (optind == 5);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-:";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, ":abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == ':');
+ ASSERT (optind == 5);
+ ASSERT (!output);
+ }
+
+ /* Check for missing argument behavior. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ap";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'p');
+ ASSERT (optind == 2);
+ ASSERT (output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ap";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 0;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'p');
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ap";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, ":abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'p');
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+
+ /* Check that by default, non-options arguments are moved to the end. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ if (posixly)
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+ else
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "donald") == 0);
+ ASSERT (strcmp (argv[5], "duck") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ ASSERT (!output);
+ }
+ }
+
+ /* Check that '--' ends the argument processing. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[20];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "--";
+ argv[argc++] = "-b";
+ argv[argc++] = "foo";
+ argv[argc++] = "-q";
+ argv[argc++] = "johnny";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ if (posixly)
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "--") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+ else
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "--") == 0);
+ ASSERT (strcmp (argv[5], "donald") == 0);
+ ASSERT (strcmp (argv[6], "duck") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ ASSERT (!output);
+ }
+ }
+
+#if GNULIB_TEST_GETOPT_GNU
+ /* Check that the '-' flag causes non-options to be returned in order. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "-abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 3);
+ ASSERT (strcmp (non_options[0], "donald") == 0);
+ ASSERT (strcmp (non_options[1], "duck") == 0);
+ ASSERT (strcmp (non_options[2], "bar") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 7);
+ ASSERT (!output);
+ }
+
+ /* Check that '--' ends the argument processing. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[20];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "--";
+ argv[argc++] = "-b";
+ argv[argc++] = "foo";
+ argv[argc++] = "-q";
+ argv[argc++] = "johnny";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "-abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "--") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (!output);
+ if (non_options_count == 2)
+ {
+ /* glibc behaviour. */
+ ASSERT (non_options_count == 2);
+ ASSERT (strcmp (non_options[0], "donald") == 0);
+ ASSERT (strcmp (non_options[1], "duck") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 7);
+ }
+ else
+ {
+ /* Another valid behaviour. */
+ ASSERT (non_options_count == 7);
+ ASSERT (strcmp (non_options[0], "donald") == 0);
+ ASSERT (strcmp (non_options[1], "duck") == 0);
+ ASSERT (strcmp (non_options[2], "-b") == 0);
+ ASSERT (strcmp (non_options[3], "foo") == 0);
+ ASSERT (strcmp (non_options[4], "-q") == 0);
+ ASSERT (strcmp (non_options[5], "johnny") == 0);
+ ASSERT (strcmp (non_options[6], "bar") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 12);
+ }
+ }
+
+ /* Check that the '-' flag has to come first. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp:q:-",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ if (posixly)
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+ else
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "donald") == 0);
+ ASSERT (strcmp (argv[5], "duck") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ ASSERT (!output);
+ }
+ }
+
+ /* Check that the '+' flag causes the first non-option to terminate the
+ loop. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "+abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-+";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_loop (argc, argv, "+abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == '+');
+ ASSERT (optind == 2);
+ ASSERT (output);
+ }
+
+ /* Check that '--' ends the argument processing. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[20];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "--";
+ argv[argc++] = "-b";
+ argv[argc++] = "foo";
+ argv[argc++] = "-q";
+ argv[argc++] = "johnny";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "+abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "--") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+#endif /* GNULIB_TEST_GETOPT_GNU */
+
+ /* Check that the '+' flag has to come first. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "abp:q:+",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ if (posixly)
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+ else
+ {
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "donald") == 0);
+ ASSERT (strcmp (argv[5], "duck") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ ASSERT (!output);
+ }
+ }
+
+#if GNULIB_TEST_GETOPT_GNU
+ /* If GNU extensions are supported, require compliance with POSIX
+ interpretation on leading '+' behavior.
+ http://austingroupbugs.net/view.php?id=191 */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ getopt_loop (argc, argv, "+:abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_loop (argc, argv, "+:abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'p');
+ ASSERT (optind == 2);
+ ASSERT (!output);
+ }
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int a_seen = 0;
+ int b_seen = 0;
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ bool output;
+ int argc = 0;
+ const char *argv[10];
+
+ argv[argc++] = "program";
+ argv[argc++] = "-b";
+ argv[argc++] = "-p";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_loop (argc, argv, "+:abp:q:",
+ &a_seen, &b_seen, &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized, &output);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'p');
+ ASSERT (optind == 3);
+ ASSERT (!output);
+ }
+
+ /* Check that 'W' does not dump core:
+ http://sourceware.org/bugzilla/show_bug.cgi?id=12922
+ Technically, POSIX says the presence of ';' in the opt-string
+ gives unspecified behavior, so we only test this when GNU compliance
+ is desired. */
+ for (start = OPTIND_MIN; start <= 1; start++)
+ {
+ int argc = 0;
+ const char *argv[10];
+ int pos = ftell (stderr);
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "dummy";
+ argv[argc] = NULL;
+ optind = start;
+ opterr = 1;
+ ASSERT (getopt (argc, (char **) argv, "W;") == 'W');
+ ASSERT (ftell (stderr) == pos);
+ ASSERT (optind == 2);
+ }
+#endif /* GNULIB_TEST_GETOPT_GNU */
+}
diff --git a/gnulib-tests/test-getopt_long.h b/gnulib-tests/test-getopt_long.h
new file mode 100644
index 0000000..0f83f47
--- /dev/null
+++ b/gnulib-tests/test-getopt_long.h
@@ -0,0 +1,2144 @@
+/* Test of command line argument processing.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+static int a_seen;
+static int b_seen;
+static int q_seen;
+
+static const struct option long_options_required[] =
+ {
+ { "alpha", no_argument, NULL, 'a' },
+ { "beta", no_argument, &b_seen, 1 },
+ { "prune", required_argument, NULL, 'p' },
+ { "quetsche", required_argument, &q_seen, 1 },
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+
+static const struct option long_options_optional[] =
+ {
+ { "alpha", no_argument, NULL, 'a' },
+ { "beta", no_argument, &b_seen, 1 },
+ { "prune", optional_argument, NULL, 'p' },
+ { "quetsche", optional_argument, &q_seen, 1 },
+ { NULL, 0, NULL, 0 }
+ };
+
+static void
+getopt_long_loop (int argc, const char **argv,
+ const char *options, const struct option *long_options,
+ const char **p_value, const char **q_value,
+ int *non_options_count, const char **non_options,
+ int *unrecognized)
+{
+ int option_index = -1;
+ int c;
+
+ opterr = 0;
+ q_seen = 0;
+ while ((c = getopt_long (argc, (char **) argv, options, long_options,
+ &option_index))
+ != -1)
+ {
+ switch (c)
+ {
+ case 0:
+ /* An option with a non-NULL flag pointer was processed. */
+ if (q_seen)
+ *q_value = optarg;
+ break;
+ case 'a':
+ a_seen++;
+ break;
+ case 'b':
+ b_seen = 1;
+ break;
+ case 'p':
+ *p_value = optarg;
+ break;
+ case 'q':
+ *q_value = optarg;
+ break;
+ case '\1':
+ /* Must only happen with option '-' at the beginning. */
+ ASSERT (options[0] == '-');
+ non_options[(*non_options_count)++] = optarg;
+ break;
+ case ':':
+ /* Must only happen with option ':' at the beginning. */
+ ASSERT (options[0] == ':'
+ || ((options[0] == '-' || options[0] == '+')
+ && options[1] == ':'));
+ /* fall through */
+ case '?':
+ *unrecognized = optopt;
+ break;
+ default:
+ *unrecognized = c;
+ break;
+ }
+ }
+}
+
+/* Reduce casting, so we can use string literals elsewhere.
+ getopt_long takes an array of char*, but luckily does not modify
+ those elements, so we can pass const char*. */
+static int
+do_getopt_long (int argc, const char **argv, const char *shortopts,
+ const struct option *longopts, int *longind)
+{
+ return getopt_long (argc, (char **) argv, shortopts, longopts, longind);
+}
+
+static void
+test_getopt_long (void)
+{
+ int start;
+
+ /* Test disambiguation of options. */
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--x";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xt";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtr";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtra";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == 1001);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtre";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtrem";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtreme";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == 1002);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtremel";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == 1003);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--xtremely";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
+ ASSERT (c == 1003);
+ }
+
+ /* Check that -W handles unknown options. */
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 'W');
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Wunknown";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index);
+ /* glibc and BSD behave differently here, but for now, we allow
+ both behaviors since W support is not frequently used. */
+ if (c == '?')
+ {
+ ASSERT (optopt == 0);
+ ASSERT (optarg == NULL);
+ }
+ else
+ {
+ ASSERT (c == 'W');
+ ASSERT (strcmp (optarg, "unknown") == 0);
+ }
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "unknown";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index);
+ /* glibc and BSD behave differently here, but for now, we allow
+ both behaviors since W support is not frequently used. */
+ if (c == '?')
+ {
+ ASSERT (optopt == 0);
+ ASSERT (optarg == NULL);
+ }
+ else
+ {
+ ASSERT (c == 'W');
+ ASSERT (strcmp (optarg, "unknown") == 0);
+ }
+ }
+
+ /* Test that 'W' does not dump core:
+ http://sourceware.org/bugzilla/show_bug.cgi?id=12922 */
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "dummy";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long (argc, argv, "W;", NULL, &option_index);
+ ASSERT (c == 'W');
+ ASSERT (optind == 2);
+ }
+
+ /* Test processing of boolean short options. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-a";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-b";
+ argv[argc++] = "-a";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ba";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ab";
+ argv[argc++] = "-a";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 2);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+
+ /* Test processing of boolean long options. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--alpha";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--beta";
+ argv[argc++] = "--alpha";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--alpha";
+ argv[argc++] = "--beta";
+ argv[argc++] = "--alpha";
+ argv[argc++] = "--beta";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 2);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ }
+
+ /* Test processing of boolean long options via -W. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Walpha";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abW;", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "beta";
+ argv[argc++] = "-W";
+ argv[argc++] = "alpha";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "aW;b", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Walpha";
+ argv[argc++] = "-Wbeta";
+ argv[argc++] = "-Walpha";
+ argv[argc++] = "-Wbeta";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "W;ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 2);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ }
+
+ /* Test processing of short options with arguments. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-pfoo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ab";
+ argv[argc++] = "-q";
+ argv[argc++] = "baz";
+ argv[argc++] = "-pfoo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ }
+
+ /* Test processing of long options with arguments. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--p=foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ab";
+ argv[argc++] = "--q";
+ argv[argc++] = "baz";
+ argv[argc++] = "--p=foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ }
+
+ /* Test processing of long options with arguments via -W. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Wp=foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p:q:W;", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p:W;q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-ab";
+ argv[argc++] = "-Wq";
+ argv[argc++] = "baz";
+ argv[argc++] = "-W";
+ argv[argc++] = "p=foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "W;abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 6);
+ }
+
+ /* Test processing of short options with optional arguments. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-pfoo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+
+ /* Test processing of long options with optional arguments. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--p=foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--p";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--p=";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && *p_value == '\0');
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--p";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+
+ /* Test processing of long options with optional arguments via -W. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Wp=foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::W;", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Wp";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::q::W;", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-Wp=";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "W;p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && *p_value == '\0');
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "p=";
+ argv[argc++] = "foo";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "W;p::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && *p_value == '\0');
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 3);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-W";
+ argv[argc++] = "p";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "W;abp::q::", long_options_optional,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ /* ASSERT (p_value == NULL); */
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+
+ /* Check that invalid options are recognized. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-x";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'x');
+ ASSERT (optind == 5);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "-:";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == ':');
+ ASSERT (optind == 5);
+ }
+
+ /* Check that unexpected arguments are recognized. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "--a=";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 'a');
+ ASSERT (optind == 4);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "foo";
+ argv[argc++] = "--b=";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ /* When flag is non-zero, glibc sets optopt anyway, but BSD
+ leaves optopt unchanged. */
+ ASSERT (unrecognized == 1 || unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+
+ /* Check that by default, non-options arguments are moved to the end. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "donald") == 0);
+ ASSERT (strcmp (argv[5], "duck") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+
+ /* Check that '--' ends the argument processing. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[20];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "--";
+ argv[argc++] = "-b";
+ argv[argc++] = "foo";
+ argv[argc++] = "-q";
+ argv[argc++] = "johnny";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "--") == 0);
+ ASSERT (strcmp (argv[5], "donald") == 0);
+ ASSERT (strcmp (argv[6], "duck") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 5);
+ }
+
+ /* Check that the '-' flag causes non-options to be returned in order. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "-abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 3);
+ ASSERT (strcmp (non_options[0], "donald") == 0);
+ ASSERT (strcmp (non_options[1], "duck") == 0);
+ ASSERT (strcmp (non_options[2], "bar") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 7);
+ }
+
+ /* Check that '--' ends the argument processing. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[20];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "--";
+ argv[argc++] = "-b";
+ argv[argc++] = "foo";
+ argv[argc++] = "-q";
+ argv[argc++] = "johnny";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "-abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "--") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ if (non_options_count == 2)
+ {
+ /* glibc behaviour. */
+ ASSERT (non_options_count == 2);
+ ASSERT (strcmp (non_options[0], "donald") == 0);
+ ASSERT (strcmp (non_options[1], "duck") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 7);
+ }
+ else
+ {
+ /* Another valid behaviour. */
+ ASSERT (non_options_count == 7);
+ ASSERT (strcmp (non_options[0], "donald") == 0);
+ ASSERT (strcmp (non_options[1], "duck") == 0);
+ ASSERT (strcmp (non_options[2], "-b") == 0);
+ ASSERT (strcmp (non_options[3], "foo") == 0);
+ ASSERT (strcmp (non_options[4], "-q") == 0);
+ ASSERT (strcmp (non_options[5], "johnny") == 0);
+ ASSERT (strcmp (non_options[6], "bar") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 12);
+ }
+ }
+
+ /* Check that the '-' flag has to come first. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:-", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "donald") == 0);
+ ASSERT (strcmp (argv[5], "duck") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+
+ /* Check that the '+' flag causes the first non-option to terminate the
+ loop. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ }
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-+";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == '+');
+ ASSERT (optind == 2);
+ }
+
+ /* Check that '--' ends the argument processing. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[20];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "--";
+ argv[argc++] = "-b";
+ argv[argc++] = "foo";
+ argv[argc++] = "-q";
+ argv[argc++] = "johnny";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "--") == 0);
+ ASSERT (strcmp (argv[7], "-b") == 0);
+ ASSERT (strcmp (argv[8], "foo") == 0);
+ ASSERT (strcmp (argv[9], "-q") == 0);
+ ASSERT (strcmp (argv[10], "johnny") == 0);
+ ASSERT (strcmp (argv[11], "bar") == 0);
+ ASSERT (argv[12] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ }
+
+ /* Check that the '+' flag has to come first. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:+", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "-p") == 0);
+ ASSERT (strcmp (argv[2], "billy") == 0);
+ ASSERT (strcmp (argv[3], "-a") == 0);
+ ASSERT (strcmp (argv[4], "donald") == 0);
+ ASSERT (strcmp (argv[5], "duck") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+}
+
+/* Test behavior of getopt_long when POSIXLY_CORRECT is set in the
+ environment. Options with optional arguments should not change
+ behavior just because of an environment variable.
+ http://lists.gnu.org/archive/html/bug-m4/2006-09/msg00028.html */
+static void
+test_getopt_long_posix (void)
+{
+ int start;
+
+ /* Check that POSIXLY_CORRECT stops parsing the same as leading '+'. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "donald";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc++] = "duck";
+ argv[argc++] = "-a";
+ argv[argc++] = "bar";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "abp:q:", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (strcmp (argv[0], "program") == 0);
+ ASSERT (strcmp (argv[1], "donald") == 0);
+ ASSERT (strcmp (argv[2], "-p") == 0);
+ ASSERT (strcmp (argv[3], "billy") == 0);
+ ASSERT (strcmp (argv[4], "duck") == 0);
+ ASSERT (strcmp (argv[5], "-a") == 0);
+ ASSERT (strcmp (argv[6], "bar") == 0);
+ ASSERT (argv[7] == NULL);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 1);
+ }
+
+ /* Check that POSIXLY_CORRECT doesn't change optional arguments. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-p";
+ argv[argc++] = "billy";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "p::", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 0);
+ ASSERT (b_seen == 0);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 2);
+ }
+
+ /* Check that leading - still sees options after non-options. */
+ for (start = 0; start <= 1; start++)
+ {
+ const char *p_value = NULL;
+ const char *q_value = NULL;
+ int non_options_count = 0;
+ const char *non_options[10];
+ int unrecognized = 0;
+ int argc = 0;
+ const char *argv[10];
+ a_seen = 0;
+ b_seen = 0;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-a";
+ argv[argc++] = "billy";
+ argv[argc++] = "-b";
+ argv[argc] = NULL;
+ optind = start;
+ getopt_long_loop (argc, argv, "-ab", long_options_required,
+ &p_value, &q_value,
+ &non_options_count, non_options, &unrecognized);
+ ASSERT (a_seen == 1);
+ ASSERT (b_seen == 1);
+ ASSERT (p_value == NULL);
+ ASSERT (q_value == NULL);
+ ASSERT (non_options_count == 1);
+ ASSERT (strcmp (non_options[0], "billy") == 0);
+ ASSERT (unrecognized == 0);
+ ASSERT (optind == 4);
+ }
+}
+
+/* Reduce casting, so we can use string literals elsewhere.
+ getopt_long_only takes an array of char*, but luckily does not
+ modify those elements, so we can pass const char*. */
+static int
+do_getopt_long_only (int argc, const char **argv, const char *shortopts,
+ const struct option *longopts, int *longind)
+{
+ return getopt_long_only (argc, (char **) argv, shortopts, longopts, longind);
+}
+
+static void
+test_getopt_long_only (void)
+{
+ /* Test disambiguation of options. */
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-x";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "ab", long_options_required,
+ &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-x";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "abx", long_options_required,
+ &option_index);
+ ASSERT (c == 'x');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--x";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "abx", long_options_required,
+ &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-b";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ b_seen = 0;
+ c = do_getopt_long_only (argc, argv, "abx", long_options_required,
+ &option_index);
+ ASSERT (c == 'b');
+ ASSERT (b_seen == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "--b";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ b_seen = 0;
+ c = do_getopt_long_only (argc, argv, "abx", long_options_required,
+ &option_index);
+ ASSERT (c == 0);
+ ASSERT (b_seen == 1);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xt";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "ab", long_options_required,
+ &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xt";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "abx", long_options_required,
+ &option_index);
+ ASSERT (c == '?');
+ ASSERT (optopt == 0);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xtra";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "ab", long_options_required,
+ &option_index);
+ ASSERT (c == 1001);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xtreme";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "abx:", long_options_required,
+ &option_index);
+ ASSERT (c == 1002);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xtremel";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "ab", long_options_required,
+ &option_index);
+ /* glibc getopt_long_only is intentionally different from
+ getopt_long when handling a prefix that is common to two
+ spellings, when both spellings have the same option directives.
+ BSD getopt_long_only treats both cases the same. */
+ ASSERT (c == 1003 || c == '?');
+ ASSERT (optind == 2);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xtremel";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "abx::", long_options_required,
+ &option_index);
+ /* glibc getopt_long_only is intentionally different from
+ getopt_long when handling a prefix that is common to two
+ spellings, when both spellings have the same option directives.
+ BSD getopt_long_only treats both cases the same. */
+ ASSERT (c == 1003 || c == '?');
+ ASSERT (optind == 2);
+ ASSERT (optarg == NULL);
+ }
+ {
+ int argc = 0;
+ const char *argv[10];
+ int option_index;
+ int c;
+
+ argv[argc++] = "program";
+ argv[argc++] = "-xtras";
+ argv[argc] = NULL;
+ optind = 1;
+ opterr = 0;
+ c = do_getopt_long_only (argc, argv, "abx::", long_options_required,
+ &option_index);
+ ASSERT (c == 'x');
+ ASSERT (strcmp (optarg, "tras") == 0);
+ }
+}
diff --git a/gnulib-tests/test-gettimeofday.c b/gnulib-tests/test-gettimeofday.c
new file mode 100644
index 0000000..7a44d71
--- /dev/null
+++ b/gnulib-tests/test-gettimeofday.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+ * Written by Jim Meyering.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/time.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (gettimeofday, int,
+ (struct timeval *, GETTIMEOFDAY_TIMEZONE *));
+
+#include <time.h>
+
+#include <stdio.h>
+#include <string.h>
+
+int
+main (void)
+{
+ time_t t = 0;
+ struct tm *lt;
+ struct tm saved_lt;
+ struct timeval tv;
+ lt = localtime (&t);
+ saved_lt = *lt;
+ gettimeofday (&tv, NULL);
+ if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
+ {
+ fprintf (stderr, "gettimeofday still clobbers the localtime buffer!\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/gnulib-tests/test-hash.c b/gnulib-tests/test-hash.c
new file mode 100644
index 0000000..7bb53f0
--- /dev/null
+++ b/gnulib-tests/test-hash.c
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ * Written by Jim Meyering
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "hash.h"
+#include "hash-pjw.h"
+#include "inttostr.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
+
+static bool
+hash_compare_strings (void const *x, void const *y)
+{
+ ASSERT (x != y);
+ return STREQ (x, y) ? true : false;
+}
+
+static void
+hash_freer (void *x)
+{
+ free (x);
+}
+
+static void
+insert_new (Hash_table *ht, const void *ent)
+{
+ void *e = hash_insert (ht, ent);
+ ASSERT (e == ent);
+}
+
+static bool
+walk (void *ent, void *data)
+{
+ char *str = ent;
+ unsigned int *map = data;
+ switch (*str)
+ {
+ case 'a': *map |= 1; return true;
+ case 'b': *map |= 2; return true;
+ case 'c': *map |= 4; return true;
+ }
+ *map |= 8;
+ return false;
+}
+
+static int
+get_seed (char const *str, unsigned int *seed)
+{
+ size_t len = strlen (str);
+ if (len == 0 || strspn (str, "0123456789") != len || 10 < len)
+ return 1;
+
+ *seed = atoi (str);
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ unsigned int i;
+ unsigned int k;
+ unsigned int table_size[] = {1, 2, 3, 4, 5, 23, 53};
+ Hash_table *ht;
+ Hash_tuning tuning;
+
+ hash_reset_tuning (&tuning);
+ tuning.shrink_threshold = 0.3;
+ tuning.shrink_factor = 0.707;
+ tuning.growth_threshold = 1.5;
+ tuning.growth_factor = 2.0;
+ tuning.is_n_buckets = true;
+
+ if (1 < argc)
+ {
+ unsigned int seed;
+ if (get_seed (argv[1], &seed) != 0)
+ {
+ fprintf (stderr, "invalid seed: %s\n", argv[1]);
+ exit (EXIT_FAILURE);
+ }
+
+ srand (seed);
+ }
+
+ for (i = 0; i < ARRAY_CARDINALITY (table_size); i++)
+ {
+ size_t sz = table_size[i];
+ ht = hash_initialize (sz, NULL, hash_pjw, hash_compare_strings, NULL);
+ ASSERT (ht);
+ insert_new (ht, "a");
+ {
+ char *str1 = strdup ("a");
+ char *str2;
+ ASSERT (str1);
+ str2 = hash_insert (ht, str1);
+ ASSERT (str1 != str2);
+ ASSERT (STREQ (str1, str2));
+ free (str1);
+ }
+ insert_new (ht, "b");
+ insert_new (ht, "c");
+ i = 0;
+ ASSERT (hash_do_for_each (ht, walk, &i) == 3);
+ ASSERT (i == 7);
+ {
+ void *buf[5] = { NULL };
+ ASSERT (hash_get_entries (ht, NULL, 0) == 0);
+ ASSERT (hash_get_entries (ht, buf, 5) == 3);
+ ASSERT (STREQ (buf[0], "a") || STREQ (buf[0], "b") || STREQ (buf[0], "c"));
+ }
+ ASSERT (hash_delete (ht, "a"));
+ ASSERT (hash_delete (ht, "a") == NULL);
+ ASSERT (hash_delete (ht, "b"));
+ ASSERT (hash_delete (ht, "c"));
+
+ ASSERT (hash_rehash (ht, 47));
+ ASSERT (hash_rehash (ht, 467));
+
+ /* Free an empty table. */
+ hash_clear (ht);
+ hash_free (ht);
+
+ ht = hash_initialize (sz, NULL, hash_pjw, hash_compare_strings, NULL);
+ ASSERT (ht);
+
+ insert_new (ht, "z");
+ insert_new (ht, "y");
+ insert_new (ht, "x");
+ insert_new (ht, "w");
+ insert_new (ht, "v");
+ insert_new (ht, "u");
+
+ hash_clear (ht);
+ ASSERT (hash_get_n_entries (ht) == 0);
+ hash_free (ht);
+
+ /* Test pointer hashing. */
+ ht = hash_initialize (sz, NULL, NULL, NULL, NULL);
+ ASSERT (ht);
+ {
+ char *str = strdup ("a");
+ ASSERT (str);
+ insert_new (ht, "a");
+ insert_new (ht, str);
+ ASSERT (hash_lookup (ht, str) == str);
+ free (str);
+ }
+ hash_free (ht);
+ }
+
+ hash_reset_tuning (&tuning);
+ tuning.shrink_threshold = 0.3;
+ tuning.shrink_factor = 0.707;
+ tuning.growth_threshold = 1.5;
+ tuning.growth_factor = 2.0;
+ tuning.is_n_buckets = true;
+ /* Invalid tuning. */
+ ht = hash_initialize (4651, &tuning, hash_pjw, hash_compare_strings,
+ hash_freer);
+ ASSERT (!ht);
+
+ /* Alternate tuning. */
+ tuning.growth_threshold = 0.89;
+
+ /* Run with default tuning, then with custom tuning settings. */
+ for (k = 0; k < 2; k++)
+ {
+ Hash_tuning const *tune = (k == 0 ? NULL : &tuning);
+ /* Now, each entry is malloc'd. */
+ ht = hash_initialize (4651, tune, hash_pjw,
+ hash_compare_strings, hash_freer);
+ ASSERT (ht);
+ for (i = 0; i < 10000; i++)
+ {
+ unsigned int op = rand () % 10;
+ switch (op)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ {
+ char buf[50];
+ char const *p = uinttostr (i, buf);
+ char *p_dup = strdup (p);
+ ASSERT (p_dup);
+ insert_new (ht, p_dup);
+ }
+ break;
+
+ case 6:
+ {
+ size_t n = hash_get_n_entries (ht);
+ ASSERT (hash_rehash (ht, n + rand () % 20));
+ }
+ break;
+
+ case 7:
+ {
+ size_t n = hash_get_n_entries (ht);
+ size_t delta = rand () % 20;
+ if (delta < n)
+ ASSERT (hash_rehash (ht, n - delta));
+ }
+ break;
+
+ case 8:
+ case 9:
+ {
+ /* Delete a random entry. */
+ size_t n = hash_get_n_entries (ht);
+ if (n)
+ {
+ size_t kk = rand () % n;
+ void const *p;
+ void *v;
+ for (p = hash_get_first (ht); kk;
+ --kk, p = hash_get_next (ht, p))
+ {
+ /* empty */
+ }
+ ASSERT (p);
+ v = hash_delete (ht, p);
+ ASSERT (v);
+ free (v);
+ }
+ break;
+ }
+ }
+ ASSERT (hash_table_ok (ht));
+ }
+
+ hash_free (ht);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-iconv-h.c b/gnulib-tests/test-iconv-h.c
new file mode 100644
index 0000000..fbb0548
--- /dev/null
+++ b/gnulib-tests/test-iconv-h.c
@@ -0,0 +1,27 @@
+/* Test of <iconv.h> substitute.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-iconv.c b/gnulib-tests/test-iconv.c
new file mode 100644
index 0000000..3e4c4ff
--- /dev/null
+++ b/gnulib-tests/test-iconv.c
@@ -0,0 +1,148 @@
+/* Test of character set conversion.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+
+# ifndef ICONV_CONST
+# define ICONV_CONST /* empty */
+# endif
+
+#include "signature.h"
+SIGNATURE_CHECK (iconv, size_t, (iconv_t, ICONV_CONST char **, size_t *,
+ char **, size_t *));
+SIGNATURE_CHECK (iconv_close, int, (iconv_t x));
+SIGNATURE_CHECK (iconv_open, iconv_t, (char const *, char const *));
+
+#endif
+
+#include <errno.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+#if HAVE_ICONV
+ /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
+ and UTF-8. */
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+
+ ASSERT (cd_88591_to_utf8 != (iconv_t)(-1));
+ ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
+
+ /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ 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,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ ASSERT (res == 0 && inbytesleft == 0);
+ ASSERT (outptr == buf + strlen (expected));
+ ASSERT (memcmp (buf, expected, strlen (expected)) == 0);
+ }
+
+ /* Test conversion from ISO-8859-1 to UTF-8 with E2BIG. */
+ {
+ 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,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ ASSERT (res == (size_t)(-1) && errno == E2BIG);
+ ASSERT (inbytesleft == 1);
+ ASSERT (outbytesleft == 1);
+ ASSERT ((unsigned char) buf[1] == 0xAD);
+ ASSERT ((unsigned char) buf[0] == 0xDE);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */
+ {
+ static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ static const char expected[] = "\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_utf8_to_88591,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ ASSERT (res == 0 && inbytesleft == 0);
+ ASSERT (outptr == buf + strlen (expected));
+ ASSERT (memcmp (buf, expected, strlen (expected)) == 0);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */
+ {
+ 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,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == (size_t)(-1))
+ {
+ ASSERT (errno == EILSEQ);
+ ASSERT (inbytesleft == strlen (input) && outptr == buf);
+ }
+ else
+ {
+ ASSERT (res == 1);
+ ASSERT (inbytesleft == 0);
+ }
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */
+ {
+ static const char input[] = "\342";
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ ASSERT (res == (size_t)(-1) && errno == EINVAL);
+ ASSERT (inbytesleft == 1 && outptr == buf);
+ }
+
+ iconv_close (cd_88591_to_utf8);
+ iconv_close (cd_utf8_to_88591);
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-ignore-value.c b/gnulib-tests/test-ignore-value.c
new file mode 100644
index 0000000..7c4b2de
--- /dev/null
+++ b/gnulib-tests/test-ignore-value.c
@@ -0,0 +1,84 @@
+/* Test the "ignore-value" module.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+#include <config.h>
+
+#include "ignore-value.h"
+
+#include <stdio.h>
+
+#ifndef _GL_ATTRIBUTE_RETURN_CHECK
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
+# define _GL_ATTRIBUTE_RETURN_CHECK
+# else
+# define _GL_ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
+# endif
+#endif
+
+struct s { int i; };
+static char doChar (void) _GL_ATTRIBUTE_RETURN_CHECK;
+static int doInt (void) _GL_ATTRIBUTE_RETURN_CHECK;
+static off_t doOff (void) _GL_ATTRIBUTE_RETURN_CHECK;
+static void *doPtr (void) _GL_ATTRIBUTE_RETURN_CHECK;
+static struct s doStruct (void) _GL_ATTRIBUTE_RETURN_CHECK;
+
+static char
+doChar (void)
+{
+ return 0;
+}
+
+static int
+doInt (void)
+{
+ return 0;
+}
+
+static off_t
+doOff (void)
+{
+ return 0;
+}
+
+static void *
+doPtr (void)
+{
+ return NULL;
+}
+
+static struct s
+doStruct (void)
+{
+ static struct s s1;
+ return s1;
+}
+
+int
+main (void)
+{
+ /* If this test can compile with -Werror and the same warnings as
+ the rest of the project, then we are properly silencing warnings
+ about ignored return values. */
+ ignore_value (doChar ());
+ ignore_value (doInt ());
+ ignore_value (doOff ());
+ ignore_value (doPtr ());
+ ignore_value (doStruct ());
+ return 0;
+}
diff --git a/gnulib-tests/test-inet_pton.c b/gnulib-tests/test-inet_pton.c
new file mode 100644
index 0000000..3d12556
--- /dev/null
+++ b/gnulib-tests/test-inet_pton.c
@@ -0,0 +1,58 @@
+/* Test of inet_pton function.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <config.h>
+
+#include <arpa/inet.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (inet_pton, int, (int, const char *, void *));
+
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+#if defined AF_INET /* HAVE_IPV4 */
+ {
+ /* This machine was for a long time known as
+ ma2s2.mathematik.uni-karlsruhe.de. */
+ const char printable[] = "129.13.115.2";
+ struct in_addr internal;
+ int ret;
+
+ ret = inet_pton (AF_INET, printable, &internal);
+ ASSERT (ret == 1);
+ /* Verify that internal is filled in network byte order. */
+ ASSERT (((unsigned char *) &internal)[0] == 0x81);
+ ASSERT (((unsigned char *) &internal)[1] == 0x0D);
+ ASSERT (((unsigned char *) &internal)[2] == 0x73);
+ ASSERT (((unsigned char *) &internal)[3] == 0x02);
+# ifdef WORDS_BIGENDIAN
+ ASSERT (internal.s_addr == 0x810D7302);
+# else
+ ASSERT (internal.s_addr == 0x02730D81);
+# endif
+ }
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-init.sh b/gnulib-tests/test-init.sh
new file mode 100755
index 0000000..1dd05f4
--- /dev/null
+++ b/gnulib-tests/test-init.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Unit tests for init.sh
+# Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
+
+fail=0
+
+test_compare()
+{
+ touch empty || fail=1
+ echo xyz > in || fail=1
+
+ compare /dev/null /dev/null >out 2>err || fail=1
+ test -s out && fail_ "out not empty: $(cat out)"
+ # "err" should be empty, too, but has "set -x" output when VERBOSE=yes
+ case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+ compare /dev/null empty >out 2>err || fail=1
+ test -s out && fail_ "out not empty: $(cat out)"
+ case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+ compare in in >out 2>err || fail=1
+ test -s out && fail_ "out not empty: $(cat out)"
+ case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+ compare /dev/null in >out 2>err && fail=1
+ cat <<\EOF > exp
+diff -u /dev/null in
+--- /dev/null 1970-01-01
++++ in 1970-01-01
++xyz
+EOF
+ compare exp out || fail=1
+ case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+ compare empty in >out 2>err && fail=1
+ # Compare against expected output only if compare is using diff -u.
+ if grep @ out >/dev/null; then
+ # Remove the TAB-date suffix on each --- and +++ line,
+ # for both the expected and the actual output files.
+ # Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ:
+ # -@@ -0,0 +1 @@
+ # +@@ -1,0 +1,1 @@
+ sed 's/ .*//;/^@@/d' out > k && mv k out
+ cat <<\EOF > exp
+--- empty
++++ in
++xyz
+EOF
+ compare exp out || fail=1
+ fi
+ case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+}
+
+test_compare
+
+Exit $fail
diff --git a/gnulib-tests/test-intprops.c b/gnulib-tests/test-intprops.c
new file mode 100644
index 0000000..0a8ddcd
--- /dev/null
+++ b/gnulib-tests/test-intprops.c
@@ -0,0 +1,370 @@
+/* Test intprops.h.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* Tell gcc not to warn about the long expressions that the overflow
+ macros expand to, or about the (X < 0) expressions. */
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Woverlength-strings"
+# pragma GCC diagnostic ignored "-Wtype-limits"
+
+/* Work around a bug in GCC 6.1 and earlier; see:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 */
+# pragma GCC diagnostic ignored "-Woverflow"
+
+#endif
+
+#include <config.h>
+
+#include "intprops.h"
+#include "verify.h"
+
+#include <stdbool.h>
+#include <inttypes.h>
+#include <limits.h>
+
+#include "macros.h"
+
+/* VERIFY (X) uses a static assertion for compilers that are known to work,
+ and falls back on a dynamic assertion for other compilers.
+ These tests should be checkable via 'verify' rather than 'ASSERT', but
+ using 'verify' would run into a bug with HP-UX 11.23 cc; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */
+#if __GNUC__ || __SUNPRO_C
+# define VERIFY(x) do { verify (x); } while (0)
+#else
+# define VERIFY(x) ASSERT (x)
+#endif
+
+#define DONTCARE __LINE__
+
+int
+main (void)
+{
+ /* Use VERIFY for tests that must be integer constant expressions,
+ ASSERT otherwise. */
+
+ /* TYPE_IS_INTEGER. */
+ ASSERT (TYPE_IS_INTEGER (bool));
+ ASSERT (TYPE_IS_INTEGER (char));
+ ASSERT (TYPE_IS_INTEGER (signed char));
+ ASSERT (TYPE_IS_INTEGER (unsigned char));
+ ASSERT (TYPE_IS_INTEGER (short int));
+ ASSERT (TYPE_IS_INTEGER (unsigned short int));
+ ASSERT (TYPE_IS_INTEGER (int));
+ ASSERT (TYPE_IS_INTEGER (unsigned int));
+ ASSERT (TYPE_IS_INTEGER (long int));
+ ASSERT (TYPE_IS_INTEGER (unsigned long int));
+ ASSERT (TYPE_IS_INTEGER (intmax_t));
+ ASSERT (TYPE_IS_INTEGER (uintmax_t));
+ ASSERT (! TYPE_IS_INTEGER (float));
+ ASSERT (! TYPE_IS_INTEGER (double));
+ ASSERT (! TYPE_IS_INTEGER (long double));
+
+ /* TYPE_SIGNED. */
+ /* VERIFY (! TYPE_SIGNED (bool)); // not guaranteed by gnulib substitute */
+ VERIFY (TYPE_SIGNED (signed char));
+ VERIFY (! TYPE_SIGNED (unsigned char));
+ VERIFY (TYPE_SIGNED (short int));
+ VERIFY (! TYPE_SIGNED (unsigned short int));
+ VERIFY (TYPE_SIGNED (int));
+ VERIFY (! TYPE_SIGNED (unsigned int));
+ VERIFY (TYPE_SIGNED (long int));
+ VERIFY (! TYPE_SIGNED (unsigned long int));
+ VERIFY (TYPE_SIGNED (intmax_t));
+ VERIFY (! TYPE_SIGNED (uintmax_t));
+ ASSERT (TYPE_SIGNED (float));
+ ASSERT (TYPE_SIGNED (double));
+ ASSERT (TYPE_SIGNED (long double));
+
+ /* Integer representation. Check that it is two's complement. */
+ VERIFY (INT_MIN + INT_MAX < 0);
+
+ /* TYPE_MINIMUM, TYPE_MAXIMUM. */
+ VERIFY (TYPE_MINIMUM (char) == CHAR_MIN);
+ VERIFY (TYPE_MAXIMUM (char) == CHAR_MAX);
+ VERIFY (TYPE_MINIMUM (unsigned char) == 0);
+ VERIFY (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
+ VERIFY (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+ VERIFY (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+ VERIFY (TYPE_MINIMUM (short int) == SHRT_MIN);
+ VERIFY (TYPE_MAXIMUM (short int) == SHRT_MAX);
+ VERIFY (TYPE_MINIMUM (unsigned short int) == 0);
+ VERIFY (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
+ VERIFY (TYPE_MINIMUM (int) == INT_MIN);
+ VERIFY (TYPE_MAXIMUM (int) == INT_MAX);
+ VERIFY (TYPE_MINIMUM (unsigned int) == 0);
+ VERIFY (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
+ VERIFY (TYPE_MINIMUM (long int) == LONG_MIN);
+ VERIFY (TYPE_MAXIMUM (long int) == LONG_MAX);
+ VERIFY (TYPE_MINIMUM (unsigned long int) == 0);
+ VERIFY (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
+ VERIFY (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
+ VERIFY (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
+ VERIFY (TYPE_MINIMUM (uintmax_t) == 0);
+ VERIFY (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
+
+ /* INT_BITS_STRLEN_BOUND. */
+ VERIFY (INT_BITS_STRLEN_BOUND (1) == 1);
+ VERIFY (INT_BITS_STRLEN_BOUND (2620) == 789);
+
+ /* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND. */
+ #ifdef INT32_MAX /* POSIX guarantees int32_t; this ports to non-POSIX. */
+ VERIFY (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1);
+ VERIFY (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648"));
+ #endif
+ #ifdef INT64_MAX
+ VERIFY (INT_STRLEN_BOUND (int64_t) == sizeof ("-9223372036854775808") - 1);
+ VERIFY (INT_BUFSIZE_BOUND (int64_t) == sizeof ("-9223372036854775808"));
+ #endif
+
+ /* All the INT_<op>_RANGE_OVERFLOW tests are equally valid as
+ INT_<op>_OVERFLOW tests, so define macros to do both. OP is the
+ operation, OPNAME its symbolic name, A and B its operands, T the
+ result type, V the overflow flag, and VRES the result if V and if
+ two's complement. CHECK_BINOP is for most binary operatinos,
+ CHECK_SBINOP for binary +, -, * when the result type is signed,
+ and CHECK_UNOP for unary operations. */
+ #define CHECK_BINOP(op, opname, a, b, t, v, vres) \
+ VERIFY (INT_##opname##_RANGE_OVERFLOW (a, b, TYPE_MINIMUM (t), \
+ TYPE_MAXIMUM (t)) \
+ == (v)); \
+ VERIFY (INT_##opname##_OVERFLOW (a, b) == (v))
+ #define CHECK_SBINOP(op, opname, a, b, t, v, vres) \
+ CHECK_BINOP(op, opname, a, b, t, v, vres); \
+ { \
+ t result; \
+ ASSERT (INT_##opname##_WRAPV (a, b, &result) == (v)); \
+ ASSERT (result == ((v) ? (vres) : ((a) op (b)))); \
+ }
+ #define CHECK_UNOP(op, opname, a, t, v) \
+ VERIFY (INT_##opname##_RANGE_OVERFLOW (a, TYPE_MINIMUM (t), \
+ TYPE_MAXIMUM (t)) \
+ == (v)); \
+ VERIFY (INT_##opname##_OVERFLOW (a) == (v))
+
+ /* INT_<op>_RANGE_OVERFLOW, INT_<op>_OVERFLOW. */
+ VERIFY (INT_ADD_RANGE_OVERFLOW (INT_MAX, 1, INT_MIN, INT_MAX));
+ VERIFY (INT_ADD_OVERFLOW (INT_MAX, 1));
+
+ CHECK_SBINOP (+, ADD, INT_MAX, 1, int, true, INT_MIN);
+ CHECK_SBINOP (+, ADD, INT_MAX, -1, int, false, INT_MAX - 1);
+ CHECK_SBINOP (+, ADD, INT_MIN, 1, int, false, INT_MIN + 1);
+ CHECK_SBINOP (+, ADD, INT_MIN, -1, int, true, INT_MAX);
+ CHECK_BINOP (+, ADD, UINT_MAX, 1u, unsigned int, true, 0u);
+ CHECK_BINOP (+, ADD, 0u, 1u, unsigned int, false, 1u);
+
+ CHECK_SBINOP (-, SUBTRACT, INT_MAX, 1, int, false, INT_MAX - 1);
+ CHECK_SBINOP (-, SUBTRACT, INT_MAX, -1, int, true, INT_MIN);
+ CHECK_SBINOP (-, SUBTRACT, INT_MIN, 1, int, true, INT_MAX);
+ CHECK_SBINOP (-, SUBTRACT, INT_MIN, -1, int, false, INT_MIN - -1);
+ CHECK_BINOP (-, SUBTRACT, UINT_MAX, 1u, unsigned int, false, UINT_MAX - 1u);
+ CHECK_BINOP (-, SUBTRACT, 0u, 1u, unsigned int, true, 0u - 1u);
+
+ CHECK_UNOP (-, NEGATE, INT_MIN, int, true);
+ CHECK_UNOP (-, NEGATE, 0, int, false);
+ CHECK_UNOP (-, NEGATE, INT_MAX, int, false);
+ CHECK_UNOP (-, NEGATE, 0u, unsigned int, false);
+ CHECK_UNOP (-, NEGATE, 1u, unsigned int, true);
+ CHECK_UNOP (-, NEGATE, UINT_MAX, unsigned int, true);
+
+ CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MAX, int, true, 1);
+ CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MIN, int, true, INT_MIN);
+ CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MAX, int, true, INT_MIN);
+ CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0);
+ CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int,
+ INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
+ CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX,
+ long int, false, LONG_MIN - LONG_MIN % INT_MAX);
+
+ CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int,
+ INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
+ CHECK_BINOP (/, DIVIDE, INT_MAX, 1, int, false, INT_MAX);
+ CHECK_BINOP (/, DIVIDE, (unsigned int) INT_MIN, -1u, unsigned int,
+ false, INT_MIN / -1u);
+
+ CHECK_BINOP (%, REMAINDER, INT_MIN, -1, int, INT_NEGATE_OVERFLOW (INT_MIN), 0);
+ CHECK_BINOP (%, REMAINDER, INT_MAX, 1, int, false, 0);
+ CHECK_BINOP (%, REMAINDER, (unsigned int) INT_MIN, -1u, unsigned int,
+ false, INT_MIN % -1u);
+
+ CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX, 1, unsigned int, true, UINT_MAX << 1);
+ CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2 + 1, 1, unsigned int, true,
+ (UINT_MAX / 2 + 1) << 1);
+ CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2, 1, unsigned int, false,
+ (UINT_MAX / 2) << 1);
+
+ /* INT_<op>_OVERFLOW and INT_<op>_WRAPV with mixed types. */
+ #define CHECK_SUM(a, b, t, v, vres) \
+ CHECK_SUM1(a, b, t, v, vres); \
+ CHECK_SUM1(b, a, t, v, vres)
+ #define CHECK_SSUM(a, b, t, v, vres) \
+ CHECK_SSUM1(a, b, t, v, vres); \
+ CHECK_SSUM1(b, a, t, v, vres)
+ #define CHECK_SUM1(a, b, t, v, vres) \
+ VERIFY (INT_ADD_OVERFLOW (a, b) == (v))
+ #define CHECK_SSUM1(a, b, t, v, vres) \
+ CHECK_SUM1(a, b, t, v, vres); \
+ { \
+ t result; \
+ ASSERT (INT_ADD_WRAPV (a, b, &result) == (v)); \
+ ASSERT (result == ((v) ? (vres) : ((a) + (b)))); \
+ }
+ CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX);
+ CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE);
+ CHECK_SSUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN,
+ INT_MIN == LONG_MIN ? INT_MAX : DONTCARE);
+ CHECK_SUM (0u, -1, unsigned int, true, 0u + -1);
+ CHECK_SUM (0u, 0, unsigned int, false, DONTCARE);
+ CHECK_SUM (0u, 1, unsigned int, false, DONTCARE);
+ CHECK_SSUM (1, LONG_MAX, long int, true, LONG_MIN);
+ CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u);
+ CHECK_SSUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX,
+ INT_MAX == LONG_MAX ? INT_MIN : DONTCARE);
+ CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX);
+ CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN);
+ {
+ long int result;
+ ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX));
+ ASSERT (INT_ADD_WRAPV (-1, INT_MIN, &result) == (INT_MIN == LONG_MIN));
+ }
+
+ #define CHECK_DIFFERENCE(a, b, t, v, vres) \
+ VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v))
+ #define CHECK_SDIFFERENCE(a, b, t, v, vres) \
+ CHECK_DIFFERENCE(a, b, t, v, vres); \
+ { \
+ t result; \
+ ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v)); \
+ ASSERT (result == ((v) ? (vres) : ((a) - (b)))); \
+ }
+ CHECK_DIFFERENCE (INT_MAX, 1u, unsigned int, UINT_MAX < INT_MAX - 1,
+ INT_MAX - 1u);
+ CHECK_DIFFERENCE (UINT_MAX, 1, unsigned int, false, UINT_MAX - 1);
+ CHECK_DIFFERENCE (0u, -1, unsigned int, false, 0u - -1);
+ CHECK_DIFFERENCE (UINT_MAX, -1, unsigned int, true, UINT_MAX - -1);
+ CHECK_DIFFERENCE (INT_MIN, 1u, unsigned int, true, INT_MIN - 1u);
+ CHECK_DIFFERENCE (-1, 0u, unsigned int, true, -1 - 0u);
+ CHECK_SDIFFERENCE (-1, INT_MIN, int, false, -1 - INT_MIN);
+ CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX);
+ CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN);
+ CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX);
+ {
+ long int result;
+ ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX));
+ ASSERT (INT_SUBTRACT_WRAPV (INT_MIN, 1, &result) == (INT_MAX == LONG_MAX));
+ }
+
+ #define CHECK_PRODUCT(a, b, t, v, vres) \
+ CHECK_PRODUCT1(a, b, t, v, vres); \
+ CHECK_PRODUCT1(b, a, t, v, vres)
+ #define CHECK_SPRODUCT(a, b, t, v, vres) \
+ CHECK_SPRODUCT1(a, b, t, v, vres); \
+ CHECK_SPRODUCT1(b, a, t, v, vres)
+ #define CHECK_PRODUCT1(a, b, t, v, vres) \
+ VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v))
+ #define CHECK_SPRODUCT1(a, b, t, v, vres) \
+ CHECK_PRODUCT1(a, b, t, v, vres); \
+ { \
+ t result; \
+ ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v)); \
+ ASSERT (result == ((v) ? (vres) : ((a) * (b)))); \
+ }
+ CHECK_PRODUCT (-1, 1u, unsigned int, true, -1 * 1u);
+ CHECK_SPRODUCT (-1, INT_MIN, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
+ CHECK_PRODUCT (-1, UINT_MAX, unsigned int, true, -1 * UINT_MAX);
+ CHECK_SPRODUCT (-32768, LONG_MAX / -32768 - 1, long int, true, LONG_MIN);
+ CHECK_SPRODUCT (-12345, LONG_MAX / -12345, long int, false, DONTCARE);
+ CHECK_SPRODUCT (0, -1, int, false, DONTCARE);
+ CHECK_SPRODUCT (0, 0, int, false, DONTCARE);
+ CHECK_PRODUCT (0, 0u, unsigned int, false, DONTCARE);
+ CHECK_SPRODUCT (0, 1, int, false, DONTCARE);
+ CHECK_SPRODUCT (0, INT_MAX, int, false, DONTCARE);
+ CHECK_SPRODUCT (0, INT_MIN, int, false, DONTCARE);
+ CHECK_PRODUCT (0, UINT_MAX, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, -1, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, 0, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, 0u, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, 1, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, INT_MAX, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, INT_MIN, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (0u, UINT_MAX, unsigned int, false, DONTCARE);
+ CHECK_SPRODUCT (1, INT_MAX, int, false, DONTCARE);
+ CHECK_SPRODUCT (1, INT_MIN, int, false, DONTCARE);
+ CHECK_PRODUCT (1, UINT_MAX, unsigned int, false, DONTCARE);
+ CHECK_PRODUCT (1u, INT_MIN, unsigned int, true, 1u * INT_MIN);
+ CHECK_PRODUCT (1u, INT_MAX, unsigned int, UINT_MAX < INT_MAX, 1u * INT_MAX);
+ CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX);
+ CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true,
+ INT_MAX * ULONG_MAX);
+ CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN);
+ CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE);
+ CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX);
+ CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true,
+ INT_MIN * ULONG_MAX);
+ {
+ long int result;
+ ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
+ == (LONG_MAX / INT_MAX < INT_MAX));
+ ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
+ || result == INT_MAX * (long int) INT_MAX);
+ ASSERT (INT_MULTIPLY_WRAPV (INT_MIN, INT_MIN, &result)
+ || result == INT_MIN * (long int) INT_MIN);
+ }
+
+# ifdef LLONG_MAX
+ {
+ long long int result;
+ ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result)
+ == (LLONG_MAX / LONG_MAX < LONG_MAX));
+ ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result)
+ || result == LONG_MAX * (long long int) LONG_MAX);
+ ASSERT (INT_MULTIPLY_WRAPV (LONG_MIN, LONG_MIN, &result)
+ || result == LONG_MIN * (long long int) LONG_MIN);
+ }
+# endif
+
+ #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v))
+
+ CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN);
+ CHECK_QUOTIENT (INT_MIN, UINT_MAX, false);
+ CHECK_QUOTIENT (INTMAX_MIN, UINTMAX_MAX, false);
+ CHECK_QUOTIENT (INTMAX_MIN, UINT_MAX, false);
+ CHECK_QUOTIENT (-11, 10u, true);
+ CHECK_QUOTIENT (-10, 10u, true);
+ CHECK_QUOTIENT (-9, 10u, false);
+ CHECK_QUOTIENT (11u, -10, true);
+ CHECK_QUOTIENT (10u, -10, true);
+ CHECK_QUOTIENT (9u, -10, false);
+
+ #define CHECK_REMAINDER(a, b, v) VERIFY (INT_REMAINDER_OVERFLOW (a, b) == (v))
+
+ CHECK_REMAINDER (INT_MIN, -1L, INT_MIN == LONG_MIN);
+ CHECK_REMAINDER (-1, UINT_MAX, true);
+ CHECK_REMAINDER ((intmax_t) -1, UINTMAX_MAX, true);
+ CHECK_REMAINDER (INTMAX_MIN, UINT_MAX,
+ (INTMAX_MAX < UINT_MAX
+ && - (unsigned int) INTMAX_MIN % UINT_MAX != 0));
+ CHECK_REMAINDER (INT_MIN, ULONG_MAX, INT_MIN % ULONG_MAX != 1);
+ CHECK_REMAINDER (1u, -1, false);
+ CHECK_REMAINDER (37*39u, -39, false);
+ CHECK_REMAINDER (37*39u + 1, -39, true);
+ CHECK_REMAINDER (37*39u - 1, -39, true);
+ CHECK_REMAINDER (LONG_MAX, -INT_MAX, false);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-inttostr.c b/gnulib-tests/test-inttostr.c
new file mode 100644
index 0000000..18ff4a2
--- /dev/null
+++ b/gnulib-tests/test-inttostr.c
@@ -0,0 +1,94 @@
+/* Test inttostr functions, and incidentally, INT_BUFSIZE_BOUND
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "inttostr.h"
+#include "intprops.h"
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+#define IS_TIGHT(T) (_GL_SIGNED_TYPE_OR_EXPR (T) == TYPE_SIGNED (T))
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+/* Verify that an inttostr function works as advertised.
+ Convert maximum and minimum (per-type, T) values using both snprintf --
+ with a cast to intmax_t or uintmax_t -- and FN, and compare the
+ resulting strings. Use malloc for the inttostr buffer, so that if
+ we ever exceed the usually-tight INT_BUFSIZE_BOUND, tools like
+ valgrind will detect the failure. */
+#define CK(T, Fn) \
+ do \
+ { \
+ char ref[100]; \
+ char *buf = malloc (INT_BUFSIZE_BOUND (T)); \
+ char const *p; \
+ ASSERT (buf); \
+ *buf = '\0'; \
+ ASSERT \
+ ((TYPE_SIGNED (T) \
+ ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MINIMUM (T)) \
+ : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MINIMUM (T))) \
+ < sizeof ref); \
+ ASSERT (STREQ ((p = Fn (TYPE_MINIMUM (T), buf)), ref)); \
+ /* Ensure that INT_BUFSIZE_BOUND is tight for signed types. */ \
+ ASSERT (! TYPE_SIGNED (T) || (p == buf && *p == '-')); \
+ ASSERT \
+ ((TYPE_SIGNED (T) \
+ ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MAXIMUM (T)) \
+ : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MAXIMUM (T))) \
+ < sizeof ref); \
+ ASSERT (STREQ ((p = Fn (TYPE_MAXIMUM (T), buf)), ref)); \
+ /* For unsigned types, the bound is not always tight. */ \
+ ASSERT (! IS_TIGHT (T) || TYPE_SIGNED (T) \
+ || (p == buf && ISDIGIT (*p))); \
+ free (buf); \
+ } \
+ while (0)
+
+int
+main (void)
+{
+ size_t b_size = 2;
+ char *b = malloc (b_size);
+ ASSERT (b);
+
+ /* Ideally we would rely on the snprintf-posix module, in which case
+ this guard would not be required, but due to limitations in gnulib's
+ implementation (see modules/snprintf-posix), we cannot. */
+ if (snprintf (b, b_size, "%ju", (uintmax_t) 3) == 1
+ && b[0] == '3' && b[1] == '\0')
+ {
+ CK (int, inttostr);
+ CK (unsigned int, uinttostr);
+ CK (off_t, offtostr);
+ CK (uintmax_t, umaxtostr);
+ CK (intmax_t, imaxtostr);
+ free (b);
+ return 0;
+ }
+
+ /* snprintf doesn't accept %ju; skip this test. */
+ free (b);
+ return 77;
+}
diff --git a/gnulib-tests/test-inttypes.c b/gnulib-tests/test-inttypes.c
new file mode 100644
index 0000000..9a3193c
--- /dev/null
+++ b/gnulib-tests/test-inttypes.c
@@ -0,0 +1,118 @@
+/* Test of <inttypes.h> substitute.
+ Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <inttypes.h>
+
+#include <stddef.h>
+
+/* Tests for macros supposed to be defined in inttypes.h. */
+
+const char *k = /* implicit string concatenation */
+#ifdef INT8_MAX
+ PRId8 PRIi8
+#endif
+#ifdef UINT8_MAX
+ PRIo8 PRIu8 PRIx8 PRIX8
+#endif
+#ifdef INT16_MAX
+ PRId16 PRIi16
+#endif
+#ifdef UINT16_MAX
+ PRIo16 PRIu16 PRIx16 PRIX16
+#endif
+#ifdef INT32_MAX
+ PRId32 PRIi32
+#endif
+#ifdef UINT32_MAX
+ PRIo32 PRIu32 PRIx32 PRIX32
+#endif
+#ifdef INT64_MAX
+ PRId64 PRIi64
+#endif
+#ifdef UINT64_MAX
+ PRIo64 PRIu64 PRIx64 PRIX64
+#endif
+ PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8
+ PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16
+ PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32
+ PRIdLEAST64 PRIiLEAST64
+ PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64
+ PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8
+ PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16
+ PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32
+ PRIdFAST64 PRIiFAST64
+ PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64
+ PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX
+#ifdef INTPTR_MAX
+ PRIdPTR PRIiPTR
+#endif
+#ifdef UINTPTR_MAX
+ PRIoPTR PRIuPTR PRIxPTR PRIXPTR
+#endif
+ ;
+const char *l = /* implicit string concatenation */
+#ifdef INT8_MAX
+ SCNd8 SCNi8
+#endif
+#ifdef UINT8_MAX
+ SCNo8 SCNu8 SCNx8
+#endif
+#ifdef INT16_MAX
+ SCNd16 SCNi16
+#endif
+#ifdef UINT16_MAX
+ SCNo16 SCNu16 SCNx16
+#endif
+#ifdef INT32_MAX
+ SCNd32 SCNi32
+#endif
+#ifdef UINT32_MAX
+ SCNo32 SCNu32 SCNx32
+#endif
+#ifdef INT64_MAX
+ SCNd64 SCNi64
+#endif
+#ifdef UINT64_MAX
+ SCNo64 SCNu64 SCNx64
+#endif
+ SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8
+ SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16
+ SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32
+ SCNdLEAST64 SCNiLEAST64
+ SCNoLEAST64 SCNuLEAST64 SCNxLEAST64
+ SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8
+ SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16
+ SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32
+ SCNdFAST64 SCNiFAST64
+ SCNoFAST64 SCNuFAST64 SCNxFAST64
+ SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX
+#ifdef INTPTR_MAX
+ SCNdPTR SCNiPTR
+#endif
+#ifdef UINTPTR_MAX
+ SCNoPTR SCNuPTR SCNxPTR
+#endif
+ ;
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-ioctl.c b/gnulib-tests/test-ioctl.c
new file mode 100644
index 0000000..db7ab9e
--- /dev/null
+++ b/gnulib-tests/test-ioctl.c
@@ -0,0 +1,51 @@
+/* Test of ioctl() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <sys/ioctl.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (ioctl, int, (int, int, ...));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+#ifdef FIONREAD
+ /* Test behaviour for invalid file descriptors. */
+ {
+ int value;
+ errno = 0;
+ ASSERT (ioctl (-1, FIONREAD, &value) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ int value;
+ close (99);
+ errno = 0;
+ ASSERT (ioctl (99, FIONREAD, &value) == -1);
+ ASSERT (errno == EBADF);
+ }
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-isblank.c b/gnulib-tests/test-isblank.c
new file mode 100644
index 0000000..2f6f676
--- /dev/null
+++ b/gnulib-tests/test-isblank.c
@@ -0,0 +1,50 @@
+/* Test of isblank() function.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <config.h>
+
+#include <ctype.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (isblank, int, (int));
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ unsigned int c;
+
+ /* Verify the property in the "C" locale.
+ POSIX specifies in
+ <http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html>
+ that
+ - in all locales, the blank characters include the <space> and <tab>
+ characters,
+ - in the "POSIX" locale (which is usually the same as the "C" locale),
+ the blank characters include only the ASCII <space> and <tab>
+ characters. */
+ for (c = 0; c <= UCHAR_MAX; c++)
+ ASSERT (!isblank (c) == !(c == ' ' || c == '\t'));
+ ASSERT (!isblank (EOF));
+
+ return 0;
+}
diff --git a/gnulib-tests/test-iswblank.c b/gnulib-tests/test-iswblank.c
new file mode 100644
index 0000000..175718f
--- /dev/null
+++ b/gnulib-tests/test-iswblank.c
@@ -0,0 +1,35 @@
+/* Test of iswblank() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "macros.h"
+
+/* Check that WEOF is defined. */
+wint_t e = WEOF;
+
+int
+main (void)
+{
+ /* Check that the function exist as a function or as a macro. */
+ (void) iswblank (0);
+ /* Check that the isw* functions map WEOF to 0. */
+ ASSERT (!iswblank (e));
+
+ return 0;
+}
diff --git a/gnulib-tests/test-langinfo.c b/gnulib-tests/test-langinfo.c
new file mode 100644
index 0000000..30b0007
--- /dev/null
+++ b/gnulib-tests/test-langinfo.c
@@ -0,0 +1,92 @@
+/* Test of <langinfo.h> substitute.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <config.h>
+
+#include <langinfo.h>
+
+/* Check that all the nl_item values are defined. */
+int items[] =
+ {
+ /* nl_langinfo items of the LC_CTYPE category */
+ CODESET,
+ /* nl_langinfo items of the LC_NUMERIC category */
+ RADIXCHAR,
+ THOUSEP,
+ /* nl_langinfo items of the LC_TIME category */
+ D_T_FMT,
+ D_FMT,
+ T_FMT,
+ T_FMT_AMPM,
+ AM_STR,
+ PM_STR,
+ DAY_1,
+ DAY_2,
+ DAY_3,
+ DAY_4,
+ DAY_5,
+ DAY_6,
+ DAY_7,
+ ABDAY_1,
+ ABDAY_2,
+ ABDAY_3,
+ ABDAY_4,
+ ABDAY_5,
+ ABDAY_6,
+ ABDAY_7,
+ MON_1,
+ MON_2,
+ MON_3,
+ MON_4,
+ MON_5,
+ MON_6,
+ MON_7,
+ MON_8,
+ MON_9,
+ MON_10,
+ MON_11,
+ MON_12,
+ ABMON_1,
+ ABMON_2,
+ ABMON_3,
+ ABMON_4,
+ ABMON_5,
+ ABMON_6,
+ ABMON_7,
+ ABMON_8,
+ ABMON_9,
+ ABMON_10,
+ ABMON_11,
+ ABMON_12,
+ ERA,
+ ERA_D_FMT,
+ ERA_D_T_FMT,
+ ERA_T_FMT,
+ ALT_DIGITS,
+ /* nl_langinfo items of the LC_MONETARY category */
+ CRNCYSTR,
+ /* nl_langinfo items of the LC_MESSAGES category */
+ YESEXPR,
+ NOEXPR
+ };
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-listen.c b/gnulib-tests/test-listen.c
new file mode 100644
index 0000000..4bc66fc
--- /dev/null
+++ b/gnulib-tests/test-listen.c
@@ -0,0 +1,49 @@
+/* Test listen() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (listen, int, (int, int));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+ (void) gl_sockets_startup (SOCKETS_1_1);
+
+ /* Test behaviour for invalid file descriptors. */
+ {
+ errno = 0;
+ ASSERT (listen (-1, 1) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ close (99);
+ errno = 0;
+ ASSERT (listen (99 ,1) == -1);
+ ASSERT (errno == EBADF);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-locale.c b/gnulib-tests/test-locale.c
new file mode 100644
index 0000000..c1811af
--- /dev/null
+++ b/gnulib-tests/test-locale.c
@@ -0,0 +1,80 @@
+/* Test of <locale.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <locale.h>
+
+#include "verify.h"
+
+int a[] =
+ {
+ LC_ALL,
+ LC_COLLATE,
+ LC_CTYPE,
+ LC_MESSAGES,
+ LC_MONETARY,
+ LC_NUMERIC,
+ LC_TIME
+ };
+
+/* Check that the 'struct lconv' type is defined. */
+struct lconv l;
+int ls;
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+int
+main ()
+{
+#if HAVE_NEWLOCALE
+ /* Check that the locale_t type and the LC_GLOBAL_LOCALE macro are defined. */
+ locale_t b = LC_GLOBAL_LOCALE;
+ (void) b;
+#endif
+
+ /* Check that 'struct lconv' has the ISO C and POSIX specified members. */
+ ls += sizeof (*l.decimal_point);
+ ls += sizeof (*l.thousands_sep);
+ ls += sizeof (*l.grouping);
+ ls += sizeof (*l.mon_decimal_point);
+ ls += sizeof (*l.mon_thousands_sep);
+ ls += sizeof (*l.mon_grouping);
+ ls += sizeof (*l.positive_sign);
+ ls += sizeof (*l.negative_sign);
+ ls += sizeof (*l.currency_symbol);
+ ls += sizeof (l.frac_digits);
+ ls += sizeof (l.p_cs_precedes);
+ ls += sizeof (l.p_sign_posn);
+ ls += sizeof (l.p_sep_by_space);
+ ls += sizeof (l.n_cs_precedes);
+ ls += sizeof (l.n_sign_posn);
+ ls += sizeof (l.n_sep_by_space);
+ ls += sizeof (*l.int_curr_symbol);
+ ls += sizeof (l.int_frac_digits);
+ ls += sizeof (l.int_p_cs_precedes);
+ ls += sizeof (l.int_p_sign_posn);
+ ls += sizeof (l.int_p_sep_by_space);
+ ls += sizeof (l.int_n_cs_precedes);
+ ls += sizeof (l.int_n_sign_posn);
+ ls += sizeof (l.int_n_sep_by_space);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-localeconv.c b/gnulib-tests/test-localeconv.c
new file mode 100644
index 0000000..9e83f2d
--- /dev/null
+++ b/gnulib-tests/test-localeconv.c
@@ -0,0 +1,72 @@
+/* Test of localeconv() function.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2012. */
+
+#include <config.h>
+
+#include <locale.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (localeconv, struct lconv *, (void));
+
+#include <limits.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+ /* Test localeconv() result in the "C" locale. */
+ {
+ struct lconv *l = localeconv ();
+
+ ASSERT (STREQ (l->decimal_point, "."));
+ ASSERT (STREQ (l->thousands_sep, ""));
+#if !(defined __FreeBSD__ || defined __sun)
+ ASSERT (STREQ (l->grouping, ""));
+#endif
+
+ ASSERT (STREQ (l->mon_decimal_point, ""));
+ ASSERT (STREQ (l->mon_thousands_sep, ""));
+#if !(defined __FreeBSD__ || defined __sun)
+ ASSERT (STREQ (l->mon_grouping, ""));
+#endif
+ ASSERT (STREQ (l->positive_sign, ""));
+ ASSERT (STREQ (l->negative_sign, ""));
+
+ ASSERT (STREQ (l->currency_symbol, ""));
+ ASSERT (l->frac_digits == CHAR_MAX);
+ ASSERT (l->p_cs_precedes == CHAR_MAX);
+ ASSERT (l->p_sign_posn == CHAR_MAX);
+ ASSERT (l->p_sep_by_space == CHAR_MAX);
+ ASSERT (l->n_cs_precedes == CHAR_MAX);
+ ASSERT (l->n_sign_posn == CHAR_MAX);
+ ASSERT (l->n_sep_by_space == CHAR_MAX);
+
+ ASSERT (STREQ (l->int_curr_symbol, ""));
+ ASSERT (l->int_frac_digits == CHAR_MAX);
+ ASSERT (l->int_p_cs_precedes == CHAR_MAX);
+ ASSERT (l->int_p_sign_posn == CHAR_MAX);
+ ASSERT (l->int_p_sep_by_space == CHAR_MAX);
+ ASSERT (l->int_n_cs_precedes == CHAR_MAX);
+ ASSERT (l->int_n_sign_posn == CHAR_MAX);
+ ASSERT (l->int_n_sep_by_space == CHAR_MAX);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-lstat.c b/gnulib-tests/test-lstat.c
new file mode 100644
index 0000000..86ff465
--- /dev/null
+++ b/gnulib-tests/test-lstat.c
@@ -0,0 +1,60 @@
+/* Test of lstat() function.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson, 2008; and Eric Blake, 2009. */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+/* Caution: lstat may be a function-like macro. Although this
+ signature check must pass, it may be the signature of the real (and
+ broken) lstat rather than rpl_lstat. Most code should not use the
+ address of lstat. */
+#include "signature.h"
+SIGNATURE_CHECK (lstat, int, (char const *, struct stat *));
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "same-inode.h"
+#include "ignore-value.h"
+#include "macros.h"
+
+#define BASE "test-lstat.t"
+
+#include "test-lstat.h"
+
+/* Wrapper around lstat, which works even if lstat is a function-like
+ macro, where test_lstat_func(lstat) would do the wrong thing. */
+static int
+do_lstat (char const *name, struct stat *st)
+{
+ return lstat (name, st);
+}
+
+int
+main (void)
+{
+ /* Remove any leftovers from a previous partial run. */
+ ignore_value (system ("rm -rf " BASE "*"));
+
+ return test_lstat_func (do_lstat, true);
+}
diff --git a/gnulib-tests/test-lstat.h b/gnulib-tests/test-lstat.h
new file mode 100644
index 0000000..4eb9036
--- /dev/null
+++ b/gnulib-tests/test-lstat.h
@@ -0,0 +1,116 @@
+/* Test of lstat() function.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson, 2008; and Eric Blake, 2009. */
+
+/* This file is designed to test both lstat(n,buf) and
+ fstatat(AT_FDCWD,n,buf,AT_SYMLINK_NOFOLLOW). FUNC is the function
+ to test. Assumes that BASE and ASSERT are already defined, and
+ that appropriate headers are already included. If PRINT, warn
+ before skipping symlink tests with status 77. */
+
+static int
+test_lstat_func (int (*func) (char const *, struct stat *), bool print)
+{
+ struct stat st1;
+ struct stat st2;
+
+ /* Test for common directories. */
+ ASSERT (func (".", &st1) == 0);
+ ASSERT (func ("./", &st2) == 0);
+ ASSERT (SAME_INODE (st1, st2));
+ ASSERT (S_ISDIR (st1.st_mode));
+ ASSERT (S_ISDIR (st2.st_mode));
+ ASSERT (func ("/", &st1) == 0);
+ ASSERT (func ("///", &st2) == 0);
+ ASSERT (SAME_INODE (st1, st2));
+ ASSERT (S_ISDIR (st1.st_mode));
+ ASSERT (S_ISDIR (st2.st_mode));
+ ASSERT (func ("..", &st1) == 0);
+ ASSERT (S_ISDIR (st1.st_mode));
+
+ /* Test for error conditions. */
+ errno = 0;
+ ASSERT (func ("", &st1) == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("nosuch", &st1) == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("nosuch/", &st1) == -1);
+ ASSERT (errno == ENOENT);
+
+ ASSERT (close (creat (BASE "file", 0600)) == 0);
+ ASSERT (func (BASE "file", &st1) == 0);
+ ASSERT (S_ISREG (st1.st_mode));
+ errno = 0;
+ ASSERT (func (BASE "file/", &st1) == -1);
+ ASSERT (errno == ENOTDIR);
+
+ /* Now for some symlink tests, where supported. We set up:
+ link1 -> directory
+ link2 -> file
+ link3 -> dangling
+ link4 -> loop
+ then test behavior both with and without trailing slash.
+ */
+ if (symlink (".", BASE "link1") != 0)
+ {
+ ASSERT (unlink (BASE "file") == 0);
+ if (print)
+ fputs ("skipping test: symlinks not supported on this file system\n",
+ stderr);
+ return 77;
+ }
+ ASSERT (symlink (BASE "file", BASE "link2") == 0);
+ ASSERT (symlink (BASE "nosuch", BASE "link3") == 0);
+ ASSERT (symlink (BASE "link4", BASE "link4") == 0);
+
+ ASSERT (func (BASE "link1", &st1) == 0);
+ ASSERT (S_ISLNK (st1.st_mode));
+ ASSERT (func (BASE "link1/", &st1) == 0);
+ ASSERT (stat (BASE "link1", &st2) == 0);
+ ASSERT (S_ISDIR (st1.st_mode));
+ ASSERT (S_ISDIR (st2.st_mode));
+ ASSERT (SAME_INODE (st1, st2));
+
+ ASSERT (func (BASE "link2", &st1) == 0);
+ ASSERT (S_ISLNK (st1.st_mode));
+ errno = 0;
+ ASSERT (func (BASE "link2/", &st1) == -1);
+ ASSERT (errno == ENOTDIR);
+
+ ASSERT (func (BASE "link3", &st1) == 0);
+ ASSERT (S_ISLNK (st1.st_mode));
+ errno = 0;
+ ASSERT (func (BASE "link3/", &st1) == -1);
+ ASSERT (errno == ENOENT);
+
+ ASSERT (func (BASE "link4", &st1) == 0);
+ ASSERT (S_ISLNK (st1.st_mode));
+ errno = 0;
+ ASSERT (func (BASE "link4/", &st1) == -1);
+ ASSERT (errno == ELOOP);
+
+ /* Cleanup. */
+ ASSERT (unlink (BASE "file") == 0);
+ ASSERT (unlink (BASE "link1") == 0);
+ ASSERT (unlink (BASE "link2") == 0);
+ ASSERT (unlink (BASE "link3") == 0);
+ ASSERT (unlink (BASE "link4") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-malloca.c b/gnulib-tests/test-malloca.c
new file mode 100644
index 0000000..e9ab83d
--- /dev/null
+++ b/gnulib-tests/test-malloca.c
@@ -0,0 +1,62 @@
+/* Test of safe automatic memory allocation.
+ Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
+
+#include <config.h>
+
+#include "malloca.h"
+
+#include <stdlib.h>
+
+static void
+do_allocation (int n)
+{
+ void *ptr = malloca (n);
+ freea (ptr);
+ safe_alloca (n);
+}
+
+void (*func) (int) = do_allocation;
+
+int
+main ()
+{
+ int i;
+
+ /* This slows down malloc a lot. */
+ unsetenv ("MALLOC_PERTURB_");
+
+ /* Repeat a lot of times, to make sure there's no memory leak. */
+ for (i = 0; i < 50000; i++)
+ {
+ /* Try various values.
+ n = 0 gave a crash on Alpha with gcc-2.5.8.
+ Some versions of Mac OS X have a stack size limit of 512 KB. */
+ func (34);
+ func (134);
+ func (399);
+ func (510823);
+ func (129321);
+ func (0);
+ func (4070);
+ func (4095);
+ func (1);
+ func (16582);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-mbrtowc-w32-1.sh b/gnulib-tests/test-mbrtowc-w32-1.sh
new file mode 100755
index 0000000..3f12e44
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc-w32-1.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP1252 locale.
+./test-mbrtowc-w32${EXEEXT} French_France 1252
diff --git a/gnulib-tests/test-mbrtowc-w32-2.sh b/gnulib-tests/test-mbrtowc-w32-2.sh
new file mode 100755
index 0000000..9e1a765
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc-w32-2.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP1256 locale.
+./test-mbrtowc-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
diff --git a/gnulib-tests/test-mbrtowc-w32-3.sh b/gnulib-tests/test-mbrtowc-w32-3.sh
new file mode 100755
index 0000000..782c2d0
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc-w32-3.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP932 locale.
+./test-mbrtowc-w32${EXEEXT} Japanese_Japan 932
diff --git a/gnulib-tests/test-mbrtowc-w32-4.sh b/gnulib-tests/test-mbrtowc-w32-4.sh
new file mode 100755
index 0000000..0630f30
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc-w32-4.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP950 locale.
+./test-mbrtowc-w32${EXEEXT} Chinese_Taiwan 950
diff --git a/gnulib-tests/test-mbrtowc-w32-5.sh b/gnulib-tests/test-mbrtowc-w32-5.sh
new file mode 100755
index 0000000..7d7faa9
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc-w32-5.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP936 locale.
+./test-mbrtowc-w32${EXEEXT} Chinese_China 936
diff --git a/gnulib-tests/test-mbrtowc-w32.c b/gnulib-tests/test-mbrtowc-w32.c
new file mode 100644
index 0000000..f637330
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc-w32.c
@@ -0,0 +1,735 @@
+/* Test of conversion of multibyte character to wide character.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include <errno.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+
+static int
+test_one_locale (const char *name, int codepage)
+{
+ mbstate_t state;
+ wchar_t wc;
+ size_t ret;
+
+# if 1
+ /* Portable code to set the locale. */
+ {
+ char name_with_codepage[1024];
+
+ sprintf (name_with_codepage, "%s.%d", name, codepage);
+
+ /* Set the locale. */
+ if (setlocale (LC_ALL, name_with_codepage) == NULL)
+ return 77;
+ }
+# else
+ /* Hacky way to set a locale.codepage combination that setlocale() refuses
+ to set. */
+ {
+ /* Codepage of the current locale, set with setlocale().
+ Not necessarily the same as GetACP(). */
+ extern __declspec(dllimport) unsigned int __lc_codepage;
+
+ /* Set the locale. */
+ if (setlocale (LC_ALL, name) == NULL)
+ return 77;
+
+ /* Clobber the codepage and MB_CUR_MAX, both set by setlocale(). */
+ __lc_codepage = codepage;
+ switch (codepage)
+ {
+ case 1252:
+ case 1256:
+ MB_CUR_MAX = 1;
+ break;
+ case 932:
+ case 950:
+ case 936:
+ MB_CUR_MAX = 2;
+ break;
+ case 54936:
+ case 65001:
+ MB_CUR_MAX = 4;
+ break;
+ }
+
+ /* Test whether the codepage is really available. */
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, " ", 1, &state) == (size_t)(-1))
+ return 77;
+ }
+# endif
+
+ /* Test zero-length input. */
+ {
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "x", 0, &state);
+ /* gnulib's implementation returns (size_t)(-2).
+ The AIX 5.1 implementation returns (size_t)(-1).
+ glibc's implementation returns 0. */
+ ASSERT (ret == (size_t)(-2) || ret == (size_t)(-1) || ret == 0);
+ ASSERT (mbsinit (&state));
+ }
+
+ /* Test NUL byte input. */
+ {
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "", 1, &state);
+ ASSERT (ret == 0);
+ ASSERT (wc == 0);
+ ASSERT (mbsinit (&state));
+ ret = mbrtowc (NULL, "", 1, &state);
+ ASSERT (ret == 0);
+ ASSERT (mbsinit (&state));
+ }
+
+ /* Test single-byte input. */
+ {
+ int c;
+ char buf[1];
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ for (c = 0; c < 0x100; c++)
+ switch (c)
+ {
+ case '\t': case '\v': case '\f':
+ case ' ': case '!': case '"': case '#': case '%':
+ case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>':
+ case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y':
+ case 'Z':
+ case '[': case '\\': case ']': case '^': case '_':
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}': case '~':
+ /* c is in the ISO C "basic character set". */
+ buf[0] = c;
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, buf, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == c);
+ ASSERT (mbsinit (&state));
+ ret = mbrtowc (NULL, buf, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (mbsinit (&state));
+ break;
+ }
+ }
+
+ /* Test special calling convention, passing a NULL pointer. */
+ {
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, NULL, 5, &state);
+ ASSERT (ret == 0);
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+ }
+
+ switch (codepage)
+ {
+ case 1252:
+ /* Locale encoding is CP1252, an extension of ISO-8859-1. */
+ {
+ char input[] = "B\374\337er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\374');
+ ASSERT (wc == 0x00FC);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 2, 3, &state);
+ ASSERT (ret == 1);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 3, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\337');
+ ASSERT (wc == 0x00DF);
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'e');
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'r');
+ ASSERT (mbsinit (&state));
+ }
+ return 0;
+
+ case 1256:
+ /* Locale encoding is CP1256, not the same as ISO-8859-6. */
+ {
+ char input[] = "x\302\341\346y"; /* "xآلوy" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'x');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\302');
+ ASSERT (wc == 0x0622);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 2, 3, &state);
+ ASSERT (ret == 1);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 3, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\341');
+ ASSERT (wc == 0x0644);
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\346');
+ ASSERT (wc == 0x0648);
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'y');
+ ASSERT (mbsinit (&state));
+ }
+ return 0;
+
+ case 932:
+ /* Locale encoding is CP932, similar to Shift_JIS. */
+ {
+ char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '<');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 2, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x65E5);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 4, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x672C);
+ ASSERT (mbsinit (&state));
+ input[4] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x8A9E);
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+ input[6] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 7, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '>');
+ ASSERT (mbsinit (&state));
+
+ /* Test some invalid input. */
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+ }
+ return 0;
+
+ case 950:
+ /* Locale encoding is CP950, similar to Big5. */
+ {
+ char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '<');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 2, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x65E5);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 4, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x672C);
+ ASSERT (mbsinit (&state));
+ input[4] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x8A9E);
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+ input[6] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 7, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '>');
+ ASSERT (mbsinit (&state));
+
+ /* Test some invalid input. */
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+ }
+ return 0;
+
+ case 936:
+ /* Locale encoding is CP936 = GBK, an extension of GB2312. */
+ {
+ char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '<');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 2, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x65E5);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 4, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x672C);
+ ASSERT (mbsinit (&state));
+ input[4] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x8A9E);
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+ input[6] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 7, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '>');
+ ASSERT (mbsinit (&state));
+
+ /* Test some invalid input. */
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+ }
+ return 0;
+
+ case 54936:
+ /* Locale encoding is CP54936 = GB18030. */
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[1] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 7, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x00FC);
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 3, 6, &state);
+ ASSERT (ret == 4);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 6, &state);
+ ASSERT (ret == 4);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x00DF);
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+ input[4] = '\0';
+ input[5] = '\0';
+ input[6] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 7, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'e');
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 8, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'r');
+ ASSERT (mbsinit (&state));
+
+ /* Test some invalid input. */
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\201\045", 2, &state); /* 0x81 0x25 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\201\060\377", 3, &state); /* 0x81 0x30 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\201\060\377\064", 4, &state); /* 0x81 0x30 0xFF 0x34 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\201\060\211\072", 4, &state); /* 0x81 0x30 0x89 0x3A */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+ }
+ return 0;
+
+ case 65001:
+ /* Locale encoding is CP65001 = UTF-8. */
+ {
+ char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[1] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 5, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x00FC);
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 3, 4, &state);
+ ASSERT (ret == 2);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 4, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (wc == 0x00DF);
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+ input[4] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 5, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'e');
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 6, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'r');
+ ASSERT (mbsinit (&state));
+
+ /* Test some invalid input. */
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\303\300", 2, &state); /* 0xC3 0xC0 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\343\300", 2, &state); /* 0xE3 0xC0 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\343\300\200", 3, &state); /* 0xE3 0xC0 0x80 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\343\200\300", 3, &state); /* 0xE3 0x80 0xC0 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\363\300", 2, &state); /* 0xF3 0xC0 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\363\300\200\200", 4, &state); /* 0xF3 0xC0 0x80 0x80 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\363\200\300", 3, &state); /* 0xF3 0x80 0xC0 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\363\200\300\200", 4, &state); /* 0xF3 0x80 0xC0 0x80 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "\363\200\200\300", 4, &state); /* 0xF3 0x80 0x80 0xC0 */
+ ASSERT (ret == (size_t)-1);
+ ASSERT (errno == EILSEQ);
+ }
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ int codepage = atoi (argv[argc - 1]);
+ int result;
+ int i;
+
+ result = 77;
+ for (i = 1; i < argc - 1; i++)
+ {
+ int ret = test_one_locale (argv[i], codepage);
+
+ if (ret != 77)
+ result = ret;
+ }
+
+ if (result == 77)
+ {
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ }
+ return result;
+}
+
+#else
+
+int
+main (int argc, char *argv[])
+{
+ fputs ("Skipping test: not a native Windows system\n", stderr);
+ return 77;
+}
+
+#endif
diff --git a/gnulib-tests/test-mbrtowc.c b/gnulib-tests/test-mbrtowc.c
new file mode 100644
index 0000000..f7fed6a
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc.c
@@ -0,0 +1,349 @@
+/* Test of conversion of multibyte character to wide character.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (mbrtowc, size_t, (wchar_t *, char const *, size_t,
+ mbstate_t *));
+
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ mbstate_t state;
+ wchar_t wc;
+ size_t ret;
+
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ /* Test zero-length input. */
+ {
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "x", 0, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (mbsinit (&state));
+ }
+
+ /* Test NUL byte input. */
+ {
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, "", 1, &state);
+ ASSERT (ret == 0);
+ ASSERT (wc == 0);
+ ASSERT (mbsinit (&state));
+ ret = mbrtowc (NULL, "", 1, &state);
+ ASSERT (ret == 0);
+ ASSERT (mbsinit (&state));
+ }
+
+ /* Test single-byte input. */
+ {
+ int c;
+ char buf[1];
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ for (c = 0; c < 0x100; c++)
+ switch (c)
+ {
+ default:
+ if (! (c && 1 < argc && argv[1][0] == '5'))
+ break;
+ /* Fall through. */
+ case '\t': case '\v': case '\f':
+ case ' ': case '!': case '"': case '#': case '%':
+ case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>':
+ case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y':
+ case 'Z':
+ case '[': case '\\': case ']': case '^': case '_':
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}': case '~':
+ /* c is in the ISO C "basic character set", or argv[1] starts
+ with '5' so we are testing all nonnull bytes. */
+ buf[0] = c;
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, buf, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == c);
+ ASSERT (mbsinit (&state));
+ ret = mbrtowc (NULL, buf, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (mbsinit (&state));
+ break;
+ }
+ }
+
+ /* Test special calling convention, passing a NULL pointer. */
+ {
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, NULL, 5, &state);
+ ASSERT (ret == 0);
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+ }
+
+ if (argc > 1)
+ switch (argv[1][0])
+ {
+ case '1':
+ /* Locale encoding is ISO-8859-1 or ISO-8859-15. */
+ {
+ char input[] = "B\374\337er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\374');
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 2, 3, &state);
+ ASSERT (ret == 1);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 3, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\337');
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'e');
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'r');
+ ASSERT (mbsinit (&state));
+ }
+ return 0;
+
+ case '2':
+ /* Locale encoding is UTF-8. */
+ {
+ char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[1] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 5, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 3, 4, &state);
+ ASSERT (ret == 2);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 4, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+ input[4] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 5, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'e');
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 6, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'r');
+ ASSERT (mbsinit (&state));
+ }
+ return 0;
+
+ case '3':
+ /* Locale encoding is EUC-JP. */
+ {
+ char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '<');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 2, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[3] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 4, 4, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[4] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 5, 3, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+ input[6] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 7, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '>');
+ ASSERT (mbsinit (&state));
+ }
+ return 0;
+
+ case '4':
+ /* Locale encoding is GB18030. */
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[1] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 2, 7, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[2] = '\0';
+
+ /* Test support of NULL first argument. */
+ ret = mbrtowc (NULL, input + 3, 6, &state);
+ ASSERT (ret == 4);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 6, &state);
+ ASSERT (ret == 4);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[3] = '\0';
+ input[4] = '\0';
+ input[5] = '\0';
+ input[6] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 7, 2, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'e');
+ ASSERT (mbsinit (&state));
+ input[5] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 8, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'r');
+ ASSERT (mbsinit (&state));
+ }
+ return 0;
+
+ case '5':
+ /* C locale; tested above. */
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/gnulib-tests/test-mbrtowc1.sh b/gnulib-tests/test-mbrtowc1.sh
new file mode 100755
index 0000000..3becba3
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc1.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional french locale is installed"
+ else
+ echo "Skipping test: no traditional french locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+./test-mbrtowc${EXEEXT} 1
diff --git a/gnulib-tests/test-mbrtowc2.sh b/gnulib-tests/test-mbrtowc2.sh
new file mode 100755
index 0000000..0405aba
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc2.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no french Unicode locale is installed"
+ else
+ echo "Skipping test: no french Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+./test-mbrtowc${EXEEXT} 2
diff --git a/gnulib-tests/test-mbrtowc3.sh b/gnulib-tests/test-mbrtowc3.sh
new file mode 100755
index 0000000..63a89a2
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc3.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific EUC-JP locale is installed.
+: ${LOCALE_JA=ja_JP}
+if test $LOCALE_JA = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional japanese locale is installed"
+ else
+ echo "Skipping test: no traditional japanese locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_JA \
+./test-mbrtowc${EXEEXT} 3
diff --git a/gnulib-tests/test-mbrtowc4.sh b/gnulib-tests/test-mbrtowc4.sh
new file mode 100755
index 0000000..b299a2c
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc4.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no transitional chinese locale is installed"
+ else
+ echo "Skipping test: no transitional chinese locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_ZH_CN \
+./test-mbrtowc${EXEEXT} 4
diff --git a/gnulib-tests/test-mbrtowc5.sh b/gnulib-tests/test-mbrtowc5.sh
new file mode 100755
index 0000000..c10b228
--- /dev/null
+++ b/gnulib-tests/test-mbrtowc5.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Test whether the POSIX locale has encoding errors.
+LC_ALL=C \
+./test-mbrtowc${EXEEXT} 5 || exit
+LC_ALL=POSIX \
+./test-mbrtowc${EXEEXT} 5
diff --git a/gnulib-tests/test-mbscasecmp.c b/gnulib-tests/test-mbscasecmp.c
new file mode 100644
index 0000000..76b6772
--- /dev/null
+++ b/gnulib-tests/test-mbscasecmp.c
@@ -0,0 +1,55 @@
+/* Test of case-insensitive string comparison function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ ASSERT (mbscasecmp ("paragraph", "Paragraph") == 0);
+
+ ASSERT (mbscasecmp ("paragrapH", "parAgRaph") == 0);
+
+ ASSERT (mbscasecmp ("paragraph", "paraLyzed") < 0);
+ ASSERT (mbscasecmp ("paraLyzed", "paragraph") > 0);
+
+ ASSERT (mbscasecmp ("para", "paragraph") < 0);
+ ASSERT (mbscasecmp ("paragraph", "para") > 0);
+
+ /* The following tests shows how mbscasecmp() is different from
+ strcasecmp(). */
+
+ ASSERT (mbscasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R") == 0); /* özgür */
+ ASSERT (mbscasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r") == 0); /* özgür */
+
+ /* This test shows how strings of different size can compare equal. */
+ ASSERT (mbscasecmp ("turkish", "TURK\304\260SH") == 0);
+ ASSERT (mbscasecmp ("TURK\304\260SH", "turkish") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-mbscasecmp.sh b/gnulib-tests/test-mbscasecmp.sh
new file mode 100755
index 0000000..1ec7d5e
--- /dev/null
+++ b/gnulib-tests/test-mbscasecmp.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific Turkish locale is installed.
+: ${LOCALE_TR_UTF8=tr_TR.UTF-8}
+if test $LOCALE_TR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no turkish Unicode locale is installed"
+ else
+ echo "Skipping test: no turkish Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_TR_UTF8 \
+./test-mbscasecmp${EXEEXT}
diff --git a/gnulib-tests/test-mbsinit.c b/gnulib-tests/test-mbsinit.c
new file mode 100644
index 0000000..8cd1c4d
--- /dev/null
+++ b/gnulib-tests/test-mbsinit.c
@@ -0,0 +1,55 @@
+/* Test of test for initial conversion state.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (mbsinit, int, (const mbstate_t *));
+
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ static mbstate_t state;
+
+ ASSERT (mbsinit (NULL));
+
+ ASSERT (mbsinit (&state));
+
+ if (argc > 1)
+ {
+ static const char input[1] = "\303";
+ wchar_t wc;
+ size_t ret;
+
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (!mbsinit (&state));
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-mbsinit.sh b/gnulib-tests/test-mbsinit.sh
new file mode 100755
index 0000000..bbda48d
--- /dev/null
+++ b/gnulib-tests/test-mbsinit.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no french Unicode locale is installed"
+ else
+ echo "Skipping test: no french Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+./test-mbsinit${EXEEXT}
diff --git a/gnulib-tests/test-mbsrtowcs.c b/gnulib-tests/test-mbsrtowcs.c
new file mode 100644
index 0000000..aef88a3
--- /dev/null
+++ b/gnulib-tests/test-mbsrtowcs.c
@@ -0,0 +1,293 @@
+/* Test of conversion of string to wide string.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (mbsrtowcs, size_t, (wchar_t *, char const **, size_t,
+ mbstate_t *));
+
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ mbstate_t state;
+ wchar_t wc;
+ size_t ret;
+
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ /* Test NUL byte input. */
+ {
+ const char *src;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ src = "";
+ ret = mbsrtowcs (NULL, &src, 0, &state);
+ ASSERT (ret == 0);
+ ASSERT (mbsinit (&state));
+
+ src = "";
+ ret = mbsrtowcs (NULL, &src, 1, &state);
+ ASSERT (ret == 0);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ src = "";
+ ret = mbsrtowcs (&wc, &src, 0, &state);
+ ASSERT (ret == 0);
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+
+ wc = (wchar_t) 0xBADFACE;
+ src = "";
+ ret = mbsrtowcs (&wc, &src, 1, &state);
+ ASSERT (ret == 0);
+ ASSERT (wc == 0);
+ ASSERT (mbsinit (&state));
+ }
+
+ if (argc > 1)
+ {
+ int unlimited;
+
+ for (unlimited = 0; unlimited < 2; unlimited++)
+ {
+ #define BUFSIZE 10
+ wchar_t buf[BUFSIZE];
+ const char *src;
+ mbstate_t temp_state;
+
+ {
+ size_t i;
+ for (i = 0; i < BUFSIZE; i++)
+ buf[i] = (wchar_t) 0xBADFACE;
+ }
+
+ switch (argv[1][0])
+ {
+ case '1':
+ /* Locale encoding is ISO-8859-1 or ISO-8859-15. */
+ {
+ char input[] = "B\374\337er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wctob (wc) == (unsigned char) '\374');
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+
+ src = input + 2;
+ temp_state = state;
+ ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 1, &temp_state);
+ ASSERT (ret == 3);
+ ASSERT (src == input + 2);
+ ASSERT (mbsinit (&state));
+
+ src = input + 2;
+ ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 1, &state);
+ ASSERT (ret == (unlimited ? 3 : 1));
+ ASSERT (src == (unlimited ? NULL : input + 3));
+ ASSERT (wctob (buf[0]) == (unsigned char) '\337');
+ if (unlimited)
+ {
+ ASSERT (buf[1] == 'e');
+ ASSERT (buf[2] == 'r');
+ ASSERT (buf[3] == 0);
+ ASSERT (buf[4] == (wchar_t) 0xBADFACE);
+ }
+ else
+ ASSERT (buf[1] == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+ }
+ break;
+
+ case '2':
+ /* Locale encoding is UTF-8. */
+ {
+ char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[1] = '\0';
+
+ src = input + 2;
+ temp_state = state;
+ ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 2, &temp_state);
+ ASSERT (ret == 4);
+ ASSERT (src == input + 2);
+ ASSERT (!mbsinit (&state));
+
+ src = input + 2;
+ ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 2, &state);
+ ASSERT (ret == (unlimited ? 4 : 2));
+ ASSERT (src == (unlimited ? NULL : input + 5));
+ ASSERT (wctob (buf[0]) == EOF);
+ ASSERT (wctob (buf[1]) == EOF);
+ if (unlimited)
+ {
+ ASSERT (buf[2] == 'e');
+ ASSERT (buf[3] == 'r');
+ ASSERT (buf[4] == 0);
+ ASSERT (buf[5] == (wchar_t) 0xBADFACE);
+ }
+ else
+ ASSERT (buf[2] == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+ }
+ break;
+
+ case '3':
+ /* Locale encoding is EUC-JP. */
+ {
+ char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == '<');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 2, &state);
+ ASSERT (ret == 2);
+ ASSERT (wctob (wc) == EOF);
+ ASSERT (mbsinit (&state));
+ input[1] = '\0';
+ input[2] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 3, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[3] = '\0';
+
+ src = input + 4;
+ temp_state = state;
+ ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 2, &temp_state);
+ ASSERT (ret == 3);
+ ASSERT (src == input + 4);
+ ASSERT (!mbsinit (&state));
+
+ src = input + 4;
+ ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 2, &state);
+ ASSERT (ret == (unlimited ? 3 : 2));
+ ASSERT (src == (unlimited ? NULL : input + 7));
+ ASSERT (wctob (buf[0]) == EOF);
+ ASSERT (wctob (buf[1]) == EOF);
+ if (unlimited)
+ {
+ ASSERT (buf[2] == '>');
+ ASSERT (buf[3] == 0);
+ ASSERT (buf[4] == (wchar_t) 0xBADFACE);
+ }
+ else
+ ASSERT (buf[2] == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+ }
+ break;
+
+ case '4':
+ /* Locale encoding is GB18030. */
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ memset (&state, '\0', sizeof (mbstate_t));
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 1, &state);
+ ASSERT (ret == 1);
+ ASSERT (wc == 'B');
+ ASSERT (mbsinit (&state));
+ input[0] = '\0';
+
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input + 1, 1, &state);
+ ASSERT (ret == (size_t)(-2));
+ ASSERT (wc == (wchar_t) 0xBADFACE);
+ ASSERT (!mbsinit (&state));
+ input[1] = '\0';
+
+ src = input + 2;
+ temp_state = state;
+ ret = mbsrtowcs (NULL, &src, unlimited ? BUFSIZE : 2, &temp_state);
+ ASSERT (ret == 4);
+ ASSERT (src == input + 2);
+ ASSERT (!mbsinit (&state));
+
+ src = input + 2;
+ ret = mbsrtowcs (buf, &src, unlimited ? BUFSIZE : 2, &state);
+ ASSERT (ret == (unlimited ? 4 : 2));
+ ASSERT (src == (unlimited ? NULL : input + 7));
+ ASSERT (wctob (buf[0]) == EOF);
+ ASSERT (wctob (buf[1]) == EOF);
+ if (unlimited)
+ {
+ ASSERT (buf[2] == 'e');
+ ASSERT (buf[3] == 'r');
+ ASSERT (buf[4] == 0);
+ ASSERT (buf[5] == (wchar_t) 0xBADFACE);
+ }
+ else
+ ASSERT (buf[2] == (wchar_t) 0xBADFACE);
+ ASSERT (mbsinit (&state));
+ }
+ break;
+
+ default:
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/gnulib-tests/test-mbsrtowcs1.sh b/gnulib-tests/test-mbsrtowcs1.sh
new file mode 100755
index 0000000..01916e7
--- /dev/null
+++ b/gnulib-tests/test-mbsrtowcs1.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional french locale is installed"
+ else
+ echo "Skipping test: no traditional french locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+./test-mbsrtowcs${EXEEXT} 1
diff --git a/gnulib-tests/test-mbsrtowcs2.sh b/gnulib-tests/test-mbsrtowcs2.sh
new file mode 100755
index 0000000..f72ceb6
--- /dev/null
+++ b/gnulib-tests/test-mbsrtowcs2.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no french Unicode locale is installed"
+ else
+ echo "Skipping test: no french Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+./test-mbsrtowcs${EXEEXT} 2
diff --git a/gnulib-tests/test-mbsrtowcs3.sh b/gnulib-tests/test-mbsrtowcs3.sh
new file mode 100755
index 0000000..b3c01d4
--- /dev/null
+++ b/gnulib-tests/test-mbsrtowcs3.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific EUC-JP locale is installed.
+: ${LOCALE_JA=ja_JP}
+if test $LOCALE_JA = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional japanese locale is installed"
+ else
+ echo "Skipping test: no traditional japanese locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_JA \
+./test-mbsrtowcs${EXEEXT} 3
diff --git a/gnulib-tests/test-mbsrtowcs4.sh b/gnulib-tests/test-mbsrtowcs4.sh
new file mode 100755
index 0000000..226d6ff
--- /dev/null
+++ b/gnulib-tests/test-mbsrtowcs4.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no transitional chinese locale is installed"
+ else
+ echo "Skipping test: no transitional chinese locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_ZH_CN \
+./test-mbsrtowcs${EXEEXT} 4
diff --git a/gnulib-tests/test-mbsstr1.c b/gnulib-tests/test-mbsstr1.c
new file mode 100644
index 0000000..8b1ac0a
--- /dev/null
+++ b/gnulib-tests/test-mbsstr1.c
@@ -0,0 +1,128 @@
+/* Test of searching in a string.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <stdlib.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+ /* This test is executed in the C locale. */
+
+ {
+ const char input[] = "foo";
+ const char *result = mbsstr (input, "");
+ ASSERT (result == input);
+ }
+
+ {
+ const char input[] = "foo";
+ const char *result = mbsstr (input, "o");
+ ASSERT (result == input + 1);
+ }
+
+ {
+ const char input[] = "ABC ABCDAB ABCDABCDABDE";
+ const char *result = mbsstr (input, "ABCDABD");
+ ASSERT (result == input + 15);
+ }
+
+ {
+ const char input[] = "ABC ABCDAB ABCDABCDABDE";
+ const char *result = mbsstr (input, "ABCDABE");
+ ASSERT (result == NULL);
+ }
+
+ /* Check that a very long haystack is handled quickly if the needle is
+ short and occurs near the beginning. */
+ {
+ size_t repeat = 10000;
+ size_t m = 1000000;
+ const char *needle =
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
+ char *haystack = (char *) malloc (m + 1);
+ if (haystack != NULL)
+ {
+ memset (haystack, 'A', m);
+ haystack[0] = 'B';
+ haystack[m] = '\0';
+
+ for (; repeat > 0; repeat--)
+ {
+ ASSERT (mbsstr (haystack, needle) == haystack + 1);
+ }
+
+ free (haystack);
+ }
+ }
+
+ /* Check that a very long needle is discarded quickly if the haystack is
+ short. */
+ {
+ size_t repeat = 10000;
+ size_t m = 1000000;
+ const char *haystack =
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
+ char *needle = (char *) malloc (m + 1);
+ if (needle != NULL)
+ {
+ memset (needle, 'A', m);
+ needle[m] = '\0';
+
+ for (; repeat > 0; repeat--)
+ {
+ ASSERT (mbsstr (haystack, needle) == NULL);
+ }
+
+ free (needle);
+ }
+ }
+
+ /* Check that the asymptotic worst-case complexity is not quadratic. */
+ {
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 2);
+ char *needle = (char *) malloc (m + 2);
+ if (haystack != NULL && needle != NULL)
+ {
+ const char *result;
+
+ 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';
+
+ result = mbsstr (haystack, needle);
+ ASSERT (result == haystack + m);
+ }
+ free (needle);
+ free (haystack);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-mbsstr2.c b/gnulib-tests/test-mbsstr2.c
new file mode 100644
index 0000000..919e47c
--- /dev/null
+++ b/gnulib-tests/test-mbsstr2.c
@@ -0,0 +1,141 @@
+/* Test of searching in a string.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <locale.h>
+#include <stdlib.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ {
+ const char input[] = "f\303\266\303\266";
+ const char *result = mbsstr (input, "");
+ ASSERT (result == input);
+ }
+
+ {
+ const char input[] = "f\303\266\303\266";
+ const char *result = mbsstr (input, "\303\266");
+ ASSERT (result == input + 1);
+ }
+
+ {
+ const char input[] = "f\303\266\303\266";
+ const char *result = mbsstr (input, "\266\303");
+ ASSERT (result == NULL);
+ }
+
+ {
+ const char input[] = "\303\204BC \303\204BCD\303\204B \303\204BCD\303\204BCD\303\204BDE"; /* "ÄBC ÄBCDÄB ÄBCDÄBCDÄBDE" */
+ const char *result = mbsstr (input, "\303\204BCD\303\204BD"); /* "ÄBCDÄBD" */
+ ASSERT (result == input + 19);
+ }
+
+ {
+ const char input[] = "\303\204BC \303\204BCD\303\204B \303\204BCD\303\204BCD\303\204BDE"; /* "ÄBC ÄBCDÄB ÄBCDÄBCDÄBDE" */
+ const char *result = mbsstr (input, "\303\204BCD\303\204BE"); /* "ÄBCDÄBE" */
+ ASSERT (result == NULL);
+ }
+
+ /* Check that a very long haystack is handled quickly if the needle is
+ short and occurs near the beginning. */
+ {
+ size_t repeat = 10000;
+ size_t m = 1000000;
+ const char *needle =
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
+ char *haystack = (char *) malloc (m + 1);
+ if (haystack != NULL)
+ {
+ memset (haystack, 'A', m);
+ haystack[0] = '\303'; haystack[1] = '\204';
+ haystack[m] = '\0';
+
+ for (; repeat > 0; repeat--)
+ {
+ ASSERT (mbsstr (haystack, needle) == haystack + 2);
+ }
+
+ free (haystack);
+ }
+ }
+
+ /* Check that a very long needle is discarded quickly if the haystack is
+ short. */
+ {
+ size_t repeat = 10000;
+ size_t m = 1000000;
+ const char *haystack =
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+ "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+ "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+ "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+ "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207";
+ char *needle = (char *) malloc (m + 1);
+ if (needle != NULL)
+ {
+ memset (needle, 'A', m);
+ needle[m] = '\0';
+
+ for (; repeat > 0; repeat--)
+ {
+ ASSERT (mbsstr (haystack, needle) == NULL);
+ }
+
+ free (needle);
+ }
+ }
+
+ /* Check that the asymptotic worst-case complexity is not quadratic. */
+ {
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 3);
+ char *needle = (char *) malloc (m + 3);
+ if (haystack != NULL && needle != NULL)
+ {
+ const char *result;
+
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = '\303'; haystack[2 * m + 1] = '\207';
+ haystack[2 * m + 2] = '\0';
+
+ memset (needle, 'A', m);
+ needle[m] = '\303'; needle[m + 1] = '\207';
+ needle[m + 2] = '\0';
+
+ result = mbsstr (haystack, needle);
+ ASSERT (result == haystack + m);
+ }
+ free (needle);
+ free (haystack);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-mbsstr2.sh b/gnulib-tests/test-mbsstr2.sh
new file mode 100755
index 0000000..79d06df
--- /dev/null
+++ b/gnulib-tests/test-mbsstr2.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no french Unicode locale is installed"
+ else
+ echo "Skipping test: no french Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+./test-mbsstr2${EXEEXT}
diff --git a/gnulib-tests/test-mbsstr3.c b/gnulib-tests/test-mbsstr3.c
new file mode 100644
index 0000000..622f0ec
--- /dev/null
+++ b/gnulib-tests/test-mbsstr3.c
@@ -0,0 +1,81 @@
+/* Test of searching in a string.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ /* Tests with a character < 0x30. */
+ {
+ const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */
+ const char *result = mbsstr (input, " ");
+ ASSERT (result == input + 4);
+ }
+
+ {
+ const char input[] = "\312\276\300\375"; /* "示例" */
+ const char *result = mbsstr (input, " ");
+ ASSERT (result == NULL);
+ }
+
+ /* Tests with a character >= 0x30. */
+ {
+ const char input[] = "\272\305123\324\313\320\320\241\243"; /* "号123运行。" */
+ const char *result = mbsstr (input, "2");
+ ASSERT (result == input + 3);
+ }
+
+ /* The following tests show how mbsstr() is different from strstr(). */
+
+ {
+ const char input[] = "\313\320\320\320"; /* "诵行" */
+ const char *result = mbsstr (input, "\320\320"); /* "行" */
+ ASSERT (result == input + 2);
+ }
+
+ {
+ const char input[] = "\203\062\332\066123\324\313\320\320\241\243"; /* "씋123运行。" */
+ const char *result = mbsstr (input, "2");
+ ASSERT (result == input + 5);
+ }
+
+ {
+ const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */
+ const char *result = mbsstr (input, "\276\300"); /* "纠" */
+ ASSERT (result == NULL);
+ }
+
+ {
+ const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */
+ const char *result = mbsstr (input, "\375 "); /* invalid multibyte sequence */
+ ASSERT (result == NULL);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-mbsstr3.sh b/gnulib-tests/test-mbsstr3.sh
new file mode 100755
index 0000000..732c01f
--- /dev/null
+++ b/gnulib-tests/test-mbsstr3.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no chinese GB18030 locale is installed"
+ else
+ echo "Skipping test: no chinese GB18030 locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_ZH_CN \
+./test-mbsstr3${EXEEXT}
diff --git a/gnulib-tests/test-memchr.c b/gnulib-tests/test-memchr.c
new file mode 100644
index 0000000..1526ed2
--- /dev/null
+++ b/gnulib-tests/test-memchr.c
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Written by Eric Blake and Bruno Haible
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (memchr, void *, (void const *, int, size_t));
+
+#include <stdlib.h>
+
+#include "zerosize-ptr.h"
+#include "macros.h"
+
+/* Calculating void * + int is not portable, so this wrapper converts
+ to char * to make the tests easier to write. */
+#define MEMCHR (char *) memchr
+
+int
+main (void)
+{
+ size_t n = 0x100000;
+ char *input = malloc (n);
+ ASSERT (input);
+
+ input[0] = 'a';
+ input[1] = 'b';
+ memset (input + 2, 'c', 1024);
+ memset (input + 1026, 'd', n - 1028);
+ input[n - 2] = 'e';
+ input[n - 1] = 'a';
+
+ /* Basic behavior tests. */
+ ASSERT (MEMCHR (input, 'a', n) == input);
+
+ ASSERT (MEMCHR (input, 'a', 0) == NULL);
+ ASSERT (MEMCHR (zerosize_ptr (), 'a', 0) == NULL);
+
+ ASSERT (MEMCHR (input, 'b', n) == input + 1);
+ ASSERT (MEMCHR (input, 'c', n) == input + 2);
+ ASSERT (MEMCHR (input, 'd', n) == input + 1026);
+
+ ASSERT (MEMCHR (input + 1, 'a', n - 1) == input + n - 1);
+ ASSERT (MEMCHR (input + 1, 'e', n - 1) == input + n - 2);
+ ASSERT (MEMCHR (input + 1, 0x789abc00 | 'e', n - 1) == input + n - 2);
+
+ ASSERT (MEMCHR (input, 'f', n) == NULL);
+ ASSERT (MEMCHR (input, '\0', n) == NULL);
+
+ /* Check that a very long haystack is handled quickly if the byte is
+ found near the beginning. */
+ {
+ size_t repeat = 10000;
+ for (; repeat > 0; repeat--)
+ {
+ ASSERT (MEMCHR (input, 'c', n) == input + 2);
+ }
+ }
+
+ /* Alignment tests. */
+ {
+ int i, j;
+ for (i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 256; j++)
+ input[i + j] = j;
+ for (j = 0; j < 256; j++)
+ {
+ ASSERT (MEMCHR (input + i, j, 256) == input + i + j);
+ }
+ }
+ }
+
+ /* Check that memchr() does not read past the first occurrence of the
+ byte being searched. See the Austin Group's clarification
+ <http://www.opengroup.org/austin/docs/austin_454.txt>.
+ Test both '\0' and something else, since some implementations
+ special-case searching for NUL.
+ */
+ {
+ char *page_boundary = (char *) zerosize_ptr ();
+ /* Too small, and we miss cache line boundary tests; too large,
+ and the test takes cubically longer to complete. */
+ int limit = 257;
+
+ if (page_boundary != NULL)
+ {
+ for (n = 1; n <= limit; n++)
+ {
+ char *mem = page_boundary - n;
+ memset (mem, 'X', n);
+ ASSERT (MEMCHR (mem, 'U', n) == NULL);
+ ASSERT (MEMCHR (mem, 0, n) == NULL);
+
+ {
+ size_t i;
+ size_t k;
+
+ for (i = 0; i < n; i++)
+ {
+ mem[i] = 'U';
+ for (k = i + 1; k < n + limit; k++)
+ ASSERT (MEMCHR (mem, 'U', k) == mem + i);
+ mem[i] = 0;
+ for (k = i + 1; k < n + limit; k++)
+ ASSERT (MEMCHR (mem, 0, k) == mem + i);
+ mem[i] = 'X';
+ }
+ }
+ }
+ }
+ }
+
+ free (input);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-nanosleep.c b/gnulib-tests/test-nanosleep.c
new file mode 100644
index 0000000..26ca73b
--- /dev/null
+++ b/gnulib-tests/test-nanosleep.c
@@ -0,0 +1,83 @@
+/* Test of nanosleep() function.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <time.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (nanosleep, int, (struct timespec const *, struct timespec *));
+
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#if HAVE_DECL_ALARM
+static void
+handle_alarm (int sig)
+{
+ if (sig != SIGALRM)
+ _exit (1);
+}
+#endif
+
+int
+main (void)
+{
+ struct timespec ts;
+
+ ts.tv_sec = 1000;
+ ts.tv_nsec = -1;
+ errno = 0;
+ ASSERT (nanosleep (&ts, NULL) == -1);
+ ASSERT (errno == EINVAL);
+ ts.tv_nsec = 1000000000;
+ errno = 0;
+ ASSERT (nanosleep (&ts, NULL) == -1);
+ ASSERT (errno == EINVAL);
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 1;
+ ASSERT (nanosleep (&ts, &ts) == 0);
+ /* Remaining time is only defined on EINTR failure; but on success,
+ it is typically either 0 or unchanged from input. At any rate,
+ it shouldn't be randomly changed to unrelated values. */
+ ASSERT (ts.tv_sec == 0);
+ ASSERT (ts.tv_nsec == 0 || ts.tv_nsec == 1);
+ ts.tv_nsec = 0;
+ ASSERT (nanosleep (&ts, NULL) == 0);
+
+#if HAVE_DECL_ALARM
+ {
+ const time_t pentecost = 50 * 24 * 60 * 60; /* 50 days. */
+ signal (SIGALRM, handle_alarm);
+ alarm (1);
+ ts.tv_sec = pentecost;
+ ts.tv_nsec = 999999999;
+ errno = 0;
+ ASSERT (nanosleep (&ts, &ts) == -1);
+ ASSERT (errno == EINTR);
+ ASSERT (pentecost - 10 < ts.tv_sec && ts.tv_sec <= pentecost);
+ ASSERT (0 <= ts.tv_nsec && ts.tv_nsec <= 999999999);
+ }
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-netinet_in.c b/gnulib-tests/test-netinet_in.c
new file mode 100644
index 0000000..8a603da
--- /dev/null
+++ b/gnulib-tests/test-netinet_in.c
@@ -0,0 +1,27 @@
+/* Test of <netinet/in.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <netinet/in.h>
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-nl_langinfo.c b/gnulib-tests/test-nl_langinfo.c
new file mode 100644
index 0000000..3a8fa8f
--- /dev/null
+++ b/gnulib-tests/test-nl_langinfo.c
@@ -0,0 +1,126 @@
+/* Test of nl_langinfo replacement.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#include <config.h>
+
+#include <langinfo.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (nl_langinfo, char *, (nl_item));
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "c-strcase.h"
+#include "macros.h"
+
+/* For GCC >= 4.3, silence the warnings
+ "comparison of unsigned expression >= 0 is always true"
+ in this file. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
+
+int
+main (int argc, char *argv[])
+{
+ int pass = atoi (argv[1]);
+ /* pass locale
+ 0 C
+ 1 traditional French locale
+ 2 French UTF-8 locale
+ */
+
+ setlocale (LC_ALL, "");
+
+ /* nl_langinfo items of the LC_CTYPE category */
+ ASSERT (strlen (nl_langinfo (CODESET)) > 0);
+ if (pass == 2)
+ {
+ const char *codeset = nl_langinfo (CODESET);
+ ASSERT (c_strcasecmp (codeset, "UTF-8") == 0 || c_strcasecmp (codeset, "UTF8") == 0);
+ }
+ /* nl_langinfo items of the LC_NUMERIC category */
+ ASSERT (strlen (nl_langinfo (RADIXCHAR)) > 0);
+ ASSERT (strlen (nl_langinfo (THOUSEP)) >= 0);
+ /* nl_langinfo items of the LC_TIME category */
+ ASSERT (strlen (nl_langinfo (D_T_FMT)) > 0);
+ ASSERT (strlen (nl_langinfo (D_FMT)) > 0);
+ ASSERT (strlen (nl_langinfo (T_FMT)) > 0);
+ ASSERT (strlen (nl_langinfo (T_FMT_AMPM)) >= (pass == 0 ? 1 : 0));
+ ASSERT (strlen (nl_langinfo (AM_STR)) >= (pass == 0 ? 1 : 0));
+ ASSERT (strlen (nl_langinfo (PM_STR)) >= (pass == 0 ? 1 : 0));
+ ASSERT (strlen (nl_langinfo (DAY_1)) > 0);
+ ASSERT (strlen (nl_langinfo (DAY_2)) > 0);
+ ASSERT (strlen (nl_langinfo (DAY_3)) > 0);
+ ASSERT (strlen (nl_langinfo (DAY_4)) > 0);
+ ASSERT (strlen (nl_langinfo (DAY_5)) > 0);
+ ASSERT (strlen (nl_langinfo (DAY_6)) > 0);
+ ASSERT (strlen (nl_langinfo (DAY_7)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_1)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_2)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_3)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_4)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_5)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_6)) > 0);
+ ASSERT (strlen (nl_langinfo (ABDAY_7)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_1)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_2)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_3)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_4)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_5)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_6)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_7)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_8)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_9)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_10)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_11)) > 0);
+ ASSERT (strlen (nl_langinfo (MON_12)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_1)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_2)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_3)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_4)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_5)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_6)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_7)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_8)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_9)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_10)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_11)) > 0);
+ ASSERT (strlen (nl_langinfo (ABMON_12)) > 0);
+ ASSERT (strlen (nl_langinfo (ERA)) >= 0);
+ ASSERT (strlen (nl_langinfo (ERA_D_FMT)) >= 0);
+ ASSERT (strlen (nl_langinfo (ERA_D_T_FMT)) >= 0);
+ ASSERT (strlen (nl_langinfo (ERA_T_FMT)) >= 0);
+ ASSERT (nl_langinfo (ALT_DIGITS) != NULL);
+ /* nl_langinfo items of the LC_MONETARY category */
+ {
+ const char *currency = nl_langinfo (CRNCYSTR);
+ ASSERT (strlen (currency) >= 0);
+#if !defined __NetBSD__
+ if (pass > 0)
+ ASSERT (strlen (currency) >= 1);
+#endif
+ }
+ /* nl_langinfo items of the LC_MESSAGES category */
+ ASSERT (strlen (nl_langinfo (YESEXPR)) > 0);
+ ASSERT (strlen (nl_langinfo (NOEXPR)) > 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-nl_langinfo.sh b/gnulib-tests/test-nl_langinfo.sh
new file mode 100755
index 0000000..3168f42
--- /dev/null
+++ b/gnulib-tests/test-nl_langinfo.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+LC_ALL=C ./test-nl_langinfo${EXEEXT} 0 || exit 1
+
+# Test whether a specific traditional locale is installed.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR != none; then
+ LC_ALL=$LOCALE_FR ./test-nl_langinfo${EXEEXT} 1 || exit 1
+fi
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 != none; then
+ LC_ALL=$LOCALE_FR_UTF8 ./test-nl_langinfo${EXEEXT} 2 || exit 1
+fi
+
+exit 0
diff --git a/gnulib-tests/test-open.c b/gnulib-tests/test-open.c
new file mode 100644
index 0000000..d9e2e27
--- /dev/null
+++ b/gnulib-tests/test-open.c
@@ -0,0 +1,41 @@
+/* Test of opening a file descriptor.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <fcntl.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (open, int, (char const *, int, ...));
+
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define BASE "test-open.t"
+
+#include "test-open.h"
+
+int
+main (void)
+{
+ return test_open (open, true);
+}
diff --git a/gnulib-tests/test-open.h b/gnulib-tests/test-open.h
new file mode 100644
index 0000000..faaff0f
--- /dev/null
+++ b/gnulib-tests/test-open.h
@@ -0,0 +1,104 @@
+/* Test of opening a file descriptor.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* Make test_open always inline if we're using Fortify, which defines
+ __always_inline to do that. Do nothing otherwise. This works
+ around a glibc bug whereby 'open' cannot be used as a function
+ pointer when _FORTIFY_SOURCE is positive. */
+
+#if __GLIBC__ && defined __always_inline
+# define ALWAYS_INLINE __always_inline
+#else
+# define ALWAYS_INLINE
+#endif
+
+/* This file is designed to test both open(n,buf[,mode]) and
+ openat(AT_FDCWD,n,buf[,mode]). FUNC is the function to test.
+ Assumes that BASE and ASSERT are already defined, and that
+ appropriate headers are already included. If PRINT, warn before
+ skipping symlink tests with status 77. */
+
+static ALWAYS_INLINE int
+test_open (int (*func) (char const *, int, ...), bool print)
+{
+ int fd;
+ /* Remove anything from prior partial run. */
+ unlink (BASE "file");
+
+ /* Cannot create directory. */
+ errno = 0;
+ ASSERT (func ("nonexist.ent/", O_CREAT | O_RDONLY, 0600) == -1);
+ ASSERT (errno == ENOTDIR || errno == EISDIR || errno == ENOENT
+ || errno == EINVAL);
+
+ /* Create a regular file. */
+ fd = func (BASE "file", O_CREAT | O_RDONLY, 0600);
+ ASSERT (0 <= fd);
+ ASSERT (close (fd) == 0);
+
+ /* Trailing slash handling. */
+ errno = 0;
+ ASSERT (func (BASE "file/", O_RDONLY) == -1);
+ ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL);
+
+ /* Directories cannot be opened for writing. */
+ errno = 0;
+ ASSERT (func (".", O_WRONLY) == -1);
+ ASSERT (errno == EISDIR || errno == EACCES);
+
+ /* /dev/null must exist, and be writable. */
+ fd = func ("/dev/null", O_RDONLY);
+ ASSERT (0 <= fd);
+ {
+ char c;
+ ASSERT (read (fd, &c, 1) == 0);
+ }
+ ASSERT (close (fd) == 0);
+ fd = func ("/dev/null", O_WRONLY);
+ ASSERT (0 <= fd);
+ ASSERT (write (fd, "c", 1) == 1);
+ ASSERT (close (fd) == 0);
+
+ /* Although O_NONBLOCK on regular files can be ignored, it must not
+ cause a failure. */
+ fd = func (BASE "file", O_NONBLOCK | O_RDONLY);
+ ASSERT (0 <= fd);
+ ASSERT (close (fd) == 0);
+
+ /* Symlink handling, where supported. */
+ if (symlink (BASE "file", BASE "link") != 0)
+ {
+ ASSERT (unlink (BASE "file") == 0);
+ if (print)
+ fputs ("skipping test: symlinks not supported on this file system\n",
+ stderr);
+ return 77;
+ }
+ errno = 0;
+ ASSERT (func (BASE "link/", O_RDONLY) == -1);
+ ASSERT (errno == ENOTDIR);
+ fd = func (BASE "link", O_RDONLY);
+ ASSERT (0 <= fd);
+ ASSERT (close (fd) == 0);
+
+ /* Cleanup. */
+ ASSERT (unlink (BASE "file") == 0);
+ ASSERT (unlink (BASE "link") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-pathmax.c b/gnulib-tests/test-pathmax.c
new file mode 100644
index 0000000..ac4a393
--- /dev/null
+++ b/gnulib-tests/test-pathmax.c
@@ -0,0 +1,32 @@
+/* Test of "pathmax.h".
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011. */
+
+#include <config.h>
+
+#include "pathmax.h"
+
+/* Check that PATH_MAX is a constant if it is defined. */
+#ifdef PATH_MAX
+int a = PATH_MAX;
+#endif
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-perror.c b/gnulib-tests/test-perror.c
new file mode 100644
index 0000000..164a79c
--- /dev/null
+++ b/gnulib-tests/test-perror.c
@@ -0,0 +1,36 @@
+/* Test of perror() function.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (perror, void, (char const *));
+
+#include <errno.h>
+
+int
+main (int argc, char **argv)
+{
+ const char *prefix = (argc > 1 ? argv[1] : NULL);
+
+ errno = EACCES; perror (prefix);
+ errno = ETIMEDOUT; perror (prefix);
+ errno = EOVERFLOW; perror (prefix);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-perror.sh b/gnulib-tests/test-perror.sh
new file mode 100755
index 0000000..7274d32
--- /dev/null
+++ b/gnulib-tests/test-perror.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
+
+# Test NULL prefix. Result should not contain a number.
+test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
+grep '[0-9]' t-perror.tmp > /dev/null \
+ && fail_ "result should not contain a number"
+
+# Test empty prefix. Result should be the same.
+test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
+diff t-perror.tmp t-perror1.tmp \
+ || fail_ "empty prefix should behave like NULL argument"
+
+# Test non-empty prefix.
+test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp
+sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp
+diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly"
+
+# Test exit status.
+test-perror >out 2>/dev/null || fail_ "unexpected exit status"
+test -s out && fail_ "unexpected output"
+
+Exit 0
diff --git a/gnulib-tests/test-perror2.c b/gnulib-tests/test-perror2.c
new file mode 100644
index 0000000..e295576
--- /dev/null
+++ b/gnulib-tests/test-perror2.c
@@ -0,0 +1,136 @@
+/* Test of perror() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+/* This test intentionally parses stderr. So, we arrange to have fd 10
+ (outside the range of interesting fd's during the test) set up to
+ duplicate the original stderr. */
+#define BACKUP_STDERR_FILENO 10
+#define ASSERT_STREAM myerr
+#include "macros.h"
+
+static FILE *myerr;
+
+#define BASE "test-perror2"
+
+int
+main (void)
+{
+ /* We change fd 2 later, so save it in fd 10. */
+ if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO
+ || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL)
+ return 2;
+
+ ASSERT (freopen (BASE ".tmp", "w+", stderr) == stderr);
+
+ /* Test that perror does not clobber strerror buffer. */
+ {
+ const char *msg1;
+ const char *msg2;
+ const char *msg3;
+ const char *msg4;
+ char *str1;
+ char *str2;
+ char *str3;
+ char *str4;
+
+ msg1 = strerror (ENOENT);
+ ASSERT (msg1);
+ str1 = strdup (msg1);
+ ASSERT (str1);
+
+ msg2 = strerror (ERANGE);
+ ASSERT (msg2);
+ str2 = strdup (msg2);
+ ASSERT (str2);
+
+ msg3 = strerror (-4);
+ ASSERT (msg3);
+ str3 = strdup (msg3);
+ ASSERT (str3);
+
+ msg4 = strerror (1729576);
+ ASSERT (msg4);
+ str4 = strdup (msg4);
+ ASSERT (str4);
+
+ errno = EACCES;
+ perror ("");
+ errno = -5;
+ perror ("");
+ ASSERT (!ferror (stderr));
+ ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
+ ASSERT (msg2 == msg4 || STREQ (msg2, str2));
+ ASSERT (msg3 == msg4 || STREQ (msg3, str3));
+ ASSERT (STREQ (msg4, str4));
+
+ free (str1);
+ free (str2);
+ free (str3);
+ free (str4);
+ }
+
+ /* Test that perror uses the same message as strerror. */
+ {
+ int errs[] = { EACCES, 0, -3, };
+ int i;
+ for (i = 0; i < SIZEOF (errs); i++)
+ {
+ char buf[256];
+ char *err = strerror (errs[i]);
+
+ ASSERT (err);
+ ASSERT (strlen (err) < sizeof buf);
+ rewind (stderr);
+ ASSERT (ftruncate (fileno (stderr), 0) == 0);
+ errno = errs[i];
+ perror (NULL);
+ ASSERT (!ferror (stderr));
+ rewind (stderr);
+ ASSERT (fgets (buf, sizeof buf, stderr) == buf);
+ ASSERT (strstr (buf, err));
+ }
+ }
+
+ /* Test that perror reports write failure. */
+ {
+ ASSERT (freopen (BASE ".tmp", "r", stderr) == stderr);
+ ASSERT (setvbuf (stderr, NULL, _IONBF, BUFSIZ) == 0);
+ errno = -1;
+ ASSERT (!ferror (stderr));
+ perror (NULL);
+#if 0
+ /* Commented out until cygwin behaves:
+ http://sourceware.org/ml/newlib/2011/msg00228.html */
+ ASSERT (errno > 0);
+ /* Commented out until glibc behaves:
+ http://sourceware.org/bugzilla/show_bug.cgi?id=12792 */
+ ASSERT (ferror (stderr));
+#endif
+ }
+
+ ASSERT (fclose (stderr) == 0);
+ ASSERT (remove (BASE ".tmp") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-pipe.c b/gnulib-tests/test-pipe.c
new file mode 100644
index 0000000..4282c05
--- /dev/null
+++ b/gnulib-tests/test-pipe.c
@@ -0,0 +1,104 @@
+/* Test of pipe.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (pipe, int, (int[2]));
+
+#include <fcntl.h>
+#include <stdbool.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+#endif
+
+#include "binary-io.h"
+#include "macros.h"
+
+/* Return true if FD is open. */
+static bool
+is_open (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows, the initial state of unassigned standard file
+ descriptors is that they are open but point to an
+ INVALID_HANDLE_VALUE, and there is no fcntl. */
+ 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
+}
+
+/* Return true if FD is not inherited to child processes. */
+static bool
+is_cloexec (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ DWORD flags;
+ ASSERT (GetHandleInformation (h, &flags));
+ return (flags & HANDLE_FLAG_INHERIT) == 0;
+#else
+ int flags;
+ ASSERT ((flags = fcntl (fd, F_GETFD)) >= 0);
+ return (flags & FD_CLOEXEC) != 0;
+#endif
+}
+
+/* Return true if FD is in non-blocking mode. */
+static bool
+is_nonblocking (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* We don't use the non-blocking mode for sockets here. */
+ return 0;
+#else
+ int flags;
+ ASSERT ((flags = fcntl (fd, F_GETFL)) >= 0);
+ return (flags & O_NONBLOCK) != 0;
+#endif
+}
+
+int
+main ()
+{
+ int fd[2];
+
+ fd[0] = -1;
+ fd[1] = -1;
+ ASSERT (pipe (fd) >= 0);
+ ASSERT (fd[0] >= 0);
+ ASSERT (fd[1] >= 0);
+ ASSERT (fd[0] != fd[1]);
+ ASSERT (is_open (fd[0]));
+ ASSERT (is_open (fd[1]));
+ ASSERT (!is_cloexec (fd[0]));
+ ASSERT (!is_cloexec (fd[1]));
+ ASSERT (!is_nonblocking (fd[0]));
+ ASSERT (!is_nonblocking (fd[1]));
+
+ return 0;
+}
diff --git a/gnulib-tests/test-quotearg-simple.c b/gnulib-tests/test-quotearg-simple.c
new file mode 100644
index 0000000..6bb4b35
--- /dev/null
+++ b/gnulib-tests/test-quotearg-simple.c
@@ -0,0 +1,359 @@
+/* Test of quotearg family of functions.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2008. */
+
+#include <config.h>
+
+#include "quotearg.h"
+
+#include <ctype.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "localcharset.h"
+#include "progname.h"
+#include "macros.h"
+#include "zerosize-ptr.h"
+
+#include "test-quotearg.h"
+
+static struct result_groups results_g[] = {
+ /* literal_quoting_style */
+ { { "", "\0""1\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b",
+ LQ RQ, LQ RQ },
+ { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b",
+ LQ RQ, LQ RQ },
+ { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b",
+ LQ RQ, LQ RQ } },
+
+ /* shell_quoting_style */
+ { { "''", "\0""1\0", 3, "simple", "' \t\n'\\''\"\033?""?/\\'", "a:b",
+ "'a\\b'", LQ RQ, LQ RQ },
+ { "''", "1", 1, "simple", "' \t\n'\\''\"\033?""?/\\'", "a:b",
+ "'a\\b'", LQ RQ, LQ RQ },
+ { "''", "1", 1, "simple", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
+ "'a\\b'", LQ RQ, LQ RQ } },
+
+ /* shell_always_quoting_style */
+ { { "''", "'\0""1\0'", 5, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
+ "'a\\b'", "'" LQ RQ "'", "'" LQ RQ "'" },
+ { "''", "'1'", 3, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
+ "'a\\b'", "'" LQ RQ "'", "'" LQ RQ "'" },
+ { "''", "'1'", 3, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
+ "'a\\b'", "'" LQ RQ "'", "'" LQ RQ "'" } },
+
+ /* shell_escape_quoting_style */
+ { { "''", "''$'\\0''1'$'\\0'", 15, "simple",
+ "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "a:b",
+ "'a\\b'", "''$'" LQ_ENC RQ_ENC "'", LQ RQ },
+ { "''", "''$'\\0''1'$'\\0'", 15, "simple",
+ "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "a:b",
+ "'a\\b'", "''$'" LQ_ENC RQ_ENC "'", LQ RQ },
+ { "''", "''$'\\0''1'$'\\0'", 15, "simple",
+ "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'",
+ "'a\\b'", "''$'" LQ_ENC RQ_ENC "'", LQ RQ } },
+
+ /* shell_escape_always_quoting_style */
+ { { "''", "''$'\\0''1'$'\\0'", 15, "'simple'",
+ "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'",
+ "'a\\b'", "''$'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+ { "''", "''$'\\0''1'$'\\0'", 15, "'simple'",
+ "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'",
+ "'a\\b'", "''$'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+ { "''", "''$'\\0''1'$'\\0'", 15, "'simple'",
+ "' '$'\\t\\n'\\''\"'$'\\033''?""?/\\'", "'a:b'",
+ "'a\\b'", "''$'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } },
+
+ /* c_quoting_style */
+ { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" },
+ { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" },
+ { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" } },
+
+ /* c_maybe_quoting_style */
+ { { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
+ "a:b", "a\\b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ },
+ { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
+ "a:b", "a\\b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ },
+ { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
+ "\"a:b\"", "a\\b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ } },
+
+ /* escape_quoting_style */
+ { { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a:b",
+ "a\\\\b", LQ_ENC RQ_ENC, LQ RQ },
+ { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a:b",
+ "a\\\\b", LQ_ENC RQ_ENC, LQ RQ },
+ { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a\\:b",
+ "a\\\\b", LQ_ENC RQ_ENC, LQ RQ } },
+
+ /* locale_quoting_style */
+ { { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'",
+ "'a:b'", "'a\\\\b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+ { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'",
+ "'a:b'", "'a\\\\b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+ { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'",
+ "'a\\:b'", "'a\\\\b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } },
+
+ /* clocale_quoting_style */
+ { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" },
+ { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" },
+ { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" } }
+};
+
+static struct result_groups flag_results[] = {
+ /* literal_quoting_style and QA_ELIDE_NULL_BYTES */
+ { { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", LQ RQ,
+ LQ RQ },
+ { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", LQ RQ,
+ LQ RQ },
+ { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b", LQ RQ,
+ LQ RQ } },
+
+ /* c_quoting_style and QA_ELIDE_OUTER_QUOTES */
+ { { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
+ "a:b", "a\\b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ },
+ { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
+ "a:b", "a\\b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ },
+ { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
+ "\"a:b\"", "a\\b", "\"" LQ_ENC RQ_ENC "\"", LQ RQ } },
+
+ /* c_quoting_style and QA_SPLIT_TRIGRAPHS */
+ { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" },
+ { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" },
+ { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
+ "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"",
+ "\"" LQ_ENC RQ_ENC "\"", "\"" LQ RQ "\"" } }
+};
+
+static char const *custom_quotes[][2] = {
+ { "", "" },
+ { "'", "'" },
+ { "(", ")" },
+ { ":", " " },
+ { " ", ":" },
+ { "# ", "\n" },
+ { "\"'", "'\"" }
+};
+
+static struct result_groups custom_results[] = {
+ /* left_quote = right_quote = "" */
+ { { "", "\\0001\\0", 7, "simple",
+ " \\t\\n'\"\\033?""?/\\\\", "a:b", "a\\\\b",
+ LQ_ENC RQ_ENC, LQ RQ },
+ { "", "\\0001\\0", 7, "simple",
+ " \\t\\n'\"\\033?""?/\\\\", "a:b", "a\\\\b",
+ LQ_ENC RQ_ENC, LQ RQ },
+ { "", "\\0001\\0", 7, "simple",
+ " \\t\\n'\"\\033?""?/\\\\", "a\\:b", "a\\\\b",
+ LQ_ENC RQ_ENC, LQ RQ } },
+
+ /* left_quote = right_quote = "'" */
+ { { "''", "'\\0001\\0'", 9, "'simple'",
+ "' \\t\\n\\'\"\\033?""?/\\\\'", "'a:b'", "'a\\\\b'",
+ "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+ { "''", "'\\0001\\0'", 9, "'simple'",
+ "' \\t\\n\\'\"\\033?""?/\\\\'", "'a:b'", "'a\\\\b'",
+ "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+ { "''", "'\\0001\\0'", 9, "'simple'",
+ "' \\t\\n\\'\"\\033?""?/\\\\'", "'a\\:b'", "'a\\\\b'",
+ "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } },
+
+ /* left_quote = "(" and right_quote = ")" */
+ { { "()", "(\\0001\\0)", 9, "(simple)",
+ "( \\t\\n'\"\\033?""?/\\\\)", "(a:b)", "(a\\\\b)",
+ "(" LQ_ENC RQ_ENC ")", "(" LQ RQ ")" },
+ { "()", "(\\0001\\0)", 9, "(simple)",
+ "( \\t\\n'\"\\033?""?/\\\\)", "(a:b)", "(a\\\\b)",
+ "(" LQ_ENC RQ_ENC ")", "(" LQ RQ ")" },
+ { "()", "(\\0001\\0)", 9, "(simple)",
+ "( \\t\\n'\"\\033?""?/\\\\)", "(a\\:b)", "(a\\\\b)",
+ "(" LQ_ENC RQ_ENC ")", "(" LQ RQ ")" } },
+
+ /* left_quote = ":" and right_quote = " " */
+ { { ": ", ":\\0001\\0 ", 9, ":simple ",
+ ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a:b ", ":a\\\\b ",
+ ":" LQ_ENC RQ_ENC " ", ":" LQ RQ " " },
+ { ": ", ":\\0001\\0 ", 9, ":simple ",
+ ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a:b ", ":a\\\\b ",
+ ":" LQ_ENC RQ_ENC " ", ":" LQ RQ " " },
+ { ": ", ":\\0001\\0 ", 9, ":simple ",
+ ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a\\:b ", ":a\\\\b ",
+ ":" LQ_ENC RQ_ENC " ", ":" LQ RQ " " } },
+
+ /* left_quote = " " and right_quote = ":" */
+ { { " :", " \\0001\\0:", 9, " simple:",
+ " \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:",
+ " " LQ_ENC RQ_ENC ":", " " LQ RQ ":" },
+ { " :", " \\0001\\0:", 9, " simple:",
+ " \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:",
+ " " LQ_ENC RQ_ENC ":", " " LQ RQ ":" },
+ { " :", " \\0001\\0:", 9, " simple:",
+ " \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:",
+ " " LQ_ENC RQ_ENC ":", " " LQ RQ ":" } },
+
+ /* left_quote = "# " and right_quote = "\n" */
+ { { "# \n", "# \\0001\\0\n", 10, "# simple\n",
+ "# \\t\\n'\"\\033?""?/\\\\\n", "# a:b\n", "# a\\\\b\n",
+ "# " LQ_ENC RQ_ENC "\n", "# " LQ RQ "\n" },
+ { "# \n", "# \\0001\\0\n", 10, "# simple\n",
+ "# \\t\\n'\"\\033?""?/\\\\\n", "# a:b\n", "# a\\\\b\n",
+ "# " LQ_ENC RQ_ENC "\n", "# " LQ RQ "\n" },
+ { "# \n", "# \\0001\\0\n", 10, "# simple\n",
+ "# \\t\\n'\"\\033?""?/\\\\\n", "# a\\:b\n", "# a\\\\b\n",
+ "# " LQ_ENC RQ_ENC "\n", "# " LQ RQ "\n" } },
+
+ /* left_quote = "\"'" and right_quote = "'\"" */
+ { { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"",
+ "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a:b'\"", "\"'a\\\\b'\"",
+ "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" },
+ { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"",
+ "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a:b'\"", "\"'a\\\\b'\"",
+ "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" },
+ { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"",
+ "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a\\:b'\"", "\"'a\\\\b'\"",
+ "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" } }
+};
+
+int
+main (int argc _GL_UNUSED, char *argv[])
+{
+ int i;
+ bool ascii_only = MB_CUR_MAX == 1 && !isprint ((unsigned char) LQ[0]);
+
+ set_program_name (argv[0]);
+
+ /* This part of the program is hard-wired to the C locale since it
+ does not call setlocale. However, according to POSIX, the use of
+ 8-bit bytes in a character context in the C locale gives
+ unspecified results (that is, the C locale charset is allowed to
+ be unibyte with 8-bit bytes rejected [ASCII], unibyte with 8-bit
+ bytes being characters [often ISO-8859-1], or multibyte [often
+ UTF-8]). We assume that the latter two cases will be
+ indistinguishable in this test - that is, the LQ and RQ sequences
+ will pass through unchanged in either type of charset. So when
+ testing for quoting of str7, use the ascii_only flag to decide
+ what to expect for the 8-bit data being quoted. */
+ ASSERT (!isprint ('\033'));
+ for (i = literal_quoting_style; i <= clocale_quoting_style; i++)
+ {
+ set_quoting_style (NULL, (enum quoting_style) i);
+ if (!(i == locale_quoting_style || i == clocale_quoting_style)
+ || (strcmp (locale_charset (), "ASCII") == 0
+ || strcmp (locale_charset (), "ANSI_X3.4-1968") == 0))
+ {
+ compare_strings (use_quotearg_buffer, &results_g[i].group1,
+ ascii_only);
+ compare_strings (use_quotearg, &results_g[i].group2,
+ ascii_only);
+ if (i == c_quoting_style)
+ compare_strings (use_quote_double_quotes, &results_g[i].group2,
+ ascii_only);
+ compare_strings (use_quotearg_colon, &results_g[i].group3,
+ ascii_only);
+ }
+ }
+
+ set_quoting_style (NULL, literal_quoting_style);
+ ASSERT (set_quoting_flags (NULL, QA_ELIDE_NULL_BYTES) == 0);
+ compare_strings (use_quotearg_buffer, &flag_results[0].group1, ascii_only);
+ compare_strings (use_quotearg, &flag_results[0].group2, ascii_only);
+ compare_strings (use_quotearg_colon, &flag_results[0].group3, ascii_only);
+
+ set_quoting_style (NULL, c_quoting_style);
+ ASSERT (set_quoting_flags (NULL, QA_ELIDE_OUTER_QUOTES)
+ == QA_ELIDE_NULL_BYTES);
+ compare_strings (use_quotearg_buffer, &flag_results[1].group1, ascii_only);
+ compare_strings (use_quotearg, &flag_results[1].group2, ascii_only);
+ compare_strings (use_quote_double_quotes, &flag_results[1].group2,
+ ascii_only);
+ compare_strings (use_quotearg_colon, &flag_results[1].group3, ascii_only);
+
+ ASSERT (set_quoting_flags (NULL, QA_SPLIT_TRIGRAPHS)
+ == QA_ELIDE_OUTER_QUOTES);
+ compare_strings (use_quotearg_buffer, &flag_results[2].group1, ascii_only);
+ compare_strings (use_quotearg, &flag_results[2].group2, ascii_only);
+ compare_strings (use_quote_double_quotes, &flag_results[2].group2,
+ ascii_only);
+ compare_strings (use_quotearg_colon, &flag_results[2].group3, ascii_only);
+
+ ASSERT (set_quoting_flags (NULL, 0) == QA_SPLIT_TRIGRAPHS);
+
+ for (i = 0; i < sizeof custom_quotes / sizeof *custom_quotes; ++i)
+ {
+ set_custom_quoting (NULL,
+ custom_quotes[i][0], custom_quotes[i][1]);
+ compare_strings (use_quotearg_buffer, &custom_results[i].group1,
+ ascii_only);
+ compare_strings (use_quotearg, &custom_results[i].group2, ascii_only);
+ compare_strings (use_quotearg_colon, &custom_results[i].group3,
+ ascii_only);
+ }
+
+ {
+ /* Trigger the bug whereby quotearg_buffer would read beyond the NUL
+ that defines the end of the string being quoted. Use an input
+ string whose NUL is the last byte before an unreadable page. */
+ char *z = zerosize_ptr ();
+
+ if (z)
+ {
+ size_t q_len = 1024;
+ char *q = malloc (q_len + 1);
+ char buf[10];
+ memset (q, 'Q', q_len);
+ q[q_len] = 0;
+
+ /* Z points to the boundary between a readable/writable page
+ and one that is neither readable nor writable. Position
+ our string so its NUL is at the end of the writable one. */
+ char const *str = "____";
+ size_t s_len = strlen (str);
+ z -= s_len + 1;
+ memcpy (z, str, s_len + 1);
+
+ set_custom_quoting (NULL, q, q);
+ /* Whether this actually triggers a SEGV depends on the
+ implementation of memcmp: whether it compares only byte-at-
+ a-time, and from left to right (no SEGV) or some other way. */
+ size_t n = quotearg_buffer (buf, sizeof buf, z, SIZE_MAX, NULL);
+ ASSERT (n == s_len + 2 * q_len);
+ ASSERT (memcmp (buf, q, sizeof buf) == 0);
+ free (q);
+ }
+ }
+
+ quotearg_free ();
+
+ return 0;
+}
diff --git a/gnulib-tests/test-quotearg.h b/gnulib-tests/test-quotearg.h
new file mode 100644
index 0000000..7eee6b5
--- /dev/null
+++ b/gnulib-tests/test-quotearg.h
@@ -0,0 +1,132 @@
+/* Test of quotearg family of functions.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2008. */
+
+struct result_strings {
+ char const *str1; /* Translation of "". */
+ char const *str2; /* Translation of "\0""1\0". */
+ size_t len2; /* Length of str2. */
+ char const *str3; /* Translation of "simple". */
+ char const *str4; /* Translation of " \t\n'\"\033?""?/\\". */
+ char const *str5; /* Translation of "a:b". */
+ char const *str6; /* Translation of "a\\b". */
+ char const *str7a; /* Translation of LQ RQ, in ASCII charset. */
+ char const *str7b; /* Translation of LQ RQ, in Latin1 or UTF-8 charset. */
+};
+
+struct result_groups {
+ struct result_strings group1; /* Via quotearg_buffer. */
+ struct result_strings group2; /* Via quotearg{,_mem}. */
+ struct result_strings group3; /* Via quotearg_colon{,_mem}. */
+};
+
+/* These quotes are borrowed from a pt_PT.utf8 translation. */
+# define LQ "\302\253"
+# define RQ "\302\273"
+# define LQ_ENC "\\302\\253"
+# define RQ_ENC "\\302\\273"
+# define RQ_ESC "\\\302\273"
+
+static struct result_strings inputs = {
+ "", "\0001\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b",
+ LQ RQ, NULL
+};
+
+static void
+compare (char const *a, size_t la, char const *b, size_t lb)
+{
+ ASSERT (la == lb);
+ ASSERT (memcmp (a, b, la) == 0);
+ ASSERT (b[lb] == '\0');
+}
+
+static void
+compare_strings (char *(func) (char const *, size_t *),
+ struct result_strings *results, bool ascii_only)
+{
+ size_t len;
+ char *p;
+
+ len = 0;
+ p = func (inputs.str1, &len);
+ compare (results->str1, strlen (results->str1), p, len);
+
+ len = inputs.len2;
+ p = func (inputs.str2, &len);
+ compare (results->str2, results->len2, p, len);
+
+ len = SIZE_MAX;
+ p = func (inputs.str3, &len);
+ compare (results->str3, strlen (results->str3), p, len);
+
+ len = strlen (inputs.str4);
+ p = func (inputs.str4, &len);
+ compare (results->str4, strlen (results->str4), p, len);
+
+ len = SIZE_MAX;
+ p = func (inputs.str5, &len);
+ compare (results->str5, strlen (results->str5), p, len);
+
+ len = strlen (inputs.str6);
+ p = func (inputs.str6, &len);
+ compare (results->str6, strlen (results->str6), p, len);
+
+ len = strlen (inputs.str7a);
+ p = func (inputs.str7a, &len);
+ if (ascii_only)
+ compare (results->str7a, strlen (results->str7a), p, len);
+ else
+ compare (results->str7b, strlen (results->str7b), p, len);
+}
+
+static char *
+use_quotearg_buffer (const char *str, size_t *len)
+{
+ static char buf[100];
+ size_t size;
+ memset (buf, 0xa5, 100);
+ size = quotearg_buffer (buf, 100, str, *len, NULL);
+ *len = size;
+ ASSERT ((unsigned char) buf[size + 1] == 0xa5);
+ return buf;
+}
+
+static char *
+use_quotearg (const char *str, size_t *len)
+{
+ char *p = *len == SIZE_MAX ? quotearg (str) : quotearg_mem (str, *len);
+ *len = strlen (p);
+ return p;
+}
+
+static char *
+use_quote_double_quotes (const char *str, size_t *len)
+{
+ char *p = *len == SIZE_MAX ? quotearg_char (str, '"')
+ : quotearg_char_mem (str, *len, '"');
+ *len = strlen (p);
+ return p;
+}
+
+static char *
+use_quotearg_colon (const char *str, size_t *len)
+{
+ char *p = (*len == SIZE_MAX ? quotearg_colon (str)
+ : quotearg_colon_mem (str, *len));
+ *len = strlen (p);
+ return p;
+}
diff --git a/gnulib-tests/test-raise.c b/gnulib-tests/test-raise.c
new file mode 100644
index 0000000..b793e97
--- /dev/null
+++ b/gnulib-tests/test-raise.c
@@ -0,0 +1,50 @@
+/* Test raising a signal.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <signal.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (raise, int, (int));
+
+#include <stdlib.h>
+
+#include "macros.h"
+
+/* It is safe to use _Noreturn here: exit() never returns, and GCC knows that
+ exit() is a non-returning function, even on platforms where its declaration
+ in <stdlib.h> does not have the 'noreturn' attribute. */
+static _Noreturn void
+handler (int sig)
+{
+ exit (0);
+}
+
+int
+main (void)
+{
+ /* Test behaviour for invalid argument. */
+ ASSERT (raise (-1) != 0);
+
+ /* Test behaviour for SIGINT. */
+ ASSERT (signal (SIGINT, handler) != SIG_ERR);
+
+ raise (SIGINT);
+
+ /* We should not get here, because the handler takes away the control. */
+ exit (1);
+}
diff --git a/gnulib-tests/test-rawmemchr.c b/gnulib-tests/test-rawmemchr.c
new file mode 100644
index 0000000..4f4ec7b
--- /dev/null
+++ b/gnulib-tests/test-rawmemchr.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Written by Eric Blake and Bruno Haible
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (rawmemchr, void *, (void const *, int));
+
+#include <stdlib.h>
+
+#include "zerosize-ptr.h"
+#include "macros.h"
+
+/* Calculating void * + int is not portable, so this wrapper converts
+ to char * to make the tests easier to write. */
+#define RAWMEMCHR (char *) rawmemchr
+
+int
+main (void)
+{
+ size_t n = 0x100000;
+ char *input = malloc (n + 1);
+ ASSERT (input);
+
+ input[0] = 'a';
+ input[1] = 'b';
+ memset (input + 2, 'c', 1024);
+ memset (input + 1026, 'd', n - 1028);
+ input[n - 2] = 'e';
+ input[n - 1] = 'a';
+ input[n] = '\0';
+
+ /* Basic behavior tests. */
+ ASSERT (RAWMEMCHR (input, 'a') == input);
+ ASSERT (RAWMEMCHR (input, 'b') == input + 1);
+ ASSERT (RAWMEMCHR (input, 'c') == input + 2);
+ ASSERT (RAWMEMCHR (input, 'd') == input + 1026);
+
+ ASSERT (RAWMEMCHR (input + 1, 'a') == input + n - 1);
+ ASSERT (RAWMEMCHR (input + 1, 'e') == input + n - 2);
+ ASSERT (RAWMEMCHR (input + 1, 0x789abc00 | 'e') == input + n - 2);
+
+ ASSERT (RAWMEMCHR (input, '\0') == input + n);
+
+ /* Alignment tests. */
+ {
+ int i, j;
+ for (i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 256; j++)
+ input[i + j] = j;
+ for (j = 0; j < 256; j++)
+ {
+ ASSERT (RAWMEMCHR (input + i, j) == input + i + j);
+ }
+ }
+ }
+
+ /* Ensure that no unaligned oversized reads occur. */
+ {
+ char *page_boundary = (char *) zerosize_ptr ();
+ size_t i;
+
+ if (!page_boundary)
+ page_boundary = input + 4096;
+ memset (page_boundary - 512, '1', 511);
+ page_boundary[-1] = '2';
+ for (i = 1; i <= 512; i++)
+ ASSERT (RAWMEMCHR (page_boundary - i, (i * 0x01010100) | '2')
+ == page_boundary - 1);
+ }
+
+ free (input);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-readlink.c b/gnulib-tests/test-readlink.c
new file mode 100644
index 0000000..fdff6e1
--- /dev/null
+++ b/gnulib-tests/test-readlink.c
@@ -0,0 +1,48 @@
+/* Tests of readlink.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (readlink, ssize_t, (char const *, char *, size_t));
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include "ignore-value.h"
+#include "macros.h"
+
+#define BASE "test-readlink.t"
+
+#include "test-readlink.h"
+
+int
+main (void)
+{
+ /* Remove any leftovers from a previous partial run. */
+ ignore_value (system ("rm -rf " BASE "*"));
+
+ return test_readlink (readlink, true);
+}
diff --git a/gnulib-tests/test-readlink.h b/gnulib-tests/test-readlink.h
new file mode 100644
index 0000000..cba98f6
--- /dev/null
+++ b/gnulib-tests/test-readlink.h
@@ -0,0 +1,119 @@
+/* Tests of readlink.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+/* This file is designed to test both readlink(a,b,c) and
+ readlinkat(AT_FDCWD,a,b,c). FUNC is the function to test. Assumes
+ that BASE and ASSERT are already defined, and that appropriate
+ headers are already included. If PRINT, warn before skipping
+ symlink tests with status 77. */
+
+static int
+test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print)
+{
+ char buf[80];
+
+ /* Sanity checks of failures. Mingw lacks symlink, but readlink can
+ still distinguish between various errors. */
+ memset (buf, 0xff, sizeof buf);
+ errno = 0;
+ ASSERT (func ("no_such", buf, sizeof buf) == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("no_such/", buf, sizeof buf) == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("", buf, sizeof buf) == -1);
+ ASSERT (errno == ENOENT || errno == EINVAL);
+ errno = 0;
+ ASSERT (func (".", buf, sizeof buf) == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (func ("./", buf, sizeof buf) == -1);
+ ASSERT (errno == EINVAL);
+ ASSERT (close (creat (BASE "file", 0600)) == 0);
+ errno = 0;
+ ASSERT (func (BASE "file", buf, sizeof buf) == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (func (BASE "file/", buf, sizeof buf) == -1);
+ ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */
+
+ /* Now test actual symlinks. */
+ if (symlink (BASE "dir", BASE "link"))
+ {
+ ASSERT (unlink (BASE "file") == 0);
+ if (print)
+ fputs ("skipping test: symlinks not supported on this file system\n",
+ stderr);
+ return 77;
+ }
+ ASSERT (mkdir (BASE "dir", 0700) == 0);
+ errno = 0;
+ ASSERT (func (BASE "link/", buf, sizeof buf) == -1);
+ ASSERT (errno == EINVAL);
+ ASSERT (symlink (BASE "link", BASE "link2") == 0);
+ errno = 0;
+ ASSERT (func (BASE "link2/", buf, sizeof buf) == -1);
+ ASSERT (errno == EINVAL);
+ ASSERT (unlink (BASE "link2") == 0);
+ ASSERT (symlink (BASE "file", BASE "link2") == 0);
+ errno = 0;
+ ASSERT (func (BASE "link2/", buf, sizeof buf) == -1);
+ ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */
+ ASSERT (unlink (BASE "file") == 0);
+ ASSERT (unlink (BASE "link2") == 0);
+ {
+ /* Up till now, no readlink has been successful, so buf should be
+ unchanged. */
+ int i;
+ for (i = 0; i < sizeof buf; i++)
+ ASSERT (buf[i] == (char) 0xff);
+ }
+ {
+ size_t len = strlen (BASE "dir");
+ /* When passing too small of a buffer, expect the truncated
+ length, or an ERANGE failure. However, a size of 0 is not
+ portable enough to test. */
+ ssize_t result;
+ errno = 0;
+ result = readlink (BASE "link", buf, 1);
+ if (result == -1)
+ {
+ ASSERT (errno == ERANGE);
+ ASSERT (buf[0] == (char) 0xff);
+ }
+ else
+ {
+ ASSERT (result == 1);
+ ASSERT (buf[0] == BASE[0]);
+ }
+ ASSERT (buf[1] == (char) 0xff);
+ ASSERT (func (BASE "link", buf, len) == len);
+ ASSERT (strncmp (buf, BASE "dir", len) == 0);
+ ASSERT (buf[len] == (char) 0xff);
+ ASSERT (func (BASE "link", buf, sizeof buf) == len);
+ ASSERT (strncmp (buf, BASE "dir", len) == 0);
+ /* POSIX says rest of buf is unspecified; but in practice, it is
+ either left alone, or NUL-terminated. */
+ ASSERT (buf[len] == '\0' || buf[len] == (char) 0xff);
+ }
+ ASSERT (rmdir (BASE "dir") == 0);
+ ASSERT (unlink (BASE "link") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-regex.c b/gnulib-tests/test-regex.c
new file mode 100644
index 0000000..c0d9824
--- /dev/null
+++ b/gnulib-tests/test-regex.c
@@ -0,0 +1,253 @@
+/* Test regular expressions
+ Copyright 1996-2001, 2003-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "regex.h"
+
+#include <locale.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#if HAVE_DECL_ALARM
+# include <unistd.h>
+# include <signal.h>
+#endif
+
+#include "localcharset.h"
+
+int
+main (void)
+{
+ 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;
+
+#if HAVE_DECL_ALARM
+ /* Some builds of glibc go into an infinite loop on this test. */
+ int alarm_value = 2;
+ signal (SIGALRM, SIG_DFL);
+ alarm (alarm_value);
+#endif
+ if (setlocale (LC_ALL, "en_US.UTF-8"))
+ {
+ {
+ /* http://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
+ {
+ memset (&regs, 0, sizeof regs);
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+ }
+
+ /* Check whether it's really a UTF-8 locale.
+ On mingw, the setlocale call succeeds but returns
+ "English_United States.1252", with locale_charset() returning
+ "CP1252". */
+ if (strcmp (locale_charset (), "UTF-8") == 0)
+ {
+ /* This test is from glibc bug 15078.
+ The test case is from Andreas Schwab in
+ <http://www.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
+ {
+ memset (&regs, 0, sizeof regs);
+ i = re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, 0);
+ if (i != 0 && i != 21)
+ result |= 1;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+ }
+
+ 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;
+ /* This should fail, but succeeds for glibc-2.5. */
+ else
+ {
+ memset (&regs, 0, sizeof regs);
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+ /* 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;
+ /* This should match, but does not for glibc-2.2.1. */
+ else
+ {
+ memset (&regs, 0, sizeof regs);
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 8;
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ else
+ {
+ memset (&regs, 0, sizeof regs);
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+ /* 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
+ {
+ memset (&regs, 0, sizeof regs);
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+ /* Catch a bug reported by Vin Shelton in
+ http://lists.gnu.org/archive/html/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;
+
+#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;
+}
diff --git a/gnulib-tests/test-select-fd.c b/gnulib-tests/test-select-fd.c
new file mode 100644
index 0000000..452ddb2
--- /dev/null
+++ b/gnulib-tests/test-select-fd.c
@@ -0,0 +1,72 @@
+/* Test of select() substitute, reading or writing from a given file descriptor.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/select.h>
+
+int
+main (int argc, char *argv[])
+{
+ if (argc == 4)
+ {
+ char mode = argv[1][0];
+
+ if (mode == 'r' || mode == 'w')
+ {
+ int fd = atoi (argv[2]);
+
+ if (fd >= 0)
+ {
+ const char *result_file_name = argv[3];
+ FILE *result_file = fopen (result_file_name, "wb");
+
+ if (result_file != NULL)
+ {
+ fd_set fds;
+ struct timeval timeout;
+ int ret;
+
+ FD_ZERO (&fds);
+ FD_SET (fd, &fds);
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 10000;
+ ret = (mode == 'r'
+ ? select (fd + 1, &fds, NULL, NULL, &timeout)
+ : select (fd + 1, NULL, &fds, NULL, &timeout));
+ if (ret < 0)
+ {
+ perror ("select failed");
+ exit (1);
+ }
+ if ((ret == 0) != ! FD_ISSET (fd, &fds))
+ {
+ fprintf (stderr, "incorrect return value\n");
+ exit (1);
+ }
+ fprintf (result_file, "%d\n", ret);
+ exit (0);
+ }
+ }
+ }
+ }
+ fprintf (stderr, "Usage: test-select-fd mode fd result-file-name\n");
+ exit (1);
+}
diff --git a/gnulib-tests/test-select-in.sh b/gnulib-tests/test-select-in.sh
new file mode 100755
index 0000000..44f5dbb
--- /dev/null
+++ b/gnulib-tests/test-select-in.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Test select() on file descriptors opened for reading.
+
+# This test is known to fail on Solaris 2.6 and older, due to its handling
+# of /dev/null.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles t-select-in.tmp"
+
+# Regular files.
+
+rm -f t-select-in.tmp
+./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT}
+test `cat t-select-in.tmp` = "1" || exit 1
+
+# Pipes.
+
+rm -f t-select-in.tmp
+{ sleep 1; echo abc; } | \
+ { ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; }
+test `cat t-select-in.tmp` = "0" || exit 1
+
+rm -f t-select-in.tmp
+echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
+test `cat t-select-in.tmp` = "1" || exit 1
+
+# Special files.
+# This part of the test is known to fail on Solaris 2.6 and older.
+
+rm -f t-select-in.tmp
+./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null
+test `cat t-select-in.tmp` = "1" || exit 1
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/gnulib-tests/test-select-out.sh b/gnulib-tests/test-select-out.sh
new file mode 100755
index 0000000..c5fd861
--- /dev/null
+++ b/gnulib-tests/test-select-out.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Test select() on file descriptors opened for writing.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp"
+
+# Regular files.
+
+rm -f t-select-out.tmp
+./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out
+test `cat t-select-out.tmp` = "1" || exit 1
+
+# Pipes.
+
+if false; then # This test fails on some platforms.
+ rm -f t-select-out.tmp
+ ( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null
+ test `cat t-select-out.tmp` = "0" || exit 1
+fi
+
+rm -f t-select-out.tmp
+( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null
+test `cat t-select-out.tmp` = "1" || exit 1
+
+# Special files.
+
+rm -f t-select-out.tmp
+./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null
+test `cat t-select-out.tmp` = "1" || exit 1
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/gnulib-tests/test-select-stdin.c b/gnulib-tests/test-select-stdin.c
new file mode 100644
index 0000000..0250af4
--- /dev/null
+++ b/gnulib-tests/test-select-stdin.c
@@ -0,0 +1,83 @@
+/* Test of select() substitute, reading from stdin.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ printf ("Applying select() from standard input. Press Ctrl-C to abort.\n");
+ for (;;)
+ {
+ struct timeval before;
+ struct timeval after;
+ unsigned long spent_usec;
+ fd_set readfds;
+ struct timeval timeout;
+ int ret;
+
+ gettimeofday (&before, NULL);
+
+ FD_ZERO (&readfds);
+ FD_SET (0, &readfds);
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 500000;
+ ret = select (1, &readfds, NULL, NULL, &timeout);
+
+ gettimeofday (&after, NULL);
+ spent_usec = (after.tv_sec - before.tv_sec) * 1000000
+ + after.tv_usec - before.tv_usec;
+
+ if (ret < 0)
+ {
+ perror ("select failed");
+ exit (1);
+ }
+ if ((ret == 0) != ! FD_ISSET (0, &readfds))
+ {
+ fprintf (stderr, "incorrect return value\n");
+ exit (1);
+ }
+ if (ret == 0)
+ {
+ if (spent_usec < 250000)
+ {
+ fprintf (stderr, "returned too early\n");
+ exit (1);
+ }
+ /* Timeout */
+ printf (".");
+ ASSERT (fflush (stdout) == 0);
+ }
+ else
+ {
+ char c;
+
+ printf ("Input available! Trying to read 1 byte...\n");
+ ASSERT (read (0, &c, 1) == 1);
+ }
+ }
+}
diff --git a/gnulib-tests/test-select.c b/gnulib-tests/test-select.c
new file mode 100644
index 0000000..9747923
--- /dev/null
+++ b/gnulib-tests/test-select.c
@@ -0,0 +1,34 @@
+/* Test of select() substitute.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini, 2008. */
+
+#include <config.h>
+
+#include <sys/select.h>
+
+#include "signature.h"
+
+SIGNATURE_CHECK (select, int, (int, fd_set *, fd_set *, fd_set *,
+ struct timeval *));
+
+#include "test-select.h"
+
+int
+main (void)
+{
+ return test_function (select);
+}
diff --git a/gnulib-tests/test-select.h b/gnulib-tests/test-select.h
new file mode 100644
index 0000000..f6daba3
--- /dev/null
+++ b/gnulib-tests/test-select.h
@@ -0,0 +1,462 @@
+/* Test of select() substitute.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini, 2008. */
+
+#include <stdio.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#include "macros.h"
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#ifndef SO_REUSEPORT
+# define SO_REUSEPORT SO_REUSEADDR
+#endif
+
+#define TEST_PORT 12345
+
+
+typedef int (*select_fn) (int, fd_set *, fd_set *, fd_set *, struct timeval *);
+
+
+/* Minimal testing infrastructure. */
+
+static int failures;
+
+static void
+failed (const char *reason)
+{
+ if (++failures > 1)
+ printf (" ");
+ printf ("failed (%s)\n", reason);
+}
+
+static int
+test (void (*fn) (select_fn), select_fn my_select, const char *msg)
+{
+ failures = 0;
+ printf ("%s... ", msg);
+ fflush (stdout);
+ fn (my_select);
+
+ if (!failures)
+ printf ("passed\n");
+
+ return failures;
+}
+
+
+/* Funny socket code. */
+
+static int
+open_server_socket (void)
+{
+ int s, x;
+ struct sockaddr_in ia;
+
+ s = socket (AF_INET, SOCK_STREAM, 0);
+
+ x = 1;
+ setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x));
+
+ memset (&ia, 0, sizeof (ia));
+ ia.sin_family = AF_INET;
+ inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr);
+ ia.sin_port = htons (TEST_PORT);
+ if (bind (s, (struct sockaddr *) &ia, sizeof (ia)) < 0)
+ {
+ perror ("bind");
+ exit (77);
+ }
+
+ if (listen (s, 1) < 0)
+ {
+ perror ("listen");
+ exit (77);
+ }
+
+ return s;
+}
+
+static int
+connect_to_socket (bool blocking)
+{
+ int s;
+ struct sockaddr_in ia;
+
+ s = socket (AF_INET, SOCK_STREAM, 0);
+
+ memset (&ia, 0, sizeof (ia));
+ ia.sin_family = AF_INET;
+ inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr);
+ ia.sin_port = htons (TEST_PORT);
+
+ if (!blocking)
+ {
+#ifdef WINDOWS_NATIVE
+ unsigned long iMode = 1;
+ ioctl (s, FIONBIO, (char *) &iMode);
+
+#elif defined F_GETFL
+ int oldflags = fcntl (s, F_GETFL, NULL);
+
+ if (!(oldflags & O_NONBLOCK))
+ fcntl (s, F_SETFL, oldflags | O_NONBLOCK);
+#endif
+ }
+
+ if (connect (s, (struct sockaddr *) &ia, sizeof (ia)) < 0
+ && (blocking || errno != EINPROGRESS))
+ {
+ perror ("connect");
+ exit (77);
+ }
+
+ return s;
+}
+
+
+/* A slightly more convenient interface to select(2).
+ Waits until a specific event occurs on a file descriptor FD.
+ EV is a bit mask of events to look for:
+ SEL_IN - input can be polled without blocking,
+ SEL_OUT - output can be provided without blocking,
+ SEL_EXC - an exception occurred,
+ A maximum wait time is specified by TIMEOUT.
+ *TIMEOUT = { 0, 0 } means to return immediately,
+ TIMEOUT = NULL means to wait indefinitely. */
+
+enum { SEL_IN = 1, SEL_OUT = 2, SEL_EXC = 4 };
+
+static int
+do_select (int fd, int ev, struct timeval *timeout, select_fn my_select)
+{
+ fd_set rfds, wfds, xfds;
+ int r, rev;
+
+ FD_ZERO (&rfds);
+ FD_ZERO (&wfds);
+ FD_ZERO (&xfds);
+ if (ev & SEL_IN)
+ FD_SET (fd, &rfds);
+ if (ev & SEL_OUT)
+ FD_SET (fd, &wfds);
+ if (ev & SEL_EXC)
+ FD_SET (fd, &xfds);
+ r = my_select (fd + 1, &rfds, &wfds, &xfds, timeout);
+ if (r < 0)
+ return r;
+
+ rev = 0;
+ if (FD_ISSET (fd, &rfds))
+ rev |= SEL_IN;
+ if (FD_ISSET (fd, &wfds))
+ rev |= SEL_OUT;
+ if (FD_ISSET (fd, &xfds))
+ rev |= SEL_EXC;
+ if (rev && r == 0)
+ failed ("select returned 0");
+ if (rev & ~ev)
+ failed ("select returned unrequested events");
+
+ return rev;
+}
+
+static int
+do_select_nowait (int fd, int ev, select_fn my_select)
+{
+ struct timeval tv0;
+ tv0.tv_sec = 0;
+ tv0.tv_usec = 0;
+ return do_select (fd, ev, &tv0, my_select);
+}
+
+static int
+do_select_wait (int fd, int ev, select_fn my_select)
+{
+ return do_select (fd, ev, NULL, my_select);
+}
+
+
+/* Test select(2) for TTYs. */
+
+#ifdef INTERACTIVE
+static void
+test_tty (select_fn my_select)
+{
+ if (do_select_nowait (0, SEL_IN, my_select) != 0)
+ failed ("can read");
+ if (do_select_nowait (0, SEL_OUT, my_select) == 0)
+ failed ("cannot write");
+
+ if (do_select_wait (0, SEL_IN, my_select) == 0)
+ failed ("return with infinite timeout");
+
+ getchar ();
+ if (do_select_nowait (0, SEL_IN, my_select) != 0)
+ failed ("can read after getc");
+}
+#endif
+
+
+static int
+do_select_bad_nfd_nowait (int nfd, select_fn my_select)
+{
+ struct timeval tv0;
+ tv0.tv_sec = 0;
+ tv0.tv_usec = 0;
+ errno = 0;
+ return my_select (nfd, NULL, NULL, NULL, &tv0);
+}
+
+static void
+test_bad_nfd (select_fn my_select)
+{
+ if (do_select_bad_nfd_nowait (-1, my_select) != -1 || errno != EINVAL)
+ failed ("invalid errno after negative nfds");
+ /* Can't test FD_SETSIZE + 1 for EINVAL, since some systems allow
+ dynamically larger set size by redefining FD_SETSIZE anywhere up
+ to the actual maximum fd. */
+ /* if (do_select_bad_nfd_nowait (FD_SETSIZE + 1, my_select) != -1 */
+ /* || errno != EINVAL) */
+ /* failed ("invalid errno after bogus nfds"); */
+}
+
+/* Test select(2) on invalid file descriptors. */
+
+static int
+do_select_bad_fd (int fd, int ev, struct timeval *timeout, select_fn my_select)
+{
+ fd_set rfds, wfds, xfds;
+
+ FD_ZERO (&rfds);
+ FD_ZERO (&wfds);
+ FD_ZERO (&xfds);
+ if (ev & SEL_IN)
+ FD_SET (fd, &rfds);
+ if (ev & SEL_OUT)
+ FD_SET (fd, &wfds);
+ if (ev & SEL_EXC)
+ FD_SET (fd, &xfds);
+ errno = 0;
+ return my_select (fd + 1, &rfds, &wfds, &xfds, timeout);
+ /* In this case, when fd is invalid, on some platforms, the bit for fd
+ is left alone in the fd_set, whereas on other platforms it is cleared.
+ So, don't check the bit for fd here. */
+}
+
+static int
+do_select_bad_fd_nowait (int fd, int ev, select_fn my_select)
+{
+ struct timeval tv0;
+ tv0.tv_sec = 0;
+ tv0.tv_usec = 0;
+ return do_select_bad_fd (fd, ev, &tv0, my_select);
+}
+
+static void
+test_bad_fd (select_fn my_select)
+{
+ /* This tests fails on OSF/1 and native Windows, even with fd = 16. */
+#if !(defined __osf__ || defined WINDOWS_NATIVE)
+ int fd;
+
+ /* On Linux, Mac OS X, *BSD, values of fd like 99 or 399 are discarded
+ by the kernel early and therefore do *not* lead to EBADF, as required
+ by POSIX. */
+# if defined __linux__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
+ fd = 16;
+# else
+ fd = 99;
+# endif
+ close (fd);
+
+ if (do_select_bad_fd_nowait (fd, SEL_IN, my_select) == 0 || errno != EBADF)
+ failed ("invalid fd among rfds");
+ if (do_select_bad_fd_nowait (fd, SEL_OUT, my_select) == 0 || errno != EBADF)
+ failed ("invalid fd among wfds");
+ if (do_select_bad_fd_nowait (fd, SEL_EXC, my_select) == 0 || errno != EBADF)
+ failed ("invalid fd among xfds");
+#endif
+}
+
+
+/* Test select(2) for unconnected nonblocking sockets. */
+
+static void
+test_connect_first (select_fn my_select)
+{
+ int s = open_server_socket ();
+ struct sockaddr_in ia;
+ socklen_t addrlen;
+
+ int c1, c2;
+
+ if (do_select_nowait (s, SEL_IN | SEL_EXC, my_select) != 0)
+ failed ("can read, socket not connected");
+
+ c1 = connect_to_socket (false);
+
+ if (do_select_wait (s, SEL_IN | SEL_EXC, my_select) != SEL_IN)
+ failed ("expecting readability on passive socket");
+ if (do_select_nowait (s, SEL_IN | SEL_EXC, my_select) != SEL_IN)
+ failed ("expecting readability on passive socket");
+
+ addrlen = sizeof (ia);
+ c2 = accept (s, (struct sockaddr *) &ia, &addrlen);
+ ASSERT (close (s) == 0);
+ ASSERT (close (c1) == 0);
+ ASSERT (close (c2) == 0);
+}
+
+
+/* Test select(2) for unconnected blocking sockets. */
+
+static void
+test_accept_first (select_fn my_select)
+{
+#ifndef WINDOWS_NATIVE
+ int s = open_server_socket ();
+ struct sockaddr_in ia;
+ socklen_t addrlen;
+ char buf[3];
+ int c, pid;
+
+ pid = fork ();
+ if (pid < 0)
+ return;
+
+ if (pid == 0)
+ {
+ addrlen = sizeof (ia);
+ c = accept (s, (struct sockaddr *) &ia, &addrlen);
+ ASSERT (close (s) == 0);
+ ASSERT (write (c, "foo", 3) == 3);
+ ASSERT (read (c, buf, 3) == 3);
+ shutdown (c, SHUT_RD);
+ ASSERT (close (c) == 0);
+ exit (0);
+ }
+ else
+ {
+ ASSERT (close (s) == 0);
+ c = connect_to_socket (true);
+ if (do_select_nowait (c, SEL_OUT, my_select) != SEL_OUT)
+ failed ("cannot write after blocking connect");
+ ASSERT (write (c, "foo", 3) == 3);
+ wait (&pid);
+ if (do_select_wait (c, SEL_IN, my_select) != SEL_IN)
+ failed ("cannot read data left in the socket by closed process");
+ ASSERT (read (c, buf, 3) == 3);
+ ASSERT (write (c, "foo", 3) == 3);
+ (void) close (c); /* may fail with errno = ECONNRESET */
+ }
+#endif
+}
+
+
+/* Common code for pipes and connected sockets. */
+
+static void
+test_pair (int rd, int wd, select_fn my_select)
+{
+ char buf[3];
+ if (do_select_wait (wd, SEL_IN | SEL_OUT | SEL_EXC, my_select) != SEL_OUT)
+ failed ("expecting writability before writing");
+ if (do_select_nowait (wd, SEL_IN | SEL_OUT | SEL_EXC, my_select) != SEL_OUT)
+ failed ("expecting writability before writing");
+
+ ASSERT (write (wd, "foo", 3) == 3);
+ if (do_select_wait (rd, SEL_IN, my_select) != SEL_IN)
+ failed ("expecting readability after writing");
+ if (do_select_nowait (rd, SEL_IN, my_select) != SEL_IN)
+ failed ("expecting readability after writing");
+
+ ASSERT (read (rd, buf, 3) == 3);
+}
+
+
+/* Test select(2) on connected sockets. */
+
+static void
+test_socket_pair (select_fn my_select)
+{
+ struct sockaddr_in ia;
+
+ socklen_t addrlen = sizeof (ia);
+ int s = open_server_socket ();
+ int c1 = connect_to_socket (false);
+ int c2 = accept (s, (struct sockaddr *) &ia, &addrlen);
+
+ ASSERT (close (s) == 0);
+
+ test_pair (c1, c2, my_select);
+ ASSERT (close (c1) == 0);
+ ASSERT (write (c2, "foo", 3) == 3);
+ (void) close (c2); /* may fail with errno = ECONNRESET */
+}
+
+
+/* Test select(2) on pipes. */
+
+static void
+test_pipe (select_fn my_select)
+{
+ int fd[2];
+
+ ASSERT (pipe (fd) == 0);
+ test_pair (fd[0], fd[1], my_select);
+ ASSERT (close (fd[0]) == 0);
+ ASSERT (close (fd[1]) == 0);
+}
+
+
+/* Do them all. */
+
+static int
+test_function (select_fn my_select)
+{
+ int result = 0;
+
+#ifdef INTERACTIVE
+ printf ("Please press Enter\n");
+ test (test_tty, "TTY", my_select);
+#endif
+
+ result += test (test_bad_nfd, my_select, "Invalid nfd test");
+ result += test (test_bad_fd, my_select, "Invalid fd test");
+ result += test (test_connect_first, my_select, "Unconnected socket test");
+ result += test (test_socket_pair, my_select, "Connected sockets test");
+ result += test (test_accept_first, my_select, "General socket test with fork");
+ result += test (test_pipe, my_select, "Pipe test");
+
+ return result;
+}
diff --git a/gnulib-tests/test-setenv.c b/gnulib-tests/test-setenv.c
new file mode 100644
index 0000000..519dc27
--- /dev/null
+++ b/gnulib-tests/test-setenv.c
@@ -0,0 +1,56 @@
+/* Tests of setenv.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (setenv, int, (char const *, char const *, int));
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ /* Test overwriting. */
+ ASSERT (setenv ("a", "==", -1) == 0);
+ ASSERT (setenv ("a", "2", 0) == 0);
+ ASSERT (strcmp (getenv ("a"), "==") == 0);
+
+ /* Required to fail with EINVAL. */
+ errno = 0;
+ ASSERT (setenv ("", "", 1) == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (setenv ("a=b", "", 0) == -1);
+ ASSERT (errno == EINVAL);
+#if 0
+ /* glibc and gnulib's implementation guarantee this, but POSIX no
+ longer requires it: http://austingroupbugs.net/view.php?id=185 */
+ errno = 0;
+ ASSERT (setenv (NULL, "", 0) == -1);
+ ASSERT (errno == EINVAL);
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-setlocale1.c b/gnulib-tests/test-setlocale1.c
new file mode 100644
index 0000000..143c0d8
--- /dev/null
+++ b/gnulib-tests/test-setlocale1.c
@@ -0,0 +1,61 @@
+/* Test of setting the current locale.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <locale.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (setlocale, char *, (int, const char *));
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ char *name1;
+ char *name2;
+
+ /* Try to set the locale by implicitly looking at the LC_ALL environment
+ variable.
+ configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ name1 = strdup (setlocale (LC_ALL, NULL));
+
+ /* Reset the locale. */
+ if (setlocale (LC_ALL, "C") == NULL)
+ return 1;
+
+ /* Try to set the locale by explicitly looking at the LC_ALL environment
+ variable.
+ configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL)
+ return 1;
+
+ name2 = strdup (setlocale (LC_ALL, NULL));
+
+ /* Test that the two results are the same. */
+ ASSERT (strcmp (name1, name2) == 0);
+ free (name1);
+ free (name2);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-setlocale1.sh b/gnulib-tests/test-setlocale1.sh
new file mode 100755
index 0000000..59a0532
--- /dev/null
+++ b/gnulib-tests/test-setlocale1.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+: ${LOCALE_FR=fr_FR}
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+: ${LOCALE_JA=ja_JP}
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none \
+ && test $LOCALE_JA = none && test $LOCALE_ZH_CN = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no locale for testing is installed"
+ else
+ echo "Skipping test: no locale for testing is supported"
+ fi
+ exit 77
+fi
+
+if test $LOCALE_FR != none; then
+ LC_ALL=$LOCALE_FR ./test-setlocale1${EXEEXT} || exit 1
+fi
+
+if test $LOCALE_FR_UTF8 != none; then
+ LC_ALL=$LOCALE_FR_UTF8 ./test-setlocale1${EXEEXT} || exit 1
+fi
+
+if test $LOCALE_JA != none; then
+ LC_ALL=$LOCALE_JA ./test-setlocale1${EXEEXT} || exit 1
+fi
+
+if test $LOCALE_ZH_CN != none; then
+ LC_ALL=$LOCALE_ZH_CN ./test-setlocale1${EXEEXT} || exit 1
+fi
+
+exit 0
diff --git a/gnulib-tests/test-setlocale2.c b/gnulib-tests/test-setlocale2.c
new file mode 100644
index 0000000..52e65d8
--- /dev/null
+++ b/gnulib-tests/test-setlocale2.c
@@ -0,0 +1,55 @@
+/* Test of setting the current locale.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <locale.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ /* Try to set the locale by implicitly looking at the LC_ALL environment
+ variable. */
+ if (setlocale (LC_ALL, "") != NULL)
+ /* It was successful. Check whether LC_CTYPE is non-trivial. */
+ if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ {
+ fprintf (stderr, "setlocale did not fail for implicit %s\n",
+ getenv ("LC_ALL"));
+ return 1;
+ }
+
+ /* Reset the locale. */
+ if (setlocale (LC_ALL, "C") == NULL)
+ return 1;
+
+ /* Try to set the locale by explicitly looking at the LC_ALL environment
+ variable. */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) != NULL)
+ /* It was successful. Check whether LC_CTYPE is non-trivial. */
+ if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ {
+ fprintf (stderr, "setlocale did not fail for explicit %s\n",
+ getenv ("LC_ALL"));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-setlocale2.sh b/gnulib-tests/test-setlocale2.sh
new file mode 100755
index 0000000..904e147
--- /dev/null
+++ b/gnulib-tests/test-setlocale2.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test locale names with likely unsupported encoding in Unix syntax.
+for name in ar_SA.ISO-8859-1 fr_FR.CP1251 zh_TW.GB18030 zh_CN.BIG5; do
+ env LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1
+done
+
+# Test locale names with likely unsupported encoding in native Windows syntax.
+for name in "Arabic_Saudi Arabia.1252" "Arabic_Saudi Arabia.65001" \
+ French_France.65001 Japanese_Japan.65001 Turkish_Turkey.65001 \
+ Chinese_Taiwan.65001 Chinese_China.54936 Chinese_China.65001; do
+ # Here we use 'env' to set the LC_ALL environment variable, because on
+ # Solaris 11 2011-11, the /bin/sh refuses to do it for Turkish_Turkey.65001.
+ env LC_ALL="$name" ./test-setlocale2${EXEEXT} 1 || exit 1
+done
+
+exit 0
diff --git a/gnulib-tests/test-setsockopt.c b/gnulib-tests/test-setsockopt.c
new file mode 100644
index 0000000..4b73b82
--- /dev/null
+++ b/gnulib-tests/test-setsockopt.c
@@ -0,0 +1,55 @@
+/* Test setsockopt() function.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (setsockopt, int, (int, int, int, const void *, socklen_t));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+ (void) gl_sockets_startup (SOCKETS_1_1);
+
+ /* Test behaviour for invalid file descriptors. */
+ {
+ int value = 1;
+
+ errno = 0;
+ ASSERT (setsockopt (-1, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value))
+ == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ int value = 1;
+
+ close (99);
+ errno = 0;
+ ASSERT (setsockopt (99, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value))
+ == -1);
+ ASSERT (errno == EBADF);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-sh-quote.c b/gnulib-tests/test-sh-quote.c
new file mode 100644
index 0000000..a2633ba
--- /dev/null
+++ b/gnulib-tests/test-sh-quote.c
@@ -0,0 +1,203 @@
+/* Test of sh-quote module.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2012. */
+
+#include <config.h>
+
+/* Specification. */
+#include "sh-quote.h"
+
+#include <limits.h>
+#include <string.h>
+
+#include "macros.h"
+
+static void
+check_one (const char *input, const char *expected)
+{
+ char buf[1000];
+ size_t output_len;
+ char *output;
+ char *bufend;
+
+ output_len = shell_quote_length (input);
+
+ output = shell_quote (input);
+ ASSERT (strlen (output) == output_len);
+
+ ASSERT (output_len <= sizeof (buf) - 2);
+ memset (buf, '\0', output_len + 1);
+ buf[output_len + 1] = '%';
+ bufend = shell_quote_copy (buf, input);
+ ASSERT (bufend == buf + output_len);
+ ASSERT (memcmp (buf, output, output_len + 1) == 0);
+ ASSERT (buf[output_len + 1] == '%');
+
+ ASSERT (strcmp (output, expected) == 0);
+
+ free (output);
+}
+
+int
+main (void)
+{
+ /* Check the shell_quote_length, shell_quote_copy, shell_quote functions. */
+ {
+ int c;
+
+ /* Empty argument. */
+ check_one ("", "''");
+
+ /* Identifier or number. */
+ check_one ("foo", "foo");
+ check_one ("phr0ck", "phr0ck");
+
+ /* Whitespace would be interpreted as argument separator by the shell. */
+ check_one ("foo\tbar", "'foo\tbar'");
+ check_one ("foo\nbar", "'foo\nbar'");
+ check_one ("foo\rbar", "'foo\rbar'");
+ check_one ("foo bar", "'foo bar'");
+
+ /* '!' at the beginning of argv[0] would introduce a negated command. */
+ check_one ("!foo", "'!foo'");
+
+ /* '"' would be interpreted as the start of a string. */
+ check_one ("\"foo\"bar", "'\"foo\"bar'");
+
+ /* '#' at the beginning of an argument would be interpreted as the start
+ of a comment. */
+ check_one ("#foo", "'#foo'");
+
+ /* '$' at the beginning of an argument would be interpreted as a variable
+ reference. */
+ check_one ("$foo", "'$foo'");
+
+ /* '&' at the beginning of an argument would be interpreted as a background
+ task indicator. */
+ check_one ("&", "'&'");
+
+ /* "'" would be interpreted as the start of a string. */
+ check_one ("'foo'bar", "''\\''foo'\\''bar'"); /* or "\"'foo'bar\"" */
+
+ /* '(' at the beginning of argv[0] would introduce a subshell command. */
+ check_one ("(", "'('");
+
+ /* ')' at the beginning of an argument would be interpreted as the end of
+ the command. */
+ check_one (")", "')'");
+
+ /* '*' would be interpreted as a wildcard character. */
+ check_one ("*", "'*'");
+ check_one ("*foo", "'*foo'");
+
+ /* ';' at the beginning of an argument would be interpreted as an empty
+ statement in argv[0] and as the end of the command otherwise. */
+ check_one (";", "';'");
+ check_one ("foo;", "'foo;'");
+
+ /* '<' would be interpreted as a redirection of stdin. */
+ check_one ("<", "'<'");
+
+ /* '=' inside argv[0] would be interpreted as an environment variable
+ assignment. */
+ check_one ("foo=bar", "'foo=bar'");
+
+ /* '>' would be interpreted as a redirection of stdout. */
+ check_one (">", "'>'");
+
+ /* '?' would be interpreted as a wildcard character. */
+ check_one ("?", "'?'");
+ check_one ("foo?bar", "'foo?bar'");
+
+ /* '^' would be interpreted in old /bin/sh, e.g. SunOS 4.1.4. */
+ check_one ("^", "'^'");
+
+ /* "[...]" would be interpreted as a wildcard pattern. */
+ check_one ("[", "'['");
+ check_one ("]", "]"); /* or "']'" */
+
+ /* '\' would be interpreted as an escape character. */
+ check_one ("\\foo", "'\\foo'");
+
+ /* '`' would be interpreted as the start of a command substitution. */
+ check_one ("`foo", "'`foo'");
+
+ /* '{' at the beginning of argv[0] would introduce a complex command. */
+ check_one ("{", "'{'");
+
+ /* '|' at the beginning of an argument would be interpreted as a pipe
+ between commands. */
+ check_one ("|", "'|'");
+
+ /* '}' at the beginning of an argument would be interpreted as the end of
+ the command. */
+ check_one ("}", "'}'");
+
+ /* '~' at the beginning of an argument would be interpreted as a reference
+ to a user's home directory. */
+ check_one ("~", "'~'");
+ check_one ("~foo", "'~foo'");
+
+ /* A string that contains both ' and ". */
+ check_one ("foo'bar\"baz", "'foo'\\''bar\"baz'"); /* or "\"foo'bar\\\"baz\"" */
+
+ /* All other characters don't need quoting. */
+ for (c = 1; c <= UCHAR_MAX; c++)
+ if (strchr ("\t\n\r !\"#$&'()*;<=>?^[\\]`{|}~", c) == NULL)
+ {
+ char s[5];
+ s[0] = 'a';
+ s[1] = (char) c;
+ s[2] = 'z';
+ s[3] = (char) c;
+ s[4] = '\0';
+
+ check_one (s, s);
+ }
+ }
+
+ /* Check the shell_quote_argv function. */
+ {
+ char *argv[1];
+ char *result;
+ argv[0] = NULL;
+ result = shell_quote_argv (argv);
+ ASSERT (strcmp (result, "") == 0);
+ free (result);
+ }
+ {
+ char *argv[2];
+ char *result;
+ argv[0] = (char *) "foo bar/baz";
+ argv[1] = NULL;
+ result = shell_quote_argv (argv);
+ ASSERT (strcmp (result, "'foo bar/baz'") == 0); /* or "\"foo bar/baz\"" */
+ free (result);
+ }
+ {
+ char *argv[3];
+ char *result;
+ argv[0] = (char *) "foo bar/baz";
+ argv[1] = (char *) "$";
+ argv[2] = NULL;
+ result = shell_quote_argv (argv);
+ ASSERT (strcmp (result, "'foo bar/baz' '$'") == 0); /* or "\"foo bar/baz\" \"\\$\"" */
+ free (result);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-sigaction.c b/gnulib-tests/test-sigaction.c
new file mode 100644
index 0000000..27c1ecc
--- /dev/null
+++ b/gnulib-tests/test-sigaction.c
@@ -0,0 +1,122 @@
+/* Test of sigaction() function.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2008. */
+
+#include <config.h>
+
+#include <signal.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (sigaction, int, (int, struct sigaction const *,
+ struct sigaction *));
+
+#include <stddef.h>
+
+#include "macros.h"
+
+#ifndef SA_NOCLDSTOP
+# define SA_NOCLDSTOP 0
+#endif
+#ifndef SA_ONSTACK
+# define SA_ONSTACK 0
+#endif
+#ifndef SA_RESETHAND
+# define SA_RESETHAND 0
+#endif
+#ifndef SA_RESTART
+# define SA_RESTART 0
+#endif
+#ifndef SA_SIGINFO
+# define SA_SIGINFO 0
+#endif
+#ifndef SA_NOCLDWAIT
+# define SA_NOCLDWAIT 0
+#endif
+
+/* Define a mask of flags required by POSIX. Some implementations
+ provide other flags as extensions, such as SA_RESTORER, that we
+ must ignore in this test. */
+#define MASK_SA_FLAGS (SA_NOCLDSTOP | SA_ONSTACK | SA_RESETHAND | SA_RESTART \
+ | SA_SIGINFO | SA_NOCLDWAIT | SA_NODEFER)
+
+/* This test is unsafe in the presence of an asynchronous SIGABRT,
+ because we install a signal-handler that is intentionally not
+ async-safe. Hopefully, this does not lead to too many reports of
+ false failures, since people don't generally use 'kill -s SIGABRT'
+ to end a runaway program. */
+
+static void
+handler (int sig)
+{
+ static int entry_count;
+ struct sigaction sa;
+ ASSERT (sig == SIGABRT);
+ ASSERT (sigaction (SIGABRT, NULL, &sa) == 0);
+ ASSERT ((sa.sa_flags & SA_SIGINFO) == 0);
+ switch (entry_count++)
+ {
+ case 0:
+ ASSERT ((sa.sa_flags & SA_RESETHAND) == 0);
+ ASSERT (sa.sa_handler == handler);
+ break;
+ case 1:
+ /* This assertion fails on glibc-2.3.6 systems with LinuxThreads,
+ when this program is linked with -lpthread, due to the sigaction()
+ override in libpthread.so. */
+#if !(defined __GLIBC__ || defined __UCLIBC__)
+ ASSERT (sa.sa_handler == SIG_DFL);
+#endif
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+int
+main (void)
+{
+ struct sigaction sa;
+ struct sigaction old_sa;
+ sa.sa_handler = handler;
+
+ sa.sa_flags = 0;
+ ASSERT (sigemptyset (&sa.sa_mask) == 0);
+ ASSERT (sigaction (SIGABRT, &sa, NULL) == 0);
+ ASSERT (raise (SIGABRT) == 0);
+
+ sa.sa_flags = SA_RESETHAND | SA_NODEFER;
+ ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0);
+ ASSERT ((old_sa.sa_flags & MASK_SA_FLAGS) == 0);
+ ASSERT (old_sa.sa_handler == handler);
+ ASSERT (raise (SIGABRT) == 0);
+
+ sa.sa_handler = SIG_DFL;
+ ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0);
+ ASSERT ((old_sa.sa_flags & SA_SIGINFO) == 0);
+#if !(defined __GLIBC__ || defined __UCLIBC__) /* see above */
+ ASSERT (old_sa.sa_handler == SIG_DFL);
+#endif
+
+ sa.sa_handler = SIG_IGN;
+ ASSERT (sigaction (SIGABRT, &sa, NULL) == 0);
+ ASSERT (raise (SIGABRT) == 0);
+ ASSERT (sigaction (SIGABRT, NULL, &old_sa) == 0);
+ ASSERT (old_sa.sa_handler == SIG_IGN);
+ ASSERT (raise (SIGABRT) == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-signal-h.c b/gnulib-tests/test-signal-h.c
new file mode 100644
index 0000000..b050839
--- /dev/null
+++ b/gnulib-tests/test-signal-h.c
@@ -0,0 +1,129 @@
+/* Test of <signal.h> substitute.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <signal.h>
+
+/* Check for required types. */
+struct
+{
+ size_t a;
+ uid_t b;
+ volatile sig_atomic_t c;
+ sigset_t d;
+ pid_t e;
+#if 0
+ /* Not guaranteed by gnulib. */
+ pthread_t f;
+ struct timespec g;
+#endif
+} s;
+
+/* Check that NSIG is defined. */
+int nsig = NSIG;
+
+int
+main (void)
+{
+ switch (0)
+ {
+ /* The following are guaranteed by C. */
+ case 0:
+ case SIGABRT:
+ case SIGFPE:
+ case SIGILL:
+ case SIGINT:
+ case SIGSEGV:
+ case SIGTERM:
+ /* The following is guaranteed by gnulib. */
+#if GNULIB_SIGPIPE || defined SIGPIPE
+ case SIGPIPE:
+#endif
+ /* Ensure no conflict with other standardized names. */
+#ifdef SIGALRM
+ case SIGALRM:
+#endif
+ /* On Haiku, SIGBUS is mistakenly equal to SIGSEGV. */
+#if defined SIGBUS && SIGBUS != SIGSEGV
+ case SIGBUS:
+#endif
+#ifdef SIGCHLD
+ case SIGCHLD:
+#endif
+#ifdef SIGCONT
+ case SIGCONT:
+#endif
+#ifdef SIGHUP
+ case SIGHUP:
+#endif
+#ifdef SIGKILL
+ case SIGKILL:
+#endif
+#ifdef SIGQUIT
+ case SIGQUIT:
+#endif
+#ifdef SIGSTOP
+ case SIGSTOP:
+#endif
+#ifdef SIGTSTP
+ case SIGTSTP:
+#endif
+#ifdef SIGTTIN
+ case SIGTTIN:
+#endif
+#ifdef SIGTTOU
+ case SIGTTOU:
+#endif
+#ifdef SIGUSR1
+ case SIGUSR1:
+#endif
+#ifdef SIGUSR2
+ case SIGUSR2:
+#endif
+#ifdef SIGSYS
+ case SIGSYS:
+#endif
+#ifdef SIGTRAP
+ case SIGTRAP:
+#endif
+#ifdef SIGURG
+ case SIGURG:
+#endif
+#ifdef SIGVTALRM
+ case SIGVTALRM:
+#endif
+#ifdef SIGXCPU
+ case SIGXCPU:
+#endif
+#ifdef SIGXFSZ
+ case SIGXFSZ:
+#endif
+ /* SIGRTMIN and SIGRTMAX need not be compile-time constants. */
+#if 0
+# ifdef SIGRTMIN
+ case SIGRTMIN:
+# endif
+# ifdef SIGRTMAX
+ case SIGRTMAX:
+# endif
+#endif
+ ;
+ }
+ return s.a + s.b + s.c + s.e;
+}
diff --git a/gnulib-tests/test-sigprocmask.c b/gnulib-tests/test-sigprocmask.c
new file mode 100644
index 0000000..e759bf1
--- /dev/null
+++ b/gnulib-tests/test-sigprocmask.c
@@ -0,0 +1,102 @@
+/* Test of sigprocmask.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011. */
+
+#include <config.h>
+
+#include <signal.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (sigprocmask, int, (int, const sigset_t *, sigset_t *));
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+
+static volatile int sigint_occurred;
+
+static void
+sigint_handler (int sig)
+{
+ sigint_occurred++;
+}
+
+int
+main (int argc, char *argv[])
+{
+ sigset_t set;
+ pid_t pid = getpid ();
+ char command[80];
+
+ if (sizeof (int) < sizeof pid && 0x7fffffff < pid)
+ {
+ fputs ("Skipping test: pid too large\n", stderr);
+ return 77;
+ }
+
+ signal (SIGINT, sigint_handler);
+
+ sigemptyset (&set);
+ sigaddset (&set, SIGINT);
+
+ /* Check error handling. */
+ ASSERT (sigprocmask (1729, &set, NULL) == -1);
+ ASSERT (errno == EINVAL);
+
+ /* Block SIGINT. */
+ ASSERT (sigprocmask (SIG_BLOCK, &set, NULL) == 0);
+
+ /* Request a SIGINT signal from outside. */
+ sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, (int) pid);
+ ASSERT (system (command) == 0);
+
+ /* Wait. */
+ sleep (2);
+
+ /* The signal should not have arrived yet, because it is blocked. */
+ ASSERT (sigint_occurred == 0);
+
+ /* Unblock SIGINT. */
+ ASSERT (sigprocmask (SIG_UNBLOCK, &set, NULL) == 0);
+
+ /* The signal should have arrived now, because POSIX says
+ "If there are any pending unblocked signals after the call to
+ sigprocmask(), at least one of those signals shall be delivered
+ before the call to sigprocmask() returns." */
+ ASSERT (sigint_occurred == 1);
+
+ return 0;
+}
+
+#else
+
+/* On native Windows, getpid() values and the arguments that are passed to
+ the (Cygwin?) 'kill' program are not necessarily related. */
+
+int
+main ()
+{
+ fputs ("Skipping test: native Windows platform\n", stderr);
+ return 77;
+}
+
+#endif
diff --git a/gnulib-tests/test-sleep.c b/gnulib-tests/test-sleep.c
new file mode 100644
index 0000000..64f681e
--- /dev/null
+++ b/gnulib-tests/test-sleep.c
@@ -0,0 +1,58 @@
+/* Test of sleep() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (sleep, unsigned int, (unsigned int));
+
+#include <signal.h>
+
+#include "macros.h"
+
+#if HAVE_DECL_ALARM
+static void
+handle_alarm (int sig)
+{
+ if (sig != SIGALRM)
+ _exit (1);
+}
+#endif
+
+int
+main (void)
+{
+ ASSERT (sleep (1) <= 1);
+
+ ASSERT (sleep (0) == 0);
+
+#if HAVE_DECL_ALARM
+ {
+ const unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
+ unsigned int remaining;
+ signal (SIGALRM, handle_alarm);
+ alarm (1);
+ remaining = sleep (pentecost);
+ ASSERT (pentecost - 10 < remaining && remaining <= pentecost);
+ }
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-snprintf.c b/gnulib-tests/test-snprintf.c
new file mode 100644
index 0000000..9041e4a
--- /dev/null
+++ b/gnulib-tests/test-snprintf.c
@@ -0,0 +1,72 @@
+/* Test of snprintf() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (snprintf, int, (char *, size_t, char const *, ...));
+
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ char buf[8];
+ int size;
+ int retval;
+
+ retval = snprintf (NULL, 0, "%d", 12345);
+ ASSERT (retval == 5);
+
+ for (size = 0; size <= 8; size++)
+ {
+ memcpy (buf, "DEADBEEF", 8);
+ retval = snprintf (buf, size, "%d", 12345);
+ ASSERT (retval == 5);
+ if (size < 6)
+ {
+ if (size > 0)
+ {
+ ASSERT (memcmp (buf, "12345", size - 1) == 0);
+ ASSERT (buf[size - 1] == '\0' || buf[size - 1] == '0' + size);
+ }
+#if !CHECK_SNPRINTF_POSIX
+ if (size > 0)
+#endif
+ ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
+ }
+ else
+ {
+ ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
+ }
+ }
+
+ /* Test the support of the POSIX/XSI format strings with positions. */
+ {
+ char result[100];
+ retval = snprintf (result, sizeof (result), "%2$d %1$d", 33, 55);
+ ASSERT (strcmp (result, "55 33") == 0);
+ ASSERT (retval == strlen (result));
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-sockets.c b/gnulib-tests/test-sockets.c
new file mode 100644
index 0000000..2836ed9
--- /dev/null
+++ b/gnulib-tests/test-sockets.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Written by Simon Josefsson.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "sockets.h"
+
+int
+main (void)
+{
+ int err;
+
+ err = gl_sockets_startup (SOCKETS_1_1);
+ if (err != 0)
+ {
+ printf ("wsastartup failed %d\n", err);
+ return 1;
+ }
+
+ err = gl_sockets_cleanup ();
+ if (err != 0)
+ {
+ printf ("wsacleanup failed %d\n", err);
+ return 1;
+ }
+
+ (void) gl_fd_to_handle (0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-stat-time.c b/gnulib-tests/test-stat-time.c
new file mode 100644
index 0000000..c60ee7a
--- /dev/null
+++ b/gnulib-tests/test-stat-time.c
@@ -0,0 +1,224 @@
+/* Test of <stat-time.h>.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by James Youngman <jay@gnu.org>, 2007. */
+
+#include <config.h>
+
+#include "stat-time.h"
+
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define BASE "test-stat-time.t"
+#include "nap.h"
+
+enum { NFILES = 4 };
+
+static int
+force_unlink (const char *filename)
+{
+ /* This chmod is necessary on mingw, where unlink() of a read-only file
+ fails with EPERM. */
+ chmod (filename, 0600);
+ return unlink (filename);
+}
+
+static void
+cleanup (int sig)
+{
+ /* Remove temporary files. */
+ force_unlink ("t-stt-stamp1");
+ force_unlink ("t-stt-testfile");
+ force_unlink ("t-stt-stamp2");
+ force_unlink ("t-stt-renamed");
+ force_unlink ("t-stt-stamp3");
+
+ if (sig != 0)
+ _exit (1);
+}
+
+static int
+open_file (const char *filename, int flags)
+{
+ int fd = open (filename, flags | O_WRONLY, 0500);
+ if (fd >= 0)
+ {
+ close (fd);
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+static void
+create_file (const char *filename)
+{
+ ASSERT (open_file (filename, O_CREAT | O_EXCL));
+}
+
+static void
+do_stat (const char *filename, struct stat *p)
+{
+ ASSERT (stat (filename, p) == 0);
+}
+
+static void
+prepare_test (struct stat *statinfo, struct timespec *modtimes)
+{
+ int i;
+
+ create_file ("t-stt-stamp1");
+ nap ();
+ create_file ("t-stt-testfile");
+ nap ();
+ create_file ("t-stt-stamp2");
+ nap ();
+ ASSERT (chmod ("t-stt-testfile", 0400) == 0);
+ nap ();
+ create_file ("t-stt-stamp3");
+
+ do_stat ("t-stt-stamp1", &statinfo[0]);
+ do_stat ("t-stt-testfile", &statinfo[1]);
+ do_stat ("t-stt-stamp2", &statinfo[2]);
+ do_stat ("t-stt-stamp3", &statinfo[3]);
+
+ /* Now use our access functions. */
+ for (i = 0; i < NFILES; ++i)
+ {
+ modtimes[i] = get_stat_mtime (&statinfo[i]);
+ }
+}
+
+static void
+test_mtime (const struct stat *statinfo, struct timespec *modtimes)
+{
+ int i;
+
+ /* Use the struct stat fields directly. */
+ /* mtime(stamp1) < mtime(stamp2) */
+ ASSERT (statinfo[0].st_mtime < statinfo[2].st_mtime
+ || (statinfo[0].st_mtime == statinfo[2].st_mtime
+ && (get_stat_mtime_ns (&statinfo[0])
+ < get_stat_mtime_ns (&statinfo[2]))));
+ /* mtime(stamp2) < mtime(stamp3) */
+ ASSERT (statinfo[2].st_mtime < statinfo[3].st_mtime
+ || (statinfo[2].st_mtime == statinfo[3].st_mtime
+ && (get_stat_mtime_ns (&statinfo[2])
+ < get_stat_mtime_ns (&statinfo[3]))));
+
+ /* Now check the result of the access functions. */
+ /* mtime(stamp1) < mtime(stamp2) */
+ ASSERT (modtimes[0].tv_sec < modtimes[2].tv_sec
+ || (modtimes[0].tv_sec == modtimes[2].tv_sec
+ && modtimes[0].tv_nsec < modtimes[2].tv_nsec));
+ /* mtime(stamp2) < mtime(stamp3) */
+ ASSERT (modtimes[2].tv_sec < modtimes[3].tv_sec
+ || (modtimes[2].tv_sec == modtimes[3].tv_sec
+ && modtimes[2].tv_nsec < modtimes[3].tv_nsec));
+
+ /* verify equivalence */
+ for (i = 0; i < NFILES; ++i)
+ {
+ struct timespec ts;
+ ts = get_stat_mtime (&statinfo[i]);
+ ASSERT (ts.tv_sec == statinfo[i].st_mtime);
+ }
+}
+
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+/* Skip the ctime tests on native Windows platforms, because their
+ st_ctime is either the same as st_mtime (plus or minus an offset)
+ or set to the file _creation_ time, and is not influenced by rename
+ or chmod. */
+# define test_ctime(ignored) ((void) 0)
+#else
+static void
+test_ctime (const struct stat *statinfo)
+{
+ /* On some buggy NFS clients, mtime and ctime are disproportionately
+ skewed from one another. Skip this test in that case. */
+ if (statinfo[0].st_mtime != statinfo[0].st_ctime)
+ return;
+
+ /* mtime(stamp2) < ctime(renamed) */
+ ASSERT (statinfo[2].st_mtime < statinfo[1].st_ctime
+ || (statinfo[2].st_mtime == statinfo[1].st_ctime
+ && (get_stat_mtime_ns (&statinfo[2])
+ < get_stat_ctime_ns (&statinfo[1]))));
+}
+#endif
+
+static void
+test_birthtime (const struct stat *statinfo,
+ const struct timespec *modtimes,
+ struct timespec *birthtimes)
+{
+ int i;
+
+ /* Collect the birth times. */
+ for (i = 0; i < NFILES; ++i)
+ {
+ birthtimes[i] = get_stat_birthtime (&statinfo[i]);
+ if (birthtimes[i].tv_nsec < 0)
+ return;
+ }
+
+ /* mtime(stamp1) < birthtime(renamed) */
+ ASSERT (modtimes[0].tv_sec < birthtimes[1].tv_sec
+ || (modtimes[0].tv_sec == birthtimes[1].tv_sec
+ && modtimes[0].tv_nsec < birthtimes[1].tv_nsec));
+ /* birthtime(renamed) < mtime(stamp2) */
+ ASSERT (birthtimes[1].tv_sec < modtimes[2].tv_sec
+ || (birthtimes[1].tv_sec == modtimes[2].tv_sec
+ && birthtimes[1].tv_nsec < modtimes[2].tv_nsec));
+}
+
+int
+main (void)
+{
+ struct stat statinfo[NFILES];
+ struct timespec modtimes[NFILES];
+ struct timespec birthtimes[NFILES];
+
+#ifdef SIGHUP
+ signal (SIGHUP, cleanup);
+#endif
+#ifdef SIGINT
+ signal (SIGINT, cleanup);
+#endif
+#ifdef SIGQUIT
+ signal (SIGQUIT, cleanup);
+#endif
+#ifdef SIGTERM
+ signal (SIGTERM, cleanup);
+#endif
+
+ cleanup (0);
+ prepare_test (statinfo, modtimes);
+ test_mtime (statinfo, modtimes);
+ test_ctime (statinfo);
+ test_birthtime (statinfo, modtimes, birthtimes);
+
+ cleanup (0);
+ return 0;
+}
diff --git a/gnulib-tests/test-stat.c b/gnulib-tests/test-stat.c
new file mode 100644
index 0000000..4510e59
--- /dev/null
+++ b/gnulib-tests/test-stat.c
@@ -0,0 +1,56 @@
+/* Tests of stat.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+/* Caution: stat may be a function-like macro. Although this
+ signature check must pass, it may be the signature of the real (and
+ broken) stat rather than rpl_stat. Most code should not use the
+ address of stat. */
+#include "signature.h"
+SIGNATURE_CHECK (stat, int, (char const *, struct stat *));
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "same-inode.h"
+#include "macros.h"
+
+#define BASE "test-stat.t"
+
+#include "test-stat.h"
+
+/* Wrapper around stat, which works even if stat is a function-like
+ macro, where test_stat_func(stat) would do the wrong thing. */
+static int
+do_stat (char const *name, struct stat *st)
+{
+ return stat (name, st);
+}
+
+int
+main (void)
+{
+ return test_stat_func (do_stat, true);
+}
diff --git a/gnulib-tests/test-stat.h b/gnulib-tests/test-stat.h
new file mode 100644
index 0000000..4cf6c6d
--- /dev/null
+++ b/gnulib-tests/test-stat.h
@@ -0,0 +1,101 @@
+/* Tests of stat.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+/* This file is designed to test both stat(n,buf) and
+ fstatat(AT_FDCWD,n,buf,0). FUNC is the function to test. Assumes
+ that BASE and ASSERT are already defined, and that appropriate
+ headers are already included. If PRINT, warn before skipping
+ symlink tests with status 77. */
+
+static int
+test_stat_func (int (*func) (char const *, struct stat *), bool print)
+{
+ struct stat st1;
+ struct stat st2;
+ char *cwd = getcwd (NULL, 0);
+
+ ASSERT (cwd);
+ ASSERT (func (".", &st1) == 0);
+ ASSERT (func ("./", &st2) == 0);
+ ASSERT (SAME_INODE (st1, st2));
+ ASSERT (func (cwd, &st2) == 0);
+ ASSERT (SAME_INODE (st1, st2));
+ ASSERT (func ("/", &st1) == 0);
+ ASSERT (func ("///", &st2) == 0);
+ ASSERT (SAME_INODE (st1, st2));
+
+ errno = 0;
+ ASSERT (func ("", &st1) == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("nosuch", &st1) == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("nosuch/", &st1) == -1);
+ ASSERT (errno == ENOENT);
+
+ ASSERT (close (creat (BASE "file", 0600)) == 0);
+ ASSERT (func (BASE "file", &st1) == 0);
+ errno = 0;
+ ASSERT (func (BASE "file/", &st1) == -1);
+ ASSERT (errno == ENOTDIR);
+
+ /* Now for some symlink tests, where supported. We set up:
+ link1 -> directory
+ link2 -> file
+ link3 -> dangling
+ link4 -> loop
+ then test behavior with trailing slash.
+ */
+ if (symlink (".", BASE "link1") != 0)
+ {
+ ASSERT (unlink (BASE "file") == 0);
+ if (print)
+ fputs ("skipping test: symlinks not supported on this file system\n",
+ stderr);
+ return 77;
+ }
+ ASSERT (symlink (BASE "file", BASE "link2") == 0);
+ ASSERT (symlink (BASE "nosuch", BASE "link3") == 0);
+ ASSERT (symlink (BASE "link4", BASE "link4") == 0);
+
+ ASSERT (func (BASE "link1/", &st1) == 0);
+ ASSERT (S_ISDIR (st1.st_mode));
+
+ errno = 0;
+ ASSERT (func (BASE "link2/", &st1) == -1);
+ ASSERT (errno == ENOTDIR);
+
+ errno = 0;
+ ASSERT (func (BASE "link3/", &st1) == -1);
+ ASSERT (errno == ENOENT);
+
+ errno = 0;
+ ASSERT (func (BASE "link4/", &st1) == -1);
+ ASSERT (errno == ELOOP);
+
+ /* Cleanup. */
+ ASSERT (unlink (BASE "file") == 0);
+ ASSERT (unlink (BASE "link1") == 0);
+ ASSERT (unlink (BASE "link2") == 0);
+ ASSERT (unlink (BASE "link3") == 0);
+ ASSERT (unlink (BASE "link4") == 0);
+ free (cwd);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-stdalign.c b/gnulib-tests/test-stdalign.c
new file mode 100644
index 0000000..0f240c5
--- /dev/null
+++ b/gnulib-tests/test-stdalign.c
@@ -0,0 +1,116 @@
+/* Test of <stdalign.h>.
+ Copyright 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert, inspired by Bruno Haible's test-alignof.c. */
+
+#include <config.h>
+
+#include <stdalign.h>
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "verify.h"
+
+#include "macros.h"
+
+typedef long double longdouble;
+typedef struct { char a[1]; } struct1;
+typedef struct { char a[2]; } struct2;
+typedef struct { char a[3]; } struct3;
+typedef struct { char a[4]; } struct4;
+
+verify (__alignof_is_defined == 1);
+#ifndef alignof
+# error "alignof is not a macro"
+#endif
+
+#if __alignas_is_defined
+verify (__alignas_is_defined == 1);
+# ifndef alignas
+# error "alignas is not a macro"
+# endif
+/* mingw can go up only to 8. 8 is all that GNU Emacs needs, so let's
+ limit the test to 8 for now. */
+# define TEST_ALIGNMENT 8
+#else
+# define _Alignas(alignment)
+# define alignas(alignment)
+# define TEST_ALIGNMENT 1
+#endif
+
+#define CHECK_STATIC(type) \
+ typedef struct { char slot1; type slot2; } type##_helper; \
+ verify (alignof (type) == offsetof (type##_helper, slot2)); \
+ verify (_Alignof (type) == alignof (type)); \
+ const int type##_alignment = alignof (type); \
+ type alignas (TEST_ALIGNMENT) static_##type##_alignas; \
+ type _Alignas (TEST_ALIGNMENT) static_##type##_Alignas
+
+#define CHECK_ALIGNED(var) ASSERT ((uintptr_t) &(var) % TEST_ALIGNMENT == 0)
+
+CHECK_STATIC (char);
+CHECK_STATIC (short);
+CHECK_STATIC (int);
+CHECK_STATIC (long);
+#ifdef INT64_MAX
+CHECK_STATIC (int64_t);
+#endif
+CHECK_STATIC (float);
+CHECK_STATIC (double);
+/* CHECK_STATIC (longdouble); */
+CHECK_STATIC (struct1);
+CHECK_STATIC (struct2);
+CHECK_STATIC (struct3);
+CHECK_STATIC (struct4);
+
+int
+main ()
+{
+#if defined __SUNPRO_C
+ /* Avoid a test failure due to Sun Studio Developer Bug Report #2125432. */
+ fputs ("Skipping test: known Sun C compiler bug\n", stderr);
+ return 77;
+#else
+ CHECK_ALIGNED (static_char_alignas);
+ CHECK_ALIGNED (static_char_Alignas);
+ CHECK_ALIGNED (static_short_alignas);
+ CHECK_ALIGNED (static_short_Alignas);
+ CHECK_ALIGNED (static_int_alignas);
+ CHECK_ALIGNED (static_int_Alignas);
+ CHECK_ALIGNED (static_long_alignas);
+ CHECK_ALIGNED (static_long_Alignas);
+# ifdef INT64_MAX
+ CHECK_ALIGNED (static_int64_t_alignas);
+ CHECK_ALIGNED (static_int64_t_Alignas);
+# endif
+ CHECK_ALIGNED (static_float_alignas);
+ CHECK_ALIGNED (static_float_Alignas);
+ CHECK_ALIGNED (static_double_alignas);
+ CHECK_ALIGNED (static_double_Alignas);
+ /* CHECK_ALIGNED (static_longdouble_alignas); */
+ /* CHECK_ALIGNED (static_longdouble_Alignas); */
+ CHECK_ALIGNED (static_struct1_alignas);
+ CHECK_ALIGNED (static_struct1_Alignas);
+ CHECK_ALIGNED (static_struct2_alignas);
+ CHECK_ALIGNED (static_struct2_Alignas);
+ CHECK_ALIGNED (static_struct3_alignas);
+ CHECK_ALIGNED (static_struct3_Alignas);
+ CHECK_ALIGNED (static_struct4_alignas);
+ CHECK_ALIGNED (static_struct4_Alignas);
+ return 0;
+#endif
+}
diff --git a/gnulib-tests/test-stdbool.c b/gnulib-tests/test-stdbool.c
new file mode 100644
index 0000000..45dc837
--- /dev/null
+++ b/gnulib-tests/test-stdbool.c
@@ -0,0 +1,118 @@
+/* Test of <stdbool.h> substitute.
+ Copyright (C) 2002-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* We want this test to succeed even when using gcc's -Werror; but to
+ do that requires a pragma that didn't exist before 4.3.0. */
+#ifndef __GNUC__
+# define ADDRESS_CHECK_OKAY
+#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+/* No way to silence -Waddress. */
+#else
+# pragma GCC diagnostic ignored "-Waddress"
+# define ADDRESS_CHECK_OKAY
+#endif
+
+#include <config.h>
+
+#include <stdbool.h>
+
+#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
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+/* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at
+ least, not for all compilers and compiler options. */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__
+struct s { _Bool s: 1; _Bool t; } s;
+#endif
+
+char a[true == 1 ? 1 : -1];
+char b[false == 0 ? 1 : -1];
+char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
+char d[(bool) 0.5 == true ? 1 : -1];
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+/* C99 may plausibly be interpreted as not requiring support for a cast from
+ a variable's address to bool in a static initializer. So treat it like a
+ GCC extension. */
+# ifdef __GNUC__
+bool e = &s;
+# endif
+# endif
+char f[(_Bool) 0.0 == false ? 1 : -1];
+#endif
+char g[true];
+char h[sizeof (_Bool)];
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
+char i[sizeof s.t];
+#endif
+enum { j = false, k = true, l = false * true, m = true * 256 };
+_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
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+_Bool q = true;
+_Bool *pq = &q;
+
+int
+main ()
+{
+ int error = 0;
+
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+ /* A cast from a variable's address to bool is valid in expressions. */
+ {
+ bool e1 = &s;
+ if (!e1)
+ error = 1;
+ }
+# endif
+#endif
+
+ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+ reported by James Lemley on 2005-10-05; see
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+ This is a runtime test, since a corresponding compile-time
+ test would rely on initializer extensions. */
+ {
+ char digs[] = "0123456789";
+ if (&(digs + 5)[-2 + (bool) 1] != &digs[4])
+ error = 1;
+ }
+
+ return error;
+}
diff --git a/gnulib-tests/test-stddef.c b/gnulib-tests/test-stddef.c
new file mode 100644
index 0000000..bfb72a0
--- /dev/null
+++ b/gnulib-tests/test-stddef.c
@@ -0,0 +1,73 @@
+/* Test of <stddef.h> substitute.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <stddef.h>
+#include <stdalign.h>
+#include "verify.h"
+
+/* Check that appropriate types are defined. */
+wchar_t a = 'c';
+ptrdiff_t b = 1;
+size_t c = 2;
+max_align_t x;
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+/* Check that offsetof produces integer constants with correct type. */
+struct d
+{
+ char e;
+ char f;
+};
+/* Solaris 10 has a bug where offsetof is under-parenthesized, and
+ cannot be used as an arbitrary expression. However, since it is
+ unlikely to bite real code, we ignore that short-coming. */
+/* verify (sizeof offsetof (struct d, e) == sizeof (size_t)); */
+verify (sizeof (offsetof (struct d, e)) == sizeof (size_t));
+verify (offsetof (struct d, e) < -1); /* Must be unsigned. */
+verify (offsetof (struct d, f) == 1);
+
+/* Check max_align_t's alignment. */
+verify (alignof (double) <= alignof (max_align_t));
+verify (alignof (int) <= alignof (max_align_t));
+verify (alignof (long double) <= alignof (max_align_t));
+verify (alignof (long int) <= alignof (max_align_t));
+verify (alignof (ptrdiff_t) <= alignof (max_align_t));
+verify (alignof (size_t) <= alignof (max_align_t));
+verify (alignof (wchar_t) <= alignof (max_align_t));
+verify (alignof (struct d) <= alignof (max_align_t));
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
+verify (__alignof__ (double) <= __alignof__ (max_align_t));
+verify (__alignof__ (int) <= __alignof__ (max_align_t));
+verify (__alignof__ (long double) <= __alignof__ (max_align_t));
+verify (__alignof__ (long int) <= __alignof__ (max_align_t));
+verify (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t));
+verify (__alignof__ (size_t) <= __alignof__ (max_align_t));
+verify (__alignof__ (wchar_t) <= __alignof__ (max_align_t));
+verify (__alignof__ (struct d) <= __alignof__ (max_align_t));
+#endif
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-stdint.c b/gnulib-tests/test-stdint.c
new file mode 100644
index 0000000..7705fc7
--- /dev/null
+++ b/gnulib-tests/test-stdint.c
@@ -0,0 +1,359 @@
+/* Test of <stdint.h> substitute.
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2006. */
+
+#include <config.h>
+
+/* Whether to enable pedantic checks. */
+#define DO_PEDANTIC 0
+
+#include <stdint.h>
+
+#include "verify.h"
+#include "intprops.h"
+
+#if __GNUC__ >= 2 && DO_PEDANTIC
+# define verify_same_types(expr1,expr2) \
+ extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
+ extern void _verify_func(__LINE__) (__typeof__ (expr2) *);
+# define _verify_func(line) _verify_func2(line)
+# define _verify_func2(line) verify_func_ ## line
+#else
+# define verify_same_types(expr1,expr2) extern void verify_func (int)
+#endif
+
+/* 7.18.1.1. Exact-width integer types */
+/* 7.18.2.1. Limits of exact-width integer types */
+
+int8_t a1[3] = { INT8_C (17), INT8_MIN, INT8_MAX };
+verify (TYPE_MINIMUM (int8_t) == INT8_MIN);
+verify (TYPE_MAXIMUM (int8_t) == INT8_MAX);
+verify_same_types (INT8_MIN, (int8_t) 0 + 0);
+verify_same_types (INT8_MAX, (int8_t) 0 + 0);
+
+int16_t a2[3] = { INT16_C (17), INT16_MIN, INT16_MAX };
+verify (TYPE_MINIMUM (int16_t) == INT16_MIN);
+verify (TYPE_MAXIMUM (int16_t) == INT16_MAX);
+verify_same_types (INT16_MIN, (int16_t) 0 + 0);
+verify_same_types (INT16_MAX, (int16_t) 0 + 0);
+
+int32_t a3[3] = { INT32_C (17), INT32_MIN, INT32_MAX };
+verify (TYPE_MINIMUM (int32_t) == INT32_MIN);
+verify (TYPE_MAXIMUM (int32_t) == INT32_MAX);
+verify_same_types (INT32_MIN, (int32_t) 0 + 0);
+verify_same_types (INT32_MAX, (int32_t) 0 + 0);
+
+#ifdef INT64_MAX
+int64_t a4[3] = { INT64_C (17), INT64_MIN, INT64_MAX };
+verify (TYPE_MINIMUM (int64_t) == INT64_MIN);
+verify (TYPE_MAXIMUM (int64_t) == INT64_MAX);
+verify_same_types (INT64_MIN, (int64_t) 0 + 0);
+verify_same_types (INT64_MAX, (int64_t) 0 + 0);
+#endif
+
+uint8_t b1[2] = { UINT8_C (17), UINT8_MAX };
+verify (TYPE_MAXIMUM (uint8_t) == UINT8_MAX);
+verify_same_types (UINT8_MAX, (uint8_t) 0 + 0);
+
+uint16_t b2[2] = { UINT16_C (17), UINT16_MAX };
+verify (TYPE_MAXIMUM (uint16_t) == UINT16_MAX);
+verify_same_types (UINT16_MAX, (uint16_t) 0 + 0);
+
+uint32_t b3[2] = { UINT32_C (17), UINT32_MAX };
+verify (TYPE_MAXIMUM (uint32_t) == UINT32_MAX);
+verify_same_types (UINT32_MAX, (uint32_t) 0 + 0);
+
+#ifdef UINT64_MAX
+uint64_t b4[2] = { UINT64_C (17), UINT64_MAX };
+verify (TYPE_MAXIMUM (uint64_t) == UINT64_MAX);
+verify_same_types (UINT64_MAX, (uint64_t) 0 + 0);
+#endif
+
+#if INT8_MIN && INT8_MAX && INT16_MIN && INT16_MAX && INT32_MIN && INT32_MAX
+/* ok */
+#else
+err or;
+#endif
+
+#if UINT8_MAX && UINT16_MAX && UINT32_MAX
+/* ok */
+#else
+err or;
+#endif
+
+/* 7.18.1.2. Minimum-width integer types */
+/* 7.18.2.2. Limits of minimum-width integer types */
+
+int_least8_t c1[3] = { 17, INT_LEAST8_MIN, INT_LEAST8_MAX };
+verify (TYPE_MINIMUM (int_least8_t) == INT_LEAST8_MIN);
+verify (TYPE_MAXIMUM (int_least8_t) == INT_LEAST8_MAX);
+verify_same_types (INT_LEAST8_MIN, (int_least8_t) 0 + 0);
+verify_same_types (INT_LEAST8_MAX, (int_least8_t) 0 + 0);
+
+int_least16_t c2[3] = { 17, INT_LEAST16_MIN, INT_LEAST16_MAX };
+verify (TYPE_MINIMUM (int_least16_t) == INT_LEAST16_MIN);
+verify (TYPE_MAXIMUM (int_least16_t) == INT_LEAST16_MAX);
+verify_same_types (INT_LEAST16_MIN, (int_least16_t) 0 + 0);
+verify_same_types (INT_LEAST16_MAX, (int_least16_t) 0 + 0);
+
+int_least32_t c3[3] = { 17, INT_LEAST32_MIN, INT_LEAST32_MAX };
+verify (TYPE_MINIMUM (int_least32_t) == INT_LEAST32_MIN);
+verify (TYPE_MAXIMUM (int_least32_t) == INT_LEAST32_MAX);
+verify_same_types (INT_LEAST32_MIN, (int_least32_t) 0 + 0);
+verify_same_types (INT_LEAST32_MAX, (int_least32_t) 0 + 0);
+
+#ifdef INT_LEAST64_MAX
+int_least64_t c4[3] = { 17, INT_LEAST64_MIN, INT_LEAST64_MAX };
+verify (TYPE_MINIMUM (int_least64_t) == INT_LEAST64_MIN);
+verify (TYPE_MAXIMUM (int_least64_t) == INT_LEAST64_MAX);
+verify_same_types (INT_LEAST64_MIN, (int_least64_t) 0 + 0);
+verify_same_types (INT_LEAST64_MAX, (int_least64_t) 0 + 0);
+#endif
+
+uint_least8_t d1[2] = { 17, UINT_LEAST8_MAX };
+verify (TYPE_MAXIMUM (uint_least8_t) == UINT_LEAST8_MAX);
+verify_same_types (UINT_LEAST8_MAX, (uint_least8_t) 0 + 0);
+
+uint_least16_t d2[2] = { 17, UINT_LEAST16_MAX };
+verify (TYPE_MAXIMUM (uint_least16_t) == UINT_LEAST16_MAX);
+verify_same_types (UINT_LEAST16_MAX, (uint_least16_t) 0 + 0);
+
+uint_least32_t d3[2] = { 17, UINT_LEAST32_MAX };
+verify (TYPE_MAXIMUM (uint_least32_t) == UINT_LEAST32_MAX);
+verify_same_types (UINT_LEAST32_MAX, (uint_least32_t) 0 + 0);
+
+#ifdef UINT_LEAST64_MAX
+uint_least64_t d4[2] = { 17, UINT_LEAST64_MAX };
+verify (TYPE_MAXIMUM (uint_least64_t) == UINT_LEAST64_MAX);
+verify_same_types (UINT_LEAST64_MAX, (uint_least64_t) 0 + 0);
+#endif
+
+#if INT_LEAST8_MIN && INT_LEAST8_MAX && INT_LEAST16_MIN && INT_LEAST16_MAX && INT_LEAST32_MIN && INT_LEAST32_MAX
+/* ok */
+#else
+err or;
+#endif
+
+#if UINT_LEAST8_MAX && UINT_LEAST16_MAX && UINT_LEAST32_MAX
+/* ok */
+#else
+err or;
+#endif
+
+/* 7.18.1.3. Fastest minimum-width integer types */
+/* 7.18.2.3. Limits of fastest minimum-width integer types */
+
+int_fast8_t e1[3] = { 17, INT_FAST8_MIN, INT_FAST8_MAX };
+verify (TYPE_MINIMUM (int_fast8_t) == INT_FAST8_MIN);
+verify (TYPE_MAXIMUM (int_fast8_t) == INT_FAST8_MAX);
+verify_same_types (INT_FAST8_MIN, (int_fast8_t) 0 + 0);
+verify_same_types (INT_FAST8_MAX, (int_fast8_t) 0 + 0);
+
+int_fast16_t e2[3] = { 17, INT_FAST16_MIN, INT_FAST16_MAX };
+verify (TYPE_MINIMUM (int_fast16_t) == INT_FAST16_MIN);
+verify (TYPE_MAXIMUM (int_fast16_t) == INT_FAST16_MAX);
+verify_same_types (INT_FAST16_MIN, (int_fast16_t) 0 + 0);
+verify_same_types (INT_FAST16_MAX, (int_fast16_t) 0 + 0);
+
+int_fast32_t e3[3] = { 17, INT_FAST32_MIN, INT_FAST32_MAX };
+verify (TYPE_MINIMUM (int_fast32_t) == INT_FAST32_MIN);
+verify (TYPE_MAXIMUM (int_fast32_t) == INT_FAST32_MAX);
+verify_same_types (INT_FAST32_MIN, (int_fast32_t) 0 + 0);
+verify_same_types (INT_FAST32_MAX, (int_fast32_t) 0 + 0);
+
+#ifdef INT_FAST64_MAX
+int_fast64_t e4[3] = { 17, INT_FAST64_MIN, INT_FAST64_MAX };
+verify (TYPE_MINIMUM (int_fast64_t) == INT_FAST64_MIN);
+verify (TYPE_MAXIMUM (int_fast64_t) == INT_FAST64_MAX);
+verify_same_types (INT_FAST64_MIN, (int_fast64_t) 0 + 0);
+verify_same_types (INT_FAST64_MAX, (int_fast64_t) 0 + 0);
+#endif
+
+uint_fast8_t f1[2] = { 17, UINT_FAST8_MAX };
+verify (TYPE_MAXIMUM (uint_fast8_t) == UINT_FAST8_MAX);
+verify_same_types (UINT_FAST8_MAX, (uint_fast8_t) 0 + 0);
+
+uint_fast16_t f2[2] = { 17, UINT_FAST16_MAX };
+verify (TYPE_MAXIMUM (uint_fast16_t) == UINT_FAST16_MAX);
+verify_same_types (UINT_FAST16_MAX, (uint_fast16_t) 0 + 0);
+
+uint_fast32_t f3[2] = { 17, UINT_FAST32_MAX };
+verify (TYPE_MAXIMUM (uint_fast32_t) == UINT_FAST32_MAX);
+verify_same_types (UINT_FAST32_MAX, (uint_fast32_t) 0 + 0);
+
+#ifdef UINT_FAST64_MAX
+uint_fast64_t f4[2] = { 17, UINT_FAST64_MAX };
+verify (TYPE_MAXIMUM (uint_fast64_t) == UINT_FAST64_MAX);
+verify_same_types (UINT_FAST64_MAX, (uint_fast64_t) 0 + 0);
+#endif
+
+#if INT_FAST8_MIN && INT_FAST8_MAX && INT_FAST16_MIN && INT_FAST16_MAX && INT_FAST32_MIN && INT_FAST32_MAX
+/* ok */
+#else
+err or;
+#endif
+
+#if UINT_FAST8_MAX && UINT_FAST16_MAX && UINT_FAST32_MAX
+/* ok */
+#else
+err or;
+#endif
+
+/* 7.18.1.4. Integer types capable of holding object pointers */
+/* 7.18.2.4. Limits of integer types capable of holding object pointers */
+
+intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX };
+verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN);
+verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX);
+verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0);
+verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0);
+
+uintptr_t h[2] = { 17, UINTPTR_MAX };
+verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX);
+verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0);
+
+#if INTPTR_MIN && INTPTR_MAX && UINTPTR_MAX
+/* ok */
+#else
+err or;
+#endif
+
+/* 7.18.1.5. Greatest-width integer types */
+/* 7.18.2.5. Limits of greatest-width integer types */
+
+intmax_t i[3] = { INTMAX_C (17), INTMAX_MIN, INTMAX_MAX };
+verify (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
+verify (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
+verify_same_types (INTMAX_MIN, (intmax_t) 0 + 0);
+verify_same_types (INTMAX_MAX, (intmax_t) 0 + 0);
+
+uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX };
+verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
+verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0);
+
+/* As of 2007, Sun C and HP-UX 10.20 cc don't support 'long long' constants in
+ the preprocessor. */
+#if !(defined __SUNPRO_C || (defined __hpux && !defined __GNUC__))
+#if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX
+/* ok */
+#else
+err or;
+#endif
+#endif
+
+/* 7.18.3. Limits of other integer types */
+
+#include <stddef.h>
+
+verify (TYPE_MINIMUM (ptrdiff_t) == PTRDIFF_MIN);
+verify (TYPE_MAXIMUM (ptrdiff_t) == PTRDIFF_MAX);
+verify_same_types (PTRDIFF_MIN, (ptrdiff_t) 0 + 0);
+verify_same_types (PTRDIFF_MAX, (ptrdiff_t) 0 + 0);
+
+#if PTRDIFF_MIN && PTRDIFF_MAX
+/* ok */
+#else
+err or;
+#endif
+
+#include <signal.h>
+
+verify (TYPE_MINIMUM (sig_atomic_t) == SIG_ATOMIC_MIN);
+verify (TYPE_MAXIMUM (sig_atomic_t) == SIG_ATOMIC_MAX);
+verify_same_types (SIG_ATOMIC_MIN, (sig_atomic_t) 0 + 0);
+verify_same_types (SIG_ATOMIC_MAX, (sig_atomic_t) 0 + 0);
+
+#if SIG_ATOMIC_MIN != 17 && SIG_ATOMIC_MAX
+/* ok */
+#else
+err or;
+#endif
+
+verify (TYPE_MAXIMUM (size_t) == SIZE_MAX);
+verify_same_types (SIZE_MAX, (size_t) 0 + 0);
+
+#if SIZE_MAX
+/* ok */
+#else
+err or;
+#endif
+
+#if HAVE_WCHAR_T
+verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN);
+verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX);
+verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0);
+verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0);
+
+# if WCHAR_MIN != 17 && WCHAR_MAX
+/* ok */
+# else
+err or;
+# endif
+#endif
+
+#if HAVE_WINT_T
+# include <wchar.h>
+
+verify (TYPE_MINIMUM (wint_t) == WINT_MIN);
+verify (TYPE_MAXIMUM (wint_t) == WINT_MAX);
+verify_same_types (WINT_MIN, (wint_t) 0 + 0);
+verify_same_types (WINT_MAX, (wint_t) 0 + 0);
+
+# if WINT_MIN != 17 && WINT_MAX
+/* ok */
+# else
+err or;
+# endif
+#endif
+
+/* 7.18.4. Macros for integer constants */
+
+verify (INT8_C (17) == 17);
+verify_same_types (INT8_C (17), (int_least8_t)0 + 0);
+verify (UINT8_C (17) == 17);
+verify_same_types (UINT8_C (17), (uint_least8_t)0 + 0);
+
+verify (INT16_C (17) == 17);
+verify_same_types (INT16_C (17), (int_least16_t)0 + 0);
+verify (UINT16_C (17) == 17);
+verify_same_types (UINT16_C (17), (uint_least16_t)0 + 0);
+
+verify (INT32_C (17) == 17);
+verify_same_types (INT32_C (17), (int_least32_t)0 + 0);
+verify (UINT32_C (17) == 17);
+verify_same_types (UINT32_C (17), (uint_least32_t)0 + 0);
+
+#ifdef INT64_C
+verify (INT64_C (17) == 17);
+verify_same_types (INT64_C (17), (int_least64_t)0 + 0);
+#endif
+#ifdef UINT64_C
+verify (UINT64_C (17) == 17);
+verify_same_types (UINT64_C (17), (uint_least64_t)0 + 0);
+#endif
+
+verify (INTMAX_C (17) == 17);
+verify_same_types (INTMAX_C (17), (intmax_t)0 + 0);
+verify (UINTMAX_C (17) == 17);
+verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
+
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-stdio.c b/gnulib-tests/test-stdio.c
new file mode 100644
index 0000000..6cde888
--- /dev/null
+++ b/gnulib-tests/test-stdio.c
@@ -0,0 +1,43 @@
+/* Test of <stdio.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "verify.h"
+
+/* Check that the various SEEK_* macros are defined. */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+/* Check that the types are all defined. */
+fpos_t t1;
+off_t t2;
+size_t t3;
+ssize_t t4;
+va_list t5;
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-stdlib.c b/gnulib-tests/test-stdlib.c
new file mode 100644
index 0000000..a1fc0d8
--- /dev/null
+++ b/gnulib-tests/test-stdlib.c
@@ -0,0 +1,54 @@
+/* Test of <stdlib.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "verify.h"
+
+/* Check that EXIT_SUCCESS is 0, per POSIX. */
+static int exitcode = EXIT_SUCCESS;
+#if EXIT_SUCCESS
+"oops"
+#endif
+
+/* Check for GNU value (not guaranteed by POSIX, but is guaranteed by
+ gnulib). */
+#if EXIT_FAILURE != 1
+"oops"
+#endif
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+#if GNULIB_TEST_SYSTEM_POSIX
+# include "test-sys_wait.h"
+#else
+# define test_sys_wait_macros() 0
+#endif
+
+int
+main (void)
+{
+ if (test_sys_wait_macros ())
+ return 1;
+
+ return exitcode;
+}
diff --git a/gnulib-tests/test-strerror.c b/gnulib-tests/test-strerror.c
new file mode 100644
index 0000000..80ffe1c
--- /dev/null
+++ b/gnulib-tests/test-strerror.c
@@ -0,0 +1,75 @@
+/* Test of strerror() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2007. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strerror, char *, (int));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ char *str;
+
+ errno = 0;
+ str = strerror (EACCES);
+ ASSERT (str);
+ ASSERT (*str);
+ ASSERT (errno == 0);
+
+ errno = 0;
+ str = strerror (ETIMEDOUT);
+ ASSERT (str);
+ ASSERT (*str);
+ ASSERT (errno == 0);
+
+ errno = 0;
+ str = strerror (EOVERFLOW);
+ ASSERT (str);
+ ASSERT (*str);
+ ASSERT (errno == 0);
+
+ /* POSIX requires strerror (0) to succeed. Reject use of "Unknown
+ error", but allow "Success", "No error", or even Solaris' "Error
+ 0" which are distinct patterns from true out-of-range strings.
+ http://austingroupbugs.net/view.php?id=382 */
+ errno = 0;
+ str = strerror (0);
+ ASSERT (str);
+ ASSERT (*str);
+ ASSERT (errno == 0);
+ ASSERT (strstr (str, "nknown") == NULL);
+ ASSERT (strstr (str, "ndefined") == NULL);
+
+ /* POSIX requires strerror to produce a non-NULL result for all
+ inputs; as an extension, we also guarantee a non-empty result.
+ Reporting EINVAL is optional. */
+ errno = 0;
+ str = strerror (-3);
+ ASSERT (str);
+ ASSERT (*str);
+ ASSERT (errno == 0 || errno == EINVAL);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-strerror_r.c b/gnulib-tests/test-strerror_r.c
new file mode 100644
index 0000000..cb773a3
--- /dev/null
+++ b/gnulib-tests/test-strerror_r.c
@@ -0,0 +1,181 @@
+/* Test of strerror_r() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strerror_r, int, (int, char *, size_t));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ char buf[100];
+ int ret;
+
+ /* Test results with valid errnum and enough room. */
+
+ errno = 0;
+ buf[0] = '\0';
+ ASSERT (strerror_r (EACCES, buf, sizeof buf) == 0);
+ ASSERT (buf[0] != '\0');
+ ASSERT (errno == 0);
+ ASSERT (strlen (buf) < sizeof buf);
+
+ errno = 0;
+ buf[0] = '\0';
+ ASSERT (strerror_r (ETIMEDOUT, buf, sizeof buf) == 0);
+ ASSERT (buf[0] != '\0');
+ ASSERT (errno == 0);
+ ASSERT (strlen (buf) < sizeof buf);
+
+ errno = 0;
+ buf[0] = '\0';
+ ASSERT (strerror_r (EOVERFLOW, buf, sizeof buf) == 0);
+ ASSERT (buf[0] != '\0');
+ ASSERT (errno == 0);
+ ASSERT (strlen (buf) < sizeof buf);
+
+ /* POSIX requires strerror (0) to succeed. Reject use of "Unknown
+ error", but allow "Success", "No error", or even Solaris' "Error
+ 0" which are distinct patterns from true out-of-range strings.
+ http://austingroupbugs.net/view.php?id=382 */
+ errno = 0;
+ buf[0] = '\0';
+ ret = strerror_r (0, buf, sizeof buf);
+ ASSERT (ret == 0);
+ ASSERT (buf[0]);
+ ASSERT (errno == 0);
+ ASSERT (strstr (buf, "nknown") == NULL);
+ ASSERT (strstr (buf, "ndefined") == NULL);
+
+ /* Test results with out-of-range errnum and enough room. POSIX
+ allows an empty string on success, and allows an unchanged buf on
+ error, but these are not useful, so we guarantee contents. */
+ errno = 0;
+ buf[0] = '^';
+ ret = strerror_r (-3, buf, sizeof buf);
+ ASSERT (ret == 0 || ret == EINVAL);
+ ASSERT (buf[0] != '^');
+ ASSERT (*buf);
+ ASSERT (errno == 0);
+ ASSERT (strlen (buf) < sizeof buf);
+
+ /* Test results with a too small buffer. POSIX requires an error;
+ only ERANGE for 0 and valid errors, and a choice of ERANGE or
+ EINVAL for out-of-range values. On error, POSIX permits buf to
+ be empty, unchanged, or unterminated, but these are not useful,
+ so we guarantee NUL-terminated truncated contents for all but
+ size 0. http://austingroupbugs.net/view.php?id=398. Also ensure
+ that no out-of-bounds writes occur. */
+ {
+ int errs[] = { EACCES, 0, -3, };
+ int j;
+
+ buf[sizeof buf - 1] = '\0';
+ for (j = 0; j < SIZEOF (errs); j++)
+ {
+ int err = errs[j];
+ char buf2[sizeof buf] = "";
+ size_t len;
+ size_t i;
+
+ strerror_r (err, buf2, sizeof buf2);
+ len = strlen (buf2);
+ ASSERT (len < sizeof buf);
+
+ for (i = 0; i <= len; i++)
+ {
+ memset (buf, '^', sizeof buf - 1);
+ errno = 0;
+ ret = strerror_r (err, buf, i);
+ ASSERT (errno == 0);
+ if (err < 0)
+ ASSERT (ret == ERANGE || ret == EINVAL);
+ else
+ ASSERT (ret == ERANGE);
+ if (i)
+ {
+ ASSERT (strncmp (buf, buf2, i - 1) == 0);
+ ASSERT (buf[i - 1] == '\0');
+ }
+ ASSERT (strspn (buf + i, "^") == sizeof buf - 1 - i);
+ }
+
+ strcpy (buf, "BADFACE");
+ errno = 0;
+ ret = strerror_r (err, buf, len + 1);
+ ASSERT (ret != ERANGE);
+ ASSERT (errno == 0);
+ ASSERT (strcmp (buf, buf2) == 0);
+ }
+ }
+
+#if GNULIB_STRERROR
+ /* Test that strerror_r does not clobber strerror buffer. On some
+ platforms, this test can only succeed if gnulib also replaces
+ strerror. */
+ {
+ const char *msg1;
+ const char *msg2;
+ const char *msg3;
+ const char *msg4;
+ char *str1;
+ char *str2;
+ char *str3;
+ char *str4;
+
+ msg1 = strerror (ENOENT);
+ ASSERT (msg1);
+ str1 = strdup (msg1);
+ ASSERT (str1);
+
+ msg2 = strerror (ERANGE);
+ ASSERT (msg2);
+ str2 = strdup (msg2);
+ ASSERT (str2);
+
+ msg3 = strerror (-4);
+ ASSERT (msg3);
+ str3 = strdup (msg3);
+ ASSERT (str3);
+
+ msg4 = strerror (1729576);
+ ASSERT (msg4);
+ str4 = strdup (msg4);
+ ASSERT (str4);
+
+ strerror_r (EACCES, buf, sizeof buf);
+ strerror_r (-5, buf, sizeof buf);
+ ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
+ ASSERT (msg2 == msg4 || STREQ (msg2, str2));
+ ASSERT (msg3 == msg4 || STREQ (msg3, str3));
+ ASSERT (STREQ (msg4, str4));
+
+ free (str1);
+ free (str2);
+ free (str3);
+ free (str4);
+ }
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-strftime.c b/gnulib-tests/test-strftime.c
new file mode 100644
index 0000000..39494e6
--- /dev/null
+++ b/gnulib-tests/test-strftime.c
@@ -0,0 +1,216 @@
+/* Test that posixtime works as required.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "strftime.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+
+#include "macros.h"
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
+struct posixtm_test
+{
+ time_t in;
+ int in_ns;
+ char const *fmt;
+ char const *exp;
+};
+
+static struct posixtm_test const T[] =
+ {
+ { 1300000000, 0, "%F", "2011-03-13" },
+ { 0, 10, "%T.%N", "00:00:00.000000010" },
+ { 0, 0, NULL, NULL }
+ };
+
+static int
+posixtm_test (void)
+{
+ int fail = 0;
+ unsigned int i;
+
+ for (i = 0; T[i].fmt; i++)
+ {
+ char buf[1000];
+ time_t t = T[i].in;
+ struct tm *tm = gmtime (&t);
+ size_t n;
+
+ ASSERT (tm);
+
+ n = nstrftime (buf, sizeof buf, T[i].fmt, tm, 0, T[i].in_ns);
+ if (n == 0)
+ {
+ fail = 1;
+ printf ("nstrftime failed with format %s\n", T[i].fmt);
+ }
+
+ if (! STREQ (buf, T[i].exp))
+ {
+ fail = 1;
+ printf ("%s: result mismatch: got %s, expected %s\n",
+ T[i].fmt, buf, T[i].exp);
+ }
+ }
+
+ return fail;
+}
+
+struct tzalloc_test
+{
+ timezone_t tz;
+ char const *setting;
+};
+
+static struct tzalloc_test TZ[] =
+ {
+#define Pacific 0
+ { 0, "PST8PDT,M3.2.0,M11.1.0" },
+#define Arizona 1
+ { 0, "MST7" },
+#define UTC 2
+ { 0, 0 },
+#define CentEur 3
+ { 0, "CET-1CEST,M3.5.0,M10.5.0/3" },
+#define Japan 4
+ { 0, "JST-9" },
+#define NZ 5
+ { 0, "NZST-12NZDT,M9.5.0,M4.1.0/3" },
+ { 0 }
+ };
+
+struct localtime_rz_test
+{
+ /* Input parameters. */
+ struct tzalloc_test *tza;
+ time_t t;
+
+ /* Expected result. */
+ char const *exp;
+
+ /* Determines if an incorrectly unset tm_isdst
+ results in failure or just a warning. */
+ int ahistorical;
+};
+
+static struct localtime_rz_test LT[] =
+ {
+ { TZ+Pacific, 0, "1969-12-31 16:00:00 -0800 (PST)", 0 },
+ { TZ+Arizona, 0, "1969-12-31 17:00:00 -0700 (MST)", 0 },
+ { TZ+UTC , 0, "1970-01-01 00:00:00 +0000 (UTC)", 0 },
+ { TZ+CentEur, 0, "1970-01-01 01:00:00 +0100 (CET)", 0 },
+ { TZ+Japan , 0, "1970-01-01 09:00:00 +0900 (JST)", 0 },
+ { TZ+NZ , 0, "1970-01-01 13:00:00 +1300 (NZDT)", 1 },
+ { TZ+Pacific, 500000001, "1985-11-04 16:53:21 -0800 (PST)", 0 },
+ { TZ+Arizona, 500000001, "1985-11-04 17:53:21 -0700 (MST)", 0 },
+ { TZ+UTC , 500000001, "1985-11-05 00:53:21 +0000 (UTC)", 0 },
+ { TZ+CentEur, 500000001, "1985-11-05 01:53:21 +0100 (CET)", 1 },
+ { TZ+Japan , 500000001, "1985-11-05 09:53:21 +0900 (JST)", 0 },
+ { TZ+NZ , 500000001, "1985-11-05 13:53:21 +1300 (NZDT)", 0 },
+ { TZ+Pacific, 1000000002, "2001-09-08 18:46:42 -0700 (PDT)", 0 },
+ { TZ+Arizona, 1000000002, "2001-09-08 18:46:42 -0700 (MST)", 0 },
+ { TZ+UTC , 1000000002, "2001-09-09 01:46:42 +0000 (UTC)", 0 },
+ { TZ+CentEur, 1000000002, "2001-09-09 03:46:42 +0200 (CEST)", 0 },
+ { TZ+Japan , 1000000002, "2001-09-09 10:46:42 +0900 (JST)", 0 },
+ { TZ+NZ , 1000000002, "2001-09-09 13:46:42 +1200 (NZST)", 0 },
+ { 0 }
+ };
+
+static int
+tzalloc_test (void)
+{
+ int fail = 0;
+ int i;
+
+ for (i = 0; LT[i].tza; i++)
+ {
+ struct tzalloc_test *tza = LT[i].tza;
+ long lt = LT[i].t;
+ timezone_t tz = tza->tz;
+ char const *setting;
+ static char const format[] = "%Y-%m-%d %H:%M:%S %z (%Z)";
+ char buf[1000];
+ struct tm tm;
+ size_t n;
+
+ if (!tz && tza->setting)
+ {
+ tz = tzalloc (tza->setting);
+ if (!tz)
+ {
+ fail = 1;
+ printf ("%s: tzalloc: %s\n", TZ[i].setting, strerror (errno));
+ continue;
+ }
+ tza->tz = tz;
+ }
+
+ setting = tza->setting ? tza->setting : "UTC0";
+
+ if (!localtime_rz (tz, &LT[i].t, &tm))
+ {
+ fail = 1;
+ printf ("%s: %ld: localtime_rz: %s\n", setting, lt,
+ strerror (errno));
+ continue;
+ }
+
+ n = nstrftime (buf, sizeof buf, format, &tm, tz, 0);
+ if (n == 0)
+ {
+ fail = 1;
+ printf ("%s: %ld: nstrftime failed\n", setting, lt);
+ continue;
+ }
+
+ if (! (STREQ (buf, LT[i].exp)
+ || (!tz && n == strlen (LT[i].exp)
+ && memcmp (buf, LT[i].exp, n - sizeof "(GMT)" + 1) == 0
+ && STREQ (buf + n - sizeof "(GMT)" + 1, "(GMT)"))))
+ {
+ /* Don't fail for unhandled dst in ahistorical entries,
+ as gnulib doesn't currently fix that issue, seen on Darwin 14. */
+ if (!LT[i].ahistorical || tm.tm_isdst)
+ fail = 1;
+ printf ("%s: expected \"%s\", got \"%s\"\n",
+ setting, LT[i].exp, buf);
+ }
+ }
+
+ return fail;
+}
+
+int
+main (void)
+{
+ int fail = 0;
+ fail |= posixtm_test ();
+ fail |= tzalloc_test ();
+ return fail;
+}
+
+/*
+Local Variables:
+indent-tabs-mode: nil
+End:
+*/
diff --git a/gnulib-tests/test-striconv.c b/gnulib-tests/test-striconv.c
new file mode 100644
index 0000000..9b71b69
--- /dev/null
+++ b/gnulib-tests/test-striconv.c
@@ -0,0 +1,180 @@
+/* Test of character set conversion.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include "striconv.h"
+
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+#if HAVE_ICONV
+ /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
+ and UTF-8. */
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+
+ ASSERT (cd_88591_to_utf8 != (iconv_t)(-1));
+ ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
+
+ /* ------------------------- Test mem_cd_iconv() ------------------------- */
+
+ /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ char *result = NULL;
+ size_t length = 0;
+ int retval = mem_cd_iconv (input, strlen (input), cd_88591_to_utf8,
+ &result, &length);
+ ASSERT (retval == 0);
+ ASSERT (length == strlen (expected));
+ ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 0);
+ free (result);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */
+ {
+ static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char *result = NULL;
+ size_t length = 0;
+ int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
+ &result, &length);
+ ASSERT (retval == 0);
+ ASSERT (length == strlen (expected));
+ ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 0);
+ free (result);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char *result = NULL;
+ size_t length = 0;
+ int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
+ &result, &length);
+ ASSERT (retval == -1 && errno == EILSEQ);
+ ASSERT (result == NULL);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */
+ {
+ static const char input[] = "\342";
+ char *result = NULL;
+ size_t length = 0;
+ int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
+ &result, &length);
+ ASSERT (retval == 0);
+ ASSERT (length == 0);
+ free (result);
+ }
+
+ /* ------------------------- Test str_cd_iconv() ------------------------- */
+
+ /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ char *result = str_cd_iconv (input, cd_88591_to_utf8);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, expected) == 0);
+ free (result);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */
+ {
+ static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char *result = str_cd_iconv (input, cd_utf8_to_88591);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, expected) == 0);
+ free (result);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */
+ {
+ static const char input[] = "Costs: 27 \342\202\254"; /* EURO SIGN */
+ char *result = str_cd_iconv (input, cd_utf8_to_88591);
+ ASSERT (result == NULL && errno == EILSEQ);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */
+ {
+ static const char input[] = "\342";
+ char *result = str_cd_iconv (input, cd_utf8_to_88591);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "") == 0);
+ free (result);
+ }
+
+ iconv_close (cd_88591_to_utf8);
+ iconv_close (cd_utf8_to_88591);
+
+ /* -------------------------- Test str_iconv() -------------------------- */
+
+ /* Test conversion from ISO-8859-1 to UTF-8 with no errors. */
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ char *result = str_iconv (input, "ISO-8859-1", "UTF-8");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, expected) == 0);
+ free (result);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with no errors. */
+ {
+ static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+ static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char *result = str_iconv (input, "UTF-8", "ISO-8859-1");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, expected) == 0);
+ free (result);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ. */
+ {
+ static const char input[] = "Costs: 27 \342\202\254"; /* EURO SIGN */
+ char *result = str_iconv (input, "UTF-8", "ISO-8859-1");
+ ASSERT (result == NULL && errno == EILSEQ);
+ }
+
+ /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL. */
+ {
+ static const char input[] = "\342";
+ char *result = str_iconv (input, "UTF-8", "ISO-8859-1");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "") == 0);
+ free (result);
+ }
+
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-string.c b/gnulib-tests/test-string.c
new file mode 100644
index 0000000..f4c60f7
--- /dev/null
+++ b/gnulib-tests/test-string.c
@@ -0,0 +1,33 @@
+/* Test of <string.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "verify.h"
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-strings.c b/gnulib-tests/test-strings.c
new file mode 100644
index 0000000..5eaa61a
--- /dev/null
+++ b/gnulib-tests/test-strings.c
@@ -0,0 +1,27 @@
+/* Test of <strings.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <strings.h>
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-strnlen.c b/gnulib-tests/test-strnlen.c
new file mode 100644
index 0000000..ee5bd78
--- /dev/null
+++ b/gnulib-tests/test-strnlen.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ * Written by Eric Blake
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strnlen, size_t, (char const *, size_t));
+
+#include <stdlib.h>
+
+#include "zerosize-ptr.h"
+#include "macros.h"
+
+int
+main (void)
+{
+ size_t i;
+ char *page_boundary = (char *) zerosize_ptr ();
+ if (!page_boundary)
+ {
+ page_boundary = malloc (0x1000);
+ ASSERT (page_boundary);
+ page_boundary += 0x1000;
+ }
+
+ /* Basic behavior tests. */
+ ASSERT (strnlen ("a", 0) == 0);
+ ASSERT (strnlen ("a", 1) == 1);
+ ASSERT (strnlen ("a", 2) == 1);
+ ASSERT (strnlen ("", 0x100000) == 0);
+
+ /* Memory fence and alignment testing. */
+ for (i = 0; i < 512; i++)
+ {
+ char *start = page_boundary - i;
+ size_t j = i;
+ memset (start, 'x', i);
+ do
+ {
+ if (i != j)
+ {
+ start[j] = 0;
+ ASSERT (strnlen (start, i + j) == j);
+ }
+ ASSERT (strnlen (start, i) == j);
+ ASSERT (strnlen (start, j) == j);
+ }
+ while (j--);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-strtoull.c b/gnulib-tests/test-strtoull.c
new file mode 100644
index 0000000..6b1e01b
--- /dev/null
+++ b/gnulib-tests/test-strtoull.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "signature.h"
+#ifndef strtoull
+SIGNATURE_CHECK (strtoull, unsigned long long, (const char *, char **, int));
+#endif
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ /* Subject sequence empty or invalid. */
+ {
+ const char input[] = "";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+ {
+ const char input[] = " ";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+ {
+ const char input[] = " +";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+ {
+ const char input[] = " -";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+
+ /* Simple integer values. */
+ {
+ const char input[] = "0";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input + 1);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "+0";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input + 2);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "-0";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input + 2);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "23";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 23);
+ ASSERT (ptr == input + 2);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = " 23";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 23);
+ ASSERT (ptr == input + 3);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "+23";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 23);
+ ASSERT (ptr == input + 3);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "-23";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == - 23ULL);
+ ASSERT (ptr == input + 3);
+ ASSERT (errno == 0);
+ }
+
+ /* Large integer values. */
+ {
+ const char input[] = "2147483647";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 2147483647);
+ ASSERT (ptr == input + 10);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "-2147483648";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == - 2147483648ULL);
+ ASSERT (ptr == input + 11);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "4294967295";
+ char *ptr;
+ unsigned long long result;
+ errno = 0;
+ result = strtoull (input, &ptr, 10);
+ ASSERT (result == 4294967295U);
+ ASSERT (ptr == input + 10);
+ ASSERT (errno == 0);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-strtoumax.c b/gnulib-tests/test-strtoumax.c
new file mode 100644
index 0000000..bb9d30e
--- /dev/null
+++ b/gnulib-tests/test-strtoumax.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <inttypes.h>
+
+#include "signature.h"
+#ifndef strtoumax
+SIGNATURE_CHECK (strtoumax, uintmax_t, (const char *, char **, int));
+#endif
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ /* Subject sequence empty or invalid. */
+ {
+ const char input[] = "";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+ {
+ const char input[] = " ";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+ {
+ const char input[] = " +";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+ {
+ const char input[] = " -";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input);
+ ASSERT (errno == 0 || errno == EINVAL);
+ }
+
+ /* Simple integer values. */
+ {
+ const char input[] = "0";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input + 1);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "+0";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input + 2);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "-0";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 0);
+ ASSERT (ptr == input + 2);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "23";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 23);
+ ASSERT (ptr == input + 2);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = " 23";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 23);
+ ASSERT (ptr == input + 3);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "+23";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 23);
+ ASSERT (ptr == input + 3);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "-23";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == - (uintmax_t) 23);
+ ASSERT (ptr == input + 3);
+ ASSERT (errno == 0);
+ }
+
+ /* Large integer values. */
+ {
+ const char input[] = "2147483647";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 2147483647);
+ ASSERT (ptr == input + 10);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "-2147483648";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == - (uintmax_t) 2147483648U);
+ ASSERT (ptr == input + 11);
+ ASSERT (errno == 0);
+ }
+ {
+ const char input[] = "4294967295";
+ char *ptr;
+ uintmax_t result;
+ errno = 0;
+ result = strtoumax (input, &ptr, 10);
+ ASSERT (result == 4294967295U);
+ ASSERT (ptr == input + 10);
+ ASSERT (errno == 0);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-symlink.c b/gnulib-tests/test-symlink.c
new file mode 100644
index 0000000..ad13b93
--- /dev/null
+++ b/gnulib-tests/test-symlink.c
@@ -0,0 +1,47 @@
+/* Tests of symlink.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (symlink, int, (char const *, char const *));
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#include "ignore-value.h"
+#include "macros.h"
+
+#define BASE "test-symlink.t"
+
+#include "test-symlink.h"
+
+int
+main (void)
+{
+ /* Remove any leftovers from a previous partial run. */
+ ignore_value (system ("rm -rf " BASE "*"));
+
+ return test_symlink (symlink, true);
+}
diff --git a/gnulib-tests/test-symlink.h b/gnulib-tests/test-symlink.h
new file mode 100644
index 0000000..fc064e8
--- /dev/null
+++ b/gnulib-tests/test-symlink.h
@@ -0,0 +1,95 @@
+/* Tests of symlink.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+/* This file is designed to test both symlink(a,b) and
+ symlinkat(a,AT_FDCWD,b). FUNC is the function to test. Assumes
+ that BASE and ASSERT are already defined, and that appropriate
+ headers are already included. If PRINT, warn before skipping
+ symlink tests with status 77. */
+
+static int
+test_symlink (int (*func) (char const *, char const *), bool print)
+{
+ if (func ("nowhere", BASE "link1"))
+ {
+ if (print)
+ fputs ("skipping test: symlinks not supported on this file system\n",
+ stderr);
+ return 77;
+ }
+
+ /* Some systems allow the creation of 0-length symlinks as a synonym
+ for "."; but most reject it. */
+ {
+ int status;
+ errno = 0;
+ status = func ("", BASE "link2");
+ if (status == -1)
+ ASSERT (errno == ENOENT || errno == EINVAL);
+ else
+ {
+ ASSERT (status == 0);
+ ASSERT (unlink (BASE "link2") == 0);
+ }
+ }
+
+ /* Sanity checks of failures. */
+ errno = 0;
+ ASSERT (func ("nowhere", "") == -1);
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("nowhere", ".") == -1);
+ ASSERT (errno == EEXIST || errno == EINVAL);
+ errno = 0;
+ ASSERT (func ("somewhere", BASE "link1") == -1);
+ ASSERT (errno == EEXIST);
+ errno = 0;
+ ASSERT (func ("nowhere", BASE "link2/") == -1);
+ ASSERT (errno == ENOTDIR || errno == ENOENT);
+ ASSERT (mkdir (BASE "dir", 0700) == 0);
+ errno = 0;
+ ASSERT (func ("nowhere", BASE "dir") == -1);
+ ASSERT (errno == EEXIST);
+ errno = 0;
+ ASSERT (func ("nowhere", BASE "dir/") == -1);
+ ASSERT (errno == EEXIST || errno == EINVAL);
+ ASSERT (close (creat (BASE "file", 0600)) == 0);
+ errno = 0;
+ ASSERT (func ("nowhere", BASE "file") == -1);
+ ASSERT (errno == EEXIST);
+ errno = 0;
+ ASSERT (func ("nowhere", BASE "file/") == -1);
+ ASSERT (errno == EEXIST || errno == ENOTDIR || errno == ENOENT);
+
+ /* Trailing slash must always be rejected. */
+ ASSERT (unlink (BASE "link1") == 0);
+ ASSERT (func (BASE "link2", BASE "link1") == 0);
+ errno = 0;
+ ASSERT (func (BASE "nowhere", BASE "link1/") == -1);
+ ASSERT (errno == EEXIST || errno == ENOTDIR || errno == ENOENT);
+ errno = 0;
+ ASSERT (unlink (BASE "link2") == -1);
+ ASSERT (errno == ENOENT);
+
+ /* Cleanup. */
+ ASSERT (rmdir (BASE "dir") == 0);
+ ASSERT (unlink (BASE "file") == 0);
+ ASSERT (unlink (BASE "link1") == 0);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-sys_ioctl.c b/gnulib-tests/test-sys_ioctl.c
new file mode 100644
index 0000000..8e0ddcd
--- /dev/null
+++ b/gnulib-tests/test-sys_ioctl.c
@@ -0,0 +1,27 @@
+/* Test of <sys/ioctl.h> substitute.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <sys/ioctl.h>
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-sys_select.c b/gnulib-tests/test-sys_select.c
new file mode 100644
index 0000000..39a878f
--- /dev/null
+++ b/gnulib-tests/test-sys_select.c
@@ -0,0 +1,59 @@
+/* Test of <sys/select.h> substitute.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <sys/select.h>
+
+#include "signature.h"
+
+/* The following may be macros without underlying functions, so only
+ check signature if they are not macros. */
+#ifndef FD_CLR
+SIGNATURE_CHECK (FD_CLR, void, (int, fd_set *));
+#endif
+#ifndef FD_ISSET
+SIGNATURE_CHECK (FD_ISSET, void, (int, fd_set *));
+#endif
+#ifndef FD_SET
+SIGNATURE_CHECK (FD_SET, int, (int, fd_set *));
+#endif
+#ifndef FD_ZERO
+SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
+#endif
+
+/* Check that the 'struct timeval' type is defined. */
+struct timeval a;
+
+/* Check that a.tv_sec is wide enough to hold a time_t, ignoring
+ signedness issues. */
+typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1];
+
+/* Check that sigset_t is defined. */
+sigset_t t2;
+
+int
+main (void)
+{
+ /* Check that FD_ZERO can be used. This should not yield a warning
+ such as "warning: implicit declaration of function 'memset'". */
+ fd_set fds;
+ FD_ZERO (&fds);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-sys_socket.c b/gnulib-tests/test-sys_socket.c
new file mode 100644
index 0000000..a4f7108
--- /dev/null
+++ b/gnulib-tests/test-sys_socket.c
@@ -0,0 +1,68 @@
+/* Test of <sys/socket.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include <errno.h>
+
+#if HAVE_SHUTDOWN
+/* Check some integer constant expressions. */
+int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+#endif
+
+/* Check that the 'socklen_t' type is defined. */
+socklen_t t1;
+
+/* Check that the 'size_t' and 'ssize_t' types are defined. */
+size_t t2;
+ssize_t t3;
+
+/* Check that 'struct iovec' is defined. */
+struct iovec io;
+
+/* Check that a minimal set of 'struct msghdr' is defined. */
+struct msghdr msg;
+
+int
+main (void)
+{
+ struct sockaddr_storage x;
+ sa_family_t i;
+
+ /* Check some errno values. */
+ switch (ENOTSOCK)
+ {
+ case ENOTSOCK:
+ case EADDRINUSE:
+ case ENETRESET:
+ case ECONNABORTED:
+ case ECONNRESET:
+ case ENOTCONN:
+ case ESHUTDOWN:
+ break;
+ }
+
+ x.ss_family = 42;
+ i = 42;
+ msg.msg_iov = &io;
+
+ return (x.ss_family - i + msg.msg_namelen + msg.msg_iov->iov_len
+ + msg.msg_iovlen);
+}
diff --git a/gnulib-tests/test-sys_stat.c b/gnulib-tests/test-sys_stat.c
new file mode 100644
index 0000000..8a3af94
--- /dev/null
+++ b/gnulib-tests/test-sys_stat.c
@@ -0,0 +1,340 @@
+/* Test of <sys/stat.h> substitute.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+#include "verify.h"
+
+/* Check the existence of some macros. */
+int a[] =
+ {
+ S_IFMT,
+#ifdef S_IFBLK /* missing on MSVC */
+ S_IFBLK,
+#endif
+ S_IFCHR, S_IFDIR, S_IFIFO, S_IFREG,
+#ifdef S_IFLNK /* missing on native Windows and DJGPP */
+ S_IFLNK,
+#endif
+#ifdef S_IFSOCK /* missing on native Windows and DJGPP */
+ S_IFSOCK,
+#endif
+ S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR,
+ S_IRWXG, S_IRGRP, S_IWGRP, S_IXGRP,
+ S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH,
+ S_ISUID, S_ISGID, S_ISVTX,
+ S_ISBLK (S_IFREG),
+ S_ISCHR (S_IFREG),
+ S_ISDIR (S_IFREG),
+ S_ISFIFO (S_IFREG),
+ S_ISREG (S_IFREG),
+ S_ISLNK (S_IFREG),
+ S_ISSOCK (S_IFREG),
+ S_ISDOOR (S_IFREG),
+ S_ISMPB (S_IFREG),
+ S_ISMPX (S_IFREG),
+ S_ISNAM (S_IFREG),
+ S_ISNWK (S_IFREG),
+ S_ISPORT (S_IFREG),
+ S_ISCTG (S_IFREG),
+ S_ISOFD (S_IFREG),
+ S_ISOFL (S_IFREG),
+ S_ISWHT (S_IFREG)
+ };
+
+/* Sanity checks. */
+
+verify (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
+verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
+verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
+
+#ifdef S_IFBLK
+verify (S_ISBLK (S_IFBLK));
+#endif
+verify (!S_ISBLK (S_IFCHR));
+verify (!S_ISBLK (S_IFDIR));
+verify (!S_ISBLK (S_IFIFO));
+verify (!S_ISBLK (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISBLK (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISBLK (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISCHR (S_IFBLK));
+#endif
+verify (S_ISCHR (S_IFCHR));
+verify (!S_ISCHR (S_IFDIR));
+verify (!S_ISCHR (S_IFIFO));
+verify (!S_ISCHR (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISCHR (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISCHR (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISDIR (S_IFBLK));
+#endif
+verify (!S_ISDIR (S_IFCHR));
+verify (S_ISDIR (S_IFDIR));
+verify (!S_ISDIR (S_IFIFO));
+verify (!S_ISDIR (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISDIR (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISDIR (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISFIFO (S_IFBLK));
+#endif
+verify (!S_ISFIFO (S_IFCHR));
+verify (!S_ISFIFO (S_IFDIR));
+verify (S_ISFIFO (S_IFIFO));
+verify (!S_ISFIFO (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISFIFO (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISFIFO (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISREG (S_IFBLK));
+#endif
+verify (!S_ISREG (S_IFCHR));
+verify (!S_ISREG (S_IFDIR));
+verify (!S_ISREG (S_IFIFO));
+verify (S_ISREG (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISREG (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISREG (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISLNK (S_IFBLK));
+#endif
+verify (!S_ISLNK (S_IFCHR));
+verify (!S_ISLNK (S_IFDIR));
+verify (!S_ISLNK (S_IFIFO));
+verify (!S_ISLNK (S_IFREG));
+#ifdef S_IFLNK
+verify (S_ISLNK (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISLNK (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISSOCK (S_IFBLK));
+#endif
+verify (!S_ISSOCK (S_IFCHR));
+verify (!S_ISSOCK (S_IFDIR));
+verify (!S_ISSOCK (S_IFIFO));
+verify (!S_ISSOCK (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISSOCK (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (S_ISSOCK (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISDOOR (S_IFBLK));
+#endif
+verify (!S_ISDOOR (S_IFCHR));
+verify (!S_ISDOOR (S_IFDIR));
+verify (!S_ISDOOR (S_IFIFO));
+verify (!S_ISDOOR (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISDOOR (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISDOOR (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISMPB (S_IFBLK));
+#endif
+verify (!S_ISMPB (S_IFCHR));
+verify (!S_ISMPB (S_IFDIR));
+verify (!S_ISMPB (S_IFIFO));
+verify (!S_ISMPB (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISMPB (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISMPB (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISMPX (S_IFBLK));
+#endif
+verify (!S_ISMPX (S_IFCHR));
+verify (!S_ISMPX (S_IFDIR));
+verify (!S_ISMPX (S_IFIFO));
+verify (!S_ISMPX (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISMPX (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISMPX (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISNAM (S_IFBLK));
+#endif
+verify (!S_ISNAM (S_IFCHR));
+verify (!S_ISNAM (S_IFDIR));
+verify (!S_ISNAM (S_IFIFO));
+verify (!S_ISNAM (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISNAM (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISNAM (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISNWK (S_IFBLK));
+#endif
+verify (!S_ISNWK (S_IFCHR));
+verify (!S_ISNWK (S_IFDIR));
+verify (!S_ISNWK (S_IFIFO));
+verify (!S_ISNWK (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISNWK (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISNWK (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISPORT (S_IFBLK));
+#endif
+verify (!S_ISPORT (S_IFCHR));
+verify (!S_ISPORT (S_IFDIR));
+verify (!S_ISPORT (S_IFIFO));
+verify (!S_ISPORT (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISPORT (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISPORT (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISCTG (S_IFBLK));
+#endif
+verify (!S_ISCTG (S_IFCHR));
+verify (!S_ISCTG (S_IFDIR));
+verify (!S_ISCTG (S_IFIFO));
+verify (!S_ISCTG (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISCTG (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISCTG (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISOFD (S_IFBLK));
+#endif
+verify (!S_ISOFD (S_IFCHR));
+verify (!S_ISOFD (S_IFDIR));
+verify (!S_ISOFD (S_IFIFO));
+verify (!S_ISOFD (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISOFD (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISOFD (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISOFL (S_IFBLK));
+#endif
+verify (!S_ISOFL (S_IFCHR));
+verify (!S_ISOFL (S_IFDIR));
+verify (!S_ISOFL (S_IFIFO));
+verify (!S_ISOFL (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISOFL (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISOFL (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
+verify (!S_ISWHT (S_IFBLK));
+#endif
+verify (!S_ISWHT (S_IFCHR));
+verify (!S_ISWHT (S_IFDIR));
+verify (!S_ISWHT (S_IFIFO));
+verify (!S_ISWHT (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISWHT (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISWHT (S_IFSOCK));
+#endif
+
+/* POSIX 2008 requires traditional encoding of permission constants. */
+verify (S_IRWXU == 00700);
+verify (S_IRUSR == 00400);
+verify (S_IWUSR == 00200);
+verify (S_IXUSR == 00100);
+verify (S_IRWXG == 00070);
+verify (S_IRGRP == 00040);
+verify (S_IWGRP == 00020);
+verify (S_IXGRP == 00010);
+verify (S_IRWXO == 00007);
+verify (S_IROTH == 00004);
+verify (S_IWOTH == 00002);
+verify (S_IXOTH == 00001);
+verify (S_ISUID == 04000);
+verify (S_ISGID == 02000);
+verify (S_ISVTX == 01000);
+
+#if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000) \
+ || (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000) \
+ || UTIME_NOW == UTIME_OMIT)
+invalid UTIME macros
+#endif
+
+/* Check the existence of some types. */
+nlink_t t1;
+off_t t2;
+mode_t t3;
+
+struct timespec st;
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-sys_time.c b/gnulib-tests/test-sys_time.c
new file mode 100644
index 0000000..44535b9
--- /dev/null
+++ b/gnulib-tests/test-sys_time.c
@@ -0,0 +1,34 @@
+/* Test of <sys/time.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <sys/time.h>
+
+/* Check that the 'struct timeval' type is defined. */
+struct timeval a;
+
+/* Check that a.tv_sec is wide enough to hold a time_t, ignoring
+ signedness issues. */
+typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1];
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-sys_types.c b/gnulib-tests/test-sys_types.c
new file mode 100644
index 0000000..7f8fb6d
--- /dev/null
+++ b/gnulib-tests/test-sys_types.c
@@ -0,0 +1,34 @@
+/* Test of <sys/types.h> substitute.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011. */
+
+#include <config.h>
+
+#include <sys/types.h>
+
+/* Check that the types are all defined. */
+pid_t t1;
+size_t t2;
+ssize_t t3;
+off_t t4;
+mode_t t5;
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-sys_uio.c b/gnulib-tests/test-sys_uio.c
new file mode 100644
index 0000000..c433847
--- /dev/null
+++ b/gnulib-tests/test-sys_uio.c
@@ -0,0 +1,32 @@
+/* Test of <sys/uio.h> substitute.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <eblake@redhat.com>, 2011. */
+
+#include <config.h>
+
+#include <sys/uio.h>
+
+/* Check that necessary types are defined. */
+size_t a;
+ssize_t b;
+struct iovec c;
+
+int
+main (void)
+{
+ return a + b + !!c.iov_base + c.iov_len;
+}
diff --git a/gnulib-tests/test-sys_wait.c b/gnulib-tests/test-sys_wait.c
new file mode 100644
index 0000000..f814ff3
--- /dev/null
+++ b/gnulib-tests/test-sys_wait.c
@@ -0,0 +1,47 @@
+/* Test of <sys/wait.h> substitute.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <sys/wait.h>
+
+/* Check for existence of required types. */
+static pid_t a;
+
+#include "test-sys_wait.h"
+
+int
+main (void)
+{
+ if (test_sys_wait_macros ())
+ return 1;
+
+#if 0
+ switch (WCONTINUED)
+ {
+ /* Gnulib doesn't guarantee these, yet. */
+ case WCONTINUED:
+ case WEXITED:
+ case WNOWAIT:
+ case WSTOPPED:
+ break;
+ }
+#endif
+
+ return a ? 1 : 0;
+}
diff --git a/gnulib-tests/test-sys_wait.h b/gnulib-tests/test-sys_wait.h
new file mode 100644
index 0000000..7389be4
--- /dev/null
+++ b/gnulib-tests/test-sys_wait.h
@@ -0,0 +1,53 @@
+/* Test of macros shared between <sys/wait.h> and <stdlib.h>.
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2010. */
+
+static int
+test_sys_wait_macros (void)
+{
+ /* Check subset of <sys/wait.h> macros that must be visible here.
+ Note that some of these macros are only portable when operating
+ on an lvalue. */
+ int i;
+ for (i = 0; i < 0x8000; i = (i ? i << 1 : 1))
+ {
+ /* POSIX requires that for all valid process statuses, that
+ exactly one of these three macros is true. But not all
+ possible 16-bit values map to valid process status.
+ Traditionally, 8 of the bits are for WIFEXITED, 7 of the bits
+ to tell between WIFSIGNALED and WIFSTOPPED, and either 0x80
+ or 0x8000 to flag that core was also dumped. Since we don't
+ know which byte is WIFEXITED, we skip the both possible bits
+ that can signal core dump. */
+ if (i == 0x80)
+ continue;
+ if (!!WIFSIGNALED (i) + !!WIFEXITED (i) + !!WIFSTOPPED (i) != 1)
+ return 1;
+ }
+ i = WEXITSTATUS (i) + WSTOPSIG (i) + WTERMSIG (i);
+
+ switch (i)
+ {
+#if 0
+ /* Gnulib doesn't guarantee these, yet. */
+ case WNOHANG:
+ case WUNTRACED:
+#endif
+ break;
+ }
+ return 0;
+}
diff --git a/gnulib-tests/test-time.c b/gnulib-tests/test-time.c
new file mode 100644
index 0000000..dec2b13
--- /dev/null
+++ b/gnulib-tests/test-time.c
@@ -0,0 +1,41 @@
+/* Test of <time.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <time.h>
+
+#include "verify.h"
+
+/* Check that the types are all defined. */
+struct timespec t1;
+#if 0
+/* POSIX:2008 does not require pid_t in <time.h> unconditionally, and indeed
+ it's missing on Mac OS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw. */
+pid_t t2;
+#endif
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-timespec.c b/gnulib-tests/test-timespec.c
new file mode 100644
index 0000000..3ea6e2d
--- /dev/null
+++ b/gnulib-tests/test-timespec.c
@@ -0,0 +1,167 @@
+/* Test timespec functions.
+ Copyright 2015-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+#include "timespec.h"
+
+#include "intprops.h"
+#include "macros.h"
+
+#include <stdbool.h>
+#include <limits.h>
+
+static struct { int s; int ns; } const prototype[] =
+ {
+ { INT_MIN, 0 },
+ { INT_MIN, 1 },
+ { INT_MIN, TIMESPEC_RESOLUTION - 1 },
+ { INT_MIN + 1, 0 },
+ { INT_MIN + 1, 1 },
+ { INT_MIN + 1, TIMESPEC_RESOLUTION - 1 },
+ { -1, 0 },
+ { -1, 1 },
+ { -1, TIMESPEC_RESOLUTION - 1 },
+ { 0, 0 },
+ { 0, 1 },
+ { 0, TIMESPEC_RESOLUTION - 1 },
+ { 1, 0 },
+ { 1, 1 },
+ { 1, TIMESPEC_RESOLUTION - 1 },
+ { 1234567890, 0 },
+ { 1234567890, 1 },
+ { 1234567890, TIMESPEC_RESOLUTION - 1 },
+ { INT_MAX - 1, 0 },
+ { INT_MAX - 1, 1 },
+ { INT_MAX - 1, TIMESPEC_RESOLUTION - 1 },
+ { INT_MAX, 0 },
+ { INT_MAX, 1 },
+ { INT_MAX, TIMESPEC_RESOLUTION - 1 },
+ { INT_MAX, 2 * TIMESPEC_RESOLUTION }
+ };
+enum { nprototypes = sizeof prototype / sizeof *prototype };
+
+static bool
+valid (struct timespec a)
+{
+ return 0 <= a.tv_nsec && a.tv_nsec < TIMESPEC_RESOLUTION;
+}
+
+static int
+sign (int i)
+{
+ return i < 0 ? -1 : 0 < i;
+}
+
+static int
+cmp (struct timespec a, struct timespec b)
+{
+ return sign (timespec_cmp (a, b));
+}
+
+static bool
+eq (struct timespec a, struct timespec b)
+{
+ return timespec_cmp (a, b) == 0;
+}
+
+static bool
+extremal (struct timespec a)
+{
+ return ((a.tv_sec == TYPE_MINIMUM (time_t) && a.tv_nsec == 0)
+ || (a.tv_sec == TYPE_MAXIMUM (time_t)
+ && a.tv_nsec == TIMESPEC_RESOLUTION - 1));
+}
+
+int
+main (void)
+{
+ int i, j, k;
+ struct timespec test[nprototypes + 1];
+ int ntests;
+ int computed_resolution = 1;
+ struct timespec prevroundtrip;
+
+ test[0] = make_timespec (TYPE_MINIMUM (time_t), -1);
+ ntests = 1;
+ for (i = 0; i < nprototypes; i++)
+ {
+ int s = prototype[i].s;
+ if (TYPE_SIGNED (time_t) || 0 <= s)
+ {
+ time_t t = (s <= INT_MIN + 1 ? s - INT_MIN + TYPE_MINIMUM (time_t)
+ : INT_MAX - 1 <= s ? s - INT_MAX + TYPE_MAXIMUM (time_t)
+ : s);
+ test[ntests++] = make_timespec (t, prototype[i].ns);
+ }
+ }
+
+ for (i = 0; i < LOG10_TIMESPEC_RESOLUTION; i++)
+ computed_resolution *= 10;
+ ASSERT (computed_resolution == TIMESPEC_RESOLUTION);
+
+ for (i = 0; i < ntests; i++)
+ {
+ struct timespec a = test[i];
+
+ struct timespec roundtrip = dtotimespec (timespectod (a));
+ if (i != 0)
+ ASSERT (cmp (prevroundtrip, roundtrip) <= 0);
+ prevroundtrip = roundtrip;
+
+ ASSERT (sign (timespec_sign (a)) == cmp (a, make_timespec (0, 0)));
+
+ if (valid (a))
+ for (j = 0; j < ntests; j++)
+ {
+ struct timespec b = test[j];
+ if (valid (b))
+ {
+ struct timespec sum = timespec_add (a, b);
+ struct timespec diff = timespec_sub (a, b);
+ struct timespec rdiff = timespec_sub (b, a);
+ ASSERT (cmp (a, b) == sign (i - j));
+ ASSERT (eq (sum, timespec_add (b, a)));
+ if (! extremal (sum))
+ {
+ ASSERT (eq (a, timespec_sub (sum, b)));
+ ASSERT (eq (b, timespec_sub (sum, a)));
+
+ for (k = 0; k < ntests; k++)
+ {
+ struct timespec c = test[k];
+ if (valid (c))
+ {
+ struct timespec sumbc = timespec_add (b, c);
+ if (! extremal (sumbc))
+ ASSERT (eq (timespec_add (a, sumbc),
+ timespec_add (sum, c)));
+ }
+ }
+ }
+ if (! extremal (diff))
+ ASSERT (eq (a, timespec_add (diff, b)));
+ if (! extremal (rdiff))
+ ASSERT (eq (b, timespec_add (rdiff, a)));
+
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-unistd.c b/gnulib-tests/test-unistd.c
new file mode 100644
index 0000000..463ef57
--- /dev/null
+++ b/gnulib-tests/test-unistd.c
@@ -0,0 +1,56 @@
+/* Test of <unistd.h> substitute.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "verify.h"
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+/* Check that the various SEEK_* macros are defined. */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
+
+/* Check that the various *_FILENO macros are defined. */
+#if ! (defined STDIN_FILENO \
+ && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3))
+missing or broken *_FILENO macros
+#endif
+
+/* Check that the types are all defined. */
+size_t t1;
+ssize_t t2;
+#ifdef TODO /* Not implemented in gnulib yet */
+uid_t t3;
+gid_t t4;
+#endif
+off_t t5;
+pid_t t6;
+#ifdef TODO
+useconds_t t7;
+intptr_t t8;
+#endif
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-unsetenv.c b/gnulib-tests/test-unsetenv.c
new file mode 100644
index 0000000..fe4548d
--- /dev/null
+++ b/gnulib-tests/test-unsetenv.c
@@ -0,0 +1,61 @@
+/* Tests of unsetenv.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (unsetenv, int, (char const *));
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+ char entry[] = "b=2";
+
+ /* Test removal when multiple entries present. */
+ ASSERT (putenv ((char *) "a=1") == 0);
+ ASSERT (putenv (entry) == 0);
+ entry[0] = 'a'; /* Unspecified what getenv("a") would be at this point. */
+ ASSERT (unsetenv ("a") == 0); /* Both entries will be removed. */
+ ASSERT (getenv ("a") == NULL);
+ ASSERT (unsetenv ("a") == 0);
+
+ /* Required to fail with EINVAL. */
+ errno = 0;
+ ASSERT (unsetenv ("") == -1);
+ ASSERT (errno == EINVAL);
+ errno = 0;
+ ASSERT (unsetenv ("a=b") == -1);
+ ASSERT (errno == EINVAL);
+#if 0
+ /* glibc and gnulib's implementation guarantee this, but POSIX no
+ longer requires it: http://austingroupbugs.net/view.php?id=185 */
+ errno = 0;
+ ASSERT (unsetenv (NULL) == -1);
+ ASSERT (errno == EINVAL);
+#endif
+
+ return 0;
+}
diff --git a/gnulib-tests/test-update-copyright.sh b/gnulib-tests/test-update-copyright.sh
new file mode 100755
index 0000000..cd4886a
--- /dev/null
+++ b/gnulib-tests/test-update-copyright.sh
@@ -0,0 +1,547 @@
+#!/bin/sh
+# Test suite for update-copyright.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+diffout=`diff -u /dev/null /dev/null 2>&1`
+if test x"$diffout" = x"" && test $? -eq 0; then
+ compare() { diff -u "$@"; }
+else
+ compare() { cmp "$@"; }
+fi
+
+# Ensure the update-copyright program gets found.
+PATH=$abs_aux_dir:$PATH
+export PATH
+
+TMP_BASE=update-copyright.test
+trap 'rm -f $TMP_BASE*' 0 1 2 3 15
+
+## --------------------------------- ##
+## Skip if user does not have perl. ##
+## --------------------------------- ##
+
+TMP=$TMP_BASE
+s=$TMP-script
+cat <<\EOF > $s
+eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
+ & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
+ if 0;
+s/a/b/
+EOF
+chmod a+x $s
+echo a > $TMP-in
+./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" ||
+ {
+ printf '%s\n' "$0: skipping this test;" \
+ 'your system has insufficient support for Perl' 1>&2
+ exit 77
+ }
+
+# Skip this test if Perl is too old. FIXME: 5.8.0 is just a guess.
+# We have a report that 5.6.1 is inadequate and that 5.8.0 works.
+perl -e 'require 5.8.0' || {
+ echo '$0: skipping this test; Perl version is too old' 1>&2
+ exit 77
+}
+
+# Do not let a different envvar setting perturb results.
+UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
+export UPDATE_COPYRIGHT_MAX_LINE_LENGTH
+
+## ----------------------------- ##
+## Examples from documentation. ##
+## ----------------------------- ##
+
+TMP=$TMP_BASE-ex
+cat > $TMP.1 <<EOF
+Copyright @copyright{} 1990-2005, 2007-2009 Free Software
+Foundation, Inc.
+EOF
+cat > $TMP.2 <<EOF
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+cat > $TMP.3 <<EOF
+/*
+ * Copyright &copy; 90,2005,2007-2009
+ * Free Software Foundation, Inc.
+ */
+EOF
+cat > $TMP.4 <<EOF
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+cat > $TMP.5 <<EOF
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+cat > $TMP.6 <<EOF
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+
+Copyright (C) 1990-2005, 2007-2009 Free Software Foundation,
+Inc.
+EOF
+cat > $TMP.7 <<EOF
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+
+UPDATE_COPYRIGHT_YEAR=2009 \
+ update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
+EOF
+compare - $TMP.1 <<EOF || exit 1
+Copyright @copyright{} 1990-2005, 2007-2009 Free Software
+Foundation, Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+/*
+ * Copyright &copy; 90,2005,2007-2009
+ * Free Software Foundation, Inc.
+ */
+EOF
+compare - $TMP.4 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+compare - $TMP.5 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+compare - $TMP.6 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+
+Copyright (C) 1990-2005, 2007-2009 Free Software Foundation,
+Inc.
+EOF
+compare - $TMP.7 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+
+UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+ update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
+EOF
+compare - $TMP.1 <<EOF || exit 1
+Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation,
+Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+/*
+ * Copyright &copy; 1990, 2005, 2007-2010 Free Software Foundation, Inc.
+ */
+EOF
+compare - $TMP.4 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+compare - $TMP.5 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+compare - $TMP.6 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+
+Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.7 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
+EOF
+
+UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \
+ update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
+EOF
+compare - $TMP.1 <<EOF || exit 1
+Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+Free Software Foundation, Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
+# Software Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+/*
+ * Copyright &copy; 1990, 2005, 2007, 2008, 2009, 2010 Free Software
+ * Foundation, Inc.
+ */
+EOF
+compare - $TMP.4 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+compare - $TMP.5 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+compare - $TMP.6 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+
+Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+EOF
+compare - $TMP.7 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
+# Software Foundation, Inc.
+EOF
+
+rm $TMP*
+
+## -------------- ##
+## Current year. ##
+## -------------- ##
+
+TMP=$TMP_BASE-current-year
+YEAR=`date +%Y`
+cat > $TMP <<EOF
+'\" Copyright (C) 2006
+'\" Free Software Foundation,
+'\" Inc.
+EOF
+update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+'\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+'\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------------ ##
+## Surrounding text. ##
+## ------------------ ##
+
+TMP=$TMP_BASE-surrounding-text
+cat > $TMP <<EOF
+ Undisturbed text.
+dnl Undisturbed text.
+dnl Copyright (C) 89
+dnl Free Software Foundation, Inc.
+dnl Undisturbed text.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ Undisturbed text.
+dnl Undisturbed text.
+dnl Copyright (C) 1989, 2010 Free Software Foundation, Inc.
+dnl Undisturbed text.
+EOF
+rm $TMP*
+
+## --------------- ##
+## Widest prefix. ##
+## --------------- ##
+
+TMP=$TMP_BASE-widest-prefix
+cat > $TMP <<EOF
+#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#### 2008 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984,
+#### 1985, 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+#### 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+#### Copyright (C) 1976-1988, 1999-2008, 2010-2011 Free Software
+#### Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------------- ##
+## Prefix too large. ##
+## ------------------- ##
+
+TMP=$TMP_BASE-prefix-too-large
+cat > $TMP <<EOF
+#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#### 2008 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP: warning: copyright statement not found
+EOF
+compare - $TMP <<EOF || exit 1
+#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#### 2008 Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------- ##
+## Blank lines. ##
+## ------------- ##
+
+TMP=$TMP_BASE-blank-lines
+cat > $TMP <<EOF
+#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#
+#1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#2008 Free Software Foundation, Inc.
+
+Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+
+1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP: warning: copyright statement not found
+EOF
+compare - $TMP <<EOF || exit 1
+#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#
+#1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#2008 Free Software Foundation, Inc.
+
+Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+
+1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## -------------- ##
+## Leading tabs. ##
+## -------------- ##
+
+TMP=$TMP_BASE-leading-tabs
+cat > $TMP <<EOF
+ Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
+ Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
+ Inc.
+EOF
+rm $TMP*
+
+## -------------------- ##
+## Unusual whitespace. ##
+## -------------------- ##
+
+TMP=$TMP_BASE-unusual-ws
+cat > $TMP <<EOF
+ # Copyright (C) 87-88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ # 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ # 2009 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ # Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994,
+ # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+ # Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ # Copyright (C) 1987-1988, 1991-2011 Free Software
+ # Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=2 \
+ UPDATE_COPYRIGHT_FORCE=1 update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ # Copyright (C) 1987-2011 Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## --------- ##
+## DOS EOL. ##
+## --------- ##
+
+TMP=$TMP_BASE-dos-eol
+tr @ '\015' > $TMP <<\EOF
+Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
+Rem 2009 Free Software Foundation, Inc.@
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+tr @ '\015' > $TMP-exp <<\EOF
+Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
+Rem 2009, 2010 Free Software Foundation, Inc.@
+EOF
+compare $TMP-exp $TMP || exit 1
+rm $TMP*
+
+## --------------- ##
+## Omitted "(C)". ##
+## --------------- ##
+
+TMP=$TMP_BASE-omitted-circle-c
+cat > $TMP <<EOF
+ Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------------ ##
+## C-style comments. ##
+## ------------------ ##
+
+TMP=$TMP_BASE-c-style-comments
+cat > $TMP.star <<EOF
+/* Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ * 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ * 2009 Free Software Foundation, Inc. */
+EOF
+cat > $TMP.space <<EOF
+ /*Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009 Free Software Foundation, Inc. */
+EOF
+cat > $TMP.single-line <<EOF
+/* Copyright 87, 1991, 1992 Free Software Foundation, Inc. */
+EOF
+cat > $TMP.single-line-wrapped <<EOF
+ /* Copyright 1988, 1991, 1992, 1993 Free Software Foundation, Inc. */
+EOF
+cat > $TMP.extra-text-star <<EOF
+ /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. End
+ * More comments. */
+EOF
+cat > $TMP.extra-text-space <<EOF
+ /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. ***
+ * End of comments. */
+EOF
+cat > $TMP.two-digit-final-is-substr-of-first <<EOF
+ /* Copyright 1991, 99 Free Software Foundation, Inc. */
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+ update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP.star <<EOF || exit 1
+/* Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ * 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ * 2009, 2010 Free Software Foundation, Inc. */
+EOF
+compare - $TMP.space <<EOF || exit 1
+ /*Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc. */
+EOF
+compare - $TMP.single-line <<EOF || exit 1
+/* Copyright 1987, 1991, 1992, 2010 Free Software Foundation, Inc. */
+EOF
+compare - $TMP.single-line-wrapped <<EOF || exit 1
+ /* Copyright 1988, 1991, 1992, 1993, 2010 Free Software Foundation,
+ * Inc. */
+EOF
+compare - $TMP.extra-text-star <<EOF || exit 1
+ /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation,
+ * Inc. End
+ * More comments. */
+EOF
+compare - $TMP.extra-text-space <<EOF || exit 1
+ /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation,
+ Inc. ***
+ * End of comments. */
+EOF
+compare - $TMP.two-digit-final-is-substr-of-first <<EOF || exit 1
+ /* Copyright 1991, 1999, 2010 Free Software Foundation, Inc. */
+EOF
+rm $TMP*
+
+exit 0
diff --git a/gnulib-tests/test-vasnprintf.c b/gnulib-tests/test-vasnprintf.c
new file mode 100644
index 0000000..a75c004
--- /dev/null
+++ b/gnulib-tests/test-vasnprintf.c
@@ -0,0 +1,94 @@
+/* Test of vasnprintf() and asnprintf() functions.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include "vasnprintf.h"
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+static void
+test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
+{
+ char buf[8];
+ int size;
+
+ for (size = 0; size <= 8; size++)
+ {
+ size_t length = size;
+ char *result = my_asnprintf (NULL, &length, "%d", 12345);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "12345") == 0);
+ ASSERT (length == 5);
+ free (result);
+ }
+
+ for (size = 0; size <= 8; size++)
+ {
+ size_t length;
+ char *result;
+
+ memcpy (buf, "DEADBEEF", 8);
+ length = size;
+ result = my_asnprintf (buf, &length, "%d", 12345);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "12345") == 0);
+ ASSERT (length == 5);
+ if (size < 6)
+ ASSERT (result != buf);
+ ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
+ if (result != buf)
+ free (result);
+ }
+}
+
+static char *
+my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+{
+ va_list args;
+ char *ret;
+
+ va_start (args, format);
+ ret = vasnprintf (resultbuf, lengthp, format, args);
+ va_end (args);
+ return ret;
+}
+
+static void
+test_vasnprintf ()
+{
+ test_function (my_asnprintf);
+}
+
+static void
+test_asnprintf ()
+{
+ test_function (asnprintf);
+}
+
+int
+main (int argc, char *argv[])
+{
+ test_vasnprintf ();
+ test_asnprintf ();
+ return 0;
+}
diff --git a/gnulib-tests/test-vasprintf.c b/gnulib-tests/test-vasprintf.c
new file mode 100644
index 0000000..ebcbfc4
--- /dev/null
+++ b/gnulib-tests/test-vasprintf.c
@@ -0,0 +1,103 @@
+/* Test of vasprintf() and asprintf() functions.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (asprintf, int, (char **, char const *, ...));
+SIGNATURE_CHECK (vasprintf, int, (char **, char const *, va_list));
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+static int
+my_asprintf (char **result, const char *format, ...)
+{
+ va_list args;
+ int ret;
+
+ va_start (args, format);
+ ret = vasprintf (result, format, args);
+ va_end (args);
+ return ret;
+}
+
+static void
+test_vasprintf ()
+{
+ int repeat;
+
+ for (repeat = 0; repeat <= 8; repeat++)
+ {
+ char *result;
+ int retval = my_asprintf (&result, "%d", 12345);
+ ASSERT (retval == 5);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "12345") == 0);
+ free (result);
+ }
+
+ for (repeat = 0; repeat <= 8; repeat++)
+ {
+ char *result;
+ int retval = my_asprintf (&result, "%08lx", 12345UL);
+ ASSERT (retval == 8);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "00003039") == 0);
+ free (result);
+ }
+}
+
+static void
+test_asprintf ()
+{
+ int repeat;
+
+ for (repeat = 0; repeat <= 8; repeat++)
+ {
+ char *result;
+ int retval = asprintf (&result, "%d", 12345);
+ ASSERT (retval == 5);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "12345") == 0);
+ free (result);
+ }
+
+ for (repeat = 0; repeat <= 8; repeat++)
+ {
+ char *result;
+ int retval = asprintf (&result, "%08lx", 12345UL);
+ ASSERT (retval == 8);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "00003039") == 0);
+ free (result);
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ test_vasprintf ();
+ test_asprintf ();
+ return 0;
+}
diff --git a/gnulib-tests/test-vc-list-files-cvs.sh b/gnulib-tests/test-vc-list-files-cvs.sh
new file mode 100755
index 0000000..6262944
--- /dev/null
+++ b/gnulib-tests/test-vc-list-files-cvs.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# Unit tests for vc-list-files
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" .
+
+tmpdir=vc-cvs
+repo=`pwd`/$tmpdir/repo
+
+fail=0
+for i in with-cvsu without; do
+ # On the first iteration, test using cvsu, if it's in your path.
+ # On the second iteration, ensure that cvsu fails, so we'll
+ # exercise the awk-using code.
+ if test $i = without; then
+ printf '%s\n' '#!/bin/sh' 'exit 1' > cvsu
+ chmod a+x cvsu
+ PATH=`pwd`:$PATH
+ export PATH
+ fi
+ ok=0
+ mkdir $tmpdir && cd $tmpdir &&
+ # without cvs, skip the test
+ { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \
+ || skip_ "cvs not found in PATH"; } &&
+ mkdir w && cd w &&
+ mkdir d &&
+ touch d/a b c &&
+ cvs -Q -d "$repo" import -m imp m M M0 &&
+ cvs -Q -d "$repo" co m && cd m &&
+ printf '%s\n' b c d/a > expected &&
+ vc-list-files | sort > actual &&
+ compare expected actual &&
+ ok=1
+ test $ok = 0 && fail=1
+done
+
+Exit $fail
diff --git a/gnulib-tests/test-vc-list-files-git.sh b/gnulib-tests/test-vc-list-files-git.sh
new file mode 100755
index 0000000..4358115
--- /dev/null
+++ b/gnulib-tests/test-vc-list-files-git.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Unit tests for vc-list-files
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" .
+
+tmpdir=vc-git-$$
+GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE
+
+fail=1
+mkdir $tmpdir && cd $tmpdir &&
+ # without git, skip the test
+ # The double use of 'exit' is needed for the reference to $? inside the trap.
+ { ( git init -q ) > /dev/null 2>&1 \
+ || skip_ "git not found in PATH"; } &&
+ mkdir d &&
+ touch d/a b c &&
+ git config user.email "you@example.com" &&
+ git config user.name "Your Name" &&
+ git add . > /dev/null &&
+ git commit -q -a -m log &&
+ printf '%s\n' b c d/a > expected &&
+ vc-list-files > actual &&
+ compare expected actual &&
+ fail=0
+
+Exit $fail
diff --git a/gnulib-tests/test-verify.c b/gnulib-tests/test-verify.c
new file mode 100644
index 0000000..d7ca053
--- /dev/null
+++ b/gnulib-tests/test-verify.c
@@ -0,0 +1,69 @@
+/* Test the "verify" module.
+
+ Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible. */
+
+#include <config.h>
+
+#include "verify.h"
+
+#ifndef EXP_FAIL
+# define EXP_FAIL 0
+#endif
+
+int x;
+enum { a, b, c };
+
+#if EXP_FAIL == 1
+verify (x >= 0); /* should give ERROR: non-constant expression */
+#endif
+verify (c == 2); /* should be ok */
+#if EXP_FAIL == 2
+verify (1 + 1 == 3); /* should give ERROR */
+#endif
+verify (1 == 1); verify (1 == 1); /* should be ok */
+
+enum
+{
+ item = verify_true (1 == 1) * 0 + 17 /* should be ok */
+};
+
+static int
+function (int n)
+{
+#if EXP_FAIL == 3
+ verify (n >= 0); /* should give ERROR: non-constant expression */
+#endif
+ verify (c == 2); /* should be ok */
+#if EXP_FAIL == 4
+ verify (1 + 1 == 3); /* should give ERROR */
+#endif
+ verify (1 == 1); verify (1 == 1); /* should be ok */
+
+ if (n)
+ return ((void) verify_expr (1 == 1, 1), verify_expr (1 == 1, 8)); /* should be ok */
+#if EXP_FAIL == 5
+ return verify_expr (1 == 2, 5); /* should give ERROR */
+#endif
+ return 0;
+}
+
+int
+main (void)
+{
+ return !(function (0) == 0 && function (1) == 8);
+}
diff --git a/gnulib-tests/test-verify.sh b/gnulib-tests/test-verify.sh
new file mode 100755
index 0000000..3e76761
--- /dev/null
+++ b/gnulib-tests/test-verify.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+. "${srcdir=.}/init.sh"
+
+# We are not interested in triggering bugs in the compilers and tools
+# (such as gcc 4.3.1 on openSUSE 11.0).
+unset MALLOC_PERTURB_
+
+# Rather than figure out how to invoke the compiler with the right
+# include path ourselves, we let make do it:
+(cd "$initial_cwd_" && rm -f test-verify.o \
+ && $MAKE test-verify.o >/dev/null 2>&1) \
+ || skip_ "cannot compile error-free"
+
+# Now, prove that we encounter all expected compilation failures:
+: >out
+: >err
+for i in 1 2 3 4 5; do
+ (cd "$initial_cwd_"
+ rm -f test-verify.o
+ $MAKE CFLAGS=-DEXP_FAIL=$i test-verify.o) >>out 2>>err \
+ && { warn_ "compiler didn't detect verification failure $i"; fail=1; }
+done
+
+Exit $fail
diff --git a/gnulib-tests/test-version-etc.c b/gnulib-tests/test-version-etc.c
new file mode 100644
index 0000000..4382c76
--- /dev/null
+++ b/gnulib-tests/test-version-etc.c
@@ -0,0 +1,33 @@
+/* Test suite for version-etc.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ This file is part of the GNUlib Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "version-etc.h"
+
+#include "progname.h"
+
+#define AUTHORS "Sergey Poznyakoff", "Eric Blake"
+
+int
+main (int argc _GL_UNUSED, char **argv)
+{
+ set_program_name (argv[0]);
+ version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS,
+ (const char *) NULL);
+ return 0;
+}
diff --git a/gnulib-tests/test-version-etc.sh b/gnulib-tests/test-version-etc.sh
new file mode 100755
index 0000000..1706aef
--- /dev/null
+++ b/gnulib-tests/test-version-etc.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Test suite for version-etc.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+TMP=ve-expected.tmp
+LC_ALL=C
+export LC_ALL
+ERR=0
+
+cat > $TMP <<EOT
+test-version-etc (PROJECT) VERSION
+COPYRIGHT Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Written by Sergey Poznyakoff and Eric Blake.
+EOT
+
+./test-version-etc${EXEEXT} --version |
+ sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/
+ /^Packaged by/d
+ 2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' |
+ tr -d '\015' |
+ diff -c $TMP - || ERR=1
+
+rm $TMP
+
+exit $ERR
diff --git a/gnulib-tests/test-wchar.c b/gnulib-tests/test-wchar.c
new file mode 100644
index 0000000..e118048
--- /dev/null
+++ b/gnulib-tests/test-wchar.c
@@ -0,0 +1,37 @@
+/* Test of <wchar.h> substitute.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "verify.h"
+
+/* Check that the types wchar_t and wint_t are defined. */
+wchar_t a = 'c';
+wint_t b = 'x';
+
+/* Check that NULL can be passed through varargs as a pointer type,
+ per POSIX 2008. */
+verify (sizeof NULL == sizeof (void *));
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gnulib-tests/test-wcrtomb-w32-1.sh b/gnulib-tests/test-wcrtomb-w32-1.sh
new file mode 100755
index 0000000..50c82f5
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb-w32-1.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP1252 locale.
+./test-wcrtomb-w32${EXEEXT} French_France 1252
diff --git a/gnulib-tests/test-wcrtomb-w32-2.sh b/gnulib-tests/test-wcrtomb-w32-2.sh
new file mode 100755
index 0000000..783c70c
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb-w32-2.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP1256 locale.
+./test-wcrtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
diff --git a/gnulib-tests/test-wcrtomb-w32-3.sh b/gnulib-tests/test-wcrtomb-w32-3.sh
new file mode 100755
index 0000000..619ea64
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb-w32-3.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP932 locale.
+./test-wcrtomb-w32${EXEEXT} Japanese_Japan 932
diff --git a/gnulib-tests/test-wcrtomb-w32-4.sh b/gnulib-tests/test-wcrtomb-w32-4.sh
new file mode 100755
index 0000000..67b6803
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb-w32-4.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP950 locale.
+./test-wcrtomb-w32${EXEEXT} Chinese_Taiwan 950
diff --git a/gnulib-tests/test-wcrtomb-w32-5.sh b/gnulib-tests/test-wcrtomb-w32-5.sh
new file mode 100755
index 0000000..9841fa9
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb-w32-5.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a CP936 locale.
+./test-wcrtomb-w32${EXEEXT} Chinese_China 936
diff --git a/gnulib-tests/test-wcrtomb-w32.c b/gnulib-tests/test-wcrtomb-w32.c
new file mode 100644
index 0000000..0570c73
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb-w32.c
@@ -0,0 +1,332 @@
+/* Test of conversion of wide character to multibyte character.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+
+static int
+test_one_locale (const char *name, int codepage)
+{
+ char buf[64];
+ size_t ret;
+
+# if 1
+ /* Portable code to set the locale. */
+ {
+ char name_with_codepage[1024];
+
+ sprintf (name_with_codepage, "%s.%d", name, codepage);
+
+ /* Set the locale. */
+ if (setlocale (LC_ALL, name_with_codepage) == NULL)
+ return 77;
+ }
+# else
+ /* Hacky way to set a locale.codepage combination that setlocale() refuses
+ to set. */
+ {
+ /* Codepage of the current locale, set with setlocale().
+ Not necessarily the same as GetACP(). */
+ extern __declspec(dllimport) unsigned int __lc_codepage;
+
+ /* Set the locale. */
+ if (setlocale (LC_ALL, name) == NULL)
+ return 77;
+
+ /* Clobber the codepage and MB_CUR_MAX, both set by setlocale(). */
+ __lc_codepage = codepage;
+ switch (codepage)
+ {
+ case 1252:
+ case 1256:
+ MB_CUR_MAX = 1;
+ break;
+ case 932:
+ case 950:
+ case 936:
+ MB_CUR_MAX = 2;
+ break;
+ case 54936:
+ case 65001:
+ MB_CUR_MAX = 4;
+ break;
+ }
+
+ /* Test whether the codepage is really available. */
+ {
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, " ", 1, &state) == (size_t)(-1))
+ return 77;
+ }
+ }
+# endif
+
+ /* Test NUL character. */
+ {
+ buf[0] = 'x';
+ ret = wcrtomb (buf, 0, NULL);
+ ASSERT (ret == 1);
+ ASSERT (buf[0] == '\0');
+ }
+
+ /* Test single bytes. */
+ {
+ int c;
+
+ for (c = 0; c < 0x100; c++)
+ switch (c)
+ {
+ case '\t': case '\v': case '\f':
+ case ' ': case '!': case '"': case '#': case '%':
+ case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>':
+ case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y':
+ case 'Z':
+ case '[': case '\\': case ']': case '^': case '_':
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}': case '~':
+ /* c is in the ISO C "basic character set". */
+ ret = wcrtomb (buf, btowc (c), NULL);
+ ASSERT (ret == 1);
+ ASSERT (buf[0] == (char) c);
+ break;
+ }
+ }
+
+ /* Test special calling convention, passing a NULL pointer. */
+ {
+ ret = wcrtomb (NULL, '\0', NULL);
+ ASSERT (ret == 1);
+ ret = wcrtomb (NULL, btowc ('x'), NULL);
+ ASSERT (ret == 1);
+ }
+
+ switch (codepage)
+ {
+ case 1252:
+ /* Locale encoding is CP1252, an extension of ISO-8859-1. */
+ {
+ /* Convert "B\374\337er": "Büßer" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x00FC, NULL);
+ ASSERT (ret == 1);
+ ASSERT (memcmp (buf, "\374", 1) == 0);
+ ASSERT (buf[1] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x00DF, NULL);
+ ASSERT (ret == 1);
+ ASSERT (memcmp (buf, "\337", 1) == 0);
+ ASSERT (buf[1] == 'x');
+ }
+ return 0;
+
+ case 1256:
+ /* Locale encoding is CP1256, not the same as ISO-8859-6. */
+ {
+ /* Convert "x\302\341\346y": "xآلوy" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x0622, NULL);
+ ASSERT (ret == 1);
+ ASSERT (memcmp (buf, "\302", 1) == 0);
+ ASSERT (buf[1] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x0644, NULL);
+ ASSERT (ret == 1);
+ ASSERT (memcmp (buf, "\341", 1) == 0);
+ ASSERT (buf[1] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x0648, NULL);
+ ASSERT (ret == 1);
+ ASSERT (memcmp (buf, "\346", 1) == 0);
+ ASSERT (buf[1] == 'x');
+ }
+ return 0;
+
+ case 932:
+ /* Locale encoding is CP932, similar to Shift_JIS. */
+ {
+ /* Convert "<\223\372\226\173\214\352>": "<日本語>" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x65E5, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\223\372", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x672C, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\226\173", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x8A9E, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\214\352", 2) == 0);
+ ASSERT (buf[2] == 'x');
+ }
+ return 0;
+
+ case 950:
+ /* Locale encoding is CP950, similar to Big5. */
+ {
+ /* Convert "<\244\351\245\273\273\171>": "<日本語>" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x65E5, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\244\351", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x672C, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\245\273", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x8A9E, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\273\171", 2) == 0);
+ ASSERT (buf[2] == 'x');
+ }
+ return 0;
+
+ case 936:
+ /* Locale encoding is CP936 = GBK, an extension of GB2312. */
+ {
+ /* Convert "<\310\325\261\276\325\132>": "<日本語>" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x65E5, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\310\325", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x672C, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\261\276", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x8A9E, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\325\132", 2) == 0);
+ ASSERT (buf[2] == 'x');
+ }
+ return 0;
+
+ case 54936:
+ /* Locale encoding is CP54936 = GB18030. */
+ {
+ /* Convert "B\250\271\201\060\211\070er": "Büßer" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x00FC, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\250\271", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x00DF, NULL);
+ ASSERT (ret == 4);
+ ASSERT (memcmp (buf, "\201\060\211\070", 4) == 0);
+ ASSERT (buf[4] == 'x');
+ }
+ return 0;
+
+ case 65001:
+ /* Locale encoding is CP65001 = UTF-8. */
+ {
+ /* Convert "B\303\274\303\237er": "Büßer" */
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x00FC, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\303\274", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = wcrtomb (buf, 0x00DF, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\303\237", 2) == 0);
+ ASSERT (buf[2] == 'x');
+ }
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ int codepage = atoi (argv[argc - 1]);
+ int result;
+ int i;
+
+ result = 77;
+ for (i = 1; i < argc - 1; i++)
+ {
+ int ret = test_one_locale (argv[i], codepage);
+
+ if (ret != 77)
+ result = ret;
+ }
+
+ if (result == 77)
+ {
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ }
+ return result;
+}
+
+#else
+
+int
+main (int argc, char *argv[])
+{
+ fputs ("Skipping test: not a native Windows system\n", stderr);
+ return 77;
+}
+
+#endif
diff --git a/gnulib-tests/test-wcrtomb.c b/gnulib-tests/test-wcrtomb.c
new file mode 100644
index 0000000..e1d2bb4
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb.c
@@ -0,0 +1,162 @@
+/* Test of conversion of wide character to multibyte character.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (wcrtomb, size_t, (char *, wchar_t, mbstate_t *));
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+/* Check the multibyte character s[0..n-1]. */
+static void
+check_character (const char *s, size_t n)
+{
+ wchar_t wc;
+ char buf[64];
+ int iret;
+ size_t ret;
+
+ wc = (wchar_t) 0xBADFACE;
+ iret = mbtowc (&wc, s, n);
+ ASSERT (iret == n);
+
+ ret = wcrtomb (buf, wc, NULL);
+ ASSERT (ret == n);
+ ASSERT (memcmp (buf, s, n) == 0);
+
+ /* Test special calling convention, passing a NULL pointer. */
+ ret = wcrtomb (NULL, wc, NULL);
+ ASSERT (ret == 1);
+}
+
+int
+main (int argc, char *argv[])
+{
+ char buf[64];
+ size_t ret;
+
+ /* configure should already have checked that the locale is supported. */
+ if (setlocale (LC_ALL, "") == NULL)
+ return 1;
+
+ /* Test NUL character. */
+ {
+ buf[0] = 'x';
+ ret = wcrtomb (buf, 0, NULL);
+ ASSERT (ret == 1);
+ ASSERT (buf[0] == '\0');
+ }
+
+ /* Test single bytes. */
+ {
+ int c;
+
+ for (c = 0; c < 0x100; c++)
+ switch (c)
+ {
+ case '\t': case '\v': case '\f':
+ case ' ': case '!': case '"': case '#': case '%':
+ case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>':
+ case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y':
+ case 'Z':
+ case '[': case '\\': case ']': case '^': case '_':
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}': case '~':
+ /* c is in the ISO C "basic character set". */
+ ret = wcrtomb (buf, btowc (c), NULL);
+ ASSERT (ret == 1);
+ ASSERT (buf[0] == (char) c);
+ break;
+ }
+ }
+
+ /* Test special calling convention, passing a NULL pointer. */
+ {
+ ret = wcrtomb (NULL, '\0', NULL);
+ ASSERT (ret == 1);
+ ret = wcrtomb (NULL, btowc ('x'), NULL);
+ ASSERT (ret == 1);
+ }
+
+ if (argc > 1)
+ switch (argv[1][0])
+ {
+ case '1':
+ /* Locale encoding is ISO-8859-1 or ISO-8859-15. */
+ {
+ const char input[] = "B\374\337er"; /* "Büßer" */
+
+ check_character (input + 1, 1);
+ check_character (input + 2, 1);
+ }
+ return 0;
+
+ case '2':
+ /* Locale encoding is UTF-8. */
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+
+ check_character (input + 1, 2);
+ check_character (input + 3, 2);
+ }
+ return 0;
+
+ case '3':
+ /* Locale encoding is EUC-JP. */
+ {
+ const char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */
+
+ check_character (input + 1, 2);
+ check_character (input + 3, 2);
+ check_character (input + 5, 2);
+ }
+ return 0;
+
+ case '4':
+ /* Locale encoding is GB18030. */
+ {
+ const char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+
+ check_character (input + 1, 2);
+ check_character (input + 3, 4);
+ }
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/gnulib-tests/test-wcrtomb.sh b/gnulib-tests/test-wcrtomb.sh
new file mode 100755
index 0000000..3eda8f3
--- /dev/null
+++ b/gnulib-tests/test-wcrtomb.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR != none; then
+ LC_ALL=$LOCALE_FR \
+ ./test-wcrtomb${EXEEXT} 1 \
+ || exit 1
+fi
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 != none; then
+ LC_ALL=$LOCALE_FR_UTF8 \
+ ./test-wcrtomb${EXEEXT} 2 \
+ || exit 1
+fi
+
+# Test whether a specific EUC-JP locale is installed.
+: ${LOCALE_JA=ja_JP}
+if test $LOCALE_JA != none; then
+ LC_ALL=$LOCALE_JA \
+ ./test-wcrtomb${EXEEXT} 3 \
+ || exit 1
+fi
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN != none; then
+ LC_ALL=$LOCALE_ZH_CN \
+ ./test-wcrtomb${EXEEXT} 4 \
+ || exit 1
+fi
+
+exit 0
diff --git a/gnulib-tests/test-wctype-h.c b/gnulib-tests/test-wctype-h.c
new file mode 100644
index 0000000..b401091
--- /dev/null
+++ b/gnulib-tests/test-wctype-h.c
@@ -0,0 +1,74 @@
+/* Test of <wctype.h> substitute.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "macros.h"
+
+/* Check that the type wint_t is defined. */
+wint_t a = 'x';
+/* Check that WEOF is defined. */
+wint_t e = WEOF;
+
+/* Check that the type wctype_t is defined. */
+wctype_t p;
+
+/* Check that the type wctrans_t is defined. */
+wctrans_t q;
+
+int
+main (void)
+{
+ /* Check that the isw* functions exist as functions or as macros. */
+ (void) iswalnum (0);
+ (void) iswalpha (0);
+ (void) iswcntrl (0);
+ (void) iswdigit (0);
+ (void) iswgraph (0);
+ (void) iswlower (0);
+ (void) iswprint (0);
+ (void) iswpunct (0);
+ (void) iswspace (0);
+ (void) iswupper (0);
+ (void) iswxdigit (0);
+
+ /* Check that the isw* functions map WEOF to 0. */
+ ASSERT (!iswalnum (e));
+ ASSERT (!iswalpha (e));
+ ASSERT (!iswcntrl (e));
+ ASSERT (!iswdigit (e));
+ ASSERT (!iswgraph (e));
+ ASSERT (!iswlower (e));
+ ASSERT (!iswprint (e));
+ ASSERT (!iswpunct (e));
+ ASSERT (!iswspace (e));
+ ASSERT (!iswupper (e));
+ ASSERT (!iswxdigit (e));
+
+ /* Check that the tow* functions exist as functions or as macros. */
+ (void) towlower (0);
+ (void) towupper (0);
+
+ /* Check that the tow* functions map WEOF to WEOF. */
+ ASSERT (towlower (e) == e);
+ ASSERT (towupper (e) == e);
+
+ return 0;
+}
diff --git a/gnulib-tests/test-wcwidth.c b/gnulib-tests/test-wcwidth.c
new file mode 100644
index 0000000..5a0d853
--- /dev/null
+++ b/gnulib-tests/test-wcwidth.c
@@ -0,0 +1,81 @@
+/* Test of wcwidth() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (wcwidth, int, (wchar_t));
+
+#include <locale.h>
+#include <string.h>
+
+#include "localcharset.h"
+#include "macros.h"
+
+int
+main ()
+{
+ wchar_t wc;
+
+ /* Test width of ASCII characters. */
+ for (wc = 0x20; wc < 0x7F; wc++)
+ ASSERT (wcwidth (wc) == 1);
+
+ /* Switch to an UTF-8 locale. */
+ if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL
+ /* Check whether it's really an UTF-8 locale.
+ On OpenBSD 4.0, the setlocale call succeeds only for the LC_CTYPE
+ category and therefore returns "C/fr_FR.UTF-8/C/C/C/C", but the
+ LC_CTYPE category is effectively set to an ASCII LC_CTYPE category;
+ in particular, locale_charset() returns "ASCII". */
+ && strcmp (locale_charset (), "UTF-8") == 0)
+ {
+ /* Test width of ASCII characters. */
+ for (wc = 0x20; wc < 0x7F; wc++)
+ ASSERT (wcwidth (wc) == 1);
+
+ /* Test width of some non-spacing characters. */
+ ASSERT (wcwidth (0x0301) == 0);
+ ASSERT (wcwidth (0x05B0) == 0);
+
+ /* Test width of some format control characters. */
+ ASSERT (wcwidth (0x200E) <= 0);
+ ASSERT (wcwidth (0x2060) <= 0);
+#if 0 /* wchar_t may be only 16 bits. */
+ ASSERT (wcwidth (0xE0001) <= 0);
+ ASSERT (wcwidth (0xE0044) <= 0);
+#endif
+
+ /* Test width of some zero width characters. */
+ ASSERT (wcwidth (0x200B) == 0);
+ ASSERT (wcwidth (0xFEFF) <= 0);
+
+ /* Test width of some CJK characters. */
+ ASSERT (wcwidth (0x3000) == 2);
+ ASSERT (wcwidth (0xB250) == 2);
+ ASSERT (wcwidth (0xFF1A) == 2);
+#if 0 /* wchar_t may be only 16 bits. */
+ ASSERT (wcwidth (0x20369) == 2);
+ ASSERT (wcwidth (0x2F876) == 2);
+#endif
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/test-xalloc-die.c b/gnulib-tests/test-xalloc-die.c
new file mode 100644
index 0000000..9329750
--- /dev/null
+++ b/gnulib-tests/test-xalloc-die.c
@@ -0,0 +1,30 @@
+/* Test of xalloc_die() function.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson <simon@josefsson.org>, 2009. */
+
+#include <config.h>
+
+#include "xalloc.h"
+#include "progname.h"
+
+int
+main (int argc _GL_UNUSED, char **argv)
+{
+ set_program_name (argv[0]);
+ xalloc_die ();
+ return 0;
+}
diff --git a/gnulib-tests/test-xalloc-die.sh b/gnulib-tests/test-xalloc-die.sh
new file mode 100755
index 0000000..fba601f
--- /dev/null
+++ b/gnulib-tests/test-xalloc-die.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Test suite for xalloc_die.
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+
+test-xalloc-die${EXEEXT} > out 2> err
+case $? in
+ 1) ;;
+ *) Exit 1;;
+esac
+
+tr -d '\015' < err \
+ | sed 's,.*test-xalloc-die[.ex]*:,test-xalloc-die:,' > err2 || Exit 1
+
+compare - err2 <<\EOF || Exit 1
+test-xalloc-die: memory exhausted
+EOF
+
+test -s out && Exit 1
+
+Exit $fail
diff --git a/gnulib-tests/test-xstrtol.c b/gnulib-tests/test-xstrtol.c
new file mode 100644
index 0000000..fef45e5
--- /dev/null
+++ b/gnulib-tests/test-xstrtol.c
@@ -0,0 +1,65 @@
+/* Test of xstrtol module.
+ Copyright (C) 1995-1996, 1998-2001, 2003-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "xstrtol.h"
+#include "error.h"
+
+#ifndef __xstrtol
+# define __xstrtol xstrtol
+# define __strtol_t long int
+# define __spec "ld"
+#endif
+
+char *program_name;
+
+/* Don't show the program name in error messages. */
+static void
+print_no_progname (void)
+{
+}
+
+int
+main (int argc, char **argv)
+{
+ strtol_error s_err;
+ int i;
+
+ program_name = argv[0];
+ error_print_progname = print_no_progname;
+
+ for (i = 1; i < argc; i++)
+ {
+ char *p;
+ __strtol_t val;
+
+ s_err = __xstrtol (argv[i], &p, 0, &val, "bckMw0");
+ if (s_err == LONGINT_OK)
+ {
+ printf ("%s->%" __spec " (%s)\n", argv[i], val, p);
+ }
+ else
+ {
+ xstrtol_fatal (s_err, -2, 'X', NULL, argv[i]);
+ }
+ }
+ exit (0);
+}
diff --git a/gnulib-tests/test-xstrtol.sh b/gnulib-tests/test-xstrtol.sh
new file mode 100755
index 0000000..5425bc7
--- /dev/null
+++ b/gnulib-tests/test-xstrtol.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
+
+too_big=99999999999999999999999999999999999999999999999999999999999999999999
+result=0
+
+# test xstrtol
+test-xstrtol 1 >> out 2>&1 || result=1
+test-xstrtol -1 >> out 2>&1 || result=1
+test-xstrtol 1k >> out 2>&1 || result=1
+test-xstrtol ${too_big}h >> out 2>&1 && result=1
+test-xstrtol $too_big >> out 2>&1 && result=1
+test-xstrtol x >> out 2>&1 && result=1
+test-xstrtol 9x >> out 2>&1 && result=1
+test-xstrtol 010 >> out 2>&1 || result=1
+# suffix without integer is valid
+test-xstrtol MiB >> out 2>&1 || result=1
+test-xstrtol 1bB >> out 2>&1 && result=1
+
+# test xstrtoul
+test-xstrtoul 1 >> out 2>&1 || result=1
+test-xstrtoul -1 >> out 2>&1 && result=1
+test-xstrtoul 1k >> out 2>&1 || result=1
+test-xstrtoul ${too_big}h >> out 2>&1 && result=1
+test-xstrtoul $too_big >> out 2>&1 && result=1
+test-xstrtoul x >> out 2>&1 && result=1
+test-xstrtoul 9x >> out 2>&1 && result=1
+test-xstrtoul 010 >> out 2>&1 || result=1
+test-xstrtoul MiB >> out 2>&1 || result=1
+test-xstrtoul 1bB >> out 2>&1 && result=1
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+if echo solaris | tr -d '\r' | grep solais > /dev/null; then
+ cr='\015'
+else
+ cr='\r'
+fi
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k
+mv k out
+
+# compare expected output
+cat > expected <<EOF
+1->1 ()
+-1->-1 ()
+1k->1024 ()
+invalid suffix in X argument '${too_big}h'
+X argument '$too_big' too large
+invalid X argument 'x'
+invalid suffix in X argument '9x'
+010->8 ()
+MiB->1048576 ()
+invalid suffix in X argument '1bB'
+1->1 ()
+invalid X argument '-1'
+1k->1024 ()
+invalid suffix in X argument '${too_big}h'
+X argument '$too_big' too large
+invalid X argument 'x'
+invalid suffix in X argument '9x'
+010->8 ()
+MiB->1048576 ()
+invalid suffix in X argument '1bB'
+EOF
+
+compare expected out || result=1
+
+Exit $result
diff --git a/gnulib-tests/test-xstrtoul.c b/gnulib-tests/test-xstrtoul.c
new file mode 100644
index 0000000..9dda9ee
--- /dev/null
+++ b/gnulib-tests/test-xstrtoul.c
@@ -0,0 +1,4 @@
+#define __xstrtol xstrtoul
+#define __strtol_t unsigned long int
+#define __spec "lu"
+#include "test-xstrtol.c"
diff --git a/gnulib-tests/test-xstrtoumax.c b/gnulib-tests/test-xstrtoumax.c
new file mode 100644
index 0000000..2e68c2e
--- /dev/null
+++ b/gnulib-tests/test-xstrtoumax.c
@@ -0,0 +1,4 @@
+#define __xstrtol xstrtoumax
+#define __strtol_t uintmax_t
+#define __spec PRIuMAX
+#include "test-xstrtol.c"
diff --git a/gnulib-tests/test-xstrtoumax.sh b/gnulib-tests/test-xstrtoumax.sh
new file mode 100755
index 0000000..bdbdbf5
--- /dev/null
+++ b/gnulib-tests/test-xstrtoumax.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
+
+too_big=99999999999999999999999999999999999999999999999999999999999999999999
+result=0
+
+# test xstrtoumax
+test-xstrtoumax 1 >> out 2>&1 || result=1
+test-xstrtoumax -1 >> out 2>&1 && result=1
+test-xstrtoumax 1k >> out 2>&1 || result=1
+test-xstrtoumax ${too_big}h >> out 2>&1 && result=1
+test-xstrtoumax $too_big >> out 2>&1 && result=1
+test-xstrtoumax x >> out 2>&1 && result=1
+test-xstrtoumax 9x >> out 2>&1 && result=1
+test-xstrtoumax 010 >> out 2>&1 || result=1
+test-xstrtoumax MiB >> out 2>&1 || result=1
+
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+if echo solaris | tr -d '\r' | grep solais > /dev/null; then
+ cr='\015'
+else
+ cr='\r'
+fi
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k
+mv k out
+
+# compare expected output
+cat > exp <<EOF
+1->1 ()
+invalid X argument '-1'
+1k->1024 ()
+invalid suffix in X argument '${too_big}h'
+X argument '$too_big' too large
+invalid X argument 'x'
+invalid suffix in X argument '9x'
+010->8 ()
+MiB->1048576 ()
+EOF
+
+compare exp out || result=1
+
+Exit $result
diff --git a/gnulib-tests/test-xvasprintf.c b/gnulib-tests/test-xvasprintf.c
new file mode 100644
index 0000000..985fe2e
--- /dev/null
+++ b/gnulib-tests/test-xvasprintf.c
@@ -0,0 +1,138 @@
+/* Test of xvasprintf() and xasprintf() functions.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* Tell GCC not to warn about the specific edge cases tested here. */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wformat-zero-length"
+# pragma GCC diagnostic ignored "-Wformat-nonliteral"
+# pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
+#include <config.h>
+
+#include "xvasprintf.h"
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "progname.h"
+#include "macros.h"
+
+static char *
+my_xasprintf (const char *format, ...)
+{
+ va_list args;
+ char *ret;
+
+ va_start (args, format);
+ ret = xvasprintf (format, args);
+ va_end (args);
+ return ret;
+}
+
+static void
+test_xvasprintf (void)
+{
+ int repeat;
+ char *result;
+
+ for (repeat = 0; repeat <= 8; repeat++)
+ {
+ result = my_xasprintf ("%d", 12345);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "12345") == 0);
+ free (result);
+ }
+
+ {
+ /* Silence gcc warning about zero-length format string. */
+ const char *empty = "";
+ result = my_xasprintf (empty);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "") == 0);
+ free (result);
+ }
+
+ result = my_xasprintf ("%s", "foo");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "foo") == 0);
+ free (result);
+
+ result = my_xasprintf ("%s%s", "foo", "bar");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "foobar") == 0);
+ free (result);
+
+ result = my_xasprintf ("%s%sbaz", "foo", "bar");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "foobarbaz") == 0);
+ free (result);
+}
+
+static void
+test_xasprintf (void)
+{
+ int repeat;
+ char *result;
+
+ for (repeat = 0; repeat <= 8; repeat++)
+ {
+ result = xasprintf ("%d", 12345);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "12345") == 0);
+ free (result);
+ }
+
+ {
+ /* Silence gcc warning about zero-length format string,
+ and about "format not a string literal and no format"
+ (whatever that means) . */
+ const char *empty = "";
+ result = xasprintf (empty, empty);
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "") == 0);
+ free (result);
+ }
+
+ result = xasprintf ("%s", "foo");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "foo") == 0);
+ free (result);
+
+ result = xasprintf ("%s%s", "foo", "bar");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "foobar") == 0);
+ free (result);
+
+ result = my_xasprintf ("%s%sbaz", "foo", "bar");
+ ASSERT (result != NULL);
+ ASSERT (strcmp (result, "foobarbaz") == 0);
+ free (result);
+}
+
+int
+main (int argc _GL_UNUSED, char *argv[])
+{
+ set_program_name (argv[0]);
+
+ test_xvasprintf ();
+ test_xasprintf ();
+
+ return 0;
+}
diff --git a/gnulib-tests/timespec-add.c b/gnulib-tests/timespec-add.c
new file mode 100644
index 0000000..b093946
--- /dev/null
+++ b/gnulib-tests/timespec-add.c
@@ -0,0 +1,71 @@
+/* Add two struct timespec values.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* Return the sum of two timespec values A and B. On overflow, return
+ an extremal value. This assumes 0 <= tv_nsec < TIMESPEC_RESOLUTION. */
+
+#include <config.h>
+#include "timespec.h"
+
+#include "intprops.h"
+
+struct timespec
+timespec_add (struct timespec a, struct timespec b)
+{
+ time_t rs = a.tv_sec;
+ time_t bs = b.tv_sec;
+ int ns = a.tv_nsec + b.tv_nsec;
+ int nsd = ns - TIMESPEC_RESOLUTION;
+ int rns = ns;
+ time_t tmin = TYPE_MINIMUM (time_t);
+ time_t tmax = TYPE_MAXIMUM (time_t);
+
+ if (0 <= nsd)
+ {
+ rns = nsd;
+ if (bs < tmax)
+ bs++;
+ else if (rs < 0)
+ rs++;
+ else
+ goto high_overflow;
+ }
+
+ /* INT_ADD_WRAPV is not appropriate since time_t might be unsigned.
+ In theory time_t might be narrower than int, so plain
+ INT_ADD_OVERFLOW does not suffice. */
+ if (! INT_ADD_OVERFLOW (rs, bs) && tmin <= rs + bs && rs + bs <= tmax)
+ rs += bs;
+ else
+ {
+ if (rs < 0)
+ {
+ rs = tmin;
+ rns = 0;
+ }
+ else
+ {
+ high_overflow:
+ rs = tmax;
+ rns = TIMESPEC_RESOLUTION - 1;
+ }
+ }
+
+ return make_timespec (rs, rns);
+}
diff --git a/gnulib-tests/timespec-sub.c b/gnulib-tests/timespec-sub.c
new file mode 100644
index 0000000..63cc142
--- /dev/null
+++ b/gnulib-tests/timespec-sub.c
@@ -0,0 +1,71 @@
+/* Subtract two struct timespec values.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* Return the difference between two timespec values A and B. On
+ overflow, return an extremal value. This assumes 0 <= tv_nsec <
+ TIMESPEC_RESOLUTION. */
+
+#include <config.h>
+#include "timespec.h"
+
+#include "intprops.h"
+
+struct timespec
+timespec_sub (struct timespec a, struct timespec b)
+{
+ time_t rs = a.tv_sec;
+ time_t bs = b.tv_sec;
+ int ns = a.tv_nsec - b.tv_nsec;
+ int rns = ns;
+ time_t tmin = TYPE_MINIMUM (time_t);
+ time_t tmax = TYPE_MAXIMUM (time_t);
+
+ if (ns < 0)
+ {
+ rns = ns + TIMESPEC_RESOLUTION;
+ if (bs < tmax)
+ bs++;
+ else if (- TYPE_SIGNED (time_t) < rs)
+ rs--;
+ else
+ goto low_overflow;
+ }
+
+ /* INT_SUBTRACT_WRAPV is not appropriate since time_t might be unsigned.
+ In theory time_t might be narrower than int, so plain
+ INT_SUBTRACT_OVERFLOW does not suffice. */
+ if (! INT_SUBTRACT_OVERFLOW (rs, bs) && tmin <= rs - bs && rs - bs <= tmax)
+ rs -= bs;
+ else
+ {
+ if (rs < 0)
+ {
+ low_overflow:
+ rs = tmin;
+ rns = 0;
+ }
+ else
+ {
+ rs = tmax;
+ rns = TIMESPEC_RESOLUTION - 1;
+ }
+ }
+
+ return make_timespec (rs, rns);
+}
diff --git a/gnulib-tests/unistr/test-u8-mbtoucr.c b/gnulib-tests/unistr/test-u8-mbtoucr.c
new file mode 100644
index 0000000..7a7b0b9
--- /dev/null
+++ b/gnulib-tests/unistr/test-u8-mbtoucr.c
@@ -0,0 +1,187 @@
+/* Test of u8_mbtoucr() function.
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
+
+#include <config.h>
+
+#include "unistr.h"
+
+#include "macros.h"
+
+int
+main ()
+{
+ ucs4_t uc;
+ int ret;
+
+ /* Test NUL unit input. */
+ {
+ static const uint8_t input[] = "";
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 1);
+ ASSERT (ret == 1);
+ ASSERT (uc == 0);
+ }
+
+ /* Test ISO 646 unit input. */
+ {
+ ucs4_t c;
+ uint8_t buf[1];
+
+ for (c = 0; c < 0x80; c++)
+ {
+ buf[0] = c;
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, buf, 1);
+ ASSERT (ret == 1);
+ ASSERT (uc == c);
+ }
+ }
+
+ /* Test 2-byte character input. */
+ {
+ static const uint8_t input[] = { 0xC3, 0x97 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == 2);
+ ASSERT (uc == 0x00D7);
+ }
+
+ /* Test 3-byte character input. */
+ {
+ static const uint8_t input[] = { 0xE2, 0x82, 0xAC };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 3);
+ ASSERT (ret == 3);
+ ASSERT (uc == 0x20AC);
+ }
+
+ /* Test 4-byte character input. */
+ {
+ static const uint8_t input[] = { 0xF4, 0x8F, 0xBF, 0xBD };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 4);
+ ASSERT (ret == 4);
+ ASSERT (uc == 0x10FFFD);
+ }
+
+ /* Test incomplete/invalid 1-byte input. */
+ {
+ static const uint8_t input[] = { 0xC1 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 1);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xC3 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 1);
+ ASSERT (ret == -2);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xE2 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 1);
+ ASSERT (ret == -2);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xF4 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 1);
+ ASSERT (ret == -2);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xFE };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 1);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+
+ /* Test incomplete/invalid 2-byte input. */
+ {
+ static const uint8_t input[] = { 0xE0, 0x9F };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xE2, 0x82 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == -2);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xE2, 0xD0 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xF0, 0x8F };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xF3, 0x8F };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == -2);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xF3, 0xD0 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 2);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+
+ /* Test incomplete/invalid 3-byte input. */
+ {
+ static const uint8_t input[] = { 0xF3, 0x8F, 0xBF };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 3);
+ ASSERT (ret == -2);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xF3, 0xD0, 0xBF };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 3);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+ {
+ static const uint8_t input[] = { 0xF3, 0x8F, 0xD0 };
+ uc = 0xBADFACE;
+ ret = u8_mbtoucr (&uc, input, 3);
+ ASSERT (ret == -1);
+ ASSERT (uc == 0xFFFD);
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/unistr/test-u8-uctomb.c b/gnulib-tests/unistr/test-u8-uctomb.c
new file mode 100644
index 0000000..bbc9418
--- /dev/null
+++ b/gnulib-tests/unistr/test-u8-uctomb.c
@@ -0,0 +1,157 @@
+/* Test of u8_uctomb() function.
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
+
+#include <config.h>
+
+#include "unistr.h"
+
+#include "macros.h"
+
+#define MAGIC 0xBA
+
+int
+main ()
+{
+ /* Test ISO 646 character, in particular the NUL character. */
+ {
+ ucs4_t uc;
+
+ for (uc = 0; uc < 0x80; uc++)
+ {
+ uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+ int ret;
+
+ ret = u8_uctomb (buf, uc, 0);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 1);
+ ASSERT (ret == 1);
+ ASSERT (buf[0] == uc);
+ ASSERT (buf[1] == MAGIC);
+ }
+ }
+
+ /* Test 2-byte character. */
+ {
+ ucs4_t uc = 0x00D7;
+ uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+ int ret;
+
+ ret = u8_uctomb (buf, uc, 0);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 1);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 2);
+ ASSERT (ret == 2);
+ ASSERT (buf[0] == 0xC3);
+ ASSERT (buf[1] == 0x97);
+ ASSERT (buf[2] == MAGIC);
+ }
+
+ /* Test 3-byte character. */
+ {
+ ucs4_t uc = 0x20AC;
+ uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+ int ret;
+
+ ret = u8_uctomb (buf, uc, 0);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 1);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 2);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+ ASSERT (buf[1] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 3);
+ ASSERT (ret == 3);
+ ASSERT (buf[0] == 0xE2);
+ ASSERT (buf[1] == 0x82);
+ ASSERT (buf[2] == 0xAC);
+ ASSERT (buf[3] == MAGIC);
+ }
+
+ /* Test 4-byte character. */
+ {
+ ucs4_t uc = 0x10FFFD;
+ uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+ int ret;
+
+ ret = u8_uctomb (buf, uc, 0);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 1);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 2);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+ ASSERT (buf[1] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 3);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
+ ASSERT (buf[1] == MAGIC);
+ ASSERT (buf[2] == MAGIC);
+
+ ret = u8_uctomb (buf, uc, 4);
+ ASSERT (ret == 4);
+ ASSERT (buf[0] == 0xF4);
+ ASSERT (buf[1] == 0x8F);
+ ASSERT (buf[2] == 0xBF);
+ ASSERT (buf[3] == 0xBD);
+ ASSERT (buf[4] == MAGIC);
+ }
+
+ /* Test invalid characters. */
+ {
+ ucs4_t invalid[] = { 0x110000, 0xD800, 0xDBFF, 0xDC00, 0xDFFF };
+ uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+ size_t i;
+
+ for (i = 0; i < SIZEOF (invalid); i++)
+ {
+ ucs4_t uc = invalid[i];
+ int n;
+
+ for (n = 0; n <= 4; n++)
+ {
+ int ret = u8_uctomb (buf, uc, n);
+ ASSERT (ret == -1);
+ ASSERT (buf[0] == MAGIC);
+ ASSERT (buf[1] == MAGIC);
+ ASSERT (buf[2] == MAGIC);
+ ASSERT (buf[3] == MAGIC);
+ ASSERT (buf[4] == MAGIC);
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/gnulib-tests/uniwidth/test-uc_width.c b/gnulib-tests/uniwidth/test-uc_width.c
new file mode 100644
index 0000000..8c248fa
--- /dev/null
+++ b/gnulib-tests/uniwidth/test-uc_width.c
@@ -0,0 +1,56 @@
+/* Test of uc_width() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include "uniwidth.h"
+
+#include "macros.h"
+
+int
+main ()
+{
+ ucs4_t uc;
+
+ /* Test width of ASCII characters. */
+ for (uc = 0x0020; uc < 0x007F; uc++)
+ ASSERT (uc_width (uc, "ISO-8859-2") == 1);
+
+ /* Test width of some non-spacing characters. */
+ ASSERT (uc_width (0x0301, "UTF-8") == 0);
+ ASSERT (uc_width (0x05B0, "UTF-8") == 0);
+
+ /* Test width of some format control characters. */
+ ASSERT (uc_width (0x200E, "UTF-8") == 0);
+ ASSERT (uc_width (0x2060, "UTF-8") == 0);
+ ASSERT (uc_width (0xE0001, "UTF-8") == 0);
+ ASSERT (uc_width (0xE0044, "UTF-8") == 0);
+
+ /* Test width of some zero width characters. */
+ ASSERT (uc_width (0x200B, "UTF-8") == 0);
+ ASSERT (uc_width (0xFEFF, "UTF-8") == 0);
+
+ /* Test width of some CJK characters. */
+ ASSERT (uc_width (0x3000, "UTF-8") == 2);
+ ASSERT (uc_width (0xB250, "UTF-8") == 2);
+ ASSERT (uc_width (0xFF1A, "UTF-8") == 2);
+ ASSERT (uc_width (0x20369, "UTF-8") == 2);
+ ASSERT (uc_width (0x2F876, "UTF-8") == 2);
+
+ return 0;
+}
diff --git a/gnulib-tests/uniwidth/test-uc_width2.c b/gnulib-tests/uniwidth/test-uc_width2.c
new file mode 100644
index 0000000..60ef755
--- /dev/null
+++ b/gnulib-tests/uniwidth/test-uc_width2.c
@@ -0,0 +1,86 @@
+/* Test of uc_width() function.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include "uniwidth.h"
+
+#include <stdio.h>
+
+#include "macros.h"
+
+/* One of 0, '0', '1', 'A', '2'. */
+static char current_width;
+/* The interval for which the current_width holds. */
+static ucs4_t current_start;
+static ucs4_t current_end;
+
+static void
+finish_interval (void)
+{
+ if (current_width != 0)
+ {
+ if (current_start == current_end)
+ printf ("%04X\t\t%c\n", (unsigned) current_start, current_width);
+ else
+ printf ("%04X..%04X\t%c\n", (unsigned) current_start,
+ (unsigned) current_end, current_width);
+ current_width = 0;
+ }
+}
+
+static void
+add_to_interval (ucs4_t uc, char width)
+{
+ if (current_width == width && uc == current_end + 1)
+ current_end = uc;
+ else
+ {
+ finish_interval ();
+ current_width = width;
+ current_start = current_end = uc;
+ }
+}
+
+int
+main ()
+{
+ ucs4_t uc;
+
+ for (uc = 0; uc < 0x110000; uc++)
+ {
+ int w1 = uc_width (uc, "UTF-8");
+ int w2 = uc_width (uc, "GBK");
+ char width =
+ (w1 == 0 && w2 == 0 ? '0' :
+ w1 == 1 && w2 == 1 ? '1' :
+ w1 == 1 && w2 == 2 ? 'A' :
+ w1 == 2 && w2 == 2 ? '2' :
+ 0);
+ if (width == 0)
+ {
+ /* uc must be a control character. */
+ ASSERT (w1 < 0 && w2 < 0);
+ }
+ else
+ add_to_interval (uc, width);
+ }
+ finish_interval ();
+
+ return 0;
+}
diff --git a/gnulib-tests/uniwidth/test-uc_width2.sh b/gnulib-tests/uniwidth/test-uc_width2.sh
new file mode 100755
index 0000000..1463d34
--- /dev/null
+++ b/gnulib-tests/uniwidth/test-uc_width2.sh
@@ -0,0 +1,597 @@
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles uc_width.out"
+./test-uc_width2${EXEEXT} | LC_ALL=C tr -d '\r' > uc_width.out
+
+tmpfiles="$tmpfiles uc_width.ok"
+cat > uc_width.ok <<\EOF
+0000 0
+0020..007E 1
+00A0 1
+00A1..00AC A
+00AD 0
+00AE..02FF A
+0300..036F 0
+0370..0482 A
+0483..0489 0
+048A..0590 A
+0591..05BD 0
+05BE A
+05BF 0
+05C0 A
+05C1..05C2 0
+05C3 A
+05C4..05C5 0
+05C6 A
+05C7 0
+05C8..05FF A
+0600..0605 0
+0606..060F A
+0610..061A 0
+061B A
+061C 0
+061D..064A A
+064B..065F 0
+0660..066F A
+0670 0
+0671..06D5 A
+06D6..06DD 0
+06DE A
+06DF..06E4 0
+06E5..06E6 A
+06E7..06E8 0
+06E9 A
+06EA..06ED 0
+06EE..070E A
+070F 0
+0710 A
+0711 0
+0712..072F A
+0730..074A 0
+074B..07A5 A
+07A6..07B0 0
+07B1..07EA A
+07EB..07F3 0
+07F4..0815 A
+0816..0819 0
+081A A
+081B..0823 0
+0824 A
+0825..0827 0
+0828 A
+0829..082D 0
+082E..0858 A
+0859..085B 0
+085C..08E2 A
+08E3..0902 0
+0903..0939 A
+093A 0
+093B A
+093C 0
+093D..0940 A
+0941..0948 0
+0949..094C A
+094D 0
+094E..0950 A
+0951..0957 0
+0958..0961 A
+0962..0963 0
+0964..0980 A
+0981 0
+0982..09BB A
+09BC 0
+09BD..09C0 A
+09C1..09C4 0
+09C5..09CC A
+09CD 0
+09CE..09E1 A
+09E2..09E3 0
+09E4..0A00 A
+0A01..0A02 0
+0A03..0A3B A
+0A3C 0
+0A3D..0A40 A
+0A41..0A42 0
+0A43..0A46 A
+0A47..0A48 0
+0A49..0A4A A
+0A4B..0A4D 0
+0A4E..0A50 A
+0A51 0
+0A52..0A6F A
+0A70..0A71 0
+0A72..0A74 A
+0A75 0
+0A76..0A80 A
+0A81..0A82 0
+0A83..0ABB A
+0ABC 0
+0ABD..0AC0 A
+0AC1..0AC5 0
+0AC6 A
+0AC7..0AC8 0
+0AC9..0ACC A
+0ACD 0
+0ACE..0AE1 A
+0AE2..0AE3 0
+0AE4..0B00 A
+0B01 0
+0B02..0B3B A
+0B3C 0
+0B3D..0B3E A
+0B3F 0
+0B40 A
+0B41..0B44 0
+0B45..0B4C A
+0B4D 0
+0B4E..0B55 A
+0B56 0
+0B57..0B61 A
+0B62..0B63 0
+0B64..0B81 A
+0B82 0
+0B83..0BBF A
+0BC0 0
+0BC1..0BCC A
+0BCD 0
+0BCE..0BFF A
+0C00 0
+0C01..0C3D A
+0C3E..0C40 0
+0C41..0C45 A
+0C46..0C48 0
+0C49 A
+0C4A..0C4D 0
+0C4E..0C54 A
+0C55..0C56 0
+0C57..0C61 A
+0C62..0C63 0
+0C64..0C80 A
+0C81 0
+0C82..0CBB A
+0CBC 0
+0CBD..0CCB A
+0CCC..0CCD 0
+0CCE..0CE1 A
+0CE2..0CE3 0
+0CE4..0D00 A
+0D01 0
+0D02..0D40 A
+0D41..0D44 0
+0D45..0D4C A
+0D4D 0
+0D4E..0D61 A
+0D62..0D63 0
+0D64..0DC9 A
+0DCA 0
+0DCB..0DD1 A
+0DD2..0DD4 0
+0DD5 A
+0DD6 0
+0DD7..0E30 A
+0E31 0
+0E32..0E33 A
+0E34..0E3A 0
+0E3B..0E46 A
+0E47..0E4E 0
+0E4F..0EB0 A
+0EB1 0
+0EB2..0EB3 A
+0EB4..0EB9 0
+0EBA A
+0EBB..0EBC 0
+0EBD..0EC7 A
+0EC8..0ECD 0
+0ECE..0F17 A
+0F18..0F19 0
+0F1A..0F34 A
+0F35 0
+0F36 A
+0F37 0
+0F38 A
+0F39 0
+0F3A..0F70 A
+0F71..0F7E 0
+0F7F A
+0F80..0F84 0
+0F85 A
+0F86..0F87 0
+0F88..0F8C A
+0F8D..0F97 0
+0F98 A
+0F99..0FBC 0
+0FBD..0FC5 A
+0FC6 0
+0FC7..102C A
+102D..1030 0
+1031 A
+1032..1037 0
+1038 A
+1039..103A 0
+103B..103C A
+103D..103E 0
+103F..1057 A
+1058..1059 0
+105A..105D A
+105E..1060 0
+1061..1070 A
+1071..1074 0
+1075..1081 A
+1082 0
+1083..1084 A
+1085..1086 0
+1087..108C A
+108D 0
+108E..109C A
+109D 0
+109E..10FF A
+1100..115F 2
+1160..135C A
+135D..135F 0
+1360..1711 A
+1712..1714 0
+1715..1731 A
+1732..1734 0
+1735..1751 A
+1752..1753 0
+1754..1771 A
+1772..1773 0
+1774..17B3 A
+17B4..17B5 0
+17B6 A
+17B7..17BD 0
+17BE..17C5 A
+17C6 0
+17C7..17C8 A
+17C9..17D3 0
+17D4..17DC A
+17DD 0
+17DE..180A A
+180B..180E 0
+180F..18A8 A
+18A9 0
+18AA..191F A
+1920..1922 0
+1923..1926 A
+1927..1928 0
+1929..1931 A
+1932 0
+1933..1938 A
+1939..193B 0
+193C..1A16 A
+1A17..1A18 0
+1A19..1A1A A
+1A1B 0
+1A1C..1A55 A
+1A56 0
+1A57 A
+1A58..1A5E 0
+1A5F A
+1A60 0
+1A61 A
+1A62 0
+1A63..1A64 A
+1A65..1A6C 0
+1A6D..1A72 A
+1A73..1A7C 0
+1A7D..1A7E A
+1A7F 0
+1A80..1AAF A
+1AB0..1ABE 0
+1ABF..1AFF A
+1B00..1B03 0
+1B04..1B33 A
+1B34 0
+1B35 A
+1B36..1B3A 0
+1B3B A
+1B3C 0
+1B3D..1B41 A
+1B42 0
+1B43..1B6A A
+1B6B..1B73 0
+1B74..1B7F A
+1B80..1B81 0
+1B82..1BA1 A
+1BA2..1BA5 0
+1BA6..1BA7 A
+1BA8..1BA9 0
+1BAA A
+1BAB..1BAD 0
+1BAE..1BE5 A
+1BE6 0
+1BE7 A
+1BE8..1BE9 0
+1BEA..1BEC A
+1BED 0
+1BEE A
+1BEF..1BF1 0
+1BF2..1C2B A
+1C2C..1C33 0
+1C34..1C35 A
+1C36..1C37 0
+1C38..1CCF A
+1CD0..1CD2 0
+1CD3 A
+1CD4..1CE0 0
+1CE1 A
+1CE2..1CE8 0
+1CE9..1CEC A
+1CED 0
+1CEE..1CF3 A
+1CF4 0
+1CF5..1CF7 A
+1CF8..1CF9 0
+1CFA..1DBF A
+1DC0..1DF5 0
+1DF6..1DFB A
+1DFC..1DFF 0
+1E00..200A A
+200B..200F 0
+2010..2029 A
+202A..202E 0
+202F..205F A
+2060..2064 0
+2065 A
+2066..206F 0
+2070..20A8 A
+20A9 1
+20AA..20CF A
+20D0..20F0 0
+20F1..2328 A
+2329..232A 2
+232B..2CEE A
+2CEF..2CF1 0
+2CF2..2D7E A
+2D7F 0
+2D80..2DDF A
+2DE0..2DFF 0
+2E00..2E7F A
+2E80..3029 2
+302A..302D 0
+302E..303E 2
+303F A
+3040..3098 2
+3099..309A 0
+309B..4DBF 2
+4DC0..4DFF A
+4E00..A4CF 2
+A4D0..A66E A
+A66F..A672 0
+A673 A
+A674..A67D 0
+A67E..A69D A
+A69E..A69F 0
+A6A0..A6EF A
+A6F0..A6F1 0
+A6F2..A801 A
+A802 0
+A803..A805 A
+A806 0
+A807..A80A A
+A80B 0
+A80C..A824 A
+A825..A826 0
+A827..A8C3 A
+A8C4 0
+A8C5..A8DF A
+A8E0..A8F1 0
+A8F2..A925 A
+A926..A92D 0
+A92E..A946 A
+A947..A951 0
+A952..A97F A
+A980..A982 0
+A983..A9B2 A
+A9B3 0
+A9B4..A9B5 A
+A9B6..A9B9 0
+A9BA..A9BB A
+A9BC 0
+A9BD..A9E4 A
+A9E5 0
+A9E6..AA28 A
+AA29..AA2E 0
+AA2F..AA30 A
+AA31..AA32 0
+AA33..AA34 A
+AA35..AA36 0
+AA37..AA42 A
+AA43 0
+AA44..AA4B A
+AA4C 0
+AA4D..AA7B A
+AA7C 0
+AA7D..AAAF A
+AAB0 0
+AAB1 A
+AAB2..AAB4 0
+AAB5..AAB6 A
+AAB7..AAB8 0
+AAB9..AABD A
+AABE..AABF 0
+AAC0 A
+AAC1 0
+AAC2..AAEB A
+AAEC..AAED 0
+AAEE..AAF5 A
+AAF6 0
+AAF7..ABE4 A
+ABE5 0
+ABE6..ABE7 A
+ABE8 0
+ABE9..ABEC A
+ABED 0
+ABEE..ABFF A
+AC00..D7A3 2
+D7A4..F8FF A
+F900..FAFF 2
+FB00..FB1D A
+FB1E 0
+FB1F..FDFF A
+FE00..FE0F 0
+FE10..FE1F 2
+FE20..FE2F 0
+FE30..FE6F 2
+FE70..FEFE A
+FEFF 0
+FF00..FF60 2
+FF61..FFDF 1
+FFE0..FFE6 2
+FFE7..FFF8 1
+FFF9..FFFB 0
+FFFC..101FC 1
+101FD 0
+101FE..102DF 1
+102E0 0
+102E1..10375 1
+10376..1037A 0
+1037B..10A00 1
+10A01..10A03 0
+10A04 1
+10A05..10A06 0
+10A07..10A0B 1
+10A0C..10A0F 0
+10A10..10A37 1
+10A38..10A3A 0
+10A3B..10A3E 1
+10A3F 0
+10A40..10AE4 1
+10AE5..10AE6 0
+10AE7..11000 1
+11001 0
+11002..11037 1
+11038..11046 0
+11047..1107E 1
+1107F..11081 0
+11082..110B2 1
+110B3..110B6 0
+110B7..110B8 1
+110B9..110BA 0
+110BB..110BC 1
+110BD 0
+110BE..110FF 1
+11100..11102 0
+11103..11126 1
+11127..1112B 0
+1112C 1
+1112D..11134 0
+11135..11172 1
+11173 0
+11174..1117F 1
+11180..11181 0
+11182..111B5 1
+111B6..111BE 0
+111BF..111C9 1
+111CA..111CC 0
+111CD..1122E 1
+1122F..11231 0
+11232..11233 1
+11234 0
+11235 1
+11236..11237 0
+11238..112DE 1
+112DF 0
+112E0..112E2 1
+112E3..112EA 0
+112EB..112FF 1
+11300..11301 0
+11302..1133B 1
+1133C 0
+1133D..1133F 1
+11340 0
+11341..11365 1
+11366..1136C 0
+1136D..1136F 1
+11370..11374 0
+11375..114B2 1
+114B3..114B8 0
+114B9 1
+114BA 0
+114BB..114BE 1
+114BF..114C0 0
+114C1 1
+114C2..114C3 0
+114C4..115B1 1
+115B2..115B5 0
+115B6..115BB 1
+115BC..115BD 0
+115BE 1
+115BF..115C0 0
+115C1..115DB 1
+115DC..115DD 0
+115DE..11632 1
+11633..1163A 0
+1163B..1163C 1
+1163D 0
+1163E 1
+1163F..11640 0
+11641..116AA 1
+116AB 0
+116AC 1
+116AD 0
+116AE..116AF 1
+116B0..116B5 0
+116B6 1
+116B7 0
+116B8..1171C 1
+1171D..1171F 0
+11720..11721 1
+11722..11725 0
+11726 1
+11727..1172B 0
+1172C..16AEF 1
+16AF0..16AF4 0
+16AF5..16B2F 1
+16B30..16B36 0
+16B37..16F8E 1
+16F8F..16F92 0
+16F93..1BC9C 1
+1BC9D..1BC9E 0
+1BC9F 1
+1BCA0..1BCA3 0
+1BCA4..1D166 1
+1D167..1D169 0
+1D16A..1D172 1
+1D173..1D182 0
+1D183..1D184 1
+1D185..1D18B 0
+1D18C..1D1A9 1
+1D1AA..1D1AD 0
+1D1AE..1D241 1
+1D242..1D244 0
+1D245..1D9FF 1
+1DA00..1DA36 0
+1DA37..1DA3A 1
+1DA3B..1DA6C 0
+1DA6D..1DA74 1
+1DA75 0
+1DA76..1DA83 1
+1DA84 0
+1DA85..1DA9A 1
+1DA9B..1DA9F 0
+1DAA0 1
+1DAA1..1DAAF 0
+1DAB0..1E8CF 1
+1E8D0..1E8D6 0
+1E8D7..1FFFF 1
+20000..3FFFF 2
+40000..E0000 1
+E0001 0
+E0002..E001F 1
+E0020..E007F 0
+E0080..E00FF 1
+E0100..E01EF 0
+E01F0..10FFFF 1
+EOF
+
+: ${DIFF=diff}
+${DIFF} uc_width.ok uc_width.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gnulib-tests/w32sock.h b/gnulib-tests/w32sock.h
new file mode 100644
index 0000000..c78b4bb
--- /dev/null
+++ b/gnulib-tests/w32sock.h
@@ -0,0 +1,136 @@
+/* w32sock.h --- internal auxiliary functions for Windows socket functions
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <errno.h>
+
+/* Get O_RDWR and O_BINARY. */
+#include <fcntl.h>
+
+/* Get _open_osfhandle(). */
+#include <io.h>
+
+/* Get _get_osfhandle(). */
+#include "msvc-nothrow.h"
+
+#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/gnulib-tests/wctob.c b/gnulib-tests/wctob.c
new file mode 100644
index 0000000..15e3ff3
--- /dev/null
+++ b/gnulib-tests/wctob.c
@@ -0,0 +1,38 @@
+/* Convert wide character to unibyte character.
+ Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+wctob (wint_t wc)
+{
+ char buf[64];
+
+ if (!(MB_CUR_MAX <= sizeof (buf)))
+ abort ();
+ /* Handle the case where WEOF is a value that does not fit in a wchar_t. */
+ if (wc == (wchar_t)wc)
+ if (wctomb (buf, (wchar_t)wc) == 1)
+ return (unsigned char) buf[0];
+ return EOF;
+}
diff --git a/gnulib-tests/wctomb-impl.h b/gnulib-tests/wctomb-impl.h
new file mode 100644
index 0000000..a6ed971
--- /dev/null
+++ b/gnulib-tests/wctomb-impl.h
@@ -0,0 +1,34 @@
+/* Convert wide character to multibyte character.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT 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/>. */
+
+int
+wctomb (char *s, wchar_t wc)
+{
+ if (s == NULL)
+ return 0;
+ else
+ {
+ mbstate_t state;
+ size_t result;
+
+ memset (&state, 0, sizeof (mbstate_t));
+ result = wcrtomb (s, wc, &state);
+ if (result == (size_t)-1)
+ return -1;
+ return result;
+ }
+}
diff --git a/gnulib-tests/wctomb.c b/gnulib-tests/wctomb.c
new file mode 100644
index 0000000..f1d14f5
--- /dev/null
+++ b/gnulib-tests/wctomb.c
@@ -0,0 +1,25 @@
+/* Convert wide character to multibyte character.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <string.h>
+#include <wchar.h>
+
+#include "wctomb-impl.h"
diff --git a/gnulib-tests/zerosize-ptr.h b/gnulib-tests/zerosize-ptr.h
new file mode 100644
index 0000000..e6ff672
--- /dev/null
+++ b/gnulib-tests/zerosize-ptr.h
@@ -0,0 +1,68 @@
+/* Return a pointer to a zero-size object in memory.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* ISO C 99 does not allow memcmp(), memchr() etc. to be invoked with a NULL
+ argument. Therefore this file produces a non-NULL pointer which cannot
+ be dereferenced, if possible. */
+
+#include <stdlib.h>
+
+/* Test whether mmap() and mprotect() are available.
+ We don't use HAVE_MMAP, because AC_FUNC_MMAP would not define it on HP-UX.
+ HAVE_MPROTECT is not enough, because mingw does not have mmap() but has an
+ mprotect() function in libgcc.a. */
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+/* Define MAP_FILE when it isn't otherwise. */
+# ifndef MAP_FILE
+# define MAP_FILE 0
+# endif
+#endif
+
+/* Return a pointer to a zero-size object in memory (that is, actually, a
+ pointer to a page boundary where the previous page is readable and writable
+ and the next page is neither readable not writable), if possible.
+ Return NULL otherwise. */
+
+static void *
+zerosize_ptr (void)
+{
+/* Use mmap and mprotect when they exist. Don't test HAVE_MMAP, because it is
+ not defined on HP-UX 11 (since it does not support MAP_FIXED). */
+#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)
+ return two_pages + pagesize;
+ }
+#endif
+ return NULL;
+}
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..8542af7
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,35 @@
+# Automakefile for GNU Diffutils library.
+
+# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2016 Free Software
+# Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AM_CFLAGS =
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST =
+MOSTLYCLEANDIRS =
+MOSTLYCLEANFILES =
+MAINTAINERCLEANFILES =
+SUFFIXES =
+noinst_LIBRARIES =
+noinst_HEADERS =
+
+include gnulib.mk
+
+noinst_HEADERS += cmpbuf.h prepargs.h
+libdiffutils_a_SOURCES += cmpbuf.c prepargs.c
+
+AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 0000000..2f8ff31
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,3607 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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@
+
+# Automakefile for GNU Diffutils library.
+
+# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2016 Free Software
+# Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Copyright (C) 2002-2016 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 <http://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=gl --lib=libdiffutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=localename --avoid=lock --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen argmatch binary-io c-stack config-h diffseq dirname do-release-commit-and-tag dup2 error exclude exitfail extensions fcntl fdl file-type filenamecat fnmatch-gnu getopt gettext-h gettime git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload hard-locale inttostr inttypes isblank largefile lstat maintainer-makefile manywarnings mbrtowc mkstemp mktime progname propername rawmemchr readme-release regex sh-quote signal stat stat-macros stat-time stdint strcase strftime strptime strtoumax sys_wait system-quote unistd unlocked-io update-copyright vararrays verify version-etc version-etc-fsf wcwidth xalloc xfreopen xreadlink xstrtoumax 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@
+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@
+@LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__append_1 = unistr/u8-mbtoucr.c
+@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__append_2 = unistr/u8-uctomb.c unistr/u8-uctomb-aux.c
+@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_3 = uniwidth/width.c
+subdir = lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.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 = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libdiffutils_a_AR = $(AR) $(ARFLAGS)
+am__DEPENDENCIES_1 =
+am__libdiffutils_a_SOURCES_DIST = allocator.c areadlink.c argmatch.c \
+ binary-io.h binary-io.c bitrotate.h bitrotate.c c-ctype.h \
+ c-ctype.c c-stack.h c-stack.c c-strcase.h c-strcasecmp.c \
+ c-strncasecmp.c careadlinkat.c diffseq.h dirname.c basename.c \
+ dirname-lgpl.c basename-lgpl.c stripslash.c exclude.c \
+ exitfail.c fd-hook.c file-type.c filenamecat.c \
+ filenamecat-lgpl.c freopen-safer.c gettext.h gettime.c \
+ hard-locale.c hash.c imaxtostr.c inttostr.c offtostr.c \
+ uinttostr.c umaxtostr.c localcharset.h localcharset.c \
+ malloca.c mbchar.c mbiter.h mbiter.c mbscasecmp.c mbslen.c \
+ mbsstr.c mbuiter.h mbuiter.c progname.h progname.c \
+ propername.h propername.c quotearg.c sh-quote.h sh-quote.c \
+ sig-handler.c size_max.h stat-time.c strftime.c striconv.h \
+ striconv.c strnlen1.h strnlen1.c system-quote.h system-quote.c \
+ tempname.c timespec.c trim.c unistd.c unistr/u8-mbtoucr.c \
+ unistr/u8-uctomb.c unistr/u8-uctomb-aux.c uniwidth/width.c \
+ version-etc.h version-etc.c version-etc-fsf.c wctype-h.c \
+ xmalloc.c xalloc-die.c xfreopen.c xfreopen.h xreadlink.c \
+ xsize.h xsize.c xstriconv.h xstriconv.c xstrndup.h xstrndup.c \
+ xstrtol.c xstrtoul.c xstrtol-error.c xstrtoumax.c xvasprintf.h \
+ xvasprintf.c xasprintf.c cmpbuf.c prepargs.c
+am__dirstamp = .dirstamp
+@LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__objects_1 = unistr/u8-mbtoucr.$(OBJEXT)
+@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__objects_2 = unistr/u8-uctomb.$(OBJEXT) \
+@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@ unistr/u8-uctomb-aux.$(OBJEXT)
+@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_3 = uniwidth/width.$(OBJEXT)
+am_libdiffutils_a_OBJECTS = allocator.$(OBJEXT) areadlink.$(OBJEXT) \
+ argmatch.$(OBJEXT) binary-io.$(OBJEXT) bitrotate.$(OBJEXT) \
+ c-ctype.$(OBJEXT) c-stack.$(OBJEXT) c-strcasecmp.$(OBJEXT) \
+ c-strncasecmp.$(OBJEXT) careadlinkat.$(OBJEXT) \
+ dirname.$(OBJEXT) basename.$(OBJEXT) dirname-lgpl.$(OBJEXT) \
+ basename-lgpl.$(OBJEXT) stripslash.$(OBJEXT) exclude.$(OBJEXT) \
+ exitfail.$(OBJEXT) fd-hook.$(OBJEXT) file-type.$(OBJEXT) \
+ filenamecat.$(OBJEXT) filenamecat-lgpl.$(OBJEXT) \
+ freopen-safer.$(OBJEXT) gettime.$(OBJEXT) \
+ hard-locale.$(OBJEXT) hash.$(OBJEXT) imaxtostr.$(OBJEXT) \
+ inttostr.$(OBJEXT) offtostr.$(OBJEXT) uinttostr.$(OBJEXT) \
+ umaxtostr.$(OBJEXT) localcharset.$(OBJEXT) malloca.$(OBJEXT) \
+ mbchar.$(OBJEXT) mbiter.$(OBJEXT) mbscasecmp.$(OBJEXT) \
+ mbslen.$(OBJEXT) mbsstr.$(OBJEXT) mbuiter.$(OBJEXT) \
+ progname.$(OBJEXT) propername.$(OBJEXT) quotearg.$(OBJEXT) \
+ sh-quote.$(OBJEXT) sig-handler.$(OBJEXT) stat-time.$(OBJEXT) \
+ strftime.$(OBJEXT) striconv.$(OBJEXT) strnlen1.$(OBJEXT) \
+ system-quote.$(OBJEXT) tempname.$(OBJEXT) timespec.$(OBJEXT) \
+ trim.$(OBJEXT) unistd.$(OBJEXT) $(am__objects_1) \
+ $(am__objects_2) $(am__objects_3) version-etc.$(OBJEXT) \
+ version-etc-fsf.$(OBJEXT) wctype-h.$(OBJEXT) xmalloc.$(OBJEXT) \
+ xalloc-die.$(OBJEXT) xfreopen.$(OBJEXT) xreadlink.$(OBJEXT) \
+ xsize.$(OBJEXT) xstriconv.$(OBJEXT) xstrndup.$(OBJEXT) \
+ xstrtol.$(OBJEXT) xstrtoul.$(OBJEXT) xstrtol-error.$(OBJEXT) \
+ xstrtoumax.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) \
+ cmpbuf.$(OBJEXT) prepargs.$(OBJEXT)
+libdiffutils_a_OBJECTS = $(am_libdiffutils_a_OBJECTS)
+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@
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = $(DEPDIR)/alloca.Po ./$(DEPDIR)/alloca.Po \
+ ./$(DEPDIR)/allocator.Po ./$(DEPDIR)/anytostr.Po \
+ ./$(DEPDIR)/areadlink.Po ./$(DEPDIR)/argmatch.Po \
+ ./$(DEPDIR)/asnprintf.Po ./$(DEPDIR)/asprintf.Po \
+ ./$(DEPDIR)/basename-lgpl.Po ./$(DEPDIR)/basename.Po \
+ ./$(DEPDIR)/binary-io.Po ./$(DEPDIR)/bitrotate.Po \
+ ./$(DEPDIR)/btowc.Po ./$(DEPDIR)/c-ctype.Po \
+ ./$(DEPDIR)/c-stack.Po ./$(DEPDIR)/c-strcasecmp.Po \
+ ./$(DEPDIR)/c-strncasecmp.Po ./$(DEPDIR)/careadlinkat.Po \
+ ./$(DEPDIR)/close.Po ./$(DEPDIR)/cmpbuf.Po \
+ ./$(DEPDIR)/dirname-lgpl.Po ./$(DEPDIR)/dirname.Po \
+ ./$(DEPDIR)/dup2.Po ./$(DEPDIR)/error.Po \
+ ./$(DEPDIR)/exclude.Po ./$(DEPDIR)/exitfail.Po \
+ ./$(DEPDIR)/fcntl.Po ./$(DEPDIR)/fd-hook.Po \
+ ./$(DEPDIR)/file-type.Po ./$(DEPDIR)/filenamecat-lgpl.Po \
+ ./$(DEPDIR)/filenamecat.Po ./$(DEPDIR)/float.Po \
+ ./$(DEPDIR)/fnmatch.Po ./$(DEPDIR)/fnmatch_loop.Po \
+ ./$(DEPDIR)/freopen-safer.Po ./$(DEPDIR)/freopen.Po \
+ ./$(DEPDIR)/fstat.Po ./$(DEPDIR)/getdtablesize.Po \
+ ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \
+ ./$(DEPDIR)/gettime.Po ./$(DEPDIR)/gettimeofday.Po \
+ ./$(DEPDIR)/hard-locale.Po ./$(DEPDIR)/hash.Po \
+ ./$(DEPDIR)/iconv.Po ./$(DEPDIR)/iconv_close.Po \
+ ./$(DEPDIR)/iconv_open.Po ./$(DEPDIR)/imaxtostr.Po \
+ ./$(DEPDIR)/inttostr.Po ./$(DEPDIR)/isblank.Po \
+ ./$(DEPDIR)/iswblank.Po ./$(DEPDIR)/itold.Po \
+ ./$(DEPDIR)/localcharset.Po ./$(DEPDIR)/localeconv.Po \
+ ./$(DEPDIR)/lstat.Po ./$(DEPDIR)/malloc.Po \
+ ./$(DEPDIR)/malloca.Po ./$(DEPDIR)/mbchar.Po \
+ ./$(DEPDIR)/mbiter.Po ./$(DEPDIR)/mbrtowc.Po \
+ ./$(DEPDIR)/mbscasecmp.Po ./$(DEPDIR)/mbsinit.Po \
+ ./$(DEPDIR)/mbslen.Po ./$(DEPDIR)/mbsrtowcs-state.Po \
+ ./$(DEPDIR)/mbsrtowcs.Po ./$(DEPDIR)/mbsstr.Po \
+ ./$(DEPDIR)/mbtowc.Po ./$(DEPDIR)/mbuiter.Po \
+ ./$(DEPDIR)/memchr.Po ./$(DEPDIR)/mkstemp.Po \
+ ./$(DEPDIR)/mktime.Po ./$(DEPDIR)/msvc-inval.Po \
+ ./$(DEPDIR)/msvc-nothrow.Po ./$(DEPDIR)/nl_langinfo.Po \
+ ./$(DEPDIR)/offtostr.Po ./$(DEPDIR)/open.Po \
+ ./$(DEPDIR)/prepargs.Po ./$(DEPDIR)/printf-args.Po \
+ ./$(DEPDIR)/printf-parse.Po ./$(DEPDIR)/progname.Po \
+ ./$(DEPDIR)/propername.Po ./$(DEPDIR)/quotearg.Po \
+ ./$(DEPDIR)/raise.Po ./$(DEPDIR)/rawmemchr.Po \
+ ./$(DEPDIR)/readlink.Po ./$(DEPDIR)/regcomp.Po \
+ ./$(DEPDIR)/regex.Po ./$(DEPDIR)/regex_internal.Po \
+ ./$(DEPDIR)/regexec.Po ./$(DEPDIR)/secure_getenv.Po \
+ ./$(DEPDIR)/setenv.Po ./$(DEPDIR)/sh-quote.Po \
+ ./$(DEPDIR)/sig-handler.Po ./$(DEPDIR)/sigaction.Po \
+ ./$(DEPDIR)/sigprocmask.Po ./$(DEPDIR)/stat-time.Po \
+ ./$(DEPDIR)/stat.Po ./$(DEPDIR)/strcasecmp.Po \
+ ./$(DEPDIR)/strerror-override.Po ./$(DEPDIR)/strerror.Po \
+ ./$(DEPDIR)/strftime.Po ./$(DEPDIR)/striconv.Po \
+ ./$(DEPDIR)/stripslash.Po ./$(DEPDIR)/strncasecmp.Po \
+ ./$(DEPDIR)/strndup.Po ./$(DEPDIR)/strnlen.Po \
+ ./$(DEPDIR)/strnlen1.Po ./$(DEPDIR)/strptime.Po \
+ ./$(DEPDIR)/strtoimax.Po ./$(DEPDIR)/strtol.Po \
+ ./$(DEPDIR)/strtoul.Po ./$(DEPDIR)/strtoull.Po \
+ ./$(DEPDIR)/strtoumax.Po ./$(DEPDIR)/system-quote.Po \
+ ./$(DEPDIR)/tempname.Po ./$(DEPDIR)/time_r.Po \
+ ./$(DEPDIR)/time_rz.Po ./$(DEPDIR)/timegm.Po \
+ ./$(DEPDIR)/timespec.Po ./$(DEPDIR)/trim.Po \
+ ./$(DEPDIR)/uinttostr.Po ./$(DEPDIR)/umaxtostr.Po \
+ ./$(DEPDIR)/unistd.Po ./$(DEPDIR)/unsetenv.Po \
+ ./$(DEPDIR)/vasnprintf.Po ./$(DEPDIR)/vasprintf.Po \
+ ./$(DEPDIR)/version-etc-fsf.Po ./$(DEPDIR)/version-etc.Po \
+ ./$(DEPDIR)/wcrtomb.Po ./$(DEPDIR)/wctype-h.Po \
+ ./$(DEPDIR)/wcwidth.Po ./$(DEPDIR)/xalloc-die.Po \
+ ./$(DEPDIR)/xasprintf.Po ./$(DEPDIR)/xfreopen.Po \
+ ./$(DEPDIR)/xmalloc.Po ./$(DEPDIR)/xreadlink.Po \
+ ./$(DEPDIR)/xsize.Po ./$(DEPDIR)/xstriconv.Po \
+ ./$(DEPDIR)/xstrndup.Po ./$(DEPDIR)/xstrtol-error.Po \
+ ./$(DEPDIR)/xstrtol.Po ./$(DEPDIR)/xstrtoul.Po \
+ ./$(DEPDIR)/xstrtoumax.Po ./$(DEPDIR)/xvasprintf.Po \
+ unistr/$(DEPDIR)/u8-mbtoucr.Po \
+ unistr/$(DEPDIR)/u8-uctomb-aux.Po \
+ unistr/$(DEPDIR)/u8-uctomb.Po uniwidth/$(DEPDIR)/width.Po
+am__mv = mv -f
+am__set_depbase = depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
+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 = $(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 = $(libdiffutils_a_SOURCES) $(EXTRA_libdiffutils_a_SOURCES)
+DIST_SOURCES = $(am__libdiffutils_a_SOURCES_DIST) \
+ $(EXTRA_libdiffutils_a_SOURCES)
+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)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.hin
+# 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)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.hin \
+ $(srcdir)/gnulib.mk $(top_srcdir)/build-aux/depcomp alloca.c
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+BUILT_SOURCES = $(ALLOCA_H) configmake.h ctype.h $(ERRNO_H) fcntl.h \
+ $(FLOAT_H) $(FNMATCH_H) $(GETOPT_H) $(ICONV_H) \
+ iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h \
+ iconv_open-osf.h iconv_open-solaris.h inttypes.h langinfo.h \
+ locale.h signal.h arg-nonnull.h c++defs.h unused-parameter.h \
+ warn-on-use.h $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
+ stdio.h stdlib.h string.h strings.h sys/stat.h sys/time.h \
+ sys/types.h sys/wait.h time.h unistd.h \
+ $(LIBUNISTRING_UNISTR_H) $(LIBUNISTRING_UNITYPES_H) \
+ $(LIBUNISTRING_UNIWIDTH_H) wchar.h wctype.h
+CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
+ ref-del.sed
+
+#if GNU_MAKE
+# [nicer features that work only with GNU Make]
+#else
+# [fallback features that work in any 'make' implementation; see
+# http://www.opengroup.org/susv3/utilities/make.html
+# for the 2004 POSIX specification]
+#endif
+EXTRA_DIST = alloca.c alloca.in.h allocator.h \
+ $(top_srcdir)/build-aux/announce-gen areadlink.h argmatch.h \
+ assure.h btowc.c c-strcaseeq.h careadlinkat.h close.c \
+ ctype.in.h stripslash.c dirname.h \
+ $(top_srcdir)/build-aux/do-release-commit-and-tag dosname.h \
+ dup2.c errno.in.h error.c error.h exclude.h exitfail.h fcntl.c \
+ fcntl.in.h fd-hook.h file-type.h filename.h filenamecat.h \
+ float.c float.in.h itold.c fnmatch.c fnmatch.in.h \
+ fnmatch_loop.c freopen.c stdio--.h stdio-safer.h fstat.c \
+ $(top_srcdir)/build-aux/gendocs.sh getdtablesize.c getopt.c \
+ getopt.in.h getopt1.c getopt_int.h gettimeofday.c \
+ $(top_srcdir)/build-aux/git-version-gen \
+ $(top_srcdir)/build-aux/gitlog-to-changelog \
+ $(top_srcdir)/build-aux/gnu-web-doc-update \
+ $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \
+ hard-locale.h hash.h $(top_srcdir)/build-aux/config.rpath \
+ iconv.in.h iconv_open-aix.h iconv_open-hpux.h \
+ iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h \
+ iconv.c iconv_close.c iconv_open-aix.gperf \
+ iconv_open-hpux.gperf iconv_open-irix.gperf \
+ iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c \
+ ignore-value.h intprops.h anytostr.c inttostr.h inttypes.in.h \
+ isblank.c iswblank.c langinfo.in.h config.charset ref-add.sin \
+ ref-del.sin locale.in.h localeconv.c lstat.c \
+ $(top_srcdir)/maint.mk malloc.c malloca.h malloca.valgrind \
+ mbchar.h mbrtowc.c mbsinit.c mbsrtowcs-impl.h \
+ mbsrtowcs-state.c mbsrtowcs.c str-kmp.h mbtowc-impl.h mbtowc.c \
+ memchr.c memchr.valgrind mkstemp.c mktime-internal.h mktime.c \
+ mktime-internal.h mktime.c msvc-inval.c msvc-inval.h \
+ msvc-nothrow.c msvc-nothrow.h nl_langinfo.c open.c pathmax.h \
+ quote.h quote.h quotearg.h raise.c rawmemchr.c \
+ rawmemchr.valgrind readlink.c $(top_srcdir)/README-release \
+ regcomp.c regex.c regex.h regex_internal.c regex_internal.h \
+ regexec.c secure_getenv.c setenv.c sig-handler.h sigaction.c \
+ signal.in.h sigprocmask.c \
+ $(top_srcdir)/build-aux/snippet/_Noreturn.h \
+ $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ $(top_srcdir)/build-aux/snippet/c++defs.h \
+ $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+ $(top_srcdir)/build-aux/snippet/warn-on-use.h stat.c \
+ stat-macros.h stat-time.h stdarg.in.h stdbool.in.h stddef.in.h \
+ stdint.in.h stdio.in.h stdlib.in.h strcasecmp.c strncasecmp.c \
+ streq.h strerror.c strerror-override.c strerror-override.h \
+ strftime.h string.in.h strings.in.h strndup.c strnlen.c \
+ strptime.c strtol.c strtoul.c strtoull.c strtoimax.c \
+ strtoumax.c sys_stat.in.h sys_time.in.h sys_types.in.h \
+ sys_wait.in.h tempname.h time.in.h time_r.c time-internal.h \
+ time_rz.c mktime-internal.h timegm.c timespec.h trim.h \
+ unistd.in.h unistr.in.h unitypes.in.h localcharset.h \
+ uniwidth.in.h uniwidth/cjk.h unlocked-io.h unsetenv.c \
+ $(top_srcdir)/build-aux/update-copyright \
+ $(top_srcdir)/build-aux/useless-if-before-free asnprintf.c \
+ float+.h printf-args.c printf-args.h printf-parse.c \
+ printf-parse.h vasnprintf.c vasnprintf.h asprintf.c \
+ vasprintf.c $(top_srcdir)/build-aux/vc-list-files verify.h \
+ wchar.in.h wcrtomb.c wctype.in.h wcwidth.c xalloc.h \
+ xalloc-oversized.h xreadlink.h xstrtol.h xalloc.h
+MOSTLYCLEANDIRS = sys sys
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \
+ ctype.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 iconv.h \
+ iconv.h-t iconv_open-aix.h-t iconv_open-hpux.h-t \
+ iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t \
+ inttypes.h inttypes.h-t langinfo.h langinfo.h-t locale.h \
+ locale.h-t signal.h signal.h-t arg-nonnull.h arg-nonnull.h-t \
+ c++defs.h c++defs.h-t unused-parameter.h unused-parameter.h-t \
+ warn-on-use.h warn-on-use.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/stat.h sys/stat.h-t sys/time.h sys/time.h-t \
+ sys/types.h sys/types.h-t sys/wait.h sys/wait.h-t time.h \
+ time.h-t unistd.h unistd.h-t unistr.h unistr.h-t unitypes.h \
+ unitypes.h-t uniwidth.h uniwidth.h-t wchar.h wchar.h-t \
+ wctype.h wctype.h-t
+MAINTAINERCLEANFILES = iconv_open-aix.h iconv_open-hpux.h \
+ iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
+SUFFIXES = .sed .sin
+noinst_LIBRARIES = libdiffutils.a
+noinst_HEADERS = cmpbuf.h prepargs.h
+libdiffutils_a_SOURCES = allocator.c areadlink.c argmatch.c \
+ binary-io.h binary-io.c bitrotate.h bitrotate.c c-ctype.h \
+ c-ctype.c c-stack.h c-stack.c c-strcase.h c-strcasecmp.c \
+ c-strncasecmp.c careadlinkat.c diffseq.h dirname.c basename.c \
+ dirname-lgpl.c basename-lgpl.c stripslash.c exclude.c \
+ exitfail.c fd-hook.c file-type.c filenamecat.c \
+ filenamecat-lgpl.c freopen-safer.c gettext.h gettime.c \
+ hard-locale.c hash.c imaxtostr.c inttostr.c offtostr.c \
+ uinttostr.c umaxtostr.c localcharset.h localcharset.c \
+ malloca.c mbchar.c mbiter.h mbiter.c mbscasecmp.c mbslen.c \
+ mbsstr.c mbuiter.h mbuiter.c progname.h progname.c \
+ propername.h propername.c quotearg.c sh-quote.h sh-quote.c \
+ sig-handler.c size_max.h stat-time.c strftime.c striconv.h \
+ striconv.c strnlen1.h strnlen1.c system-quote.h system-quote.c \
+ tempname.c timespec.c trim.c unistd.c $(am__append_1) \
+ $(am__append_2) $(am__append_3) version-etc.h version-etc.c \
+ version-etc-fsf.c wctype-h.c xmalloc.c xalloc-die.c xfreopen.c \
+ xfreopen.h xreadlink.c xsize.h xsize.c xstriconv.h xstriconv.c \
+ xstrndup.h xstrndup.c xstrtol.c xstrtoul.c xstrtol-error.c \
+ xstrtoumax.c xvasprintf.h xvasprintf.c xasprintf.c cmpbuf.c \
+ prepargs.c
+libdiffutils_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@
+libdiffutils_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@
+EXTRA_libdiffutils_a_SOURCES = alloca.c btowc.c close.c stripslash.c \
+ dup2.c error.c fcntl.c float.c itold.c fnmatch.c \
+ fnmatch_loop.c freopen.c fstat.c getdtablesize.c getopt.c \
+ getopt1.c gettimeofday.c iconv.c iconv_close.c iconv_open.c \
+ anytostr.c isblank.c iswblank.c localeconv.c lstat.c malloc.c \
+ mbrtowc.c mbsinit.c mbsrtowcs-state.c mbsrtowcs.c mbtowc.c \
+ memchr.c mkstemp.c mktime.c mktime.c msvc-inval.c \
+ msvc-nothrow.c nl_langinfo.c open.c raise.c rawmemchr.c \
+ readlink.c regcomp.c regex.c regex_internal.c regexec.c \
+ secure_getenv.c setenv.c sigaction.c sigprocmask.c stat.c \
+ strcasecmp.c strncasecmp.c strerror.c strerror-override.c \
+ strndup.c strnlen.c strptime.c strtol.c strtoul.c strtoull.c \
+ strtoimax.c strtoumax.c time_r.c time_rz.c timegm.c unsetenv.c \
+ asnprintf.c printf-args.c printf-parse.c vasnprintf.c \
+ asprintf.c vasprintf.c wcrtomb.c wcwidth.c
+
+# 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__ || 60000000 <= __DECC_VER)
+GPERF = gperf
+V_GPERF = $(V_GPERF_@AM_V@)
+V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
+V_GPERF_0 = @echo " GPERF " $@;
+charset_alias = $(DESTDIR)$(libdir)/charset.alias
+charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(top_srcdir)/build-aux/snippet/_Noreturn.h
+ARG_NONNULL_H = arg-nonnull.h
+CXXDEFS_H = c++defs.h
+UNUSED_PARAMETER_H = unused-parameter.h
+WARN_ON_USE_H = warn-on-use.h
+all: $(BUILT_SOURCES) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .sed .sin .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(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) --gnu lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu 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;
+$(srcdir)/gnulib.mk $(am__empty):
+
+$(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):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status lib/config.h
+$(srcdir)/config.hin: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+unistr/$(am__dirstamp):
+ @$(MKDIR_P) unistr
+ @: > unistr/$(am__dirstamp)
+unistr/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) unistr/$(DEPDIR)
+ @: > unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/u8-mbtoucr.$(OBJEXT): unistr/$(am__dirstamp) \
+ unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \
+ unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/u8-uctomb-aux.$(OBJEXT): unistr/$(am__dirstamp) \
+ unistr/$(DEPDIR)/$(am__dirstamp)
+uniwidth/$(am__dirstamp):
+ @$(MKDIR_P) uniwidth
+ @: > uniwidth/$(am__dirstamp)
+uniwidth/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) uniwidth/$(DEPDIR)
+ @: > uniwidth/$(DEPDIR)/$(am__dirstamp)
+uniwidth/width.$(OBJEXT): uniwidth/$(am__dirstamp) \
+ uniwidth/$(DEPDIR)/$(am__dirstamp)
+
+libdiffutils.a: $(libdiffutils_a_OBJECTS) $(libdiffutils_a_DEPENDENCIES) $(EXTRA_libdiffutils_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libdiffutils.a
+ $(AM_V_AR)$(libdiffutils_a_AR) libdiffutils.a $(libdiffutils_a_OBJECTS) $(libdiffutils_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libdiffutils.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f unistr/*.$(OBJEXT)
+ -rm -f uniwidth/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anytostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/areadlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argmatch.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary-io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitrotate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-stack.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmpbuf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exclude.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-type.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch_loop.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freopen-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hard-locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imaxtostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inttostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iswblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localeconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbchar.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbiter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbscasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbslen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs-state.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsstr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbuiter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offtostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prepargs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propername.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_getenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh-quote.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/striconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strptime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoull.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoumax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system-quote.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_rz.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timegm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uinttostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umaxtostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctype-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcwidth.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfreopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xreadlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstriconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol-error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoumax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-mbtoucr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb-aux.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/width.Po@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)$(am__set_depbase) && \
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $<; \
+@am__fastdepCC_TRUE@ if test $$? = 0; then $(am__mv) $$depbase.Tpo $$depbase.Po; \
+@am__fastdepCC_TRUE@ else rm -f $$depbase.Tpo; false; fi
+@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)$(am__set_depbase) && \
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $$($(CYGPATH_W) $<); \
+@am__fastdepCC_TRUE@ if test $$? = 0; then $(am__mv) $$depbase.Tpo $$depbase.Po; \
+@am__fastdepCC_TRUE@ else rm -f $$depbase.Tpo; false; fi
+@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) $<)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(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-am
+
+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-am
+
+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: $(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
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(HEADERS) config.h all-local
+installdirs:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+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 unistr/$(DEPDIR)/$(am__dirstamp)
+ -rm -f unistr/$(am__dirstamp)
+ -rm -f uniwidth/$(DEPDIR)/$(am__dirstamp)
+ -rm -f uniwidth/$(am__dirstamp)
+
+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-am
+
+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(DEPDIR)/alloca.Po
+ -rm -f ./$(DEPDIR)/alloca.Po
+ -rm -f ./$(DEPDIR)/allocator.Po
+ -rm -f ./$(DEPDIR)/anytostr.Po
+ -rm -f ./$(DEPDIR)/areadlink.Po
+ -rm -f ./$(DEPDIR)/argmatch.Po
+ -rm -f ./$(DEPDIR)/asnprintf.Po
+ -rm -f ./$(DEPDIR)/asprintf.Po
+ -rm -f ./$(DEPDIR)/basename-lgpl.Po
+ -rm -f ./$(DEPDIR)/basename.Po
+ -rm -f ./$(DEPDIR)/binary-io.Po
+ -rm -f ./$(DEPDIR)/bitrotate.Po
+ -rm -f ./$(DEPDIR)/btowc.Po
+ -rm -f ./$(DEPDIR)/c-ctype.Po
+ -rm -f ./$(DEPDIR)/c-stack.Po
+ -rm -f ./$(DEPDIR)/c-strcasecmp.Po
+ -rm -f ./$(DEPDIR)/c-strncasecmp.Po
+ -rm -f ./$(DEPDIR)/careadlinkat.Po
+ -rm -f ./$(DEPDIR)/close.Po
+ -rm -f ./$(DEPDIR)/cmpbuf.Po
+ -rm -f ./$(DEPDIR)/dirname-lgpl.Po
+ -rm -f ./$(DEPDIR)/dirname.Po
+ -rm -f ./$(DEPDIR)/dup2.Po
+ -rm -f ./$(DEPDIR)/error.Po
+ -rm -f ./$(DEPDIR)/exclude.Po
+ -rm -f ./$(DEPDIR)/exitfail.Po
+ -rm -f ./$(DEPDIR)/fcntl.Po
+ -rm -f ./$(DEPDIR)/fd-hook.Po
+ -rm -f ./$(DEPDIR)/file-type.Po
+ -rm -f ./$(DEPDIR)/filenamecat-lgpl.Po
+ -rm -f ./$(DEPDIR)/filenamecat.Po
+ -rm -f ./$(DEPDIR)/float.Po
+ -rm -f ./$(DEPDIR)/fnmatch.Po
+ -rm -f ./$(DEPDIR)/fnmatch_loop.Po
+ -rm -f ./$(DEPDIR)/freopen-safer.Po
+ -rm -f ./$(DEPDIR)/freopen.Po
+ -rm -f ./$(DEPDIR)/fstat.Po
+ -rm -f ./$(DEPDIR)/getdtablesize.Po
+ -rm -f ./$(DEPDIR)/getopt.Po
+ -rm -f ./$(DEPDIR)/getopt1.Po
+ -rm -f ./$(DEPDIR)/gettime.Po
+ -rm -f ./$(DEPDIR)/gettimeofday.Po
+ -rm -f ./$(DEPDIR)/hard-locale.Po
+ -rm -f ./$(DEPDIR)/hash.Po
+ -rm -f ./$(DEPDIR)/iconv.Po
+ -rm -f ./$(DEPDIR)/iconv_close.Po
+ -rm -f ./$(DEPDIR)/iconv_open.Po
+ -rm -f ./$(DEPDIR)/imaxtostr.Po
+ -rm -f ./$(DEPDIR)/inttostr.Po
+ -rm -f ./$(DEPDIR)/isblank.Po
+ -rm -f ./$(DEPDIR)/iswblank.Po
+ -rm -f ./$(DEPDIR)/itold.Po
+ -rm -f ./$(DEPDIR)/localcharset.Po
+ -rm -f ./$(DEPDIR)/localeconv.Po
+ -rm -f ./$(DEPDIR)/lstat.Po
+ -rm -f ./$(DEPDIR)/malloc.Po
+ -rm -f ./$(DEPDIR)/malloca.Po
+ -rm -f ./$(DEPDIR)/mbchar.Po
+ -rm -f ./$(DEPDIR)/mbiter.Po
+ -rm -f ./$(DEPDIR)/mbrtowc.Po
+ -rm -f ./$(DEPDIR)/mbscasecmp.Po
+ -rm -f ./$(DEPDIR)/mbsinit.Po
+ -rm -f ./$(DEPDIR)/mbslen.Po
+ -rm -f ./$(DEPDIR)/mbsrtowcs-state.Po
+ -rm -f ./$(DEPDIR)/mbsrtowcs.Po
+ -rm -f ./$(DEPDIR)/mbsstr.Po
+ -rm -f ./$(DEPDIR)/mbtowc.Po
+ -rm -f ./$(DEPDIR)/mbuiter.Po
+ -rm -f ./$(DEPDIR)/memchr.Po
+ -rm -f ./$(DEPDIR)/mkstemp.Po
+ -rm -f ./$(DEPDIR)/mktime.Po
+ -rm -f ./$(DEPDIR)/msvc-inval.Po
+ -rm -f ./$(DEPDIR)/msvc-nothrow.Po
+ -rm -f ./$(DEPDIR)/nl_langinfo.Po
+ -rm -f ./$(DEPDIR)/offtostr.Po
+ -rm -f ./$(DEPDIR)/open.Po
+ -rm -f ./$(DEPDIR)/prepargs.Po
+ -rm -f ./$(DEPDIR)/printf-args.Po
+ -rm -f ./$(DEPDIR)/printf-parse.Po
+ -rm -f ./$(DEPDIR)/progname.Po
+ -rm -f ./$(DEPDIR)/propername.Po
+ -rm -f ./$(DEPDIR)/quotearg.Po
+ -rm -f ./$(DEPDIR)/raise.Po
+ -rm -f ./$(DEPDIR)/rawmemchr.Po
+ -rm -f ./$(DEPDIR)/readlink.Po
+ -rm -f ./$(DEPDIR)/regcomp.Po
+ -rm -f ./$(DEPDIR)/regex.Po
+ -rm -f ./$(DEPDIR)/regex_internal.Po
+ -rm -f ./$(DEPDIR)/regexec.Po
+ -rm -f ./$(DEPDIR)/secure_getenv.Po
+ -rm -f ./$(DEPDIR)/setenv.Po
+ -rm -f ./$(DEPDIR)/sh-quote.Po
+ -rm -f ./$(DEPDIR)/sig-handler.Po
+ -rm -f ./$(DEPDIR)/sigaction.Po
+ -rm -f ./$(DEPDIR)/sigprocmask.Po
+ -rm -f ./$(DEPDIR)/stat-time.Po
+ -rm -f ./$(DEPDIR)/stat.Po
+ -rm -f ./$(DEPDIR)/strcasecmp.Po
+ -rm -f ./$(DEPDIR)/strerror-override.Po
+ -rm -f ./$(DEPDIR)/strerror.Po
+ -rm -f ./$(DEPDIR)/strftime.Po
+ -rm -f ./$(DEPDIR)/striconv.Po
+ -rm -f ./$(DEPDIR)/stripslash.Po
+ -rm -f ./$(DEPDIR)/strncasecmp.Po
+ -rm -f ./$(DEPDIR)/strndup.Po
+ -rm -f ./$(DEPDIR)/strnlen.Po
+ -rm -f ./$(DEPDIR)/strnlen1.Po
+ -rm -f ./$(DEPDIR)/strptime.Po
+ -rm -f ./$(DEPDIR)/strtoimax.Po
+ -rm -f ./$(DEPDIR)/strtol.Po
+ -rm -f ./$(DEPDIR)/strtoul.Po
+ -rm -f ./$(DEPDIR)/strtoull.Po
+ -rm -f ./$(DEPDIR)/strtoumax.Po
+ -rm -f ./$(DEPDIR)/system-quote.Po
+ -rm -f ./$(DEPDIR)/tempname.Po
+ -rm -f ./$(DEPDIR)/time_r.Po
+ -rm -f ./$(DEPDIR)/time_rz.Po
+ -rm -f ./$(DEPDIR)/timegm.Po
+ -rm -f ./$(DEPDIR)/timespec.Po
+ -rm -f ./$(DEPDIR)/trim.Po
+ -rm -f ./$(DEPDIR)/uinttostr.Po
+ -rm -f ./$(DEPDIR)/umaxtostr.Po
+ -rm -f ./$(DEPDIR)/unistd.Po
+ -rm -f ./$(DEPDIR)/unsetenv.Po
+ -rm -f ./$(DEPDIR)/vasnprintf.Po
+ -rm -f ./$(DEPDIR)/vasprintf.Po
+ -rm -f ./$(DEPDIR)/version-etc-fsf.Po
+ -rm -f ./$(DEPDIR)/version-etc.Po
+ -rm -f ./$(DEPDIR)/wcrtomb.Po
+ -rm -f ./$(DEPDIR)/wctype-h.Po
+ -rm -f ./$(DEPDIR)/wcwidth.Po
+ -rm -f ./$(DEPDIR)/xalloc-die.Po
+ -rm -f ./$(DEPDIR)/xasprintf.Po
+ -rm -f ./$(DEPDIR)/xfreopen.Po
+ -rm -f ./$(DEPDIR)/xmalloc.Po
+ -rm -f ./$(DEPDIR)/xreadlink.Po
+ -rm -f ./$(DEPDIR)/xsize.Po
+ -rm -f ./$(DEPDIR)/xstriconv.Po
+ -rm -f ./$(DEPDIR)/xstrndup.Po
+ -rm -f ./$(DEPDIR)/xstrtol-error.Po
+ -rm -f ./$(DEPDIR)/xstrtol.Po
+ -rm -f ./$(DEPDIR)/xstrtoul.Po
+ -rm -f ./$(DEPDIR)/xstrtoumax.Po
+ -rm -f ./$(DEPDIR)/xvasprintf.Po
+ -rm -f unistr/$(DEPDIR)/u8-mbtoucr.Po
+ -rm -f unistr/$(DEPDIR)/u8-uctomb-aux.Po
+ -rm -f unistr/$(DEPDIR)/u8-uctomb.Po
+ -rm -f uniwidth/$(DEPDIR)/width.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-exec-local
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(DEPDIR)/alloca.Po
+ -rm -f ./$(DEPDIR)/alloca.Po
+ -rm -f ./$(DEPDIR)/allocator.Po
+ -rm -f ./$(DEPDIR)/anytostr.Po
+ -rm -f ./$(DEPDIR)/areadlink.Po
+ -rm -f ./$(DEPDIR)/argmatch.Po
+ -rm -f ./$(DEPDIR)/asnprintf.Po
+ -rm -f ./$(DEPDIR)/asprintf.Po
+ -rm -f ./$(DEPDIR)/basename-lgpl.Po
+ -rm -f ./$(DEPDIR)/basename.Po
+ -rm -f ./$(DEPDIR)/binary-io.Po
+ -rm -f ./$(DEPDIR)/bitrotate.Po
+ -rm -f ./$(DEPDIR)/btowc.Po
+ -rm -f ./$(DEPDIR)/c-ctype.Po
+ -rm -f ./$(DEPDIR)/c-stack.Po
+ -rm -f ./$(DEPDIR)/c-strcasecmp.Po
+ -rm -f ./$(DEPDIR)/c-strncasecmp.Po
+ -rm -f ./$(DEPDIR)/careadlinkat.Po
+ -rm -f ./$(DEPDIR)/close.Po
+ -rm -f ./$(DEPDIR)/cmpbuf.Po
+ -rm -f ./$(DEPDIR)/dirname-lgpl.Po
+ -rm -f ./$(DEPDIR)/dirname.Po
+ -rm -f ./$(DEPDIR)/dup2.Po
+ -rm -f ./$(DEPDIR)/error.Po
+ -rm -f ./$(DEPDIR)/exclude.Po
+ -rm -f ./$(DEPDIR)/exitfail.Po
+ -rm -f ./$(DEPDIR)/fcntl.Po
+ -rm -f ./$(DEPDIR)/fd-hook.Po
+ -rm -f ./$(DEPDIR)/file-type.Po
+ -rm -f ./$(DEPDIR)/filenamecat-lgpl.Po
+ -rm -f ./$(DEPDIR)/filenamecat.Po
+ -rm -f ./$(DEPDIR)/float.Po
+ -rm -f ./$(DEPDIR)/fnmatch.Po
+ -rm -f ./$(DEPDIR)/fnmatch_loop.Po
+ -rm -f ./$(DEPDIR)/freopen-safer.Po
+ -rm -f ./$(DEPDIR)/freopen.Po
+ -rm -f ./$(DEPDIR)/fstat.Po
+ -rm -f ./$(DEPDIR)/getdtablesize.Po
+ -rm -f ./$(DEPDIR)/getopt.Po
+ -rm -f ./$(DEPDIR)/getopt1.Po
+ -rm -f ./$(DEPDIR)/gettime.Po
+ -rm -f ./$(DEPDIR)/gettimeofday.Po
+ -rm -f ./$(DEPDIR)/hard-locale.Po
+ -rm -f ./$(DEPDIR)/hash.Po
+ -rm -f ./$(DEPDIR)/iconv.Po
+ -rm -f ./$(DEPDIR)/iconv_close.Po
+ -rm -f ./$(DEPDIR)/iconv_open.Po
+ -rm -f ./$(DEPDIR)/imaxtostr.Po
+ -rm -f ./$(DEPDIR)/inttostr.Po
+ -rm -f ./$(DEPDIR)/isblank.Po
+ -rm -f ./$(DEPDIR)/iswblank.Po
+ -rm -f ./$(DEPDIR)/itold.Po
+ -rm -f ./$(DEPDIR)/localcharset.Po
+ -rm -f ./$(DEPDIR)/localeconv.Po
+ -rm -f ./$(DEPDIR)/lstat.Po
+ -rm -f ./$(DEPDIR)/malloc.Po
+ -rm -f ./$(DEPDIR)/malloca.Po
+ -rm -f ./$(DEPDIR)/mbchar.Po
+ -rm -f ./$(DEPDIR)/mbiter.Po
+ -rm -f ./$(DEPDIR)/mbrtowc.Po
+ -rm -f ./$(DEPDIR)/mbscasecmp.Po
+ -rm -f ./$(DEPDIR)/mbsinit.Po
+ -rm -f ./$(DEPDIR)/mbslen.Po
+ -rm -f ./$(DEPDIR)/mbsrtowcs-state.Po
+ -rm -f ./$(DEPDIR)/mbsrtowcs.Po
+ -rm -f ./$(DEPDIR)/mbsstr.Po
+ -rm -f ./$(DEPDIR)/mbtowc.Po
+ -rm -f ./$(DEPDIR)/mbuiter.Po
+ -rm -f ./$(DEPDIR)/memchr.Po
+ -rm -f ./$(DEPDIR)/mkstemp.Po
+ -rm -f ./$(DEPDIR)/mktime.Po
+ -rm -f ./$(DEPDIR)/msvc-inval.Po
+ -rm -f ./$(DEPDIR)/msvc-nothrow.Po
+ -rm -f ./$(DEPDIR)/nl_langinfo.Po
+ -rm -f ./$(DEPDIR)/offtostr.Po
+ -rm -f ./$(DEPDIR)/open.Po
+ -rm -f ./$(DEPDIR)/prepargs.Po
+ -rm -f ./$(DEPDIR)/printf-args.Po
+ -rm -f ./$(DEPDIR)/printf-parse.Po
+ -rm -f ./$(DEPDIR)/progname.Po
+ -rm -f ./$(DEPDIR)/propername.Po
+ -rm -f ./$(DEPDIR)/quotearg.Po
+ -rm -f ./$(DEPDIR)/raise.Po
+ -rm -f ./$(DEPDIR)/rawmemchr.Po
+ -rm -f ./$(DEPDIR)/readlink.Po
+ -rm -f ./$(DEPDIR)/regcomp.Po
+ -rm -f ./$(DEPDIR)/regex.Po
+ -rm -f ./$(DEPDIR)/regex_internal.Po
+ -rm -f ./$(DEPDIR)/regexec.Po
+ -rm -f ./$(DEPDIR)/secure_getenv.Po
+ -rm -f ./$(DEPDIR)/setenv.Po
+ -rm -f ./$(DEPDIR)/sh-quote.Po
+ -rm -f ./$(DEPDIR)/sig-handler.Po
+ -rm -f ./$(DEPDIR)/sigaction.Po
+ -rm -f ./$(DEPDIR)/sigprocmask.Po
+ -rm -f ./$(DEPDIR)/stat-time.Po
+ -rm -f ./$(DEPDIR)/stat.Po
+ -rm -f ./$(DEPDIR)/strcasecmp.Po
+ -rm -f ./$(DEPDIR)/strerror-override.Po
+ -rm -f ./$(DEPDIR)/strerror.Po
+ -rm -f ./$(DEPDIR)/strftime.Po
+ -rm -f ./$(DEPDIR)/striconv.Po
+ -rm -f ./$(DEPDIR)/stripslash.Po
+ -rm -f ./$(DEPDIR)/strncasecmp.Po
+ -rm -f ./$(DEPDIR)/strndup.Po
+ -rm -f ./$(DEPDIR)/strnlen.Po
+ -rm -f ./$(DEPDIR)/strnlen1.Po
+ -rm -f ./$(DEPDIR)/strptime.Po
+ -rm -f ./$(DEPDIR)/strtoimax.Po
+ -rm -f ./$(DEPDIR)/strtol.Po
+ -rm -f ./$(DEPDIR)/strtoul.Po
+ -rm -f ./$(DEPDIR)/strtoull.Po
+ -rm -f ./$(DEPDIR)/strtoumax.Po
+ -rm -f ./$(DEPDIR)/system-quote.Po
+ -rm -f ./$(DEPDIR)/tempname.Po
+ -rm -f ./$(DEPDIR)/time_r.Po
+ -rm -f ./$(DEPDIR)/time_rz.Po
+ -rm -f ./$(DEPDIR)/timegm.Po
+ -rm -f ./$(DEPDIR)/timespec.Po
+ -rm -f ./$(DEPDIR)/trim.Po
+ -rm -f ./$(DEPDIR)/uinttostr.Po
+ -rm -f ./$(DEPDIR)/umaxtostr.Po
+ -rm -f ./$(DEPDIR)/unistd.Po
+ -rm -f ./$(DEPDIR)/unsetenv.Po
+ -rm -f ./$(DEPDIR)/vasnprintf.Po
+ -rm -f ./$(DEPDIR)/vasprintf.Po
+ -rm -f ./$(DEPDIR)/version-etc-fsf.Po
+ -rm -f ./$(DEPDIR)/version-etc.Po
+ -rm -f ./$(DEPDIR)/wcrtomb.Po
+ -rm -f ./$(DEPDIR)/wctype-h.Po
+ -rm -f ./$(DEPDIR)/wcwidth.Po
+ -rm -f ./$(DEPDIR)/xalloc-die.Po
+ -rm -f ./$(DEPDIR)/xasprintf.Po
+ -rm -f ./$(DEPDIR)/xfreopen.Po
+ -rm -f ./$(DEPDIR)/xmalloc.Po
+ -rm -f ./$(DEPDIR)/xreadlink.Po
+ -rm -f ./$(DEPDIR)/xsize.Po
+ -rm -f ./$(DEPDIR)/xstriconv.Po
+ -rm -f ./$(DEPDIR)/xstrndup.Po
+ -rm -f ./$(DEPDIR)/xstrtol-error.Po
+ -rm -f ./$(DEPDIR)/xstrtol.Po
+ -rm -f ./$(DEPDIR)/xstrtoul.Po
+ -rm -f ./$(DEPDIR)/xstrtoumax.Po
+ -rm -f ./$(DEPDIR)/xvasprintf.Po
+ -rm -f unistr/$(DEPDIR)/u8-mbtoucr.Po
+ -rm -f unistr/$(DEPDIR)/u8-uctomb-aux.Po
+ -rm -f unistr/$(DEPDIR)/u8-uctomb.Po
+ -rm -f uniwidth/$(DEPDIR)/width.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-local
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-local
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local am--depfiles check \
+ check-am clean clean-generic clean-noinstLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-hdr 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-exec-local \
+ 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 maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-local pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-local
+
+.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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_ALLOCA_H_TRUE@ cat $(srcdir)/alloca.in.h; \
+@GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \
+@GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@
+@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
+
+# Listed in the same order as the GNU makefile conventions, and
+# provided by autoconf 2.59c+ or 2.70.
+# The Automake-defined pkg* macros are appended, in the order
+# listed in the Automake 1.10a+ documentation.
+configmake.h: Makefile
+ $(AM_V_GEN)rm -f $@-t && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo '#define PREFIX "$(prefix)"'; \
+ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
+ echo '#define BINDIR "$(bindir)"'; \
+ echo '#define SBINDIR "$(sbindir)"'; \
+ echo '#define LIBEXECDIR "$(libexecdir)"'; \
+ echo '#define DATAROOTDIR "$(datarootdir)"'; \
+ echo '#define DATADIR "$(datadir)"'; \
+ echo '#define SYSCONFDIR "$(sysconfdir)"'; \
+ echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
+ echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
+ echo '#define RUNSTATEDIR "$(runstatedir)"'; \
+ echo '#define INCLUDEDIR "$(includedir)"'; \
+ echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
+ echo '#define DOCDIR "$(docdir)"'; \
+ echo '#define INFODIR "$(infodir)"'; \
+ echo '#define HTMLDIR "$(htmldir)"'; \
+ echo '#define DVIDIR "$(dvidir)"'; \
+ echo '#define PDFDIR "$(pdfdir)"'; \
+ echo '#define PSDIR "$(psdir)"'; \
+ echo '#define LIBDIR "$(libdir)"'; \
+ echo '#define LISPDIR "$(lispdir)"'; \
+ echo '#define LOCALEDIR "$(localedir)"'; \
+ echo '#define MANDIR "$(mandir)"'; \
+ echo '#define MANEXT "$(manext)"'; \
+ echo '#define PKGDATADIR "$(pkgdatadir)"'; \
+ echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
+ echo '#define PKGLIBDIR "$(pkglibdir)"'; \
+ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
+ } | sed '/""/d' > $@-t && \
+ mv -f $@-t $@
+
+# 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+ -e 's/@''GNULIB_ISBLANK''@/$(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 && \
+ 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ERRNO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_ERRNO_H_TRUE@ sed -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; \
+@GL_GENERATE_ERRNO_H_TRUE@ } > $@-t && \
+@GL_GENERATE_ERRNO_H_TRUE@ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|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 && \
+ 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_FLOAT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_FLOAT_H_TRUE@ sed -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; \
+@GL_GENERATE_FLOAT_H_TRUE@ } > $@-t && \
+@GL_GENERATE_FLOAT_H_TRUE@ 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> when the system
+# doesn't have one that supports the required API.
+@GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+@GL_GENERATE_FNMATCH_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_FNMATCH_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_FNMATCH_H_TRUE@ sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_FNMATCH_H_TRUE@ < $(srcdir)/fnmatch.in.h; \
+@GL_GENERATE_FNMATCH_H_TRUE@ } > $@-t && \
+@GL_GENERATE_FNMATCH_H_TRUE@ mv -f $@-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.
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ < $(srcdir)/getopt.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+
+distclean-local: clean-GNUmakefile
+clean-GNUmakefile:
+ test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
+
+# We need the following in order to create <iconv.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_ICONV_H_TRUE@iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@GL_GENERATE_ICONV_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ICONV_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_ICONV_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's/@''GNULIB_ICONV''@/$(GNULIB_ICONV)/g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
+@GL_GENERATE_ICONV_H_TRUE@ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+@GL_GENERATE_ICONV_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_ICONV_H_TRUE@ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+@GL_GENERATE_ICONV_H_TRUE@ < $(srcdir)/iconv.in.h; \
+@GL_GENERATE_ICONV_H_TRUE@ } > $@-t && \
+@GL_GENERATE_ICONV_H_TRUE@ mv $@-t $@
+@GL_GENERATE_ICONV_H_FALSE@iconv.h: $(top_builddir)/config.status
+@GL_GENERATE_ICONV_H_FALSE@ rm -f $@
+
+iconv_open-aix.h: iconv_open-aix.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \
+ mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
+iconv_open-hpux.h: iconv_open-hpux.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \
+ mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
+iconv_open-irix.h: iconv_open-irix.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \
+ mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
+iconv_open-osf.h: iconv_open-osf.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \
+ mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
+iconv_open-solaris.h: iconv_open-solaris.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \
+ mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \
+ -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \
+ -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \
+ -e 's/@''GNULIB_STRTOUMAX''@/$(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/@''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 && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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''@/$(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_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 && \
+ mv $@-t $@
+
+# We need the following in order to install a simple file in $(libdir)
+# which is shared with other installed packages. We use a list of referencing
+# packages so that "make uninstall" will remove the file if and only if it
+# is not used by another installed package.
+# On systems with glibc-2.1 or newer, the file is redundant, therefore we
+# avoid installing it.
+
+all-local: charset.alias ref-add.sed ref-del.sed
+install-exec-local: install-exec-localcharset
+install-exec-localcharset: all-local
+ if test $(GLIBC21) = no; then \
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+ darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+ esac ; \
+ else \
+ need_charset_alias=false ; \
+ fi ; \
+ if $$need_charset_alias; then \
+ $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
+ fi ; \
+ if test -f $(charset_alias); then \
+ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
+ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
+ rm -f $(charset_tmp) ; \
+ else \
+ if $$need_charset_alias; then \
+ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
+ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
+ rm -f $(charset_tmp) ; \
+ fi ; \
+ fi
+
+uninstall-local: uninstall-localcharset
+uninstall-localcharset: all-local
+ if test -f $(charset_alias); then \
+ sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
+ if grep '^# Packages using this file: $$' $(charset_tmp) \
+ > /dev/null; then \
+ rm -f $(charset_alias); \
+ else \
+ $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
+ fi; \
+ rm -f $(charset_tmp); \
+ fi
+
+charset.alias: config.charset
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
+ mv t-$@ $@
+.sin.sed:
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
+ mv t-$@ $@
+
+# 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+ -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \
+ -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \
+ -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \
+ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|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_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|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 && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+ -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
+ -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
+ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
+ -e 's/@''GNULIB_SIGACTION''@/$(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 && \
+ mv $@-t $@
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_ARG_NONNULL/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ > $@-t && \
+ mv $@-t $@
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/_GL_CXXDEFS/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/c++defs.h \
+ > $@-t && \
+ mv $@-t $@
+# The unused-parameter.h that gets inserted into generated .h files is the same
+# as build-aux/snippet/unused-parameter.h, except that it has the copyright
+# header cut off.
+unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+ > $@-t && \
+ mv $@-t $@
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/^.ifndef/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+ > $@-t && \
+ mv $@-t $@
+
+# 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDARG_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_STDARG_H_TRUE@ sed -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; \
+@GL_GENERATE_STDARG_H_TRUE@ } > $@-t && \
+@GL_GENERATE_STDARG_H_TRUE@ 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDBOOL_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDBOOL_H_TRUE@ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
+@GL_GENERATE_STDBOOL_H_TRUE@ } > $@-t && \
+@GL_GENERATE_STDBOOL_H_TRUE@ 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_STDDEF_H_TRUE@ sed -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; \
+@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \
+@GL_GENERATE_STDDEF_H_TRUE@ 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@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDINT_H_TRUE@ sed -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_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/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/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@ < $(srcdir)/stdint.in.h; \
+@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \
+@GL_GENERATE_STDINT_H_TRUE@ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -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_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 && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
+ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
+ -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
+ -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
+ -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
+ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
+ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
+ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
+ -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
+ -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
+ -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
+ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
+ -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
+ -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
+ -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
+ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
+ -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
+ -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
+ -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|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_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_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_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_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_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|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_CALLOC''@|$(REPLACE_CALLOC)|g' \
+ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
+ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|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_R''@|$(REPLACE_RANDOM_R)|g' \
+ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
+ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|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 && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|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_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|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_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|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)'; \
+ < $(srcdir)/string.in.h; \
+ } > $@-t && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -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''@|$(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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+ -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
+ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
+ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
+ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
+ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
+ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
+ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
+ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
+ -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
+ -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
+ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
+ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/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_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_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_MKNOD''@|$(REPLACE_MKNOD)|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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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''@/$(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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ < $(srcdir)/sys_types.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
+# We need the following in order to create <sys/wait.h> when the system
+# has one that is incomplete.
+sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+ -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/sys_wait.in.h; \
+ } > $@-t && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
+ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
+ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
+ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
+ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/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_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|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_TIMEGM''@|$(REPLACE_TIMEGM)|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 '/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 && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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_CHDIR''@/$(GNULIB_CHDIR)/g' \
+ -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
+ -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
+ -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
+ -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
+ -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+ -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
+ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
+ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
+ -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
+ -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
+ -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
+ -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
+ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
+ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
+ -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
+ -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
+ -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+ -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
+ -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
+ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
+ -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
+ -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
+ -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
+ -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
+ -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
+ -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
+ -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
+ -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
+ -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
+ -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
+ -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
+ -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
+ -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
+ -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
+ -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
+ -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
+ -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
+ -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
+ -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
+ -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
+ -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
+ -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
+ -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
+ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|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_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
+ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+ -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
+ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|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_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_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_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_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
+ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|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_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_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_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 && \
+ mv $@-t $@
+
+unistr.h: unistr.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/unistr.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+
+unitypes.h: unitypes.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/unitypes.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+
+uniwidth.h: uniwidth.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/uniwidth.in.h; \
+ } > $@-t && \
+ mv -f $@-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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''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/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
+ -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \
+ -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
+ -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
+ -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \
+ -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
+ -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
+ -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
+ -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
+ -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
+ -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \
+ -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \
+ -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \
+ -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \
+ -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \
+ -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \
+ -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \
+ -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \
+ -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \
+ -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \
+ -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \
+ -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \
+ -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \
+ -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \
+ -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \
+ -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \
+ -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \
+ -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \
+ -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
+ -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/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_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_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|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_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 '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+ } > $@-t && \
+ mv $@-t $@
+
+# 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(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_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 && \
+ 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; \
+ :
+
+# 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/lib/alloca.c b/lib/alloca.c
new file mode 100644
index 0000000..ee0f018
--- /dev/null
+++ b/lib/alloca.c
@@ -0,0 +1,478 @@
+/* alloca.c -- allocate automatically reclaimed memory
+ (Mostly) portable public-domain 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>
+
+#ifdef emacs
+# include "lisp.h"
+# include "blockinput.h"
+# ifdef EMACS_FREE
+# undef free
+# define free EMACS_FREE
+# endif
+#else
+# define memory_full() abort ()
+#endif
+
+/* If compiling with GCC 2, this file's not needed. */
+#if !defined (__GNUC__) || __GNUC__ < 2
+
+/* If someone has defined alloca as a macro,
+ there must be some other way alloca is supposed to work. */
+# ifndef alloca
+
+# ifdef emacs
+# ifdef static
+/* actually, only want this if static is defined as ""
+ -- this is for usg, in which emacs must undefine static
+ in order to make unexec workable
+ */
+# ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+/* Using #error here is not wise since this file should work for
+ old and obscure compilers. */
+# endif /* STACK_DIRECTION undefined */
+# endif /* static */
+# endif /* emacs */
+
+/* If your stack is a linked list of frames, you have to
+ provide an "address metric" ADDRESS_FUNCTION macro. */
+
+# if defined (CRAY) && defined (CRAY_STACKSEG_END)
+long i00afunc ();
+# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
+# else
+# define ADDRESS_FUNCTION(arg) &(arg)
+# endif
+
+/* 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 = ADDRESS_FUNCTION (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. */
+
+# ifdef emacs
+ BLOCK_INPUT;
+# endif
+
+ 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. */
+
+# ifdef emacs
+ UNBLOCK_INPUT;
+# endif
+ }
+
+ 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);
+ }
+}
+
+# if defined (CRAY) && defined (CRAY_STACKSEG_END)
+
+# ifdef DEBUG_I00AFUNC
+# include <stdio.h>
+# endif
+
+# ifndef CRAY_STACK
+# define CRAY_STACK
+# ifndef CRAY2
+/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
+struct stack_control_header
+ {
+ long shgrow:32; /* Number of times stack has grown. */
+ long shaseg:32; /* Size of increments to stack. */
+ long shhwm:32; /* High water mark of stack. */
+ long shsize:32; /* Current size of stack (all segments). */
+ };
+
+/* The stack segment linkage control information occurs at
+ the high-address end of a stack segment. (The stack
+ grows from low addresses to high addresses.) The initial
+ part of the stack segment linkage control information is
+ 0200 (octal) words. This provides for register storage
+ for the routine which overflows the stack. */
+
+struct stack_segment_linkage
+ {
+ long ss[0200]; /* 0200 overflow words. */
+ long sssize:32; /* Number of words in this segment. */
+ long ssbase:32; /* Offset to stack base. */
+ long:32;
+ long sspseg:32; /* Offset to linkage control of previous
+ segment of stack. */
+ long:32;
+ long sstcpt:32; /* Pointer to task common address block. */
+ long sscsnm; /* Private control structure number for
+ microtasking. */
+ long ssusr1; /* Reserved for user. */
+ long ssusr2; /* Reserved for user. */
+ long sstpid; /* Process ID for pid based multi-tasking. */
+ long ssgvup; /* Pointer to multitasking thread giveup. */
+ long sscray[7]; /* Reserved for Cray Research. */
+ long ssa0;
+ long ssa1;
+ long ssa2;
+ long ssa3;
+ long ssa4;
+ long ssa5;
+ long ssa6;
+ long ssa7;
+ long sss0;
+ long sss1;
+ long sss2;
+ long sss3;
+ long sss4;
+ long sss5;
+ long sss6;
+ long sss7;
+ };
+
+# else /* CRAY2 */
+/* The following structure defines the vector of words
+ returned by the STKSTAT library routine. */
+struct stk_stat
+ {
+ long now; /* Current total stack size. */
+ long maxc; /* Amount of contiguous space which would
+ be required to satisfy the maximum
+ stack demand to date. */
+ long high_water; /* Stack high-water mark. */
+ long overflows; /* Number of stack overflow ($STKOFEN) calls. */
+ long hits; /* Number of internal buffer hits. */
+ long extends; /* Number of block extensions. */
+ long stko_mallocs; /* Block allocations by $STKOFEN. */
+ long underflows; /* Number of stack underflow calls ($STKRETN). */
+ long stko_free; /* Number of deallocations by $STKRETN. */
+ long stkm_free; /* Number of deallocations by $STKMRET. */
+ long segments; /* Current number of stack segments. */
+ long maxs; /* Maximum number of stack segments so far. */
+ long pad_size; /* Stack pad size. */
+ long current_address; /* Current stack segment address. */
+ long current_size; /* Current stack segment size. This
+ number is actually corrupted by STKSTAT to
+ include the fifteen word trailer area. */
+ long initial_address; /* Address of initial segment. */
+ long initial_size; /* Size of initial segment. */
+ };
+
+/* The following structure describes the data structure which trails
+ any stack segment. I think that the description in 'asdef' is
+ out of date. I only describe the parts that I am sure about. */
+
+struct stk_trailer
+ {
+ long this_address; /* Address of this block. */
+ long this_size; /* Size of this block (does not include
+ this trailer). */
+ long unknown2;
+ long unknown3;
+ long link; /* Address of trailer block of previous
+ segment. */
+ long unknown5;
+ long unknown6;
+ long unknown7;
+ long unknown8;
+ long unknown9;
+ long unknown10;
+ long unknown11;
+ long unknown12;
+ long unknown13;
+ long unknown14;
+ };
+
+# endif /* CRAY2 */
+# endif /* not CRAY_STACK */
+
+# ifdef CRAY2
+/* Determine a "stack measure" for an arbitrary ADDRESS.
+ I doubt that "lint" will like this much. */
+
+static long
+i00afunc (long *address)
+{
+ struct stk_stat status;
+ struct stk_trailer *trailer;
+ long *block, size;
+ long result = 0;
+
+ /* We want to iterate through all of the segments. The first
+ step is to get the stack status structure. We could do this
+ more quickly and more directly, perhaps, by referencing the
+ $LM00 common block, but I know that this works. */
+
+ STKSTAT (&status);
+
+ /* Set up the iteration. */
+
+ trailer = (struct stk_trailer *) (status.current_address
+ + status.current_size
+ - 15);
+
+ /* There must be at least one stack segment. Therefore it is
+ a fatal error if "trailer" is null. */
+
+ if (trailer == 0)
+ abort ();
+
+ /* Discard segments that do not contain our argument address. */
+
+ while (trailer != 0)
+ {
+ block = (long *) trailer->this_address;
+ size = trailer->this_size;
+ if (block == 0 || size == 0)
+ abort ();
+ trailer = (struct stk_trailer *) trailer->link;
+ if ((block <= address) && (address < (block + size)))
+ break;
+ }
+
+ /* Set the result to the offset in this segment and add the sizes
+ of all predecessor segments. */
+
+ result = address - block;
+
+ if (trailer == 0)
+ {
+ return result;
+ }
+
+ do
+ {
+ if (trailer->this_size <= 0)
+ abort ();
+ result += trailer->this_size;
+ trailer = (struct stk_trailer *) trailer->link;
+ }
+ while (trailer != 0);
+
+ /* We are done. Note that if you present a bogus address (one
+ not in any segment), you will get a different number back, formed
+ from subtracting the address of the first block. This is probably
+ not what you want. */
+
+ return (result);
+}
+
+# else /* not CRAY2 */
+/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
+ Determine the number of the cell within the stack,
+ given the address of the cell. The purpose of this
+ routine is to linearize, in some sense, stack addresses
+ for alloca. */
+
+static long
+i00afunc (long address)
+{
+ long stkl = 0;
+
+ long size, pseg, this_segment, stack;
+ long result = 0;
+
+ struct stack_segment_linkage *ssptr;
+
+ /* Register B67 contains the address of the end of the
+ current stack segment. If you (as a subprogram) store
+ your registers on the stack and find that you are past
+ the contents of B67, you have overflowed the segment.
+
+ B67 also points to the stack segment linkage control
+ area, which is what we are really interested in. */
+
+ stkl = CRAY_STACKSEG_END ();
+ ssptr = (struct stack_segment_linkage *) stkl;
+
+ /* If one subtracts 'size' from the end of the segment,
+ one has the address of the first word of the segment.
+
+ If this is not the first segment, 'pseg' will be
+ nonzero. */
+
+ pseg = ssptr->sspseg;
+ size = ssptr->sssize;
+
+ this_segment = stkl - size;
+
+ /* It is possible that calling this routine itself caused
+ a stack overflow. Discard stack segments which do not
+ contain the target address. */
+
+ while (!(this_segment <= address && address <= stkl))
+ {
+# ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
+# endif
+ if (pseg == 0)
+ break;
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ this_segment = stkl - size;
+ }
+
+ result = address - this_segment;
+
+ /* If you subtract pseg from the current end of the stack,
+ you get the address of the previous stack segment's end.
+ This seems a little convoluted to me, but I'll bet you save
+ a cycle somewhere. */
+
+ while (pseg != 0)
+ {
+# ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o\n", pseg, size);
+# endif
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ result += size;
+ }
+ return (result);
+}
+
+# endif /* not CRAY2 */
+# endif /* CRAY */
+
+# endif /* no alloca */
+#endif /* not GCC 2 */
diff --git a/lib/alloca.in.h b/lib/alloca.in.h
new file mode 100644
index 0000000..d457ebb
--- /dev/null
+++ b/lib/alloca.in.h
@@ -0,0 +1,63 @@
+/* Memory allocation on the stack.
+
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, see
+ <http://www.gnu.org/licenses/>.
+ */
+
+/* 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
+# ifdef __GNUC__
+# 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
+# else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+# endif
+#endif
+
+#endif /* _GL_ALLOCA_H */
diff --git a/lib/allocator.c b/lib/allocator.c
new file mode 100644
index 0000000..2c1a3da
--- /dev/null
+++ b/lib/allocator.c
@@ -0,0 +1,5 @@
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+#include "allocator.h"
+#include <stdlib.h>
+struct allocator const stdlib_allocator = { malloc, realloc, free, NULL };
diff --git a/lib/allocator.h b/lib/allocator.h
new file mode 100644
index 0000000..1f1eab6
--- /dev/null
+++ b/lib/allocator.h
@@ -0,0 +1,58 @@
+/* Memory allocators such as malloc+free.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef _GL_ALLOCATOR_H
+#define _GL_ALLOCATOR_H
+
+#include <stddef.h>
+
+/* An object describing a memory allocator family. */
+
+struct allocator
+{
+ /* Do not use GCC attributes such as __attribute__ ((malloc)) with
+ the function types pointed at by these members, because these
+ attributes do not work with pointers to functions. See
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00007.html>. */
+
+ /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE
+ should return NULL, though not necessarily set errno. When given
+ a zero size it may return NULL even if successful. */
+ void *(*allocate) (size_t);
+
+ /* If nonnull, call REALLOCATE to reallocate memory, like 'realloc'.
+ On failure REALLOCATE should return NULL, though not necessarily set
+ errno. When given a zero size it may return NULL even if
+ successful. */
+ void *(*reallocate) (void *, size_t);
+
+ /* Call FREE to free memory, like 'free'. */
+ void (*free) (void *);
+
+ /* If nonnull, call DIE (SIZE) if MALLOC (SIZE) or REALLOC (...,
+ SIZE) fails. DIE should not return. SIZE should equal SIZE_MAX
+ if size_t overflow was detected while calculating sizes to be
+ passed to MALLOC or REALLOC. */
+ void (*die) (size_t);
+};
+
+/* An allocator using the stdlib functions and a null DIE function. */
+extern struct allocator const stdlib_allocator;
+
+#endif /* _GL_ALLOCATOR_H */
diff --git a/lib/anytostr.c b/lib/anytostr.c
new file mode 100644
index 0000000..39aab0e
--- /dev/null
+++ b/lib/anytostr.c
@@ -0,0 +1,57 @@
+/* anytostr.c -- convert integers to printable strings
+
+ Copyright (C) 2001, 2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert */
+
+/* Tell gcc not to warn about the (i < 0) test, below. */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wtype-limits"
+#elif defined __clang__
+# pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
+
+#include <config.h>
+
+#include "inttostr.h"
+
+/* Convert I to a printable string in BUF, which must be at least
+ INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the
+ printable string, which need not start at BUF. */
+
+char * __attribute_warn_unused_result__
+anytostr (inttype i, char *buf)
+{
+ char *p = buf + INT_STRLEN_BOUND (inttype);
+ *p = 0;
+
+ if (i < 0)
+ {
+ do
+ *--p = '0' - i % 10;
+ while ((i /= 10) != 0);
+
+ *--p = '-';
+ }
+ else
+ {
+ do
+ *--p = '0' + i % 10;
+ while ((i /= 10) != 0);
+ }
+
+ return p;
+}
diff --git a/lib/areadlink.c b/lib/areadlink.c
new file mode 100644
index 0000000..fee84a3
--- /dev/null
+++ b/lib/areadlink.c
@@ -0,0 +1,56 @@
+/* areadlink.c -- readlink wrapper to return the link name in malloc'd storage
+ Unlike xreadlink and xreadlink_with_size, don't ever call exit.
+
+ Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering <jim@meyering.net>
+ and Bruno Haible <bruno@clisp.org>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "areadlink.h"
+
+#include "careadlinkat.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Get the symbolic link value of FILENAME and put it into BUFFER, with
+ size BUFFER_SIZE. This function acts like readlink but has
+ readlinkat's signature. */
+static ssize_t
+careadlinkatcwd (int fd, char const *filename, char *buffer,
+ size_t buffer_size)
+{
+ /* FD must be AT_FDCWD here, otherwise the caller is using this
+ function in contexts it was not meant for. */
+ if (fd != AT_FDCWD)
+ abort ();
+ return readlink (filename, buffer, buffer_size);
+}
+
+/* Call readlink to get the symbolic link value of FILENAME.
+ Return a pointer to that NUL-terminated string in malloc'd storage.
+ If readlink fails, return NULL and set errno.
+ If allocation fails, or if the link value is longer than SIZE_MAX :-),
+ return NULL and set errno to ENOMEM. */
+
+char *
+areadlink (char const *filename)
+{
+ return careadlinkat (AT_FDCWD, filename, NULL, 0, NULL, careadlinkatcwd);
+}
diff --git a/lib/areadlink.h b/lib/areadlink.h
new file mode 100644
index 0000000..829c959
--- /dev/null
+++ b/lib/areadlink.h
@@ -0,0 +1,33 @@
+/* Read symbolic links without size limitation.
+
+ Copyright (C) 2001, 2003-2004, 2007, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering <jim@meyering.net> */
+
+#include <stddef.h>
+
+extern char *areadlink (char const *filename);
+extern char *areadlink_with_size (char const *filename, size_t size_hint);
+
+#if GNULIB_AREADLINKAT
+extern char *areadlinkat (int fd, char const *filename);
+#endif
+
+#if GNULIB_AREADLINKAT_WITH_SIZE
+extern char *areadlinkat_with_size (int fd, char const *filename,
+ size_t size_hint);
+#endif
diff --git a/lib/argmatch.c b/lib/argmatch.c
new file mode 100644
index 0000000..bd1ad71
--- /dev/null
+++ b/lib/argmatch.c
@@ -0,0 +1,277 @@
+/* argmatch.c -- find a match for a string in an array
+
+ Copyright (C) 1990, 1998-1999, 2001-2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by David MacKenzie <djm@ai.mit.edu>
+ Modified by Akim Demaille <demaille@inf.enst.fr> */
+
+#include <config.h>
+
+/* Specification. */
+#include "argmatch.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+#include "error.h"
+#include "quotearg.h"
+#include "quote.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+/* When reporting an invalid argument, show nonprinting characters
+ by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
+ literal_quoting_style. */
+#ifndef ARGMATCH_QUOTING_STYLE
+# define ARGMATCH_QUOTING_STYLE locale_quoting_style
+#endif
+
+/* Non failing version of argmatch call this function after failing. */
+#ifndef ARGMATCH_DIE
+# include "exitfail.h"
+# define ARGMATCH_DIE exit (exit_failure)
+#endif
+
+#ifdef ARGMATCH_DIE_DECL
+ARGMATCH_DIE_DECL;
+#endif
+
+static void
+__argmatch_die (void)
+{
+ ARGMATCH_DIE;
+}
+
+/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h.
+ Default to __argmatch_die, but allow caller to change this at run-time. */
+argmatch_exit_fn argmatch_die = __argmatch_die;
+
+
+/* If ARG is an unambiguous match for an element of the
+ NULL-terminated array ARGLIST, return the index in ARGLIST
+ of the matched element, else -1 if it does not match any element
+ or -2 if it is ambiguous (is a prefix of more than one element).
+
+ If VALLIST is none null, use it to resolve ambiguities limited to
+ synonyms, i.e., for
+ "yes", "yop" -> 0
+ "no", "nope" -> 1
+ "y" is a valid argument, for 0, and "n" for 1. */
+
+ptrdiff_t
+argmatch (const char *arg, const char *const *arglist,
+ const char *vallist, size_t valsize)
+{
+ size_t i; /* Temporary index in ARGLIST. */
+ size_t arglen; /* Length of ARG. */
+ ptrdiff_t matchind = -1; /* Index of first nonexact match. */
+ bool ambiguous = false; /* If true, multiple nonexact match(es). */
+
+ arglen = strlen (arg);
+
+ /* Test all elements for either exact match or abbreviated matches. */
+ for (i = 0; arglist[i]; i++)
+ {
+ if (!strncmp (arglist[i], arg, arglen))
+ {
+ if (strlen (arglist[i]) == arglen)
+ /* Exact match found. */
+ return i;
+ else if (matchind == -1)
+ /* First nonexact match found. */
+ matchind = i;
+ else
+ {
+ /* Second nonexact match found. */
+ if (vallist == NULL
+ || memcmp (vallist + valsize * matchind,
+ vallist + valsize * i, valsize))
+ {
+ /* There is a real ambiguity, or we could not
+ disambiguate. */
+ ambiguous = true;
+ }
+ }
+ }
+ }
+ if (ambiguous)
+ return -2;
+ else
+ return matchind;
+}
+
+/* Error reporting for argmatch.
+ CONTEXT is a description of the type of entity that was being matched.
+ VALUE is the invalid value that was given.
+ PROBLEM is the return value from argmatch. */
+
+void
+argmatch_invalid (const char *context, const char *value, ptrdiff_t problem)
+{
+ char const *format = (problem == -1
+ ? _("invalid argument %s for %s")
+ : _("ambiguous argument %s for %s"));
+
+ error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value),
+ quote_n (1, context));
+}
+
+/* List the valid arguments for argmatch.
+ ARGLIST is the same as in argmatch.
+ VALLIST is a pointer to an array of values.
+ VALSIZE is the size of the elements of VALLIST */
+void
+argmatch_valid (const char *const *arglist,
+ const char *vallist, size_t valsize)
+{
+ size_t i;
+ const char *last_val = NULL;
+
+ /* We try to put synonyms on the same line. The assumption is that
+ synonyms follow each other */
+ fputs (_("Valid arguments are:"), stderr);
+ for (i = 0; arglist[i]; i++)
+ if ((i == 0)
+ || memcmp (last_val, vallist + valsize * i, valsize))
+ {
+ fprintf (stderr, "\n - %s", quote (arglist[i]));
+ last_val = vallist + valsize * i;
+ }
+ else
+ {
+ fprintf (stderr, ", %s", quote (arglist[i]));
+ }
+ putc ('\n', stderr);
+}
+
+/* Never failing versions of the previous functions.
+
+ CONTEXT is the context for which argmatch is called (e.g.,
+ "--version-control", or "$VERSION_CONTROL" etc.). Upon failure,
+ calls the (supposed never to return) function EXIT_FN. */
+
+ptrdiff_t
+__xargmatch_internal (const char *context,
+ const char *arg, const char *const *arglist,
+ const char *vallist, size_t valsize,
+ argmatch_exit_fn exit_fn)
+{
+ ptrdiff_t res = argmatch (arg, arglist, vallist, valsize);
+ if (res >= 0)
+ /* Success. */
+ return res;
+
+ /* We failed. Explain why. */
+ argmatch_invalid (context, arg, res);
+ argmatch_valid (arglist, vallist, valsize);
+ (*exit_fn) ();
+
+ return -1; /* To please the compilers. */
+}
+
+/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and
+ return the first corresponding argument in ARGLIST */
+const char *
+argmatch_to_argument (const char *value,
+ const char *const *arglist,
+ const char *vallist, size_t valsize)
+{
+ size_t i;
+
+ for (i = 0; arglist[i]; i++)
+ if (!memcmp (value, vallist + valsize * i, valsize))
+ return arglist[i];
+ return NULL;
+}
+
+#ifdef TEST
+/*
+ * Based on "getversion.c" by David MacKenzie <djm@gnu.ai.mit.edu>
+ */
+char *program_name;
+
+/* When to make backup files. */
+enum backup_type
+{
+ /* Never make backups. */
+ no_backups,
+
+ /* Make simple backups of every file. */
+ simple_backups,
+
+ /* Make numbered backups of files that already have numbered backups,
+ and simple backups of the others. */
+ numbered_existing_backups,
+
+ /* Make numbered backups of every file. */
+ numbered_backups
+};
+
+/* Two tables describing arguments (keys) and their corresponding
+ values */
+static const char *const backup_args[] =
+{
+ "no", "none", "off",
+ "simple", "never",
+ "existing", "nil",
+ "numbered", "t",
+ 0
+};
+
+static const enum backup_type backup_vals[] =
+{
+ no_backups, no_backups, no_backups,
+ simple_backups, simple_backups,
+ numbered_existing_backups, numbered_existing_backups,
+ numbered_backups, numbered_backups
+};
+
+int
+main (int argc, const char *const *argv)
+{
+ const char *cp;
+ enum backup_type backup_type = no_backups;
+
+ program_name = (char *) argv[0];
+
+ if (argc > 2)
+ {
+ fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name);
+ exit (1);
+ }
+
+ if ((cp = getenv ("VERSION_CONTROL")))
+ backup_type = XARGMATCH ("$VERSION_CONTROL", cp,
+ backup_args, backup_vals);
+
+ if (argc == 2)
+ backup_type = XARGMATCH (program_name, argv[1],
+ backup_args, backup_vals);
+
+ printf ("The version control is '%s'\n",
+ ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals));
+
+ return 0;
+}
+#endif
diff --git a/lib/argmatch.h b/lib/argmatch.h
new file mode 100644
index 0000000..43cda5a
--- /dev/null
+++ b/lib/argmatch.h
@@ -0,0 +1,111 @@
+/* argmatch.h -- definitions and prototypes for argmatch.c
+
+ Copyright (C) 1990, 1998-1999, 2001-2002, 2004-2005, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by David MacKenzie <djm@ai.mit.edu>
+ Modified by Akim Demaille <demaille@inf.enst.fr> */
+
+#ifndef ARGMATCH_H_
+# define ARGMATCH_H_ 1
+
+# include <stddef.h>
+
+# include "verify.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
+
+/* Assert there are as many real arguments as there are values
+ (argument list ends with a NULL guard). */
+
+# define ARGMATCH_VERIFY(Arglist, Vallist) \
+ verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1)
+
+/* Return the index of the element of ARGLIST (NULL terminated) that
+ matches with ARG. If VALLIST is not NULL, then use it to resolve
+ false ambiguities (i.e., different matches of ARG but corresponding
+ to the same values in VALLIST). */
+
+ptrdiff_t argmatch (char const *arg, char const *const *arglist,
+ char const *vallist, size_t valsize) _GL_ATTRIBUTE_PURE;
+
+# define ARGMATCH(Arg, Arglist, Vallist) \
+ argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist))
+
+/* xargmatch calls this function when it fails. This function should not
+ return. By default, this is a function that calls ARGMATCH_DIE which
+ in turn defaults to 'exit (exit_failure)'. */
+typedef void (*argmatch_exit_fn) (void);
+extern argmatch_exit_fn argmatch_die;
+
+/* Report on stderr why argmatch failed. Report correct values. */
+
+void argmatch_invalid (char const *context, char const *value,
+ ptrdiff_t problem);
+
+/* Left for compatibility with the old name invalid_arg */
+
+# define invalid_arg(Context, Value, Problem) \
+ argmatch_invalid (Context, Value, Problem)
+
+
+
+/* Report on stderr the list of possible arguments. */
+
+void argmatch_valid (char const *const *arglist,
+ char const *vallist, size_t valsize);
+
+# define ARGMATCH_VALID(Arglist, Vallist) \
+ argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist))
+
+
+
+/* Same as argmatch, but upon failure, report an explanation of the
+ failure, and exit using the function EXIT_FN. */
+
+ptrdiff_t __xargmatch_internal (char const *context,
+ char const *arg, char const *const *arglist,
+ char const *vallist, size_t valsize,
+ argmatch_exit_fn exit_fn);
+
+/* Programmer friendly interface to __xargmatch_internal. */
+
+# define XARGMATCH(Context, Arg, Arglist, Vallist) \
+ ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \
+ (char const *) (Vallist), \
+ sizeof *(Vallist), \
+ argmatch_die)])
+
+/* Convert a value into a corresponding argument. */
+
+char const *argmatch_to_argument (char const *value,
+ char const *const *arglist,
+ char const *vallist, size_t valsize)
+ _GL_ATTRIBUTE_PURE;
+
+# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \
+ argmatch_to_argument (Value, Arglist, \
+ (char const *) (Vallist), sizeof *(Vallist))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ARGMATCH_H_ */
diff --git a/lib/asnprintf.c b/lib/asnprintf.c
new file mode 100644
index 0000000..f23b776
--- /dev/null
+++ b/lib/asnprintf.c
@@ -0,0 +1,34 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "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/lib/asprintf.c b/lib/asprintf.c
new file mode 100644
index 0000000..d0ca5f2
--- /dev/null
+++ b/lib/asprintf.c
@@ -0,0 +1,39 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#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/lib/assure.h b/lib/assure.h
new file mode 100644
index 0000000..de1f665
--- /dev/null
+++ b/lib/assure.h
@@ -0,0 +1,37 @@
+/* Run-time assert-like macros.
+
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef _GL_ASSURE_H
+#define _GL_ASSURE_H
+
+#include <assert.h>
+
+/* Check E's value at runtime, and report an error and abort if not.
+ However, do nothng if NDEBUG is defined.
+
+ Unlike standard 'assert', this macro always compiles E even when NDEBUG
+ is defined, so as to catch typos and avoid some GCC warnings. */
+
+#ifdef NDEBUG
+# define assure(E) ((void) (0 && (E)))
+#else
+# define assure(E) assert (E)
+#endif
+
+#endif
diff --git a/lib/basename-lgpl.c b/lib/basename-lgpl.c
new file mode 100644
index 0000000..1182109
--- /dev/null
+++ b/lib/basename-lgpl.c
@@ -0,0 +1,75 @@
+/* basename.c -- return the last element in a file name
+
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <string.h>
+
+/* Return the address of the last file name component of NAME. If
+ NAME has no relative file name components because it is a file
+ system root, return the empty string. */
+
+char *
+last_component (char const *name)
+{
+ char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
+ char const *p;
+ bool saw_slash = false;
+
+ while (ISSLASH (*base))
+ base++;
+
+ for (p = base; *p; p++)
+ {
+ if (ISSLASH (*p))
+ saw_slash = true;
+ else if (saw_slash)
+ {
+ base = p;
+ saw_slash = false;
+ }
+ }
+
+ return (char *) base;
+}
+
+/* Return the length of the basename NAME. Typically NAME is the
+ value returned by base_name or last_component. Act like strlen
+ (NAME), except omit all trailing slashes. */
+
+size_t
+base_len (char const *name)
+{
+ size_t len;
+ size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+ for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
+ continue;
+
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
+ && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
+ return 2;
+
+ if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
+ && len == prefix_len && ISSLASH (name[prefix_len]))
+ return prefix_len + 1;
+
+ return len;
+}
diff --git a/lib/basename.c b/lib/basename.c
new file mode 100644
index 0000000..ed1872d
--- /dev/null
+++ b/lib/basename.c
@@ -0,0 +1,58 @@
+/* basename.c -- return the last element in a file name
+
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <string.h>
+#include "xalloc.h"
+#include "xstrndup.h"
+
+char *
+base_name (char const *name)
+{
+ char const *base = last_component (name);
+ size_t length;
+
+ /* If there is no last component, then name is a file system root or the
+ empty string. */
+ if (! *base)
+ return xstrndup (name, base_len (name));
+
+ /* Collapse a sequence of trailing slashes into one. */
+ length = base_len (base);
+ if (ISSLASH (base[length]))
+ 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. */
+ if (FILE_SYSTEM_PREFIX_LEN (base))
+ {
+ char *p = xmalloc (length + 3);
+ p[0] = '.';
+ p[1] = '/';
+ memcpy (p + 2, base, length);
+ p[length + 2] = '\0';
+ return p;
+ }
+
+ /* Finally, copy the basename. */
+ return xstrndup (base, length);
+}
diff --git a/lib/binary-io.c b/lib/binary-io.c
new file mode 100644
index 0000000..d828bcd
--- /dev/null
+++ b/lib/binary-io.c
@@ -0,0 +1,4 @@
+#include <config.h>
+#define BINARY_IO_INLINE _GL_EXTERN_INLINE
+#include "binary-io.h"
+typedef int dummy;
diff --git a/lib/binary-io.h b/lib/binary-io.h
new file mode 100644
index 0000000..9f17c0d
--- /dev/null
+++ b/lib/binary-io.h
@@ -0,0 +1,75 @@
+/* Binary mode I/O.
+ Copyright (C) 2001, 2003, 2005, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _BINARY_H
+#define _BINARY_H
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is guaranteed by the gnulib <fcntl.h>. */
+#include <fcntl.h>
+
+/* The MSVC7 <stdio.h> doesn't like to be included after '#define fileno ...',
+ so we include it here first. */
+#include <stdio.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef BINARY_IO_INLINE
+# define BINARY_IO_INLINE _GL_INLINE
+#endif
+
+/* set_binary_mode (fd, mode)
+ sets the binary/text I/O mode of file descriptor fd to the given mode
+ (must be O_BINARY or O_TEXT) and returns the previous mode. */
+#if O_BINARY
+# if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__
+# include <io.h> /* declares setmode() */
+# define set_binary_mode setmode
+# else
+# define set_binary_mode _setmode
+# undef fileno
+# define fileno _fileno
+# endif
+#else
+ /* On reasonable systems, binary I/O is the only choice. */
+ /* Use a function rather than a macro, to avoid gcc warnings
+ "warning: statement with no effect". */
+BINARY_IO_INLINE int
+set_binary_mode (int fd, int mode)
+{
+ (void) fd;
+ (void) mode;
+ return O_BINARY;
+}
+#endif
+
+/* SET_BINARY (fd);
+ changes the file descriptor fd to perform binary I/O. */
+#if defined __DJGPP__ || defined __EMX__
+# include <unistd.h> /* declares isatty() */
+ /* Avoid putting stdin/stdout in binary mode if it is connected to
+ the console, because that would make it impossible for the user
+ to interrupt the program through Ctrl-C or Ctrl-Break. */
+# define SET_BINARY(fd) ((void) (!isatty (fd) ? (set_binary_mode (fd, O_BINARY), 0) : 0))
+#else
+# define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _BINARY_H */
diff --git a/lib/bitrotate.c b/lib/bitrotate.c
new file mode 100644
index 0000000..a8f6028
--- /dev/null
+++ b/lib/bitrotate.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define BITROTATE_INLINE _GL_EXTERN_INLINE
+#include "bitrotate.h"
diff --git a/lib/bitrotate.h b/lib/bitrotate.h
new file mode 100644
index 0000000..a259481
--- /dev/null
+++ b/lib/bitrotate.h
@@ -0,0 +1,136 @@
+/* bitrotate.h - Rotate bits in integers
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson <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 ((x << n) | (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 ((x >> n) | (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 ((x << n) | (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 ((x >> n) | (x << (8 - n))) & UINT8_MAX;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_BITROTATE_H */
diff --git a/lib/btowc.c b/lib/btowc.c
new file mode 100644
index 0000000..e7badf9
--- /dev/null
+++ b/lib/btowc.c
@@ -0,0 +1,39 @@
+/* Convert unibyte character to wide character.
+ Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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/lib/c-ctype.c b/lib/c-ctype.c
new file mode 100644
index 0000000..5d9d4d8
--- /dev/null
+++ b/lib/c-ctype.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define C_CTYPE_INLINE _GL_EXTERN_INLINE
+#include "c-ctype.h"
diff --git a/lib/c-ctype.h b/lib/c-ctype.h
new file mode 100644
index 0000000..717ae78
--- /dev/null
+++ b/lib/c-ctype.h
@@ -0,0 +1,366 @@
+/* Character handling in C locale.
+
+ These functions work like the corresponding functions in <ctype.h>,
+ except that they have the C (POSIX) locale hardwired, whereas the
+ <ctype.h> functions' behaviour depends on the current locale set via
+ setlocale.
+
+ Copyright (C) 2000-2003, 2006, 2008-2016 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef C_CTYPE_H
+#define C_CTYPE_H
+
+#include <stdbool.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef C_CTYPE_INLINE
+# define C_CTYPE_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* The functions defined in this file assume the "C" locale and a character
+ set without diacritics (ASCII-US or EBCDIC-US or something like that).
+ Even if the "C" locale on a particular system is an extension of the ASCII
+ character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
+ is ISO-8859-1), the functions in this file recognize only the ASCII
+ characters. */
+
+
+#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
+/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
+ Testing the value of '\n' and '\r' is not relevant. */
+# define C_CTYPE_ASCII 1
+#elif ! (' ' == '\x40' && '0' == '\xf0' \
+ && 'A' == '\xc1' && 'J' == '\xd1' && 'S' == '\xe2' \
+ && 'a' == '\x81' && 'j' == '\x91' && 's' == '\xa2')
+# error "Only ASCII and EBCDIC are supported"
+#endif
+
+#if 'A' < 0
+# error "EBCDIC and char is signed -- not supported"
+#endif
+
+/* Cases for control characters. */
+
+#define _C_CTYPE_CNTRL \
+ case '\a': case '\b': case '\f': case '\n': \
+ case '\r': case '\t': case '\v': \
+ _C_CTYPE_OTHER_CNTRL
+
+/* ASCII control characters other than those with \-letter escapes. */
+
+#if C_CTYPE_ASCII
+# define _C_CTYPE_OTHER_CNTRL \
+ case '\x00': case '\x01': case '\x02': case '\x03': \
+ case '\x04': case '\x05': case '\x06': case '\x0e': \
+ case '\x0f': case '\x10': case '\x11': case '\x12': \
+ case '\x13': case '\x14': case '\x15': case '\x16': \
+ case '\x17': case '\x18': case '\x19': case '\x1a': \
+ case '\x1b': case '\x1c': case '\x1d': case '\x1e': \
+ case '\x1f': case '\x7f'
+#else
+ /* Use EBCDIC code page 1047's assignments for ASCII control chars;
+ assume all EBCDIC code pages agree about these assignments. */
+# define _C_CTYPE_OTHER_CNTRL \
+ case '\x00': case '\x01': case '\x02': case '\x03': \
+ case '\x07': case '\x0e': case '\x0f': case '\x10': \
+ case '\x11': case '\x12': case '\x13': case '\x18': \
+ case '\x19': case '\x1c': case '\x1d': case '\x1e': \
+ case '\x1f': case '\x26': case '\x27': case '\x2d': \
+ case '\x2e': case '\x32': case '\x37': case '\x3c': \
+ case '\x3d': case '\x3f'
+#endif
+
+/* Cases for lowercase hex letters, and lowercase letters, all offset by N. */
+
+#define _C_CTYPE_LOWER_A_THRU_F_N(n) \
+ case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
+ case 'e' + (n): case 'f' + (n)
+#define _C_CTYPE_LOWER_N(n) \
+ _C_CTYPE_LOWER_A_THRU_F_N(n): \
+ case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \
+ case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \
+ case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \
+ case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \
+ case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n)
+
+/* Cases for hex letters, digits, lower, punct, and upper. */
+
+#define _C_CTYPE_A_THRU_F \
+ _C_CTYPE_LOWER_A_THRU_F_N (0): \
+ _C_CTYPE_LOWER_A_THRU_F_N ('A' - 'a')
+#define _C_CTYPE_DIGIT \
+ case '0': case '1': case '2': case '3': \
+ case '4': case '5': case '6': case '7': \
+ case '8': case '9'
+#define _C_CTYPE_LOWER _C_CTYPE_LOWER_N (0)
+#define _C_CTYPE_PUNCT \
+ case '!': case '"': case '#': case '$': \
+ case '%': case '&': case '\'': case '(': \
+ case ')': case '*': case '+': case ',': \
+ case '-': case '.': case '/': case ':': \
+ case ';': case '<': case '=': case '>': \
+ case '?': case '@': case '[': case '\\': \
+ case ']': case '^': case '_': case '`': \
+ case '{': case '|': case '}': case '~'
+#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a')
+
+
+/* Function definitions. */
+
+/* Unlike the functions in <ctype.h>, which require an argument in the range
+ of the 'unsigned char' type, the functions here operate on values that are
+ in the 'unsigned char' range or in the 'char' range. In other words,
+ when you have a 'char' value, you need to cast it before using it as
+ argument to a <ctype.h> function:
+
+ const char *s = ...;
+ if (isalpha ((unsigned char) *s)) ...
+
+ but you don't need to cast it for the functions defined in this file:
+
+ const char *s = ...;
+ if (c_isalpha (*s)) ...
+ */
+
+C_CTYPE_INLINE bool
+c_isalnum (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_DIGIT:
+ _C_CTYPE_LOWER:
+ _C_CTYPE_UPPER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isalpha (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_LOWER:
+ _C_CTYPE_UPPER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/* The function isascii is not locale dependent.
+ Its use in EBCDIC is questionable. */
+C_CTYPE_INLINE bool
+c_isascii (int c)
+{
+ switch (c)
+ {
+ case ' ':
+ _C_CTYPE_CNTRL:
+ _C_CTYPE_DIGIT:
+ _C_CTYPE_LOWER:
+ _C_CTYPE_PUNCT:
+ _C_CTYPE_UPPER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isblank (int c)
+{
+ return c == ' ' || c == '\t';
+}
+
+C_CTYPE_INLINE bool
+c_iscntrl (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_CNTRL:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isdigit (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_DIGIT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isgraph (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_DIGIT:
+ _C_CTYPE_LOWER:
+ _C_CTYPE_PUNCT:
+ _C_CTYPE_UPPER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_islower (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_LOWER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isprint (int c)
+{
+ switch (c)
+ {
+ case ' ':
+ _C_CTYPE_DIGIT:
+ _C_CTYPE_LOWER:
+ _C_CTYPE_PUNCT:
+ _C_CTYPE_UPPER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_ispunct (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_PUNCT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isspace (int c)
+{
+ switch (c)
+ {
+ case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isupper (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_UPPER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE bool
+c_isxdigit (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_DIGIT:
+ _C_CTYPE_A_THRU_F:
+ return true;
+ default:
+ return false;
+ }
+}
+
+C_CTYPE_INLINE int
+c_tolower (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_UPPER:
+ return c - 'A' + 'a';
+ default:
+ return c;
+ }
+}
+
+C_CTYPE_INLINE int
+c_toupper (int c)
+{
+ switch (c)
+ {
+ _C_CTYPE_LOWER:
+ return c - 'a' + 'A';
+ default:
+ return c;
+ }
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* C_CTYPE_H */
diff --git a/lib/c-stack.c b/lib/c-stack.c
new file mode 100644
index 0000000..baace41
--- /dev/null
+++ b/lib/c-stack.c
@@ -0,0 +1,330 @@
+/* Stack overflow handling.
+
+ Copyright (C) 2002, 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* NOTES:
+
+ A program that uses alloca, dynamic arrays, or large local
+ variables may extend the stack by more than a page at a time. If
+ so, when the stack overflows the operating system may not detect
+ the overflow until the program uses the array, and this module may
+ incorrectly report a program error instead of a stack overflow.
+
+ To avoid this problem, allocate only small objects on the stack; a
+ program should be OK if it limits single allocations to a page or
+ less. Allocate larger arrays in static storage, or on the heap
+ (e.g., with malloc). Yes, this is a pain, but we don't know of any
+ better solution that is portable.
+
+ No attempt has been made to deal with multithreaded applications. */
+
+#include <config.h>
+
+#ifndef __attribute__
+# if __GNUC__ < 3
+# define __attribute__(x)
+# endif
+#endif
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+#include <errno.h>
+
+#include <signal.h>
+#if ! HAVE_STACK_T && ! defined stack_t
+typedef struct sigaltstack stack_t;
+#endif
+#ifndef SIGSTKSZ
+# define SIGSTKSZ 16384
+#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
+/* libsigsegv 2.6 through 2.8 have a bug where some architectures use
+ more than the Linux default of an 8k alternate stack when deciding
+ if a fault was caused by stack overflow. */
+# undef SIGSTKSZ
+# define SIGSTKSZ 16384
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+/* Posix 2001 declares ucontext_t in <ucontext.h>, Posix 200x in
+ <signal.h>. */
+#if HAVE_UCONTEXT_H
+# include <ucontext.h>
+#endif
+
+#include <unistd.h>
+
+#if HAVE_LIBSIGSEGV
+# include <sigsegv.h>
+#endif
+
+#include "c-stack.h"
+#include "exitfail.h"
+#include "ignore-value.h"
+
+#if defined SA_ONSTACK && defined SA_SIGINFO
+# define SIGINFO_WORKS 1
+#else
+# define SIGINFO_WORKS 0
+# ifndef SA_ONSTACK
+# define SA_ONSTACK 0
+# endif
+#endif
+
+extern char *program_name;
+
+/* The user-specified action to take when a SEGV-related program error
+ or stack overflow occurs. */
+static void (* volatile segv_action) (int);
+
+/* Translated messages for program errors and stack overflow. Do not
+ translate them in the signal handler, since gettext is not
+ async-signal-safe. */
+static char const * volatile program_error_message;
+static char const * volatile stack_overflow_message;
+
+/* Output an error message, then exit with status EXIT_FAILURE if it
+ appears to have been a stack overflow, or with a core dump
+ otherwise. This function is async-signal-safe. */
+
+static _Noreturn void
+die (int signo)
+{
+ char const *message;
+#if !SIGINFO_WORKS && !HAVE_LIBSIGSEGV
+ /* We can't easily determine whether it is a stack overflow; so
+ assume that the rest of our program is perfect (!) and that
+ this segmentation violation is a stack overflow. */
+ signo = 0;
+#endif /* !SIGINFO_WORKS && !HAVE_LIBSIGSEGV */
+ segv_action (signo);
+ message = signo ? program_error_message : stack_overflow_message;
+ ignore_value (write (STDERR_FILENO, program_name, strlen (program_name)));
+ ignore_value (write (STDERR_FILENO, ": ", 2));
+ ignore_value (write (STDERR_FILENO, message, strlen (message)));
+ ignore_value (write (STDERR_FILENO, "\n", 1));
+ if (! signo)
+ _exit (exit_failure);
+ raise (signo);
+ abort ();
+}
+
+#if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \
+ && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV
+
+/* Storage for the alternate signal stack. */
+static union
+{
+ char buffer[SIGSTKSZ];
+
+ /* These other members are for proper alignment. There's no
+ standard way to guarantee stack alignment, but this seems enough
+ in practice. */
+ long double ld;
+ long l;
+ void *p;
+} alternate_signal_stack;
+
+static void
+null_action (int signo __attribute__ ((unused)))
+{
+}
+
+#endif /* SIGALTSTACK || LIBSIGSEGV */
+
+/* Only use libsigsegv if we need it; platforms like Solaris can
+ detect stack overflow without the overhead of an external
+ library. */
+#if HAVE_LIBSIGSEGV && ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC
+
+/* Nonzero if general segv handler could not be installed. */
+static volatile int segv_handler_missing;
+
+/* Handle a segmentation violation and exit if it cannot be stack
+ overflow. This function is async-signal-safe. */
+
+static int segv_handler (void *address __attribute__ ((unused)),
+ int serious)
+{
+# if DEBUG
+ {
+ char buf[1024];
+ sprintf (buf, "segv_handler serious=%d\n", serious);
+ write (STDERR_FILENO, buf, strlen (buf));
+ }
+# endif
+
+ /* If this fault is not serious, return 0 to let the stack overflow
+ handler take a shot at it. */
+ if (!serious)
+ return 0;
+ die (SIGSEGV);
+}
+
+/* Handle a segmentation violation that is likely to be a stack
+ overflow and exit. This function is async-signal-safe. */
+
+static _Noreturn void
+overflow_handler (int emergency,
+ stackoverflow_context_t context __attribute__ ((unused)))
+{
+# if DEBUG
+ {
+ char buf[1024];
+ sprintf (buf, "overflow_handler emergency=%d segv_handler_missing=%d\n",
+ emergency, segv_handler_missing);
+ write (STDERR_FILENO, buf, strlen (buf));
+ }
+# endif
+
+ die ((!emergency || segv_handler_missing) ? 0 : SIGSEGV);
+}
+
+int
+c_stack_action (void (*action) (int))
+{
+ segv_action = action ? action : null_action;
+ program_error_message = _("program error");
+ stack_overflow_message = _("stack overflow");
+
+ /* Always install the overflow handler. */
+ if (stackoverflow_install_handler (overflow_handler,
+ alternate_signal_stack.buffer,
+ sizeof alternate_signal_stack.buffer))
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
+ /* Try installing a general handler; if it fails, then treat all
+ segv as stack overflow. */
+ segv_handler_missing = sigsegv_install_handler (segv_handler);
+ return 0;
+}
+
+#elif HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING
+
+# if SIGINFO_WORKS
+
+/* Handle a segmentation violation and exit. This function is
+ async-signal-safe. */
+
+static _Noreturn void
+segv_handler (int signo, siginfo_t *info,
+ void *context __attribute__ ((unused)))
+{
+ /* Clear SIGNO if it seems to have been a stack overflow. */
+# if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC
+ /* We can't easily determine whether it is a stack overflow; so
+ assume that the rest of our program is perfect (!) and that
+ this segmentation violation is a stack overflow.
+
+ Note that although both Linux and Solaris provide
+ sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only
+ Solaris satisfies the XSI heuristic. This is because
+ Solaris populates uc_stack with the details of the
+ interrupted stack, while Linux populates it with the details
+ of the current stack. */
+ signo = 0;
+# else
+ if (0 < info->si_code)
+ {
+ /* If the faulting address is within the stack, or within one
+ page of the stack, assume that it is a stack overflow. */
+ ucontext_t const *user_context = context;
+ char const *stack_base = user_context->uc_stack.ss_sp;
+ size_t stack_size = user_context->uc_stack.ss_size;
+ char const *faulting_address = info->si_addr;
+ size_t page_size = sysconf (_SC_PAGESIZE);
+ size_t s = faulting_address - stack_base + page_size;
+ if (s < stack_size + 2 * page_size)
+ signo = 0;
+
+# if DEBUG
+ {
+ char buf[1024];
+ sprintf (buf,
+ "segv_handler fault=%p base=%p size=%lx page=%lx signo=%d\n",
+ faulting_address, stack_base, (unsigned long) stack_size,
+ (unsigned long) page_size, signo);
+ write (STDERR_FILENO, buf, strlen (buf));
+ }
+# endif
+ }
+# endif
+
+ die (signo);
+}
+# endif
+
+int
+c_stack_action (void (*action) (int))
+{
+ int r;
+ stack_t st;
+ struct sigaction act;
+ st.ss_flags = 0;
+# if SIGALTSTACK_SS_REVERSED
+ /* Irix mistakenly treats ss_sp as the upper bound, rather than
+ lower bound, of the alternate stack. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *);
+ st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *);
+# else
+ st.ss_sp = alternate_signal_stack.buffer;
+ st.ss_size = sizeof alternate_signal_stack.buffer;
+# endif
+ r = sigaltstack (&st, NULL);
+ if (r != 0)
+ return r;
+
+ segv_action = action ? action : null_action;
+ program_error_message = _("program error");
+ stack_overflow_message = _("stack overflow");
+
+ sigemptyset (&act.sa_mask);
+
+# if SIGINFO_WORKS
+ /* POSIX 1003.1-2001 says SA_RESETHAND implies SA_NODEFER, but
+ this is not true on Solaris 8 at least. It doesn't hurt to use
+ SA_NODEFER here, so leave it in. */
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
+ act.sa_sigaction = segv_handler;
+# else
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
+ act.sa_handler = die;
+# endif
+
+# if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, NULL) < 0)
+ return -1;
+# endif
+ return sigaction (SIGSEGV, &act, NULL);
+}
+
+#else /* ! ((HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK
+ && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV) */
+
+int
+c_stack_action (void (*action) (int) __attribute__ ((unused)))
+{
+ errno = ENOTSUP;
+ return -1;
+}
+
+#endif
diff --git a/lib/c-stack.h b/lib/c-stack.h
new file mode 100644
index 0000000..efd3b8f
--- /dev/null
+++ b/lib/c-stack.h
@@ -0,0 +1,44 @@
+/* Stack overflow handling.
+
+ Copyright (C) 2002, 2004, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* Set up ACTION so that it is invoked on C stack overflow and on other,
+ stack-unrelated, segmentation violation.
+ Return -1 (setting errno) if this cannot be done.
+
+ When a stack overflow or segmentation violation occurs:
+ 1) ACTION is called. It is passed an argument equal to
+ - 0, for a stack overflow,
+ - SIGSEGV, for a segmentation violation that does not appear related
+ to stack overflow.
+ On many platforms the two cases are hard to distinguish; when in doubt,
+ zero is passed.
+ 2) If ACTION returns, a message is written to standard error, and the
+ program is terminated: in the case of stack overflow, with exit code
+ exit_failure (see "exitfail.h"), otherwise through a signal SIGSEGV.
+
+ A null ACTION acts like an action that does nothing.
+
+ ACTION must be async-signal-safe. ACTION together with its callees
+ must not require more than SIGSTKSZ bytes of stack space. Also,
+ ACTION should not call longjmp, because this implementation does
+ not guarantee that it is safe to return to the original stack.
+
+ This function may install a handler for the SIGSEGV signal or for the SIGBUS
+ signal or exercise other system dependent exception handling APIs. */
+
+extern int c_stack_action (void (* /*action*/) (int));
diff --git a/lib/c-strcase.h b/lib/c-strcase.h
new file mode 100644
index 0000000..7e570f5
--- /dev/null
+++ b/lib/c-strcase.h
@@ -0,0 +1,56 @@
+/* Case-insensitive string comparison functions in C locale.
+ Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef C_STRCASE_H
+#define C_STRCASE_H
+
+#include <stddef.h>
+
+
+/* The functions defined in this file assume the "C" locale and a character
+ set without diacritics (ASCII-US or EBCDIC-US or something like that).
+ Even if the "C" locale on a particular system is an extension of the ASCII
+ character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
+ is ISO-8859-1), the functions in this file recognize only the ASCII
+ characters. More precisely, one of the string arguments must be an ASCII
+ string; the other one can also contain non-ASCII characters (but then
+ the comparison result will be nonzero). */
+
+
+#ifdef __cplusplus
+extern "C" {
+#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. */
+extern int c_strcasecmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE;
+
+/* Compare no more than N characters 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. */
+extern int c_strncasecmp (const char *s1, const char *s2, size_t n)
+ _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* C_STRCASE_H */
diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c
new file mode 100644
index 0000000..bd113b7
--- /dev/null
+++ b/lib/c-strcasecmp.c
@@ -0,0 +1,56 @@
+/* c-strcasecmp.c -- case insensitive string comparator in C locale
+ Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "c-strcase.h"
+
+#include <limits.h>
+
+#include "c-ctype.h"
+
+int
+c_strcasecmp (const char *s1, const char *s2)
+{
+ 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)
+ return 0;
+
+ do
+ {
+ c1 = c_tolower (*p1);
+ c2 = c_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 (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+}
diff --git a/lib/c-strcaseeq.h b/lib/c-strcaseeq.h
new file mode 100644
index 0000000..ed57251
--- /dev/null
+++ b/lib/c-strcaseeq.h
@@ -0,0 +1,181 @@
+/* Optimized case-insensitive string comparison in C locale.
+ Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#include "c-strcase.h"
+#include "c-ctype.h"
+
+/* STRCASEEQ allows to optimize string comparison with a small literal string.
+ STRCASEEQ (s, "UTF-8", 'U','T','F','-','8',0,0,0,0)
+ is semantically equivalent to
+ c_strcasecmp (s, "UTF-8") == 0
+ just faster. */
+
+/* Help GCC to generate good code for string comparisons with
+ immediate strings. */
+#if defined (__GNUC__) && defined (__OPTIMIZE__)
+
+/* Case insensitive comparison of ASCII characters. */
+# if C_CTYPE_ASCII
+# define CASEEQ(other,upper) \
+ (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
+# else
+# define CASEEQ(other,upper) \
+ (c_toupper (other) == (upper))
+# endif
+
+static inline int
+strcaseeq9 (const char *s1, const char *s2)
+{
+ return c_strcasecmp (s1 + 9, s2 + 9) == 0;
+}
+
+static inline int
+strcaseeq8 (const char *s1, const char *s2, char s28)
+{
+ if (CASEEQ (s1[8], s28))
+ {
+ if (s28 == 0)
+ return 1;
+ else
+ return strcaseeq9 (s1, s2);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq7 (const char *s1, const char *s2, char s27, char s28)
+{
+ if (CASEEQ (s1[7], s27))
+ {
+ if (s27 == 0)
+ return 1;
+ else
+ return strcaseeq8 (s1, s2, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq6 (const char *s1, const char *s2, char s26, char s27, char s28)
+{
+ if (CASEEQ (s1[6], s26))
+ {
+ if (s26 == 0)
+ return 1;
+ else
+ return strcaseeq7 (s1, s2, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28)
+{
+ if (CASEEQ (s1[5], s25))
+ {
+ if (s25 == 0)
+ return 1;
+ else
+ return strcaseeq6 (s1, s2, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28)
+{
+ if (CASEEQ (s1[4], s24))
+ {
+ if (s24 == 0)
+ return 1;
+ else
+ return strcaseeq5 (s1, s2, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (CASEEQ (s1[3], s23))
+ {
+ if (s23 == 0)
+ return 1;
+ else
+ return strcaseeq4 (s1, s2, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (CASEEQ (s1[2], s22))
+ {
+ if (s22 == 0)
+ return 1;
+ else
+ return strcaseeq3 (s1, s2, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (CASEEQ (s1[1], s21))
+ {
+ if (s21 == 0)
+ return 1;
+ else
+ return strcaseeq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+strcaseeq0 (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 (CASEEQ (s1[0], s20))
+ {
+ if (s20 == 0)
+ return 1;
+ else
+ return strcaseeq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+#define STRCASEEQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+ strcaseeq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
+
+#else
+
+#define STRCASEEQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+ (c_strcasecmp (s1, s2) == 0)
+
+#endif
diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c
new file mode 100644
index 0000000..c316929
--- /dev/null
+++ b/lib/c-strncasecmp.c
@@ -0,0 +1,56 @@
+/* c-strncasecmp.c -- case insensitive string comparator in C locale
+ Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "c-strcase.h"
+
+#include <limits.h>
+
+#include "c-ctype.h"
+
+int
+c_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 = c_tolower (*p1);
+ c2 = c_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 (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+}
diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c
new file mode 100644
index 0000000..4180de9
--- /dev/null
+++ b/lib/careadlinkat.c
@@ -0,0 +1,160 @@
+/* Read symbolic links into a buffer without size limitation, relative to fd.
+
+ Copyright (C) 2001, 2003-2004, 2007, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
+
+#include <config.h>
+
+#include "careadlinkat.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+
+/* Define this independently so that stdint.h is not a prerequisite. */
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#endif
+
+#include "allocator.h"
+
+/* Assuming the current directory is FD, get the symbolic link value
+ of FILENAME as a null-terminated string and put it into a buffer.
+ If FD is AT_FDCWD, FILENAME is interpreted relative to the current
+ working directory, as in openat.
+
+ If the link is small enough to fit into BUFFER put it there.
+ BUFFER's size is BUFFER_SIZE, and BUFFER can be null
+ if BUFFER_SIZE is zero.
+
+ If the link is not small, put it into a dynamically allocated
+ buffer managed by ALLOC. It is the caller's responsibility to free
+ the returned value if it is nonnull and is not BUFFER. A null
+ ALLOC stands for the standard allocator.
+
+ The PREADLINKAT function specifies how to read links. It operates
+ like POSIX readlinkat()
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>
+ but can assume that its first argument is the same as FD.
+
+ If successful, return the buffer address; otherwise return NULL and
+ set errno. */
+
+char *
+careadlinkat (int fd, char const *filename,
+ char *buffer, size_t buffer_size,
+ struct allocator const *alloc,
+ ssize_t (*preadlinkat) (int, char const *, char *, size_t))
+{
+ char *buf;
+ size_t buf_size;
+ size_t buf_size_max =
+ SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
+ char stack_buf[1024];
+
+ if (! alloc)
+ alloc = &stdlib_allocator;
+
+ if (! buffer_size)
+ {
+ /* Allocate the initial buffer on the stack. This way, in the
+ common case of a symlink of small size, we get away with a
+ single small malloc() instead of a big malloc() followed by a
+ shrinking realloc(). */
+ buffer = stack_buf;
+ buffer_size = sizeof stack_buf;
+ }
+
+ buf = buffer;
+ buf_size = buffer_size;
+
+ do
+ {
+ /* Attempt to read the link into the current buffer. */
+ ssize_t link_length = preadlinkat (fd, filename, buf, buf_size);
+ size_t link_size;
+ if (link_length < 0)
+ {
+ /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1
+ with errno == ERANGE if the buffer is too small. */
+ int readlinkat_errno = errno;
+ if (readlinkat_errno != ERANGE)
+ {
+ if (buf != buffer)
+ {
+ alloc->free (buf);
+ errno = readlinkat_errno;
+ }
+ return NULL;
+ }
+ }
+
+ link_size = link_length;
+
+ if (link_size < buf_size)
+ {
+ buf[link_size++] = '\0';
+
+ if (buf == stack_buf)
+ {
+ char *b = (char *) alloc->allocate (link_size);
+ buf_size = link_size;
+ if (! b)
+ break;
+ memcpy (b, buf, link_size);
+ buf = b;
+ }
+ else if (link_size < buf_size && buf != buffer && alloc->reallocate)
+ {
+ /* Shrink BUF before returning it. */
+ char *b = (char *) alloc->reallocate (buf, link_size);
+ if (b)
+ buf = b;
+ }
+
+ return buf;
+ }
+
+ if (buf != buffer)
+ alloc->free (buf);
+
+ if (buf_size <= buf_size_max / 2)
+ buf_size *= 2;
+ else if (buf_size < buf_size_max)
+ buf_size = buf_size_max;
+ else if (buf_size_max < SIZE_MAX)
+ {
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
+ else
+ break;
+ buf = (char *) alloc->allocate (buf_size);
+ }
+ while (buf);
+
+ if (alloc->die)
+ alloc->die (buf_size);
+ errno = ENOMEM;
+ return NULL;
+}
diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h
new file mode 100644
index 0000000..84ede3e
--- /dev/null
+++ b/lib/careadlinkat.h
@@ -0,0 +1,67 @@
+/* Read symbolic links into a buffer without size limitation, relative to fd.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
+
+#ifndef _GL_CAREADLINKAT_H
+#define _GL_CAREADLINKAT_H
+
+#include <fcntl.h>
+#include <unistd.h>
+
+struct allocator;
+
+/* Assuming the current directory is FD, get the symbolic link value
+ of FILENAME as a null-terminated string and put it into a buffer.
+ If FD is AT_FDCWD, FILENAME is interpreted relative to the current
+ working directory, as in openat.
+
+ If the link is small enough to fit into BUFFER put it there.
+ BUFFER's size is BUFFER_SIZE, and BUFFER can be null
+ if BUFFER_SIZE is zero.
+
+ If the link is not small, put it into a dynamically allocated
+ buffer managed by ALLOC. It is the caller's responsibility to free
+ the returned value if it is nonnull and is not BUFFER.
+
+ The PREADLINKAT function specifies how to read links. It operates
+ like POSIX readlinkat()
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>
+ but can assume that its first argument is the same as FD.
+
+ If successful, return the buffer address; otherwise return NULL and
+ set errno. */
+
+char *careadlinkat (int fd, char const *filename,
+ char *buffer, size_t buffer_size,
+ struct allocator const *alloc,
+ ssize_t (*preadlinkat) (int, char const *,
+ char *, size_t));
+
+/* Suitable value for careadlinkat's FD argument. */
+#if HAVE_READLINKAT
+/* AT_FDCWD is declared in <fcntl.h>. */
+#else
+/* Define AT_FDCWD independently, so that the careadlinkat module does
+ not depend on the fcntl-h module. We might as well use the same value
+ as fcntl-h. */
+# ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+# endif
+#endif
+
+#endif /* _GL_CAREADLINKAT_H */
diff --git a/lib/close.c b/lib/close.c
new file mode 100644
index 0000000..46a7aa5
--- /dev/null
+++ b/lib/close.c
@@ -0,0 +1,69 @@
+/* close replacement.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+
+#include "fd-hook.h"
+#include "msvc-inval.h"
+
+#undef close
+
+#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
+
+/* 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/lib/cmpbuf.c b/lib/cmpbuf.c
new file mode 100644
index 0000000..fd34505
--- /dev/null
+++ b/lib/cmpbuf.c
@@ -0,0 +1,109 @@
+/* Buffer primitives for comparison operations.
+
+ Copyright (C) 1993, 1995, 1998, 2001-2002, 2006, 2009-2013, 2015-2016 Free
+ Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <signal.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include "cmpbuf.h"
+#include "intprops.h"
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX TYPE_MAXIMUM (ssize_t)
+#endif
+
+#undef MIN
+#define MIN(a, b) ((a) <= (b) ? (a) : (b))
+
+/* Read NBYTES bytes from descriptor FD into BUF.
+ NBYTES must not be SIZE_MAX.
+ Return the number of characters successfully read.
+ On error, return SIZE_MAX, setting errno.
+ The number returned is always NBYTES unless end-of-file or error. */
+
+size_t
+block_read (int fd, char *buf, size_t nbytes)
+{
+ char *bp = buf;
+ char const *buflim = buf + nbytes;
+ size_t readlim = MIN (SSIZE_MAX, SIZE_MAX);
+
+ do
+ {
+ size_t bytes_remaining = buflim - bp;
+ size_t bytes_to_read = MIN (bytes_remaining, readlim);
+ ssize_t nread = read (fd, bp, bytes_to_read);
+ if (nread <= 0)
+ {
+ if (nread == 0)
+ break;
+
+ /* Accommodate Tru64 5.1, which can't read more than INT_MAX
+ bytes at a time. They call that a 64-bit OS? */
+ if (errno == EINVAL && INT_MAX < bytes_to_read)
+ {
+ readlim = INT_MAX;
+ continue;
+ }
+
+ /* This is needed for programs that have signal handlers on
+ older hosts without SA_RESTART. It also accommodates
+ ancient AIX hosts that set errno to EINTR after uncaught
+ SIGCONT. See <news:1r77ojINN85n@ftp.UU.NET>
+ (1993-04-22). */
+ if (! SA_RESTART && errno == EINTR)
+ continue;
+
+ return SIZE_MAX;
+ }
+ bp += nread;
+ }
+ while (bp < buflim);
+
+ return bp - buf;
+}
+
+/* Least common multiple of two buffer sizes A and B. However, if
+ either A or B is zero, or if the multiple is greater than LCM_MAX,
+ return a reasonable buffer size. */
+
+size_t
+buffer_lcm (size_t a, size_t b, size_t lcm_max)
+{
+ size_t lcm, m, n, q, r;
+
+ /* Yield reasonable values if buffer sizes are zero. */
+ if (!a)
+ return b ? b : 8 * 1024;
+ if (!b)
+ return a;
+
+ /* n = gcd (a, b) */
+ for (m = a, n = b; (r = m % n) != 0; m = n, n = r)
+ continue;
+
+ /* Yield a if there is an overflow. */
+ q = a / n;
+ lcm = q * b;
+ return lcm <= lcm_max && lcm / b == q ? lcm : a;
+}
diff --git a/lib/cmpbuf.h b/lib/cmpbuf.h
new file mode 100644
index 0000000..b9333d8
--- /dev/null
+++ b/lib/cmpbuf.h
@@ -0,0 +1,19 @@
+/* Buffer primitives for comparison operations.
+
+ Copyright (C) 2002, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t block_read (int, char *, size_t);
+size_t buffer_lcm (size_t, size_t, size_t) _GL_ATTRIBUTE_CONST;
diff --git a/lib/config.charset b/lib/config.charset
new file mode 100644
index 0000000..947d916
--- /dev/null
+++ b/lib/config.charset
@@ -0,0 +1,682 @@
+#! /bin/sh
+# Output a system dependent table of character encoding aliases.
+#
+# Copyright (C) 2000-2004, 2006-2016 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# The table consists of lines of the form
+# ALIAS CANONICAL
+#
+# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
+# ALIAS is compared in a case sensitive way.
+#
+# CANONICAL is the GNU canonical name for this character encoding.
+# It must be an encoding supported by libiconv. Support by GNU libc is
+# also desirable. CANONICAL is case insensitive. Usually an upper case
+# MIME charset name is preferred.
+# The current list of GNU canonical charset names is as follows.
+#
+# name MIME? used by which systems
+# (darwin = Mac OS X, woe32 = native Windows)
+#
+# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
+# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-3 Y glibc solaris cygwin
+# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin
+# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-6 Y glibc aix hpux solaris cygwin
+# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
+# ISO-8859-8 Y glibc aix hpux osf solaris cygwin
+# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin
+# ISO-8859-13 glibc netbsd openbsd darwin cygwin
+# ISO-8859-14 glibc cygwin
+# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
+# KOI8-R Y glibc 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 woe32 dos
+# CP922 aix
+# CP932 aix cygwin woe32 dos
+# CP943 aix
+# CP949 osf darwin woe32 dos
+# CP950 woe32 dos
+# CP1046 aix
+# CP1124 aix
+# CP1125 dos
+# CP1129 aix
+# CP1131 darwin
+# CP1250 woe32
+# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32
+# CP1252 aix woe32
+# CP1253 woe32
+# CP1254 woe32
+# CP1255 glibc woe32
+# CP1256 woe32
+# CP1257 woe32
+# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
+# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
+# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
+# EUC-TW glibc aix hpux irix osf solaris netbsd
+# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin
+# BIG5-HKSCS glibc solaris darwin
+# GBK glibc aix osf solaris darwin cygwin woe32 dos
+# GB18030 glibc solaris netbsd darwin
+# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
+# JOHAB glibc solaris woe32
+# TIS-620 glibc aix hpux osf solaris cygwin
+# VISCII Y glibc
+# TCVN5712-1 glibc
+# ARMSCII-8 glibc darwin
+# GEORGIAN-PS glibc cygwin
+# PT154 glibc
+# 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
+#
+# 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.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+
+host="$1"
+os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
+echo "# This file contains a table of character encoding aliases,"
+echo "# suitable for operating system '${os}'."
+echo "# It was automatically generated from config.charset."
+# List of references, updated during installation:
+echo "# Packages using this file: "
+case "$os" in
+ linux-gnulibc1*)
+ # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ echo "POSIX ASCII"
+ for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
+ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
+ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
+ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
+ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
+ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
+ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
+ sv_FI sv_SE; do
+ echo "$l ISO-8859-1"
+ echo "$l.iso-8859-1 ISO-8859-1"
+ echo "$l.iso-8859-15 ISO-8859-15"
+ echo "$l.iso-8859-15@euro ISO-8859-15"
+ echo "$l@euro ISO-8859-15"
+ echo "$l.cp-437 CP437"
+ echo "$l.cp-850 CP850"
+ echo "$l.cp-1252 CP1252"
+ echo "$l.cp-1252@euro CP1252"
+ #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
+ echo "$l.utf-8 UTF-8"
+ echo "$l.utf-8@euro UTF-8"
+ done
+ for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
+ sl_SI sr sr_CS sr_YU; do
+ echo "$l ISO-8859-2"
+ echo "$l.iso-8859-2 ISO-8859-2"
+ echo "$l.cp-852 CP852"
+ echo "$l.cp-1250 CP1250"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in mk mk_MK ru ru_RU; do
+ echo "$l ISO-8859-5"
+ echo "$l.iso-8859-5 ISO-8859-5"
+ echo "$l.koi8-r KOI8-R"
+ echo "$l.cp-866 CP866"
+ echo "$l.cp-1251 CP1251"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in ar ar_SA; do
+ echo "$l ISO-8859-6"
+ echo "$l.iso-8859-6 ISO-8859-6"
+ echo "$l.cp-864 CP864"
+ #echo "$l.cp-868 CP868" # not a commonly used encoding
+ echo "$l.cp-1256 CP1256"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in el el_GR gr gr_GR; do
+ echo "$l ISO-8859-7"
+ echo "$l.iso-8859-7 ISO-8859-7"
+ echo "$l.cp-869 CP869"
+ echo "$l.cp-1253 CP1253"
+ echo "$l.cp-1253@euro CP1253"
+ echo "$l.utf-8 UTF-8"
+ echo "$l.utf-8@euro UTF-8"
+ done
+ for l in he he_IL iw iw_IL; do
+ echo "$l ISO-8859-8"
+ echo "$l.iso-8859-8 ISO-8859-8"
+ echo "$l.cp-862 CP862"
+ echo "$l.cp-1255 CP1255"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in tr tr_TR; do
+ echo "$l ISO-8859-9"
+ echo "$l.iso-8859-9 ISO-8859-9"
+ echo "$l.cp-857 CP857"
+ echo "$l.cp-1254 CP1254"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in lt lt_LT lv lv_LV; do
+ #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
+ echo "$l ISO-8859-13"
+ done
+ for l in ru_UA uk uk_UA; do
+ echo "$l KOI8-U"
+ done
+ for l in zh zh_CN; do
+ #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
+ echo "$l GB2312"
+ done
+ for l in ja ja_JP ja_JP.EUC; do
+ echo "$l EUC-JP"
+ done
+ for l in ko ko_KR; do
+ echo "$l EUC-KR"
+ done
+ for l in th th_TH; do
+ echo "$l TIS-620"
+ done
+ for l in fa fa_IR; do
+ #echo "$l ISIRI-3342" # a broken encoding
+ echo "$l.utf-8 UTF-8"
+ done
+ ;;
+ linux* | *-gnu*)
+ # 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. Therefore, the Makefile does not
+ # need to install the alias file at all.
+ # The following applies only to glibc-2.0.x and older libcs.
+ echo "ISO_646.IRV:1983 ASCII"
+ ;;
+ aix*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-6 ISO-8859-6"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "IBM-850 CP850"
+ echo "IBM-856 CP856"
+ echo "IBM-921 ISO-8859-13"
+ echo "IBM-922 CP922"
+ echo "IBM-932 CP932"
+ echo "IBM-943 CP943"
+ echo "IBM-1046 CP1046"
+ echo "IBM-1124 CP1124"
+ echo "IBM-1129 CP1129"
+ echo "IBM-1252 CP1252"
+ echo "IBM-eucCN GB2312"
+ echo "IBM-eucJP EUC-JP"
+ echo "IBM-eucKR EUC-KR"
+ echo "IBM-eucTW EUC-TW"
+ echo "big5 BIG5"
+ echo "GBK GBK"
+ echo "TIS-620 TIS-620"
+ echo "UTF-8 UTF-8"
+ ;;
+ hpux*)
+ echo "iso88591 ISO-8859-1"
+ echo "iso88592 ISO-8859-2"
+ echo "iso88595 ISO-8859-5"
+ echo "iso88596 ISO-8859-6"
+ echo "iso88597 ISO-8859-7"
+ echo "iso88598 ISO-8859-8"
+ echo "iso88599 ISO-8859-9"
+ echo "iso885915 ISO-8859-15"
+ echo "roman8 HP-ROMAN8"
+ echo "arabic8 HP-ARABIC8"
+ echo "greek8 HP-GREEK8"
+ echo "hebrew8 HP-HEBREW8"
+ echo "turkish8 HP-TURKISH8"
+ echo "kana8 HP-KANA8"
+ echo "tis620 TIS-620"
+ echo "big5 BIG5"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "hp15CN GB2312"
+ #echo "ccdc ?" # what is this?
+ echo "SJIS SHIFT_JIS"
+ echo "utf8 UTF-8"
+ ;;
+ irix*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "eucCN GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ ;;
+ osf*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "cp850 CP850"
+ echo "big5 BIG5"
+ echo "dechanyu DEC-HANYU"
+ echo "dechanzi GB2312"
+ echo "deckanji DEC-KANJI"
+ echo "deckorean EUC-KR"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "GBK GBK"
+ echo "KSC5601 CP949"
+ echo "sdeckanji EUC-JP"
+ echo "SJIS SHIFT_JIS"
+ echo "TACTIS TIS-620"
+ echo "UTF-8 UTF-8"
+ ;;
+ solaris*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-3 ISO-8859-3"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-6 ISO-8859-6"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "koi8-r KOI8-R"
+ echo "ansi-1251 CP1251"
+ echo "BIG5 BIG5"
+ echo "Big5-HKSCS BIG5-HKSCS"
+ echo "gb2312 GB2312"
+ echo "GBK GBK"
+ echo "GB18030 GB18030"
+ echo "cns11643 EUC-TW"
+ echo "5601 EUC-KR"
+ echo "ko_KR.johap92 JOHAB"
+ echo "eucJP EUC-JP"
+ echo "PCK SHIFT_JIS"
+ echo "TIS620.2533 TIS-620"
+ #echo "sun_eu_greek ?" # what is this?
+ echo "UTF-8 UTF-8"
+ ;;
+ freebsd*)
+ # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ echo "US-ASCII ASCII"
+ for l in la_LN lt_LN; do
+ echo "$l.ASCII ASCII"
+ done
+ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
+ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
+ echo "$l.ISO_8859-1 ISO-8859-1"
+ echo "$l.DIS_8859-15 ISO-8859-15"
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
+ echo "$l.ISO_8859-2 ISO-8859-2"
+ done
+ for l in la_LN lt_LT; do
+ echo "$l.ISO_8859-4 ISO-8859-4"
+ done
+ for l in ru_RU ru_SU; do
+ echo "$l.KOI8-R KOI8-R"
+ echo "$l.ISO_8859-5 ISO-8859-5"
+ echo "$l.CP866 CP866"
+ done
+ echo "uk_UA.KOI8-U KOI8-U"
+ echo "zh_TW.BIG5 BIG5"
+ echo "zh_TW.Big5 BIG5"
+ echo "zh_CN.EUC GB2312"
+ echo "ja_JP.EUC EUC-JP"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ja_JP.Shift_JIS SHIFT_JIS"
+ echo "ko_KR.EUC EUC-KR"
+ ;;
+ netbsd*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-13 ISO-8859-13"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "eucCN GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "BIG5 BIG5"
+ echo "SJIS SHIFT_JIS"
+ ;;
+ openbsd*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-13 ISO-8859-13"
+ echo "ISO8859-15 ISO-8859-15"
+ ;;
+ darwin[56]*)
+ # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ for l in en_AU en_CA en_GB en_US la_LN; do
+ echo "$l.US-ASCII ASCII"
+ done
+ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
+ nl_NL no_NO pt_PT sv_SE; do
+ echo "$l ISO-8859-1"
+ echo "$l.ISO8859-1 ISO-8859-1"
+ echo "$l.ISO8859-15 ISO-8859-15"
+ done
+ for l in la_LN; do
+ echo "$l.ISO8859-1 ISO-8859-1"
+ echo "$l.ISO8859-15 ISO-8859-15"
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
+ echo "$l.ISO8859-2 ISO-8859-2"
+ done
+ for l in la_LN lt_LT; do
+ echo "$l.ISO8859-4 ISO-8859-4"
+ done
+ for l in ru_RU; do
+ echo "$l.KOI8-R KOI8-R"
+ echo "$l.ISO8859-5 ISO-8859-5"
+ echo "$l.CP866 CP866"
+ done
+ for l in bg_BG; do
+ echo "$l.CP1251 CP1251"
+ done
+ echo "uk_UA.KOI8-U KOI8-U"
+ echo "zh_TW.BIG5 BIG5"
+ echo "zh_TW.Big5 BIG5"
+ echo "zh_CN.EUC GB2312"
+ echo "ja_JP.EUC EUC-JP"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ko_KR.EUC EUC-KR"
+ ;;
+ darwin*)
+ # 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.
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-13 ISO-8859-13"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "KOI8-R KOI8-R"
+ echo "KOI8-U KOI8-U"
+ echo "CP866 CP866"
+ echo "CP949 CP949"
+ echo "CP1131 CP1131"
+ echo "CP1251 CP1251"
+ echo "eucCN GB2312"
+ echo "GB2312 GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "Big5 BIG5"
+ echo "Big5HKSCS BIG5-HKSCS"
+ echo "GBK GBK"
+ echo "GB18030 GB18030"
+ echo "SJIS SHIFT_JIS"
+ echo "ARMSCII-8 ARMSCII-8"
+ echo "PT154 PT154"
+ #echo "ISCII-DEV ?"
+ echo "* UTF-8"
+ ;;
+ beos* | haiku*)
+ # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
+ echo "* UTF-8"
+ ;;
+ msdosdjgpp*)
+ # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "#"
+ echo "# The encodings given here may not all be correct."
+ echo "# If you find that the encoding given for your language and"
+ echo "# country is not the one your DOS machine actually uses, just"
+ echo "# correct it in this file, and send a mail to"
+ echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
+ echo "# and Bruno Haible <bruno@clisp.org>."
+ echo "#"
+ echo "C ASCII"
+ # ISO-8859-1 languages
+ echo "ca CP850"
+ echo "ca_ES CP850"
+ echo "da CP865" # not CP850 ??
+ echo "da_DK CP865" # not CP850 ??
+ echo "de CP850"
+ echo "de_AT CP850"
+ echo "de_CH CP850"
+ echo "de_DE CP850"
+ echo "en CP850"
+ echo "en_AU CP850" # not CP437 ??
+ echo "en_CA CP850"
+ echo "en_GB CP850"
+ echo "en_NZ CP437"
+ echo "en_US CP437"
+ echo "en_ZA CP850" # not CP437 ??
+ echo "es CP850"
+ echo "es_AR CP850"
+ echo "es_BO CP850"
+ echo "es_CL CP850"
+ echo "es_CO CP850"
+ echo "es_CR CP850"
+ echo "es_CU CP850"
+ echo "es_DO CP850"
+ echo "es_EC CP850"
+ echo "es_ES CP850"
+ echo "es_GT CP850"
+ echo "es_HN CP850"
+ echo "es_MX CP850"
+ echo "es_NI CP850"
+ echo "es_PA CP850"
+ echo "es_PY CP850"
+ echo "es_PE CP850"
+ echo "es_SV CP850"
+ echo "es_UY CP850"
+ echo "es_VE CP850"
+ echo "et CP850"
+ echo "et_EE CP850"
+ echo "eu CP850"
+ echo "eu_ES CP850"
+ echo "fi CP850"
+ echo "fi_FI CP850"
+ echo "fr CP850"
+ echo "fr_BE CP850"
+ echo "fr_CA CP850"
+ echo "fr_CH CP850"
+ echo "fr_FR CP850"
+ echo "ga CP850"
+ echo "ga_IE CP850"
+ echo "gd CP850"
+ echo "gd_GB CP850"
+ echo "gl CP850"
+ echo "gl_ES CP850"
+ echo "id CP850" # not CP437 ??
+ echo "id_ID CP850" # not CP437 ??
+ echo "is CP861" # not CP850 ??
+ echo "is_IS CP861" # not CP850 ??
+ echo "it CP850"
+ echo "it_CH CP850"
+ echo "it_IT CP850"
+ echo "lt CP775"
+ echo "lt_LT CP775"
+ echo "lv CP775"
+ echo "lv_LV CP775"
+ echo "nb CP865" # not CP850 ??
+ echo "nb_NO CP865" # not CP850 ??
+ echo "nl CP850"
+ echo "nl_BE CP850"
+ echo "nl_NL CP850"
+ echo "nn CP865" # not CP850 ??
+ echo "nn_NO CP865" # not CP850 ??
+ echo "no CP865" # not CP850 ??
+ echo "no_NO CP865" # not CP850 ??
+ echo "pt CP850"
+ echo "pt_BR CP850"
+ echo "pt_PT CP850"
+ echo "sv CP850"
+ echo "sv_SE CP850"
+ # ISO-8859-2 languages
+ echo "cs CP852"
+ echo "cs_CZ CP852"
+ echo "hr CP852"
+ echo "hr_HR CP852"
+ echo "hu CP852"
+ echo "hu_HU CP852"
+ echo "pl CP852"
+ echo "pl_PL CP852"
+ echo "ro CP852"
+ echo "ro_RO CP852"
+ echo "sk CP852"
+ echo "sk_SK CP852"
+ echo "sl CP852"
+ echo "sl_SI CP852"
+ echo "sq CP852"
+ echo "sq_AL CP852"
+ echo "sr CP852" # CP852 or CP866 or CP855 ??
+ echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
+ echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+ # ISO-8859-3 languages
+ echo "mt CP850"
+ echo "mt_MT CP850"
+ # ISO-8859-5 languages
+ echo "be CP866"
+ echo "be_BE CP866"
+ echo "bg CP866" # not CP855 ??
+ echo "bg_BG CP866" # not CP855 ??
+ echo "mk CP866" # not CP855 ??
+ echo "mk_MK CP866" # not CP855 ??
+ echo "ru CP866"
+ echo "ru_RU CP866"
+ echo "uk CP1125"
+ echo "uk_UA CP1125"
+ # ISO-8859-6 languages
+ echo "ar CP864"
+ echo "ar_AE CP864"
+ echo "ar_DZ CP864"
+ echo "ar_EG CP864"
+ echo "ar_IQ CP864"
+ echo "ar_IR CP864"
+ echo "ar_JO CP864"
+ echo "ar_KW CP864"
+ echo "ar_MA CP864"
+ echo "ar_OM CP864"
+ echo "ar_QA CP864"
+ echo "ar_SA CP864"
+ echo "ar_SY CP864"
+ # ISO-8859-7 languages
+ echo "el CP869"
+ echo "el_GR CP869"
+ # ISO-8859-8 languages
+ echo "he CP862"
+ echo "he_IL CP862"
+ # ISO-8859-9 languages
+ echo "tr CP857"
+ echo "tr_TR CP857"
+ # Japanese
+ echo "ja CP932"
+ echo "ja_JP CP932"
+ # Chinese
+ echo "zh_CN GBK"
+ echo "zh_TW CP950" # not CP938 ??
+ # Korean
+ echo "kr CP949" # not CP934 ??
+ echo "kr_KR CP949" # not CP934 ??
+ # Thai
+ echo "th CP874"
+ echo "th_TH CP874"
+ # Other
+ echo "eo CP850"
+ echo "eo_EO CP850"
+ ;;
+esac
diff --git a/lib/config.hin b/lib/config.hin
new file mode 100644
index 0000000..651da70
--- /dev/null
+++ b/lib/config.hin
@@ -0,0 +1,2257 @@
+/* lib/config.hin. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to the number of bits in type 'ptrdiff_t'. */
+#undef BITSIZEOF_PTRDIFF_T
+
+/* Define to the number of bits in type 'sig_atomic_t'. */
+#undef BITSIZEOF_SIG_ATOMIC_T
+
+/* Define to the number of bits in type 'size_t'. */
+#undef BITSIZEOF_SIZE_T
+
+/* Define to the number of bits in type 'wchar_t'. */
+#undef BITSIZEOF_WCHAR_T
+
+/* Define to the number of bits in type 'wint_t'. */
+#undef BITSIZEOF_WINT_T
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+#undef CLOSEDIR_VOID
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if the C locale may have encoding errors. */
+#undef C_LOCALE_MAYBE_EILSEQ
+
+/* Define as the bit index in the word where to find bit 0 of the exponent of
+ 'double'. */
+#undef DBL_EXPBIT0_BIT
+
+/* Define as the word index where to find the exponent of 'double'. */
+#undef DBL_EXPBIT0_WORD
+
+/* Name of editor program, unless overridden. */
+#undef DEFAULT_EDITOR_PROGRAM
+
+/* Define to 1 if // is a file system root distinct from /. */
+#undef DOUBLE_SLASH_IS_DISTINCT_ROOT
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* Define to 1 if an invalid memory address access may yield a SIGBUS. */
+#undef FAULT_YIELDS_SIGBUS
+
+/* Define this to 1 if F_DUPFD behavior does not match POSIX */
+#undef FCNTL_DUPFD_BUGGY
+
+/* 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; double
+ d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
+ compilers. When computing the size of such an object, don't use 'sizeof
+ (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
+ instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
+ MSVC and with C++ compilers. */
+#undef FLEXIBLE_ARRAY_MEMBER
+
+/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */
+#undef FUNC_NL_LANGINFO_YESEXPR_WORKS
+
+/* Define if gettimeofday clobbers the localtime buffer. */
+#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
+
+/* Define this to 'void' or 'struct timezone' to match the system's
+ declaration of the second argument to gettimeofday. */
+#undef GETTIMEOFDAY_TIMEZONE
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module dirname shall be considered present. */
+#undef GNULIB_DIRNAME
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module filenamecat shall be considered present. */
+#undef GNULIB_FILENAMECAT
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module freopen-safer shall be considered present. */
+#undef GNULIB_FREOPEN_SAFER
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module fscanf shall be considered present. */
+#undef GNULIB_FSCANF
+
+/* enable some gnulib portability checks */
+#undef GNULIB_PORTCHECK
+
+/* Define to 1 if printf and friends should be labeled with attribute
+ "__gnu_printf__" instead of "__printf__" */
+#undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module scanf shall be considered present. */
+#undef GNULIB_SCANF
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module snprintf shall be considered present. */
+#undef GNULIB_SNPRINTF
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module strerror shall be considered present. */
+#undef GNULIB_STRERROR
+
+/* Define to 1 when the gnulib module accept should be tested. */
+#undef GNULIB_TEST_ACCEPT
+
+/* Define to 1 when the gnulib module bind should be tested. */
+#undef GNULIB_TEST_BIND
+
+/* Define to 1 when the gnulib module btowc should be tested. */
+#undef GNULIB_TEST_BTOWC
+
+/* Define to 1 when the gnulib module close should be tested. */
+#undef GNULIB_TEST_CLOSE
+
+/* Define to 1 when the gnulib module connect should be tested. */
+#undef GNULIB_TEST_CONNECT
+
+/* Define to 1 when the gnulib module dup2 should be tested. */
+#undef GNULIB_TEST_DUP2
+
+/* Define to 1 when the gnulib module environ should be tested. */
+#undef GNULIB_TEST_ENVIRON
+
+/* Define to 1 when the gnulib module fcntl should be tested. */
+#undef GNULIB_TEST_FCNTL
+
+/* Define to 1 when the gnulib module fdopen should be tested. */
+#undef GNULIB_TEST_FDOPEN
+
+/* Define to 1 when the gnulib module freopen should be tested. */
+#undef GNULIB_TEST_FREOPEN
+
+/* Define to 1 when the gnulib module fstat should be tested. */
+#undef GNULIB_TEST_FSTAT
+
+/* Define to 1 when the gnulib module ftruncate should be tested. */
+#undef GNULIB_TEST_FTRUNCATE
+
+/* Define to 1 when the gnulib module getcwd should be tested. */
+#undef GNULIB_TEST_GETCWD
+
+/* Define to 1 when the gnulib module getdtablesize should be tested. */
+#undef GNULIB_TEST_GETDTABLESIZE
+
+/* Define to 1 when the gnulib module getopt-gnu should be tested. */
+#undef GNULIB_TEST_GETOPT_GNU
+
+/* Define to 1 when the gnulib module getpagesize should be tested. */
+#undef GNULIB_TEST_GETPAGESIZE
+
+/* Define to 1 when the gnulib module gettimeofday should be tested. */
+#undef GNULIB_TEST_GETTIMEOFDAY
+
+/* Define to 1 when the gnulib module ioctl should be tested. */
+#undef GNULIB_TEST_IOCTL
+
+/* Define to 1 when the gnulib module iswblank should be tested. */
+#undef GNULIB_TEST_ISWBLANK
+
+/* Define to 1 when the gnulib module listen should be tested. */
+#undef GNULIB_TEST_LISTEN
+
+/* Define to 1 when the gnulib module localeconv should be tested. */
+#undef GNULIB_TEST_LOCALECONV
+
+/* Define to 1 when the gnulib module lstat should be tested. */
+#undef GNULIB_TEST_LSTAT
+
+/* Define to 1 when the gnulib module malloc-posix should be tested. */
+#undef GNULIB_TEST_MALLOC_POSIX
+
+/* Define to 1 when the gnulib module mbrtowc should be tested. */
+#undef GNULIB_TEST_MBRTOWC
+
+/* Define to 1 when the gnulib module mbscasecmp should be tested. */
+#undef GNULIB_TEST_MBSCASECMP
+
+/* Define to 1 when the gnulib module mbsinit should be tested. */
+#undef GNULIB_TEST_MBSINIT
+
+/* Define to 1 when the gnulib module mbslen should be tested. */
+#undef GNULIB_TEST_MBSLEN
+
+/* Define to 1 when the gnulib module mbsrtowcs should be tested. */
+#undef GNULIB_TEST_MBSRTOWCS
+
+/* Define to 1 when the gnulib module mbsstr should be tested. */
+#undef GNULIB_TEST_MBSSTR
+
+/* Define to 1 when the gnulib module mbtowc should be tested. */
+#undef GNULIB_TEST_MBTOWC
+
+/* Define to 1 when the gnulib module memchr should be tested. */
+#undef GNULIB_TEST_MEMCHR
+
+/* Define to 1 when the gnulib module mkstemp should be tested. */
+#undef GNULIB_TEST_MKSTEMP
+
+/* Define to 1 when the gnulib module mktime should be tested. */
+#undef GNULIB_TEST_MKTIME
+
+/* Define to 1 when the gnulib module nanosleep should be tested. */
+#undef GNULIB_TEST_NANOSLEEP
+
+/* Define to 1 when the gnulib module nl_langinfo should be tested. */
+#undef GNULIB_TEST_NL_LANGINFO
+
+/* Define to 1 when the gnulib module open should be tested. */
+#undef GNULIB_TEST_OPEN
+
+/* Define to 1 when the gnulib module perror should be tested. */
+#undef GNULIB_TEST_PERROR
+
+/* Define to 1 when the gnulib module pipe should be tested. */
+#undef GNULIB_TEST_PIPE
+
+/* Define to 1 when the gnulib module putenv should be tested. */
+#undef GNULIB_TEST_PUTENV
+
+/* Define to 1 when the gnulib module raise should be tested. */
+#undef GNULIB_TEST_RAISE
+
+/* Define to 1 when the gnulib module rawmemchr should be tested. */
+#undef GNULIB_TEST_RAWMEMCHR
+
+/* Define to 1 when the gnulib module readlink should be tested. */
+#undef GNULIB_TEST_READLINK
+
+/* Define to 1 when the gnulib module secure_getenv should be tested. */
+#undef GNULIB_TEST_SECURE_GETENV
+
+/* Define to 1 when the gnulib module select should be tested. */
+#undef GNULIB_TEST_SELECT
+
+/* Define to 1 when the gnulib module setenv should be tested. */
+#undef GNULIB_TEST_SETENV
+
+/* Define to 1 when the gnulib module setlocale should be tested. */
+#undef GNULIB_TEST_SETLOCALE
+
+/* Define to 1 when the gnulib module setsockopt should be tested. */
+#undef GNULIB_TEST_SETSOCKOPT
+
+/* Define to 1 when the gnulib module sigaction should be tested. */
+#undef GNULIB_TEST_SIGACTION
+
+/* Define to 1 when the gnulib module sigprocmask should be tested. */
+#undef GNULIB_TEST_SIGPROCMASK
+
+/* Define to 1 when the gnulib module sleep should be tested. */
+#undef GNULIB_TEST_SLEEP
+
+/* Define to 1 when the gnulib module snprintf should be tested. */
+#undef GNULIB_TEST_SNPRINTF
+
+/* Define to 1 when the gnulib module socket should be tested. */
+#undef GNULIB_TEST_SOCKET
+
+/* Define to 1 when the gnulib module stat should be tested. */
+#undef GNULIB_TEST_STAT
+
+/* Define to 1 when the gnulib module strerror should be tested. */
+#undef GNULIB_TEST_STRERROR
+
+/* Define to 1 when the gnulib module strerror_r should be tested. */
+#undef GNULIB_TEST_STRERROR_R
+
+/* Define to 1 when the gnulib module strndup should be tested. */
+#undef GNULIB_TEST_STRNDUP
+
+/* Define to 1 when the gnulib module strnlen should be tested. */
+#undef GNULIB_TEST_STRNLEN
+
+/* Define to 1 when the gnulib module strptime should be tested. */
+#undef GNULIB_TEST_STRPTIME
+
+/* Define to 1 when the gnulib module strtoull should be tested. */
+#undef GNULIB_TEST_STRTOULL
+
+/* Define to 1 when the gnulib module symlink should be tested. */
+#undef GNULIB_TEST_SYMLINK
+
+/* Define to 1 when the gnulib module timegm should be tested. */
+#undef GNULIB_TEST_TIMEGM
+
+/* Define to 1 when the gnulib module time_r should be tested. */
+#undef GNULIB_TEST_TIME_R
+
+/* Define to 1 when the gnulib module time_rz should be tested. */
+#undef GNULIB_TEST_TIME_RZ
+
+/* Define to 1 when the gnulib module unsetenv should be tested. */
+#undef GNULIB_TEST_UNSETENV
+
+/* Define to 1 when the gnulib module vasprintf should be tested. */
+#undef GNULIB_TEST_VASPRINTF
+
+/* Define to 1 when the gnulib module wcrtomb should be tested. */
+#undef GNULIB_TEST_WCRTOMB
+
+/* Define to 1 when the gnulib module wctob should be tested. */
+#undef GNULIB_TEST_WCTOB
+
+/* Define to 1 when the gnulib module wctomb should be tested. */
+#undef GNULIB_TEST_WCTOMB
+
+/* Define to 1 when the gnulib module wcwidth should be tested. */
+#undef GNULIB_TEST_WCWIDTH
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u8-mbtoucr shall be considered present. */
+#undef GNULIB_UNISTR_U8_MBTOUCR
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u8-uctomb shall be considered present. */
+#undef GNULIB_UNISTR_U8_UCTOMB
+
+/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
+ may be supplied by this distribution. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if <alloca.h> works. */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <bp-sym.h> header file. */
+#undef HAVE_BP_SYM_H
+
+/* Define to 1 if you have the `btowc' function. */
+#undef HAVE_BTOWC
+
+/* Define to 1 if nanosleep mishandles large arguments. */
+#undef HAVE_BUG_BIG_NANOSLEEP
+
+/* Define to 1 if you have the `catgets' function. */
+#undef HAVE_CATGETS
+
+/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYCURRENT
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+
+/* Define to 1 if you have the `chsize' function. */
+#undef HAVE_CHSIZE
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `clock_settime' function. */
+#undef HAVE_CLOCK_SETTIME
+
+/* Define to 1 if C supports variable-length arrays. */
+#undef HAVE_C_VARARRAYS
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
+/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't.
+ */
+#undef HAVE_DECL_ALARM
+
+/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_CLEARERR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FEOF_UNLOCKED
+
+/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FERROR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FFLUSH_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FGETS_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FPUTC_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FPUTS_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FREAD_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FWRITE_UNLOCKED
+
+/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_GETCHAR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETC_UNLOCKED
+
+/* Define to 1 if you have the declaration of `getdtablesize', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETDTABLESIZE
+
+/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETENV
+
+/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
+ don't. */
+#undef HAVE_DECL_INET_PTON
+
+/* Define to 1 if you have the declaration of `isblank', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ISBLANK
+
+/* Define to 1 if you have the declaration of `iswblank', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ISWBLANK
+
+/* Define to 1 if you have the declaration of `localtime_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_LOCALTIME_R
+
+/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MBRTOWC
+
+/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MBSINIT
+
+/* Define to 1 if you have the declaration of `mbsrtowcs', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MBSRTOWCS
+
+/* Define to 1 if you have the declaration of `program_invocation_name', and
+ to 0 if you don't. */
+#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
+
+/* Define to 1 if you have the declaration of `program_invocation_short_name',
+ and to 0 if you don't. */
+#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+
+/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_PUTCHAR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
+ don't. */
+#undef HAVE_DECL_PUTC_UNLOCKED
+
+/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't.
+ */
+#undef HAVE_DECL_SETENV
+
+/* Define to 1 if you have the declaration of `sigaltstack', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SIGALTSTACK
+
+/* Define to 1 if you have the declaration of `sleep', and to 0 if you don't.
+ */
+#undef HAVE_DECL_SLEEP
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
+/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRNCASECMP
+
+/* Define to 1 if you have the declaration of `strndup', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRNDUP
+
+/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRNLEN
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strtoumax', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOUMAX
+
+/* Define to 1 if you have the declaration of `towlower', and to 0 if you
+ don't. */
+#undef HAVE_DECL_TOWLOWER
+
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+ */
+#undef HAVE_DECL_TZNAME
+
+/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you
+ don't. */
+#undef HAVE_DECL_UNSETENV
+
+/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you
+ don't. */
+#undef HAVE_DECL_WCRTOMB
+
+/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't.
+ */
+#undef HAVE_DECL_WCTOB
+
+/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you
+ don't. */
+#undef HAVE_DECL_WCWIDTH
+
+/* Define to 1 if you have the declaration of `_putenv', and to 0 if you
+ don't. */
+#undef HAVE_DECL__PUTENV
+
+/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL__SNPRINTF
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the 'dup2' function. */
+#undef HAVE_DUP2
+
+/* Define if you have the declaration of environ. */
+#undef HAVE_ENVIRON_DECL
+
+/* Define to 1 if you have the `fcntl' function. */
+#undef HAVE_FCNTL
+
+/* Define to 1 if you have the <features.h> header file. */
+#undef HAVE_FEATURES_H
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the `ftruncate' function. */
+#undef HAVE_FTRUNCATE
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getegid' function. */
+#undef HAVE_GETEGID
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getopt_long_only' function. */
+#undef HAVE_GETOPT_LONG_ONLY
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define if you have the iconv() function and it works. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <iconv.h> header file. */
+#undef HAVE_ICONV_H
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
+/* Define to 1 if the compiler supports one of the keywords 'inline',
+ '__inline__', '__inline' and effectively inlines functions marked as such.
+ */
+#undef HAVE_INLINE
+
+/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+ declares uintmax_t. */
+#undef HAVE_INTTYPES_H_WITH_UINTMAX
+
+/* Define to 1 if you have the `ioctl' function. */
+#undef HAVE_IOCTL
+
+/* Define to 1 if <sys/socket.h> defines AF_INET. */
+#undef HAVE_IPV4
+
+/* Define to 1 if <sys/socket.h> defines AF_INET6. */
+#undef HAVE_IPV6
+
+/* Define to 1 if you have the `isblank' function. */
+#undef HAVE_ISBLANK
+
+/* Define to 1 if you have the `issetugid' function. */
+#undef HAVE_ISSETUGID
+
+/* Define to 1 if you have the `iswblank' function. */
+#undef HAVE_ISWBLANK
+
+/* Define to 1 if you have the `iswcntrl' function. */
+#undef HAVE_ISWCNTRL
+
+/* Define to 1 if you have the `iswctype' function. */
+#undef HAVE_ISWCTYPE
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define if you have the libsigsegv library. */
+#undef HAVE_LIBSIGSEGV
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define to 1 if the system has the type 'long long int'. */
+#undef HAVE_LONG_LONG_INT
+
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if the 'malloc' function is POSIX compliant. */
+#undef HAVE_MALLOC_POSIX
+
+/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+ config.h and <sys/mman.h>. */
+#undef HAVE_MAP_ANONYMOUS
+
+/* Define to 1 if you have the `mbrtowc' function. */
+#undef HAVE_MBRTOWC
+
+/* Define to 1 if you have the `mbsinit' function. */
+#undef HAVE_MBSINIT
+
+/* Define to 1 if you have the `mbslen' function. */
+#undef HAVE_MBSLEN
+
+/* Define to 1 if you have the `mbsrtowcs' function. */
+#undef HAVE_MBSRTOWCS
+
+/* Define to 1 if <wchar.h> declares mbstate_t. */
+#undef HAVE_MBSTATE_T
+
+/* Define to 1 if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
+/* Define to 1 on MSVC platforms that have the "invalid parameter handler"
+ concept. */
+#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Define to 1 if you have the `nanotime' function. */
+#undef HAVE_NANOTIME
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the `newlocale' function. */
+#undef HAVE_NEWLOCALE
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
+/* Define to 1 if you have the <OS.h> header file. */
+#undef HAVE_OS_H
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `raise' function. */
+#undef HAVE_RAISE
+
+/* Define to 1 if you have the `rawmemchr' function. */
+#undef HAVE_RAWMEMCHR
+
+/* Define to 1 if accept is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ACCEPT
+
+/* Define to 1 if accept4 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ACCEPT4
+
+/* Define to 1 if atoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ATOLL
+
+/* Define to 1 if bind is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_BIND
+
+/* Define to 1 if btowc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_BTOWC
+
+/* Define to 1 if canonicalize_file_name is declared even after undefining
+ macros. */
+#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+
+/* Define to 1 if chdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CHDIR
+
+/* Define to 1 if chown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CHOWN
+
+/* Define to 1 if connect is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CONNECT
+
+/* Define to 1 if dprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DPRINTF
+
+/* Define to 1 if dup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP
+
+/* Define to 1 if dup2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP2
+
+/* Define to 1 if dup3 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP3
+
+/* Define to 1 if duplocale is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUPLOCALE
+
+/* Define to 1 if endusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ENDUSERSHELL
+
+/* Define to 1 if environ is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ENVIRON
+
+/* Define to 1 if euidaccess is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EUIDACCESS
+
+/* Define to 1 if faccessat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FACCESSAT
+
+/* Define to 1 if fchdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHDIR
+
+/* Define to 1 if fchmodat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHMODAT
+
+/* Define to 1 if fchownat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHOWNAT
+
+/* Define to 1 if fcntl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCNTL
+
+/* Define to 1 if fdatasync is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FDATASYNC
+
+/* Define to 1 if ffs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFS
+
+/* Define to 1 if ffsl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFSL
+
+/* Define to 1 if ffsll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFSLL
+
+/* Define to 1 if fpurge is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FPURGE
+
+/* Define to 1 if fseeko is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSEEKO
+
+/* Define to 1 if fstat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSTAT
+
+/* Define to 1 if fstatat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSTATAT
+
+/* Define to 1 if fsync is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSYNC
+
+/* Define to 1 if ftello is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FTELLO
+
+/* Define to 1 if ftruncate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FTRUNCATE
+
+/* Define to 1 if futimens is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FUTIMENS
+
+/* Define to 1 if getcwd is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETCWD
+
+/* Define to 1 if getdelim is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDELIM
+
+/* Define to 1 if getdomainname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDOMAINNAME
+
+/* Define to 1 if getdtablesize is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDTABLESIZE
+
+/* Define to 1 if getgroups is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETGROUPS
+
+/* Define to 1 if gethostname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETHOSTNAME
+
+/* Define to 1 if getline is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLINE
+
+/* Define to 1 if getloadavg is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOADAVG
+
+/* Define to 1 if getlogin is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOGIN
+
+/* Define to 1 if getlogin_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOGIN_R
+
+/* Define to 1 if getpagesize is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETPAGESIZE
+
+/* Define to 1 if getpeername is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETPEERNAME
+
+/* Define to 1 if gets is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETS
+
+/* Define to 1 if getsockname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSOCKNAME
+
+/* Define to 1 if getsockopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSOCKOPT
+
+/* Define to 1 if getsubopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSUBOPT
+
+/* Define to 1 if gettimeofday is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETTIMEOFDAY
+
+/* Define to 1 if getusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETUSERSHELL
+
+/* Define to 1 if grantpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GRANTPT
+
+/* Define to 1 if group_member is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GROUP_MEMBER
+
+/* Define to 1 if imaxabs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_IMAXABS
+
+/* Define to 1 if imaxdiv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_IMAXDIV
+
+/* Define to 1 if inet_ntop is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INET_NTOP
+
+/* Define to 1 if inet_pton is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INET_PTON
+
+/* Define to 1 if initstate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTATE
+
+/* Define to 1 if initstate_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTATE_R
+
+/* Define to 1 if ioctl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_IOCTL
+
+/* Define to 1 if isatty is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ISATTY
+
+/* Define to 1 if isblank is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ISBLANK
+
+/* Define to 1 if iswctype is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ISWCTYPE
+
+/* Define to 1 if lchmod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LCHMOD
+
+/* Define to 1 if lchown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LCHOWN
+
+/* Define to 1 if link is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LINK
+
+/* Define to 1 if linkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LINKAT
+
+/* Define to 1 if listen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LISTEN
+
+/* Define to 1 if lseek is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LSEEK
+
+/* Define to 1 if lstat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LSTAT
+
+/* Define to 1 if mbrlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBRLEN
+
+/* Define to 1 if mbrtowc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBRTOWC
+
+/* Define to 1 if mbsinit is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSINIT
+
+/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSNRTOWCS
+
+/* Define to 1 if mbsrtowcs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSRTOWCS
+
+/* Define to 1 if memmem is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMMEM
+
+/* Define to 1 if mempcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMPCPY
+
+/* Define to 1 if memrchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMRCHR
+
+/* Define to 1 if mkdirat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKDIRAT
+
+/* Define to 1 if mkdtemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKDTEMP
+
+/* Define to 1 if mkfifo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKFIFO
+
+/* Define to 1 if mkfifoat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKFIFOAT
+
+/* Define to 1 if mknod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKNOD
+
+/* Define to 1 if mknodat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKNODAT
+
+/* Define to 1 if mkostemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKOSTEMP
+
+/* Define to 1 if mkostemps is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKOSTEMPS
+
+/* Define to 1 if mkstemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKSTEMP
+
+/* Define to 1 if mkstemps is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKSTEMPS
+
+/* Define to 1 if nl_langinfo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_NL_LANGINFO
+
+/* Define to 1 if openat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_OPENAT
+
+/* Define to 1 if pclose is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PCLOSE
+
+/* Define to 1 if pipe is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PIPE
+
+/* Define to 1 if pipe2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PIPE2
+
+/* Define to 1 if popen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POPEN
+
+/* Define to 1 if posix_openpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POSIX_OPENPT
+
+/* Define to 1 if pread is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PREAD
+
+/* Define to 1 if pselect is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PSELECT
+
+/* Define to 1 if pthread_sigmask is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTHREAD_SIGMASK
+
+/* Define to 1 if ptsname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTSNAME
+
+/* Define to 1 if ptsname_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTSNAME_R
+
+/* Define to 1 if pwrite is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PWRITE
+
+/* Define to 1 if random is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RANDOM
+
+/* Define to 1 if random_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RANDOM_R
+
+/* Define to 1 if rawmemchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RAWMEMCHR
+
+/* Define to 1 if readlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READLINK
+
+/* Define to 1 if readlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READLINKAT
+
+/* Define to 1 if realpath is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REALPATH
+
+/* Define to 1 if recv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RECV
+
+/* Define to 1 if recvfrom is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RECVFROM
+
+/* Define to 1 if renameat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RENAMEAT
+
+/* Define to 1 if rmdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RMDIR
+
+/* Define to 1 if rpmatch is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RPMATCH
+
+/* Define to 1 if secure_getenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SECURE_GETENV
+
+/* Define to 1 if select is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SELECT
+
+/* Define to 1 if send is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SEND
+
+/* Define to 1 if sendto is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SENDTO
+
+/* Define to 1 if setenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETENV
+
+/* Define to 1 if sethostname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETHOSTNAME
+
+/* Define to 1 if setlocale is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETLOCALE
+
+/* Define to 1 if setsockopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSOCKOPT
+
+/* Define to 1 if setstate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSTATE
+
+/* Define to 1 if setstate_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSTATE_R
+
+/* Define to 1 if setusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETUSERSHELL
+
+/* Define to 1 if shutdown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SHUTDOWN
+
+/* Define to 1 if sigaction is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGACTION
+
+/* Define to 1 if sigaddset is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGADDSET
+
+/* Define to 1 if sigdelset is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGDELSET
+
+/* Define to 1 if sigemptyset is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGEMPTYSET
+
+/* Define to 1 if sigfillset is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGFILLSET
+
+/* Define to 1 if sigismember is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGISMEMBER
+
+/* Define to 1 if sigpending is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGPENDING
+
+/* Define to 1 if sigprocmask is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SIGPROCMASK
+
+/* Define to 1 if sleep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SLEEP
+
+/* Define to 1 if snprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SNPRINTF
+
+/* Define to 1 if socket is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SOCKET
+
+/* Define to 1 if srandom is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SRANDOM
+
+/* Define to 1 if srandom_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SRANDOM_R
+
+/* Define to 1 if stat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STAT
+
+/* Define to 1 if stpcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STPCPY
+
+/* Define to 1 if stpncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STPNCPY
+
+/* Define to 1 if strcasecmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCASECMP
+
+/* Define to 1 if strcasestr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCASESTR
+
+/* Define to 1 if strchrnul is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCHRNUL
+
+/* Define to 1 if strdup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRDUP
+
+/* Define to 1 if strerror_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRERROR_R
+
+/* Define to 1 if strncasecmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNCASECMP
+
+/* Define to 1 if strncat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNCAT
+
+/* Define to 1 if strndup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNDUP
+
+/* Define to 1 if strnlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNLEN
+
+/* Define to 1 if strpbrk is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRPBRK
+
+/* Define to 1 if strsep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRSEP
+
+/* Define to 1 if strsignal is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRSIGNAL
+
+/* Define to 1 if strtod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOD
+
+/* Define to 1 if strtoimax is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOIMAX
+
+/* Define to 1 if strtok_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOK_R
+
+/* Define to 1 if strtoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOLL
+
+/* Define to 1 if strtoull is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOULL
+
+/* Define to 1 if strtoumax is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOUMAX
+
+/* Define to 1 if strverscmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRVERSCMP
+
+/* Define to 1 if symlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SYMLINK
+
+/* Define to 1 if symlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SYMLINKAT
+
+/* Define to 1 if tmpfile is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TMPFILE
+
+/* Define to 1 if towctrans is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TOWCTRANS
+
+/* Define to 1 if ttyname_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TTYNAME_R
+
+/* Define to 1 if unlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLINK
+
+/* Define to 1 if unlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLINKAT
+
+/* Define to 1 if unlockpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLOCKPT
+
+/* Define to 1 if unsetenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNSETENV
+
+/* Define to 1 if usleep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_USLEEP
+
+/* Define to 1 if utimensat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UTIMENSAT
+
+/* Define to 1 if vdprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_VDPRINTF
+
+/* Define to 1 if vsnprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_VSNPRINTF
+
+/* Define to 1 if waitpid is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WAITPID
+
+/* Define to 1 if wcpcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCPCPY
+
+/* Define to 1 if wcpncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCPNCPY
+
+/* Define to 1 if wcrtomb is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCRTOMB
+
+/* Define to 1 if wcscasecmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCASECMP
+
+/* Define to 1 if wcscat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCAT
+
+/* Define to 1 if wcschr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCHR
+
+/* Define to 1 if wcscmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCMP
+
+/* Define to 1 if wcscoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCOLL
+
+/* Define to 1 if wcscpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCPY
+
+/* Define to 1 if wcscspn is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCSPN
+
+/* Define to 1 if wcsdup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSDUP
+
+/* Define to 1 if wcslen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSLEN
+
+/* Define to 1 if wcsncasecmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCASECMP
+
+/* Define to 1 if wcsncat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCAT
+
+/* Define to 1 if wcsncmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCMP
+
+/* Define to 1 if wcsncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCPY
+
+/* Define to 1 if wcsnlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNLEN
+
+/* Define to 1 if wcsnrtombs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNRTOMBS
+
+/* Define to 1 if wcspbrk is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSPBRK
+
+/* Define to 1 if wcsrchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSRCHR
+
+/* Define to 1 if wcsrtombs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSRTOMBS
+
+/* Define to 1 if wcsspn is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSSPN
+
+/* Define to 1 if wcsstr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSSTR
+
+/* Define to 1 if wcstok is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSTOK
+
+/* Define to 1 if wcswidth is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSWIDTH
+
+/* Define to 1 if wcsxfrm is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSXFRM
+
+/* Define to 1 if wctob is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTOB
+
+/* Define to 1 if wctrans is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTRANS
+
+/* Define to 1 if wctype is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTYPE
+
+/* Define to 1 if wcwidth is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCWIDTH
+
+/* Define to 1 if wmemchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMCHR
+
+/* Define to 1 if wmemcmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMCMP
+
+/* Define to 1 if wmemcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMCPY
+
+/* Define to 1 if wmemmove is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMMOVE
+
+/* Define to 1 if wmemset is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMSET
+
+/* Define to 1 if _Exit is declared even after undefining macros. */
+#undef HAVE_RAW_DECL__EXIT
+
+/* Define to 1 if you have the `readlink' function. */
+#undef HAVE_READLINK
+
+/* Define to 1 if you have the `readlinkat' function. */
+#undef HAVE_READLINKAT
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+#undef HAVE_SA_FAMILY_T
+
+/* Define to 1 if you have the <search.h> header file. */
+#undef HAVE_SEARCH_H
+
+/* Define to 1 if you have the `secure_getenv' function. */
+#undef HAVE_SECURE_GETENV
+
+/* Define to 1 if you have the `setdtablesize' function. */
+#undef HAVE_SETDTABLESIZE
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
+/* Define to 1 if you have the `shutdown' function. */
+#undef HAVE_SHUTDOWN
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the `sigblock' function. */
+#undef HAVE_SIGBLOCK
+
+/* Define to 1 if the system has the type `siginfo_t'. */
+#undef HAVE_SIGINFO_T
+
+/* Define to 1 if you have the `siginterrupt' function. */
+#undef HAVE_SIGINTERRUPT
+
+/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
+#undef HAVE_SIGNED_SIG_ATOMIC_T
+
+/* Define to 1 if 'wchar_t' is a signed integer type. */
+#undef HAVE_SIGNED_WCHAR_T
+
+/* Define to 1 if 'wint_t' is a signed integer type. */
+#undef HAVE_SIGNED_WINT_T
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define to 1 if the system has the type `sigset_t'. */
+#undef HAVE_SIGSET_T
+
+/* Define to 1 if you have the `sleep' function. */
+#undef HAVE_SLEEP
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* 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. */
+#undef HAVE_SNPRINTF_RETVAL_C99
+
+/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV
+ which can be handled on an alternate stack established with sigaltstack. */
+#undef HAVE_STACK_OVERFLOW_HANDLING
+
+/* Define to 1 if the system has the type `stack_t'. */
+#undef HAVE_STACK_T
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+ uintmax_t. */
+#undef HAVE_STDINT_H_WITH_UINTMAX
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasecoll' function. */
+#undef HAVE_STRCASECOLL
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* Define to 1 if you have the `stricoll' function. */
+#undef HAVE_STRICOLL
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Always define to 1, for backward compatibility. You can assume <string.h>
+ exists. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
+/* Define to 1 if you have the `strnlen' function. */
+#undef HAVE_STRNLEN
+
+/* Define to 1 if you have the `strptime' function. */
+#undef HAVE_STRPTIME
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if you have the `strtoumax' function. */
+#undef HAVE_STRTOUMAX
+
+/* Define to 1 if `decimal_point' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
+#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
+
+/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+
+/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+
+/* Define to 1 if `st_birthtimensec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+
+/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_RDEV
+
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_ZONE
+
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+#undef HAVE_SYS_BITYPES_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/inttypes.h> header file. */
+#undef HAVE_SYS_INTTYPES_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the `timegm' function. */
+#undef HAVE_TIMEGM
+
+/* Define to 1 if the system has the type `timezone_t'. */
+#undef HAVE_TIMEZONE_T
+
+/* Define if struct tm has the tm_gmtoff member. */
+#undef HAVE_TM_GMTOFF
+
+/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#undef HAVE_TM_ZONE
+
+/* Define to 1 if you have the `towlower' function. */
+#undef HAVE_TOWLOWER
+
+/* Define to 1 if you have the `tsearch' function. */
+#undef HAVE_TSEARCH
+
+/* Define to 1 if you don't have `tm_zone' but do have the external array
+ `tzname'. */
+#undef HAVE_TZNAME
+
+/* Define to 1 if you have the `tzset' function. */
+#undef HAVE_TZSET
+
+/* Define to 1 if you have the <ucontext.h> header file. */
+#undef HAVE_UCONTEXT_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
+/* Define to 1 if the system has the type 'unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
+/* Define to 1 if you have the `vasnprintf' function. */
+#undef HAVE_VASNPRINTF
+
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define if you have the 'wchar_t' type. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#undef HAVE_WCRTOMB
+
+/* Define to 1 if you have the `wcslen' function. */
+#undef HAVE_WCSLEN
+
+/* Define to 1 if you have the `wcsnlen' function. */
+#undef HAVE_WCSNLEN
+
+/* Define to 1 if you have the `wctob' function. */
+#undef HAVE_WCTOB
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Define to 1 if you have the `wcwidth' function. */
+#undef HAVE_WCWIDTH
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
+
+/* Define if you have the 'wint_t' type. */
+#undef HAVE_WINT_T
+
+/* Define to 1 if you have the `wmemchr' function. */
+#undef HAVE_WMEMCHR
+
+/* Define to 1 if you have the `wmemcpy' function. */
+#undef HAVE_WMEMCPY
+
+/* Define to 1 if you have the `wmempcpy' function. */
+#undef HAVE_WMEMPCPY
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if O_NOATIME works. */
+#undef HAVE_WORKING_O_NOATIME
+
+/* Define to 1 if O_NOFOLLOW works. */
+#undef HAVE_WORKING_O_NOFOLLOW
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#undef HAVE_WS2TCPIP_H
+
+/* Define to 1 if you have the <xlocale.h> header file. */
+#undef HAVE_XLOCALE_H
+
+/* Define to 1 if extending the stack slightly past the limit causes a
+ SIGSEGV, and an alternate stack can be established with sigaltstack, and
+ the signal handler is passed a context that specifies the run time stack.
+ This behavior is defined by POSIX 1003.1-2001 with the X/Open System
+ Interface (XSI) option and is a standardized way to implement a SEGV-based
+ stack overflow detection heuristic. */
+#undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* Define to 1 if you have the `_ftime' function. */
+#undef HAVE__FTIME
+
+/* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
+#undef HAVE__SET_INVALID_PARAMETER_HANDLER
+
+/* Define to 1 if you have the `__secure_getenv' function. */
+#undef HAVE___SECURE_GETENV
+
+/* Define to 1 if you have the `__xpg_strerror_r' function. */
+#undef HAVE___XPG_STRERROR_R
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
+/* Define to a symbolic name denoting the flavor of iconv_open()
+ implementation. */
+#undef ICONV_FLAVOR
+
+/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing
+ slash. */
+#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
+
+/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */
+#undef MALLOC_0_IS_NONNULL
+
+/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
+#undef MAP_ANONYMOUS
+
+/* Define if the mbrtowc function does not return (size_t) -2 for empty input.
+ */
+#undef MBRTOWC_EMPTY_INPUT_BUG
+
+/* Define if the mbrtowc function has the NULL pwc argument bug. */
+#undef MBRTOWC_NULL_ARG1_BUG
+
+/* Define if the mbrtowc function has the NULL string argument bug. */
+#undef MBRTOWC_NULL_ARG2_BUG
+
+/* Define if the mbrtowc function does not return 0 for a NUL character. */
+#undef MBRTOWC_NUL_RETVAL_BUG
+
+/* Define if the mbrtowc function returns a wrong return value. */
+#undef MBRTOWC_RETVAL_BUG
+
+/* Define to 1 if open() fails to recognize a trailing slash. */
+#undef OPEN_TRAILING_SLASH_BUG
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* String identifying the packager of this software */
+#undef PACKAGE_PACKAGER
+
+/* Packager info for bug reports (URL/e-mail/...) */
+#undef PACKAGE_PACKAGER_BUG_REPORTS
+
+/* Packager-specific version information */
+#undef PACKAGE_PACKAGER_VERSION
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
+#undef PRI_MACROS_BROKEN
+
+/* Define to the type that is the result of default argument promotions of
+ type mode_t. */
+#undef PROMOTED_MODE_T
+
+/* Name of "pr" program. */
+#undef PR_PROGRAM
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'ptrdiff_t'. */
+#undef PTRDIFF_T_SUFFIX
+
+/* Define to 1 if readlink fails to recognize a trailing slash. */
+#undef READLINK_TRAILING_SLASH_BUG
+
+/* Define to 1 if stat needs help when passed a directory name with a trailing
+ slash */
+#undef REPLACE_FUNC_STAT_DIR
+
+/* Define to 1 if stat needs help when passed a file name with a trailing
+ slash */
+#undef REPLACE_FUNC_STAT_FILE
+
+/* Define if nl_langinfo exists but is overridden by gnulib. */
+#undef REPLACE_NL_LANGINFO
+
+/* Define to 1 if strerror(0) does not return a message implying success. */
+#undef REPLACE_STRERROR_0
+
+/* Define if vasnprintf exists but is overridden by gnulib. */
+#undef REPLACE_VASNPRINTF
+
+/* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as
+ the highest address of the alternate stack range rather than as the lowest
+ address. */
+#undef SIGALTSTACK_SS_REVERSED
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'sig_atomic_t'. */
+#undef SIG_ATOMIC_T_SUFFIX
+
+/* Define as the maximum value of type 'size_t', if the system doesn't define
+ it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'size_t'. */
+#undef SIZE_T_SUFFIX
+
+/* 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
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+#undef STAT_MACROS_BROKEN
+
+/* Always define to 1, for backward compatibility. You can assume the C90
+ standard headers exist. */
+#undef STDC_HEADERS
+
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
+/* Define to 1 if time_t is signed. */
+#undef TIME_T_IS_SIGNED
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Define to 1 if the type of the st_atim member of a struct stat is struct
+ timespec. */
+#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on OS X. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to 1 if you want getc etc. to use unlocked I/O if available.
+ Unlocked I/O can improve performance in unithreaded apps, but it is not
+ safe for multithreaded apps. */
+#undef USE_UNLOCKED_IO
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if unsetenv returns void instead of int. */
+#undef VOID_UNSETENV
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wchar_t'. */
+#undef WCHAR_T_SUFFIX
+
+/* Define if WSAStartup is needed. */
+#undef WINDOWS_SOCKETS
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wint_t'. */
+#undef WINT_T_SUFFIX
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#undef _DARWIN_USE_64_BIT_INODE
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* enable compile-time and run-time bounds-checking, and some warnings */
+#undef _FORTIFY_SOURCE
+
+/* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct
+ stat.st_size becomes 64-bit. */
+#undef _GL_WINDOWS_64_BIT_ST_SIZE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 on Solaris. */
+#undef _LCONV_C99
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */
+#undef _NETBSD_SOURCE
+
+/* The _Noreturn keyword of C11. */
+#if ! (defined _Noreturn \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 in order to get the POSIX compatible declarations of socket
+ functions. */
+#undef _POSIX_PII_SOCKET
+
+/* Define to 1 if you need to in order for 'stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define if you want <regex.h> to include <limits.h>, so that it consistently
+ overrides <limits.h>'s RE_DUP_MAX. */
+#undef _REGEX_INCLUDE_LIMITS_H
+
+/* Define if you want regoff_t to be at least as wide POSIX requires. */
+#undef _REGEX_LARGE_OFFSETS
+
+/* Define to rpl_ if the getopt replacement functions and variables should be
+ used. */
+#undef __GETOPT_PREFIX
+
+/* Define to 1 if the system <stdint.h> predates C++11. */
+#undef __STDC_CONSTANT_MACROS
+
+/* Define to 1 if the system <stdint.h> predates C++11. */
+#undef __STDC_LIMIT_MACROS
+
+/* Define to 1 if C does not support variable-length arrays, and if the
+ compiler does not already define this. */
+#undef __STDC_NO_VLA__
+
+/* 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
+ <http://lists.gnu.org/archive/html/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 Sun C 5.12 SunOS_i386 2011/11/16.
+
+ 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. This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ http://lists.gnu.org/archive/html/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 <http://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar. */
+#if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined __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 static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#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
+
+/* Define to a replacement function name for fnmatch(). */
+#undef fnmatch
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* A replacement for va_copy, if needed. */
+#define gl_va_copy(a,b) ((a) = (b))
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */
+#undef intmax_t
+
+/* 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
+
+/* Define to 1 if the compiler is checking for lint. */
+#undef lint
+
+/* Define to a type if <wchar.h> does not define. */
+#undef mbstate_t
+
+/* Define to the real name of the mktime_internal function. */
+#undef mktime_internal
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
+/* Define to the name of the strftime replacement function. */
+#undef my_strftime
+
+/* Define to the type of st_nlink in struct stat, or a supertype. */
+#undef nlink_t
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define as the type of the result of subtracting two pointers, if the system
+ doesn't define it. */
+#undef ptrdiff_t
+
+/* Define to rpl_re_comp if the replacement should be used. */
+#undef re_comp
+
+/* Define to rpl_re_compile_fastmap if the replacement should be used. */
+#undef re_compile_fastmap
+
+/* Define to rpl_re_compile_pattern if the replacement should be used. */
+#undef re_compile_pattern
+
+/* Define to rpl_re_exec if the replacement should be used. */
+#undef re_exec
+
+/* Define to rpl_re_match if the replacement should be used. */
+#undef re_match
+
+/* Define to rpl_re_match_2 if the replacement should be used. */
+#undef re_match_2
+
+/* Define to rpl_re_search if the replacement should be used. */
+#undef re_search
+
+/* Define to rpl_re_search_2 if the replacement should be used. */
+#undef re_search_2
+
+/* Define to rpl_re_set_registers if the replacement should be used. */
+#undef re_set_registers
+
+/* Define to rpl_re_set_syntax if the replacement should be used. */
+#undef re_set_syntax
+
+/* Define to rpl_re_syntax_options if the replacement should be used. */
+#undef re_syntax_options
+
+/* Define to rpl_regcomp if the replacement should be used. */
+#undef regcomp
+
+/* Define to rpl_regerror if the replacement should be used. */
+#undef regerror
+
+/* Define to rpl_regexec if the replacement should be used. */
+#undef regexec
+
+/* Define to rpl_regfree if the replacement should be used. */
+#undef regfree
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#undef restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* type to use in place of socklen_t if not defined */
+#undef socklen_t
+
+/* Define as a signed type of the same size as size_t. */
+#undef ssize_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define as a marker that can be attached to declarations that might not
+ be used. This helps to reduce warnings, such as from
+ GCC -Wunused-parameter. */
+#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_UNUSED
+#endif
+/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+ is a misnomer outside of parameter lists. */
+#define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* gcc supports the "unused" attribute on possibly unused labels, and
+ g++ has since version 4.5. Note to support C++ as well as C,
+ _GL_UNUSED_LABEL should be used with a trailing ; */
+#if !defined __cplusplus || __GNUC__ > 4 \
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
+
+
+/* Define as a macro for copying va_list variables. */
+#undef va_copy
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff --git a/lib/ctype.in.h b/lib/ctype.in.h
new file mode 100644
index 0000000..217812d
--- /dev/null
+++ b/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-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible. */
+
+/*
+ * ISO C 99 <ctype.h> for platforms on which it is incomplete.
+ * <http://www.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/lib/diffseq.h b/lib/diffseq.h
new file mode 100644
index 0000000..6be7d83
--- /dev/null
+++ b/lib/diffseq.h
@@ -0,0 +1,425 @@
+/* Analyze differences between two vectors.
+
+ Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* The basic idea is to consider two vectors as similar if, when
+ transforming the first vector into the second vector through a
+ sequence of edits (inserts and deletes of one element each),
+ this sequence is short - or equivalently, if the ordered list
+ of elements that are untouched by these edits is long. For a
+ good introduction to the subject, read about the "Levenshtein
+ distance" in Wikipedia.
+
+ The basic algorithm is described in:
+ "An O(ND) Difference Algorithm and its Variations", Eugene W. Myers,
+ Algorithmica Vol. 1, 1986, pp. 251-266,
+ <http://dx.doi.org/10.1007/BF01840446>.
+ See especially section 4.2, which describes the variation used below.
+
+ The basic algorithm was independently discovered as described in:
+ "Algorithms for Approximate String Matching", Esko Ukkonen,
+ Information and Control Vol. 64, 1985, pp. 100-118,
+ <http://dx.doi.org/10.1016/S0019-9958(85)80046-2>. */
+
+/* Before including this file, you need to define:
+ ELEMENT The element type of the vectors being compared.
+ EQUAL A two-argument macro that tests two elements for
+ equality.
+ OFFSET A signed integer type sufficient to hold the
+ difference between two indices. Usually
+ something like ptrdiff_t.
+ EXTRA_CONTEXT_FIELDS Declarations of fields for 'struct context'.
+ NOTE_DELETE(ctxt, xoff) Record the removal of the object xvec[xoff].
+ NOTE_INSERT(ctxt, yoff) Record the insertion of the object yvec[yoff].
+ EARLY_ABORT(ctxt) (Optional) A boolean expression that triggers an
+ early abort of the computation.
+ USE_HEURISTIC (Optional) Define if you want to support the
+ heuristic for large vectors.
+ It is also possible to use this file with abstract arrays. In this case,
+ xvec and yvec are not represented in memory. They only exist conceptually.
+ In this case, the list of defines above is amended as follows:
+ ELEMENT Undefined.
+ EQUAL Undefined.
+ XVECREF_YVECREF_EQUAL(ctxt, xoff, yoff)
+ A three-argument macro: References xvec[xoff] and
+ yvec[yoff] and tests these elements for equality.
+ Before including this file, you also need to include:
+ #include <limits.h>
+ #include <stdbool.h>
+ #include "minmax.h"
+ */
+
+/* Maximum value of type OFFSET. */
+#define OFFSET_MAX \
+ ((((OFFSET)1 << (sizeof (OFFSET) * CHAR_BIT - 2)) - 1) * 2 + 1)
+
+/* Default to no early abort. */
+#ifndef EARLY_ABORT
+# define EARLY_ABORT(ctxt) false
+#endif
+
+/* Use this to suppress gcc's "...may be used before initialized" warnings.
+ Beware: The Code argument must not contain commas. */
+#ifndef IF_LINT
+# if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+# else
+# define IF_LINT(Code) /* empty */
+# endif
+#endif
+
+/* As above, but when Code must contain one comma. */
+#ifndef IF_LINT2
+# if defined GCC_LINT || defined lint
+# define IF_LINT2(Code1, Code2) Code1, Code2
+# else
+# define IF_LINT2(Code1, Code2) /* empty */
+# endif
+#endif
+
+/*
+ * Context of comparison operation.
+ */
+struct context
+{
+ #ifdef ELEMENT
+ /* Vectors being compared. */
+ ELEMENT const *xvec;
+ ELEMENT const *yvec;
+ #endif
+
+ /* Extra fields. */
+ EXTRA_CONTEXT_FIELDS
+
+ /* Vector, indexed by diagonal, containing 1 + the X coordinate of the point
+ furthest along the given diagonal in the forward search of the edit
+ matrix. */
+ OFFSET *fdiag;
+
+ /* Vector, indexed by diagonal, containing the X coordinate of the point
+ furthest along the given diagonal in the backward search of the edit
+ matrix. */
+ OFFSET *bdiag;
+
+ #ifdef USE_HEURISTIC
+ /* This corresponds to the diff --speed-large-files flag. With this
+ heuristic, for vectors with a constant small density of changes,
+ the algorithm is linear in the vector size. */
+ bool heuristic;
+ #endif
+
+ /* Snakes bigger than this are considered "big". */
+ #define SNAKE_LIMIT 20
+};
+
+struct partition
+{
+ /* Midpoints of this partition. */
+ OFFSET xmid;
+ OFFSET ymid;
+};
+
+
+/* Find the midpoint of the shortest edit script for a specified portion
+ of the two vectors.
+
+ Scan from the beginnings of the vectors, and simultaneously from the ends,
+ doing a breadth-first search through the space of edit-sequence.
+ When the two searches meet, we have found the midpoint of the shortest
+ edit sequence.
+
+ Set *PART to the midpoint (XMID,YMID). The diagonal number
+ XMID - YMID equals the number of inserted elements minus the number
+ of deleted elements (counting only elements before the midpoint).
+
+ This function assumes that the first elements of the specified portions
+ of the two vectors do not match, and likewise that the last elements do not
+ match. The caller must trim matching elements from the beginning and end
+ of the portions it is going to specify.
+
+ If we return the "wrong" partitions, the worst this can do is cause
+ suboptimal diff output. It cannot cause incorrect diff output. */
+
+static void
+diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim,
+ struct partition *part, struct context *ctxt)
+{
+ OFFSET *const fd = ctxt->fdiag; /* Give the compiler a chance. */
+ OFFSET *const bd = ctxt->bdiag; /* Additional help for the compiler. */
+#ifdef ELEMENT
+ ELEMENT const *const xv = ctxt->xvec; /* Still more help for the compiler. */
+ ELEMENT const *const yv = ctxt->yvec; /* And more and more . . . */
+ #define XREF_YREF_EQUAL(x,y) EQUAL (xv[x], yv[y])
+#else
+ #define XREF_YREF_EQUAL(x,y) XVECREF_YVECREF_EQUAL (ctxt, x, y)
+#endif
+ const OFFSET dmin = xoff - ylim; /* Minimum valid diagonal. */
+ const OFFSET dmax = xlim - yoff; /* Maximum valid diagonal. */
+ const OFFSET fmid = xoff - yoff; /* Center diagonal of top-down search. */
+ const OFFSET bmid = xlim - ylim; /* Center diagonal of bottom-up search. */
+ OFFSET fmin = fmid;
+ OFFSET fmax = fmid; /* Limits of top-down search. */
+ OFFSET bmin = bmid;
+ OFFSET bmax = bmid; /* Limits of bottom-up search. */
+ OFFSET c; /* Cost. */
+ bool odd = (fmid - bmid) & 1; /* True if southeast corner is on an odd
+ diagonal with respect to the northwest. */
+
+ fd[fmid] = xoff;
+ bd[bmid] = xlim;
+
+ for (c = 1;; ++c)
+ {
+ OFFSET d; /* Active diagonal. */
+ bool big_snake = false;
+
+ /* Extend the top-down search by an edit step in each diagonal. */
+ if (fmin > dmin)
+ fd[--fmin - 1] = -1;
+ else
+ ++fmin;
+ if (fmax < dmax)
+ fd[++fmax + 1] = -1;
+ else
+ --fmax;
+ for (d = fmax; d >= fmin; d -= 2)
+ {
+ OFFSET x;
+ OFFSET y;
+ OFFSET tlo = fd[d - 1];
+ OFFSET thi = fd[d + 1];
+ OFFSET x0 = tlo < thi ? thi : tlo + 1;
+
+ for (x = x0, y = x0 - d;
+ x < xlim && y < ylim && XREF_YREF_EQUAL (x, y);
+ x++, y++)
+ continue;
+ if (x - x0 > SNAKE_LIMIT)
+ big_snake = true;
+ fd[d] = x;
+ if (odd && bmin <= d && d <= bmax && bd[d] <= x)
+ {
+ part->xmid = x;
+ part->ymid = y;
+ return;
+ }
+ }
+
+ /* Similarly extend the bottom-up search. */
+ if (bmin > dmin)
+ bd[--bmin - 1] = OFFSET_MAX;
+ else
+ ++bmin;
+ if (bmax < dmax)
+ bd[++bmax + 1] = OFFSET_MAX;
+ else
+ --bmax;
+ for (d = bmax; d >= bmin; d -= 2)
+ {
+ OFFSET x;
+ OFFSET y;
+ OFFSET tlo = bd[d - 1];
+ OFFSET thi = bd[d + 1];
+ OFFSET x0 = tlo < thi ? tlo : thi - 1;
+
+ for (x = x0, y = x0 - d;
+ xoff < x && yoff < y && XREF_YREF_EQUAL (x - 1, y - 1);
+ x--, y--)
+ continue;
+ if (x0 - x > SNAKE_LIMIT)
+ big_snake = true;
+ bd[d] = x;
+ if (!odd && fmin <= d && d <= fmax && x <= fd[d])
+ {
+ part->xmid = x;
+ part->ymid = y;
+ return;
+ }
+ }
+
+#ifdef USE_HEURISTIC
+ /* Heuristic: check occasionally for a diagonal that has made lots
+ of progress compared with the edit distance. If we have any
+ such, find the one that has made the most progress and return it
+ as if it had succeeded.
+
+ With this heuristic, for vectors with a constant small density
+ of changes, the algorithm is linear in the vector size. */
+
+ if (200 < c && big_snake && ctxt->heuristic)
+ {
+ {
+ OFFSET best = 0;
+
+ for (d = fmax; d >= fmin; d -= 2)
+ {
+ OFFSET dd = d - fmid;
+ OFFSET x = fd[d];
+ OFFSET y = x - d;
+ OFFSET v = (x - xoff) * 2 - dd;
+
+ if (v > 12 * (c + (dd < 0 ? -dd : dd)))
+ {
+ if (v > best
+ && xoff + SNAKE_LIMIT <= x && x < xlim
+ && yoff + SNAKE_LIMIT <= y && y < ylim)
+ {
+ /* We have a good enough best diagonal; now insist
+ that it end with a significant snake. */
+ int k;
+
+ for (k = 1; XREF_YREF_EQUAL (x - k, y - k); k++)
+ if (k == SNAKE_LIMIT)
+ {
+ best = v;
+ part->xmid = x;
+ part->ymid = y;
+ break;
+ }
+ }
+ }
+ }
+ if (best > 0)
+ return;
+ }
+
+ {
+ OFFSET best = 0;
+
+ for (d = bmax; d >= bmin; d -= 2)
+ {
+ OFFSET dd = d - bmid;
+ OFFSET x = bd[d];
+ OFFSET y = x - d;
+ OFFSET v = (xlim - x) * 2 + dd;
+
+ if (v > 12 * (c + (dd < 0 ? -dd : dd)))
+ {
+ if (v > best
+ && xoff < x && x <= xlim - SNAKE_LIMIT
+ && yoff < y && y <= ylim - SNAKE_LIMIT)
+ {
+ /* We have a good enough best diagonal; now insist
+ that it end with a significant snake. */
+ int k;
+
+ for (k = 0; XREF_YREF_EQUAL (x + k, y + k); k++)
+ if (k == SNAKE_LIMIT - 1)
+ {
+ best = v;
+ part->xmid = x;
+ part->ymid = y;
+ break;
+ }
+ }
+ }
+ }
+ if (best > 0)
+ return;
+ }
+ }
+#endif /* USE_HEURISTIC */
+ }
+ #undef XREF_YREF_EQUAL
+}
+
+
+/* Compare in detail contiguous subsequences of the two vectors
+ which are known, as a whole, to match each other.
+
+ The subsequence of vector 0 is [XOFF, XLIM) and likewise for vector 1.
+
+ Note that XLIM, YLIM are exclusive bounds. All indices into the vectors
+ are origin-0.
+
+ The results are recorded by invoking NOTE_DELETE and NOTE_INSERT.
+
+ Return false if terminated normally, or true if terminated through early
+ abort. */
+
+static bool
+compareseq (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim,
+ struct context *ctxt)
+{
+#ifdef ELEMENT
+ ELEMENT const *xv = ctxt->xvec; /* Help the compiler. */
+ ELEMENT const *yv = ctxt->yvec;
+ #define XREF_YREF_EQUAL(x,y) EQUAL (xv[x], yv[y])
+#else
+ #define XREF_YREF_EQUAL(x,y) XVECREF_YVECREF_EQUAL (ctxt, x, y)
+#endif
+
+ /* Slide down the bottom initial diagonal. */
+ while (xoff < xlim && yoff < ylim && XREF_YREF_EQUAL (xoff, yoff))
+ {
+ xoff++;
+ yoff++;
+ }
+
+ /* Slide up the top initial diagonal. */
+ while (xoff < xlim && yoff < ylim && XREF_YREF_EQUAL (xlim - 1, ylim - 1))
+ {
+ xlim--;
+ ylim--;
+ }
+
+ /* Handle simple cases. */
+ if (xoff == xlim)
+ while (yoff < ylim)
+ {
+ NOTE_INSERT (ctxt, yoff);
+ if (EARLY_ABORT (ctxt))
+ return true;
+ yoff++;
+ }
+ else if (yoff == ylim)
+ while (xoff < xlim)
+ {
+ NOTE_DELETE (ctxt, xoff);
+ if (EARLY_ABORT (ctxt))
+ return true;
+ xoff++;
+ }
+ else
+ {
+ struct partition part IF_LINT2 (= { .xmid = 0, .ymid = 0 });
+
+ /* Find a point of correspondence in the middle of the vectors. */
+ diag (xoff, xlim, yoff, ylim, &part, ctxt);
+
+ /* Use the partitions to split this problem into subproblems. */
+ if (compareseq (xoff, part.xmid, yoff, part.ymid, ctxt))
+ return true;
+ if (compareseq (part.xmid, xlim, part.ymid, ylim, ctxt))
+ return true;
+ }
+
+ return false;
+ #undef XREF_YREF_EQUAL
+}
+
+#undef ELEMENT
+#undef EQUAL
+#undef OFFSET
+#undef EXTRA_CONTEXT_FIELDS
+#undef NOTE_DELETE
+#undef NOTE_INSERT
+#undef EARLY_ABORT
+#undef USE_HEURISTIC
+#undef XVECREF_YVECREF_EQUAL
+#undef OFFSET_MAX
diff --git a/lib/dirname-lgpl.c b/lib/dirname-lgpl.c
new file mode 100644
index 0000000..a7aabf9
--- /dev/null
+++ b/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-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/* Return the length of the prefix of FILE that will be used by
+ dir_name. If FILE is in the working directory, this returns zero
+ even though 'dir_name (FILE)' will return ".". Works properly even
+ if there are trailing slashes (by effectively ignoring them). */
+
+size_t
+dir_len (char const *file)
+{
+ size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
+ size_t length;
+
+ /* Advance prefix_length beyond important leading slashes. */
+ prefix_length += (prefix_length != 0
+ ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ && ISSLASH (file[prefix_length]))
+ : (ISSLASH (file[0])
+ ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
+ && ISSLASH (file[1]) && ! ISSLASH (file[2])
+ ? 2 : 1))
+ : 0));
+
+ /* Strip the basename and any redundant slashes before it. */
+ for (length = last_component (file) - file;
+ prefix_length < length; length--)
+ if (! ISSLASH (file[length - 1]))
+ break;
+ return length;
+}
+
+
+/* In general, we can't use the builtin 'dirname' function if available,
+ since it has different meanings in different environments.
+ In some environments the builtin 'dirname' modifies its argument.
+
+ Return the leading directories part of FILE, allocated with malloc.
+ Works properly even if there are trailing slashes (by effectively
+ ignoring them). Return NULL on failure.
+
+ If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
+ lstat (base_name (FILE)); } will access the same file. Likewise,
+ if the sequence { chdir (dir_name (FILE));
+ rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
+ to "foo" in the same directory FILE was in. */
+
+char *
+mdir_name (char const *file)
+{
+ size_t length = dir_len (file);
+ bool append_dot = (length == 0
+ || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ && length == FILE_SYSTEM_PREFIX_LEN (file)
+ && file[2] != '\0' && ! ISSLASH (file[2])));
+ char *dir = malloc (length + append_dot + 1);
+ if (!dir)
+ return NULL;
+ memcpy (dir, file, length);
+ if (append_dot)
+ dir[length++] = '.';
+ dir[length] = '\0';
+ return dir;
+}
diff --git a/lib/dirname.c b/lib/dirname.c
new file mode 100644
index 0000000..07aac13
--- /dev/null
+++ b/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-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+#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/lib/dirname.h b/lib/dirname.h
new file mode 100644
index 0000000..875b31b
--- /dev/null
+++ b/lib/dirname.h
@@ -0,0 +1,54 @@
+/* Take file names apart into directory and base names.
+
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef DIRNAME_H_
+# define DIRNAME_H_ 1
+
+# include <stdbool.h>
+# include <stddef.h>
+# include "dosname.h"
+
+# ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+# endif
+
+# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if GNULIB_DIRNAME
+char *base_name (char const *file);
+char *dir_name (char const *file);
+# endif
+
+char *mdir_name (char const *file);
+size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
+size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
+char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
+
+bool strip_trailing_slashes (char *file);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* not DIRNAME_H_ */
diff --git a/lib/dosname.h b/lib/dosname.h
new file mode 100644
index 0000000..83a953f
--- /dev/null
+++ b/lib/dosname.h
@@ -0,0 +1,53 @@
+/* File names on MS-DOS/Windows systems.
+
+ Copyright (C) 2000-2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ From Paul Eggert and Jim Meyering. */
+
+#ifndef _DOSNAME_H
+#define _DOSNAME_H
+
+#if (defined _WIN32 || defined __WIN32__ || \
+ defined __MSDOS__ || defined __CYGWIN__ || \
+ defined __EMX__ || defined __DJGPP__)
+ /* This internal macro assumes ASCII, but all hosts that support drive
+ letters use ASCII. */
+# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
+ <= 'z' - 'a')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
+# ifndef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
+# define ISSLASH(C) ((C) == '/')
+#endif
+
+#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+#endif
+
+#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(F) \
+ (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
+#endif
+#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
+
+#endif /* DOSNAME_H_ */
diff --git a/lib/dup2.c b/lib/dup2.c
new file mode 100644
index 0000000..5d026f2
--- /dev/null
+++ b/lib/dup2.c
@@ -0,0 +1,215 @@
+/* Duplicate an open file descriptor to a specified file descriptor.
+
+ Copyright (C) 1999, 2004-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <fcntl.h>
+
+#if HAVE_DUP2
+
+# undef dup2
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# include "msvc-inval.h"
+
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+
+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:
+ http://bugs.winehq.org/show_bug.cgi?id=21289 */
+ if (desired_fd < 0)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ TRY_MSVC_INVAL
+ {
+ result = dup2 (fd, desired_fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ errno = EBADF;
+ result = -1;
+ }
+ DONE_MSVC_INVAL;
+
+ 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;
+}
+
+#else /* !HAVE_DUP2 */
+
+/* On older platforms, dup2 did not exist. */
+
+# ifndef F_DUPFD
+static int
+dupfd (int fd, int desired_fd)
+{
+ int duplicated_fd = dup (fd);
+ if (duplicated_fd < 0 || duplicated_fd == desired_fd)
+ return duplicated_fd;
+ else
+ {
+ int r = dupfd (fd, desired_fd);
+ int e = errno;
+ close (duplicated_fd);
+ errno = e;
+ return r;
+ }
+}
+# endif
+
+int
+dup2 (int fd, int desired_fd)
+{
+ int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd;
+ if (result == -1 || fd == desired_fd)
+ return result;
+ close (desired_fd);
+# ifdef F_DUPFD
+ result = fcntl (fd, F_DUPFD, desired_fd);
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (fd, result);
+# endif
+# else
+ result = dupfd (fd, desired_fd);
+# endif
+ if (result == -1 && (errno == EMFILE || errno == EINVAL))
+ errno = EBADF;
+ return result;
+}
+#endif /* !HAVE_DUP2 */
diff --git a/lib/errno.in.h b/lib/errno.in.h
new file mode 100644
index 0000000..b8397ee
--- /dev/null
+++ b/lib/errno.in.h
@@ -0,0 +1,279 @@
+/* A POSIX-like <errno.h>.
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_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 __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 __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/lib/error.c b/lib/error.c
new file mode 100644
index 0000000..56ac889
--- /dev/null
+++ b/lib/error.c
@@ -0,0 +1,406 @@
+/* Error handler for noninteractive utilities
+ Copyright (C) 1990-1998, 2000-2007, 2009-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#if !_LIBC
+# include <config.h>
+#endif
+
+#include "error.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if !_LIBC && ENABLE_NLS
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <wchar.h>
+# define mbsrtowcs __mbsrtowcs
+# define USE_UNLOCKED_IO 0
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
+# define _GL_ARG_NONNULL(a)
+#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 __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+# endif
+
+/* The gnulib override of fcntl is not needed in this file. */
+# undef fcntl
+
+# if !HAVE_DECL_STRERROR_R
+# ifndef HAVE_DECL_STRERROR_R
+"this configure-time declaration test was not run"
+# endif
+# if STRERROR_R_CHAR_P
+char *strerror_r ();
+# else
+int strerror_r ();
+# endif
+# endif
+
+/* The calling program should define program_name and set it to the
+ name of the executing program. */
+extern char *program_name;
+
+# if HAVE_STRERROR_R || defined strerror_r
+# define __strerror_r strerror_r
+# endif /* HAVE_STRERROR_R || defined strerror_r */
+#endif /* not _LIBC */
+
+#if !_LIBC
+/* Return non-zero if FD is open. */
+static int
+is_open (int fd)
+{
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Windows: The initial state of unassigned standard file
+ descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
+ There is no fcntl, and the gnulib replacement fcntl does not support
+ F_GETFL. */
+ return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+# ifndef F_GETFL
+# error Please port fcntl to your platform
+# endif
+ return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
+static void
+flush_stdout (void)
+{
+#if !_LIBC
+ int stdout_fd;
+
+# if GNULIB_FREOPEN_SAFER
+ /* Use of gnulib's freopen-safer module normally ensures that
+ fileno (stdout) == 1
+ whenever stdout is open. */
+ stdout_fd = STDOUT_FILENO;
+# else
+ /* POSIX states that fileno (stdout) after fclose is unspecified. But in
+ practice it is not a problem, because stdout is statically allocated and
+ the fd of a FILE stream is stored as a field in its allocated memory. */
+ stdout_fd = fileno (stdout);
+# endif
+ /* POSIX states that fflush (stdout) after fclose is unspecified; it
+ is safe in glibc, but not on all other platforms. fflush (NULL)
+ is always defined, but too draconian. */
+ if (0 <= stdout_fd && is_open (stdout_fd))
+#endif
+ fflush (stdout);
+}
+
+static void
+print_errno_message (int errnum)
+{
+ char const *s;
+
+#if defined HAVE_STRERROR_R || _LIBC
+ char errbuf[1024];
+# if _LIBC || 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 (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);
+ va_end (args);
+
+ ++error_message_count;
+ if (errnum)
+ print_errno_message (errnum);
+#if _LIBC
+ __fxprintf (NULL, "\n");
+#else
+ putc ('\n', stderr);
+#endif
+ fflush (stderr);
+ if (status)
+ exit (status);
+}
+
+
+/* Print the program name and error message MESSAGE, which is a printf-style
+ format string with optional args.
+ If ERRNUM is nonzero, print its corresponding system error message.
+ Exit with status STATUS if it is nonzero. */
+void
+error (int status, int errnum, const char *message, ...)
+{
+ va_list args;
+
+#if defined _LIBC && defined __libc_ptf_call
+ /* We do not want this call to be cut short by a thread
+ cancellation. Therefore disable cancellation for now. */
+ int state = PTHREAD_CANCEL_ENABLE;
+ __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ 0);
+#endif
+
+ flush_stdout ();
+#ifdef _LIBC
+ _IO_flockfile (stderr);
+#endif
+ if (error_print_progname)
+ (*error_print_progname) ();
+ else
+ {
+#if _LIBC
+ __fxprintf (NULL, "%s: ", program_name);
+#else
+ fprintf (stderr, "%s: ", program_name);
+#endif
+ }
+
+ va_start (args, message);
+ error_tail (status, errnum, message, args);
+
+#ifdef _LIBC
+ _IO_funlockfile (stderr);
+# ifdef __libc_ptf_call
+ __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+# endif
+#endif
+}
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+int error_one_per_line;
+
+void
+error_at_line (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message, ...)
+{
+ va_list args;
+
+ if (error_one_per_line)
+ {
+ static const char *old_file_name;
+ static unsigned int old_line_number;
+
+ if (old_line_number == line_number
+ && (file_name == old_file_name
+ || (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);
+
+#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/lib/error.h b/lib/error.h
new file mode 100644
index 0000000..6a69db0
--- /dev/null
+++ b/lib/error.h
@@ -0,0 +1,75 @@
+/* Declaration for error-reporting function
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2016 Free Software Foundation,
+ Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _ERROR_H
+#define _ERROR_H 1
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The __-protected variants of the attributes 'format' and 'printf' are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+#endif
+
+/* On mingw, the flavor of printf depends on whether the extensions module
+ * is in use; the check for <stdio.h> determines the witness macro. */
+#ifndef _GL_ATTRIBUTE_SPEC_PRINTF
+# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__
+# else
+# define _GL_ATTRIBUTE_SPEC_PRINTF __printf__
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Print a message with 'fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4));
+
+extern void error_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6));
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+extern void (*error_print_progname) (void);
+
+/* This variable is incremented each time 'error' is called. */
+extern unsigned int error_message_count;
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+extern int error_one_per_line;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* error.h */
diff --git a/lib/exclude.c b/lib/exclude.c
new file mode 100644
index 0000000..92dacc4
--- /dev/null
+++ b/lib/exclude.c
@@ -0,0 +1,695 @@
+/* exclude.c -- exclude file names
+
+ Copyright (C) 1992-1994, 1997, 1999-2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert <eggert@twinsun.com>
+ and Sergey Poznyakoff <gray@gnu.org>.
+ Thanks to Phil Proudman <phil@proudman51.freeserve.co.uk>
+ for improvement suggestions. */
+
+#include <config.h>
+
+#include <stdbool.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wctype.h>
+#include <regex.h>
+
+#include "exclude.h"
+#include "hash.h"
+#include "mbuiter.h"
+#include "fnmatch.h"
+#include "xalloc.h"
+#include "verify.h"
+#include "filename.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+/* Non-GNU systems lack these options, so we don't need to check them. */
+#ifndef FNM_CASEFOLD
+# define FNM_CASEFOLD 0
+#endif
+#ifndef FNM_EXTMATCH
+# define FNM_EXTMATCH 0
+#endif
+#ifndef FNM_LEADING_DIR
+# define FNM_LEADING_DIR 0
+#endif
+
+verify (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
+ & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
+ | FNM_CASEFOLD | FNM_EXTMATCH))
+ == 0);
+
+
+/* Exclusion patterns are grouped into a singly-linked list of
+ "exclusion segments". Each segment represents a set of patterns
+ that can be matches using the same algorithm. Non-wildcard
+ patterns are kept in hash tables, to speed up searches. Wildcard
+ patterns are stored as arrays of patterns. */
+
+
+/* An exclude pattern-options pair. The options are fnmatch options
+ ORed with EXCLUDE_* options. */
+
+struct patopts
+ {
+ int options;
+ union
+ {
+ char const *pattern;
+ regex_t re;
+ } v;
+ };
+
+/* An array of pattern-options pairs. */
+
+struct exclude_pattern
+ {
+ struct patopts *exclude;
+ size_t exclude_alloc;
+ size_t exclude_count;
+ };
+
+enum exclude_type
+ {
+ exclude_hash, /* a hash table of excluded names */
+ exclude_pattern /* an array of exclude patterns */
+ };
+
+struct exclude_segment
+ {
+ struct exclude_segment *next; /* next segment in list */
+ enum exclude_type type; /* type of this segment */
+ int options; /* common options for this segment */
+ union
+ {
+ Hash_table *table; /* for type == exclude_hash */
+ struct exclude_pattern pat; /* for type == exclude_pattern */
+ } v;
+ };
+
+struct pattern_buffer
+ {
+ struct pattern_buffer *next;
+ char *base;
+ };
+
+/* The exclude structure keeps a singly-linked list of exclude segments,
+ maintained in reverse order. */
+struct exclude
+ {
+ struct exclude_segment *head;
+ struct pattern_buffer *patbuf;
+ };
+
+/* Register BUF in the pattern buffer list of EX. ADD_FUNC (see
+ add_exclude_file and add_exclude_fp below) can use this function
+ if it modifies the pattern, to ensure the allocated memory will be
+ properly reclaimed upon calling free_exclude. */
+void
+exclude_add_pattern_buffer (struct exclude *ex, char *buf)
+{
+ struct pattern_buffer *pbuf = xmalloc (sizeof *pbuf);
+ pbuf->base = buf;
+ pbuf->next = ex->patbuf;
+ ex->patbuf = pbuf;
+}
+
+/* Return true if STR has or may have wildcards, when matched with OPTIONS.
+ Return false if STR definitely does not have wildcards. */
+bool
+fnmatch_pattern_has_wildcards (const char *str, int options)
+{
+ while (1)
+ {
+ switch (*str++)
+ {
+ case '.':
+ case '{':
+ case '}':
+ case '(':
+ case ')':
+ if (options & EXCLUDE_REGEX)
+ return true;
+ break;
+
+ case '\\':
+ if (options & EXCLUDE_REGEX)
+ continue;
+ else
+ str += ! (options & FNM_NOESCAPE) && *str;
+ break;
+
+ case '+': case '@': case '!':
+ if (options & FNM_EXTMATCH && *str == '(')
+ return true;
+ break;
+
+ case '?': case '*': case '[':
+ return true;
+
+ case '\0':
+ return false;
+ }
+ }
+}
+
+static void
+unescape_pattern (char *str)
+{
+ char const *q = str;
+ do
+ q += *q == '\\' && q[1];
+ while ((*str++ = *q++));
+}
+
+/* Return a newly allocated and empty exclude list. */
+
+struct exclude *
+new_exclude (void)
+{
+ return xzalloc (sizeof *new_exclude ());
+}
+
+/* Calculate the hash of string. */
+static size_t
+string_hasher (void const *data, size_t n_buckets)
+{
+ char const *p = data;
+ return hash_string (p, n_buckets);
+}
+
+/* Ditto, for case-insensitive hashes */
+static size_t
+string_hasher_ci (void const *data, size_t n_buckets)
+{
+ char const *p = data;
+ mbui_iterator_t iter;
+ size_t value = 0;
+
+ for (mbui_init (iter, p); mbui_avail (iter); mbui_advance (iter))
+ {
+ mbchar_t m = mbui_cur (iter);
+ wchar_t wc;
+
+ if (m.wc_valid)
+ wc = towlower (m.wc);
+ else
+ wc = *m.ptr;
+
+ value = (value * 31 + wc) % n_buckets;
+ }
+
+ return value;
+}
+
+/* compare two strings for equality */
+static bool
+string_compare (void const *data1, void const *data2)
+{
+ char const *p1 = data1;
+ char const *p2 = data2;
+ return strcmp (p1, p2) == 0;
+}
+
+/* compare two strings for equality, case-insensitive */
+static bool
+string_compare_ci (void const *data1, void const *data2)
+{
+ char const *p1 = data1;
+ char const *p2 = data2;
+ return mbscasecmp (p1, p2) == 0;
+}
+
+static void
+string_free (void *data)
+{
+ free (data);
+}
+
+/* Create new exclude segment of given TYPE and OPTIONS, and attach it
+ to the head of EX. */
+static void
+new_exclude_segment (struct exclude *ex, enum exclude_type type, int options)
+{
+ struct exclude_segment *sp = xzalloc (sizeof (struct exclude_segment));
+ sp->type = type;
+ sp->options = options;
+ switch (type)
+ {
+ case exclude_pattern:
+ break;
+
+ case exclude_hash:
+ sp->v.table = hash_initialize (0, NULL,
+ (options & FNM_CASEFOLD) ?
+ string_hasher_ci
+ : string_hasher,
+ (options & FNM_CASEFOLD) ?
+ string_compare_ci
+ : string_compare,
+ string_free);
+ break;
+ }
+ sp->next = ex->head;
+ ex->head = sp;
+}
+
+/* Free a single exclude segment */
+static void
+free_exclude_segment (struct exclude_segment *seg)
+{
+ size_t i;
+
+ switch (seg->type)
+ {
+ case exclude_pattern:
+ for (i = 0; i < seg->v.pat.exclude_count; i++)
+ {
+ if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX)
+ regfree (&seg->v.pat.exclude[i].v.re);
+ }
+ free (seg->v.pat.exclude);
+ break;
+
+ case exclude_hash:
+ hash_free (seg->v.table);
+ break;
+ }
+ free (seg);
+}
+
+/* Free the storage associated with an exclude list. */
+void
+free_exclude (struct exclude *ex)
+{
+ struct exclude_segment *seg;
+ struct pattern_buffer *pbuf;
+
+ for (seg = ex->head; seg; )
+ {
+ struct exclude_segment *next = seg->next;
+ free_exclude_segment (seg);
+ seg = next;
+ }
+
+ for (pbuf = ex->patbuf; pbuf; )
+ {
+ struct pattern_buffer *next = pbuf->next;
+ free (pbuf->base);
+ free (pbuf);
+ pbuf = next;
+ }
+
+ free (ex);
+}
+
+/* Return zero if PATTERN matches F, obeying OPTIONS, except that
+ (unlike fnmatch) wildcards are disabled in PATTERN. */
+
+static int
+fnmatch_no_wildcards (char const *pattern, char const *f, int options)
+{
+ if (! (options & FNM_LEADING_DIR))
+ return ((options & FNM_CASEFOLD)
+ ? mbscasecmp (pattern, f)
+ : strcmp (pattern, f));
+ else if (! (options & FNM_CASEFOLD))
+ {
+ size_t patlen = strlen (pattern);
+ int r = strncmp (pattern, f, patlen);
+ if (! r)
+ {
+ r = f[patlen];
+ if (r == '/')
+ r = 0;
+ }
+ return r;
+ }
+ else
+ {
+ /* Walk through a copy of F, seeing whether P matches any prefix
+ of F.
+
+ FIXME: This is an O(N**2) algorithm; it should be O(N).
+ Also, the copy should not be necessary. However, fixing this
+ will probably involve a change to the mbs* API. */
+
+ char *fcopy = xstrdup (f);
+ char *p;
+ int r;
+ for (p = fcopy; ; *p++ = '/')
+ {
+ p = strchr (p, '/');
+ if (p)
+ *p = '\0';
+ r = mbscasecmp (pattern, fcopy);
+ if (!p || r <= 0)
+ break;
+ }
+ free (fcopy);
+ return r;
+ }
+}
+
+bool
+exclude_fnmatch (char const *pattern, char const *f, int options)
+{
+ int (*matcher) (char const *, char const *, int) =
+ (options & EXCLUDE_WILDCARDS
+ ? fnmatch
+ : fnmatch_no_wildcards);
+ bool matched = ((*matcher) (pattern, f, options) == 0);
+ char const *p;
+
+ if (! (options & EXCLUDE_ANCHORED))
+ for (p = f; *p && ! matched; p++)
+ if (*p == '/' && p[1] != '/')
+ matched = ((*matcher) (pattern, p + 1, options) == 0);
+
+ return matched;
+}
+
+static bool
+exclude_patopts (struct patopts const *opts, char const *f)
+{
+ int options = opts->options;
+
+ return (options & EXCLUDE_REGEX)
+ ? regexec (&opts->v.re, f, 0, NULL, 0) == 0
+ : exclude_fnmatch (opts->v.pattern, f, options);
+}
+
+/* Return true if the exclude_pattern segment SEG matches F. */
+
+static bool
+file_pattern_matches (struct exclude_segment const *seg, char const *f)
+{
+ size_t exclude_count = seg->v.pat.exclude_count;
+ struct patopts const *exclude = seg->v.pat.exclude;
+ size_t i;
+
+ for (i = 0; i < exclude_count; i++)
+ {
+ if (exclude_patopts (exclude + i, f))
+ return true;
+ }
+ return false;
+}
+
+/* Return true if the exclude_hash segment SEG matches F.
+ BUFFER is an auxiliary storage of the same length as F (with nul
+ terminator included) */
+static bool
+file_name_matches (struct exclude_segment const *seg, char const *f,
+ char *buffer)
+{
+ int options = seg->options;
+ Hash_table *table = seg->v.table;
+
+ do
+ {
+ /* initialize the pattern */
+ strcpy (buffer, f);
+
+ while (1)
+ {
+ if (hash_lookup (table, buffer))
+ return true;
+ if (options & FNM_LEADING_DIR)
+ {
+ char *p = strrchr (buffer, '/');
+ if (p)
+ {
+ *p = 0;
+ continue;
+ }
+ }
+ break;
+ }
+
+ if (!(options & EXCLUDE_ANCHORED))
+ {
+ f = strchr (f, '/');
+ if (f)
+ f++;
+ }
+ else
+ break;
+ }
+ while (f);
+
+ return false;
+}
+
+/* Return true if EX excludes F. */
+
+bool
+excluded_file_name (struct exclude const *ex, char const *f)
+{
+ struct exclude_segment *seg;
+ bool invert = false;
+ char *filename = NULL;
+
+ /* If no patterns are given, the default is to include. */
+ if (!ex->head)
+ return false;
+
+ /* Scan through the segments, reporting the status of the first match.
+ The segments are in reverse order, so this reports the status of
+ the last match in the original option list. */
+ for (seg = ex->head; ; seg = seg->next)
+ {
+ if (seg->type == exclude_hash)
+ {
+ if (!filename)
+ filename = xmalloc (strlen (f) + 1);
+ if (file_name_matches (seg, f, filename))
+ break;
+ }
+ else
+ {
+ if (file_pattern_matches (seg, f))
+ break;
+ }
+
+ if (! seg->next)
+ {
+ /* If patterns are given but none match, the default is the
+ opposite of the last segment (i.e., the first in the
+ original option list). For example, in the command
+ 'grep -r --exclude="a*" --include="*b" pat dir', the
+ first option is --exclude so any file name matching
+ neither a* nor *b is included. */
+ invert = true;
+ break;
+ }
+ }
+
+ free (filename);
+ return invert ^ ! (seg->options & EXCLUDE_INCLUDE);
+}
+
+/* Append to EX the exclusion PATTERN with OPTIONS. */
+
+void
+add_exclude (struct exclude *ex, char const *pattern, int options)
+{
+ struct exclude_segment *seg;
+ struct exclude_pattern *pat;
+ struct patopts *patopts;
+
+ if ((options & (EXCLUDE_REGEX|EXCLUDE_WILDCARDS))
+ && fnmatch_pattern_has_wildcards (pattern, options))
+ {
+ if (! (ex->head && ex->head->type == exclude_pattern
+ && ((ex->head->options & EXCLUDE_INCLUDE)
+ == (options & EXCLUDE_INCLUDE))))
+ new_exclude_segment (ex, exclude_pattern, options);
+
+ seg = ex->head;
+
+ pat = &seg->v.pat;
+ if (pat->exclude_count == pat->exclude_alloc)
+ pat->exclude = x2nrealloc (pat->exclude, &pat->exclude_alloc,
+ sizeof *pat->exclude);
+ patopts = &pat->exclude[pat->exclude_count++];
+
+ patopts->options = options;
+ if (options & EXCLUDE_REGEX)
+ {
+ int rc;
+ int cflags = REG_NOSUB|REG_EXTENDED|
+ ((options & FNM_CASEFOLD) ? REG_ICASE : 0);
+
+ if (options & FNM_LEADING_DIR)
+ {
+ char *tmp;
+ size_t len = strlen (pattern);
+
+ while (len > 0 && ISSLASH (pattern[len-1]))
+ --len;
+
+ if (len == 0)
+ rc = 1;
+ else
+ {
+ tmp = xmalloc (len + 7);
+ memcpy (tmp, pattern, len);
+ strcpy (tmp + len, "(/.*)?");
+ rc = regcomp (&patopts->v.re, tmp, cflags);
+ free (tmp);
+ }
+ }
+ else
+ rc = regcomp (&patopts->v.re, pattern, cflags);
+
+ if (rc)
+ {
+ pat->exclude_count--;
+ return;
+ }
+ }
+ else
+ {
+ if (options & EXCLUDE_ALLOC)
+ {
+ pattern = xstrdup (pattern);
+ exclude_add_pattern_buffer (ex, (char*) pattern);
+ }
+ patopts->v.pattern = pattern;
+ }
+ }
+ else
+ {
+ char *str, *p;
+ int exclude_hash_flags = (EXCLUDE_INCLUDE | EXCLUDE_ANCHORED
+ | FNM_LEADING_DIR | FNM_CASEFOLD);
+ if (! (ex->head && ex->head->type == exclude_hash
+ && ((ex->head->options & exclude_hash_flags)
+ == (options & exclude_hash_flags))))
+ new_exclude_segment (ex, exclude_hash, options);
+ seg = ex->head;
+
+ str = xstrdup (pattern);
+ if ((options & (EXCLUDE_WILDCARDS | FNM_NOESCAPE)) == EXCLUDE_WILDCARDS)
+ unescape_pattern (str);
+ p = hash_insert (seg->v.table, str);
+ if (p != str)
+ free (str);
+ }
+}
+
+/* Use ADD_FUNC to append to EX the patterns in FILE_NAME, each with
+ OPTIONS. LINE_END terminates each pattern in the file. If
+ LINE_END is a space character, ignore trailing spaces and empty
+ lines in FP. Return -1 on failure, 0 on success. */
+
+int
+add_exclude_fp (void (*add_func) (struct exclude *, char const *, int, void *),
+ struct exclude *ex, FILE *fp, int options,
+ char line_end,
+ void *data)
+{
+ char *buf = NULL;
+ char *p;
+ char *pattern;
+ char const *lim;
+ size_t buf_alloc = 0;
+ size_t buf_count = 0;
+ int c;
+ int e = 0;
+
+ while ((c = getc (fp)) != EOF)
+ {
+ if (buf_count == buf_alloc)
+ buf = x2realloc (buf, &buf_alloc);
+ buf[buf_count++] = c;
+ }
+
+ if (ferror (fp))
+ e = errno;
+
+ buf = xrealloc (buf, buf_count + 1);
+ buf[buf_count] = line_end;
+ lim = buf + buf_count + ! (buf_count == 0 || buf[buf_count - 1] == line_end);
+
+ exclude_add_pattern_buffer (ex, buf);
+
+ pattern = buf;
+
+ for (p = buf; p < lim; p++)
+ if (*p == line_end)
+ {
+ char *pattern_end = p;
+
+ if (isspace ((unsigned char) line_end))
+ {
+ for (; ; pattern_end--)
+ if (pattern_end == pattern)
+ goto next_pattern;
+ else if (! isspace ((unsigned char) pattern_end[-1]))
+ break;
+ }
+
+ *pattern_end = '\0';
+ (*add_func) (ex, pattern, options, data);
+
+ next_pattern:
+ pattern = p + 1;
+ }
+
+ errno = e;
+ return e ? -1 : 0;
+}
+
+static void
+call_addfn (struct exclude *ex, char const *pattern, int options, void *data)
+{
+ void (**addfnptr) (struct exclude *, char const *, int) = data;
+ (*addfnptr) (ex, pattern, options);
+}
+
+int
+add_exclude_file (void (*add_func) (struct exclude *, char const *, int),
+ struct exclude *ex, char const *file_name, int options,
+ char line_end)
+{
+ bool use_stdin = file_name[0] == '-' && !file_name[1];
+ FILE *in;
+ int rc = 0;
+
+ if (use_stdin)
+ in = stdin;
+ else if (! (in = fopen (file_name, "r")))
+ return -1;
+
+ rc = add_exclude_fp (call_addfn, ex, in, options, line_end, &add_func);
+
+ if (!use_stdin && fclose (in) != 0)
+ rc = -1;
+
+ return rc;
+}
diff --git a/lib/exclude.h b/lib/exclude.h
new file mode 100644
index 0000000..8cb8b36
--- /dev/null
+++ b/lib/exclude.h
@@ -0,0 +1,62 @@
+/* exclude.h -- declarations for excluding file names
+
+ Copyright (C) 1992-1994, 1997, 1999, 2001-2003, 2005-2006, 2009-2016 Free
+ Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _GL_EXCLUDE_H
+#define _GL_EXCLUDE_H 1
+
+#include <stdbool.h>
+#include <stdio.h>
+
+/* Written by Paul Eggert <eggert@twinsun.com>
+ and Sergey Poznyakoff <gray@gnu.org> */
+
+/* Exclude options, which can be ORed with fnmatch options. */
+
+/* Patterns must match the start of file names, instead of matching
+ anywhere after a '/'. */
+#define EXCLUDE_ANCHORED (1 << 30)
+
+/* Include instead of exclude. */
+#define EXCLUDE_INCLUDE (1 << 29)
+
+/* '?', '*', '[', and '\\' are special in patterns. Without this
+ option, these characters are ordinary and fnmatch is not used. */
+#define EXCLUDE_WILDCARDS (1 << 28)
+
+/* Patterns are POSIX extended regular expressions */
+#define EXCLUDE_REGEX (1 << 27)
+
+/* Allocate storage for the pattern */
+#define EXCLUDE_ALLOC (1 << 26)
+
+struct exclude;
+
+bool fnmatch_pattern_has_wildcards (const char *, int) _GL_ATTRIBUTE_PURE;
+
+struct exclude *new_exclude (void);
+void free_exclude (struct exclude *);
+void add_exclude (struct exclude *, char const *, int);
+int add_exclude_file (void (*) (struct exclude *, char const *, int),
+ struct exclude *, char const *, int, char);
+int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *),
+ struct exclude *, FILE *, int, char, void *);
+bool excluded_file_name (struct exclude const *, char const *);
+void exclude_add_pattern_buffer (struct exclude *ex, char *buf);
+bool exclude_fnmatch (char const *, char const *, int);
+
+#endif /* _GL_EXCLUDE_H */
diff --git a/lib/exitfail.c b/lib/exitfail.c
new file mode 100644
index 0000000..8033c22
--- /dev/null
+++ b/lib/exitfail.c
@@ -0,0 +1,24 @@
+/* Failure exit status
+
+ Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "exitfail.h"
+
+#include <stdlib.h>
+
+int volatile exit_failure = EXIT_FAILURE;
diff --git a/lib/exitfail.h b/lib/exitfail.h
new file mode 100644
index 0000000..62311bd
--- /dev/null
+++ b/lib/exitfail.h
@@ -0,0 +1,18 @@
+/* Failure exit status
+
+ Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+extern int volatile exit_failure;
diff --git a/lib/fcntl.c b/lib/fcntl.c
new file mode 100644
index 0000000..fd17e96
--- /dev/null
+++ b/lib/fcntl.c
@@ -0,0 +1,414 @@
+/* Provide file descriptor control.
+
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <fcntl.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <unistd.h>
+
+#if !HAVE_FCNTL
+# define rpl_fcntl fcntl
+#endif
+#undef fcntl
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
+
+/* 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 */
+
+#ifdef __KLIBC__
+
+# define INCL_DOS
+# include <os2.h>
+
+static int
+klibc_fcntl (int fd, int action, /* arg */...)
+{
+ va_list arg_ptr;
+ int arg;
+ struct stat sbuf;
+ int result = -1;
+
+ 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;
+}
+
+# define fcntl klibc_fcntl
+#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
+rpl_fcntl (int fd, int action, /* arg */...)
+{
+ va_list arg;
+ int result = -1;
+ va_start (arg, action);
+ switch (action)
+ {
+
+#if !HAVE_FCNTL
+ case F_DUPFD:
+ {
+ int target = va_arg (arg, int);
+ result = dupfd (fd, target, 0);
+ break;
+ }
+#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
+ case F_DUPFD:
+ {
+ int target = va_arg (arg, int);
+ /* Detect invalid target; needed for cygwin 1.5.x. */
+ if (target < 0 || getdtablesize () <= target)
+ errno = EINVAL;
+ else
+ {
+ /* Haiku alpha 2 loses fd flags on original. */
+ int flags = fcntl (fd, F_GETFD);
+ if (flags < 0)
+ {
+ result = -1;
+ break;
+ }
+ result = fcntl (fd, action, 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
+ }
+ break;
+ } /* F_DUPFD */
+#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */
+
+ case F_DUPFD_CLOEXEC:
+ {
+ int target = va_arg (arg, int);
+
+#if !HAVE_FCNTL
+ result = dupfd (fd, target, O_CLOEXEC);
+ break;
+#else /* HAVE_FCNTL */
+ /* 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, action, 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 (fd, F_DUPFD, target);
+ if (result < 0)
+ break;
+ have_dupfd_cloexec = -1;
+ }
+ }
+ else
+ result = rpl_fcntl (fd, F_DUPFD, 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;
+ }
+ }
+ break;
+#endif /* HAVE_FCNTL */
+ } /* F_DUPFD_CLOEXEC */
+
+#if !HAVE_FCNTL
+ case F_GETFD:
+ {
+# if (defined _WIN32 || 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
+ void *p = va_arg (arg, void *);
+ result = fcntl (fd, action, p);
+#else
+ errno = EINVAL;
+#endif
+ break;
+ }
+ }
+ va_end (arg);
+ return result;
+}
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
new file mode 100644
index 0000000..b943973
--- /dev/null
+++ b/lib/fcntl.in.h
@@ -0,0 +1,363 @@
+/* Like <fcntl.h>, but with non-working flags defined to 0.
+
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by 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@
+
+#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@
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_FCNTL_H
+
+#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+# include <unistd.h>
+#endif
+
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.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_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, ...));
+# else
+# if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+# 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, ...));
+# 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");
+#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 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
+
+
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif
diff --git a/lib/fd-hook.c b/lib/fd-hook.c
new file mode 100644
index 0000000..8676c6b
--- /dev/null
+++ b/lib/fd-hook.c
@@ -0,0 +1,116 @@
+/* Hook for making making file descriptor functions close(), ioctl() extensible.
+ Copyright (C) 2009-2016 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 <http://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/lib/fd-hook.h b/lib/fd-hook.h
new file mode 100644
index 0000000..9568d07
--- /dev/null
+++ b/lib/fd-hook.h
@@ -0,0 +1,119 @@
+/* Hook for making making file descriptor functions close(), ioctl() extensible.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+#ifndef 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/lib/file-type.c b/lib/file-type.c
new file mode 100644
index 0000000..b405133
--- /dev/null
+++ b/lib/file-type.c
@@ -0,0 +1,111 @@
+/* Return a string describing the type of a file.
+
+ Copyright (C) 1993-1994, 2001-2002, 2004-2006, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+#include "file-type.h"
+
+#include <gettext.h>
+#define _(text) gettext (text)
+
+char const *
+file_type (struct stat const *st)
+{
+ /* See POSIX 1003.1-2001 XCU Table 4-8 lines 17093-17107 for some of
+ these formats.
+
+ To keep diagnostics grammatical in English, the returned string
+ must start with a consonant. */
+
+ /* Do these three first, as they're the most common. */
+
+ if (S_ISREG (st->st_mode))
+ return st->st_size == 0 ? _("regular empty file") : _("regular file");
+
+ if (S_ISDIR (st->st_mode))
+ return _("directory");
+
+ if (S_ISLNK (st->st_mode))
+ return _("symbolic link");
+
+ /* Do the S_TYPEIS* macros next, as they may be implemented in terms
+ of S_ISNAM, and we want the more-specialized interpretation. */
+
+ if (S_TYPEISMQ (st))
+ return _("message queue");
+
+ if (S_TYPEISSEM (st))
+ return _("semaphore");
+
+ if (S_TYPEISSHM (st))
+ return _("shared memory object");
+
+ if (S_TYPEISTMO (st))
+ return _("typed memory object");
+
+ /* The remaining are in alphabetical order. */
+
+ if (S_ISBLK (st->st_mode))
+ return _("block special file");
+
+ if (S_ISCHR (st->st_mode))
+ return _("character special file");
+
+ if (S_ISCTG (st->st_mode))
+ return _("contiguous data");
+
+ if (S_ISFIFO (st->st_mode))
+ return _("fifo");
+
+ if (S_ISDOOR (st->st_mode))
+ return _("door");
+
+ if (S_ISMPB (st->st_mode))
+ return _("multiplexed block special file");
+
+ if (S_ISMPC (st->st_mode))
+ return _("multiplexed character special file");
+
+ if (S_ISMPX (st->st_mode))
+ return _("multiplexed file");
+
+ if (S_ISNAM (st->st_mode))
+ return _("named file");
+
+ if (S_ISNWK (st->st_mode))
+ return _("network special file");
+
+ if (S_ISOFD (st->st_mode))
+ return _("migrated file with data");
+
+ if (S_ISOFL (st->st_mode))
+ return _("migrated file without data");
+
+ if (S_ISPORT (st->st_mode))
+ return _("port");
+
+ if (S_ISSOCK (st->st_mode))
+ return _("socket");
+
+ if (S_ISWHT (st->st_mode))
+ return _("whiteout");
+
+ return _("weird file");
+}
diff --git a/lib/file-type.h b/lib/file-type.h
new file mode 100644
index 0000000..0933f7a
--- /dev/null
+++ b/lib/file-type.h
@@ -0,0 +1,29 @@
+/* Return a string describing the type of a file.
+
+ Copyright (C) 1993-1994, 2001-2002, 2004-2005, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert and Jim Meyering. */
+
+#ifndef FILE_TYPE_H
+# define FILE_TYPE_H 1
+
+# include <sys/types.h>
+# include <sys/stat.h>
+
+char const *file_type (struct stat const *) _GL_ATTRIBUTE_PURE;
+
+#endif /* FILE_TYPE_H */
diff --git a/lib/filename.h b/lib/filename.h
new file mode 100644
index 0000000..7d2c31a
--- /dev/null
+++ b/lib/filename.h
@@ -0,0 +1,54 @@
+/* Basic filename support macros.
+ Copyright (C) 2001-2004, 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
+ it may be concatenated to a directory pathname.
+ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+ /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+ && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+# define IS_PATH_WITH_DIR(P) \
+ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# define FILE_SYSTEM_PREFIX_LEN(P) 0
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
diff --git a/lib/filenamecat-lgpl.c b/lib/filenamecat-lgpl.c
new file mode 100644
index 0000000..4903fbf
--- /dev/null
+++ b/lib/filenamecat-lgpl.c
@@ -0,0 +1,88 @@
+/* Concatenate two arbitrary file names.
+
+ Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+/* Specification. */
+#include "filenamecat.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "dirname.h"
+
+#if ! HAVE_MEMPCPY && ! defined mempcpy
+# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
+#endif
+
+/* Return the longest suffix of F that is a relative file name.
+ If it has no such suffix, return the empty string. */
+
+static char const * _GL_ATTRIBUTE_PURE
+longest_relative_suffix (char const *f)
+{
+ for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
+ continue;
+ return f;
+}
+
+/* Concatenate two file name components, DIR and ABASE, 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, where BASE is ABASE with any
+ file system prefixes and leading separators removed.
+ Arrange for a directory separator if necessary between DIR and BASE
+ in the result, removing any redundant separators.
+ In any case, if BASE_IN_RESULT is non-NULL, set
+ *BASE_IN_RESULT to point to the copy of ABASE in the returned
+ concatenation. However, if ABASE begins with more than one slash,
+ set *BASE_IN_RESULT to point to the sole corresponding slash that
+ is copied into the result buffer.
+
+ Return NULL if malloc fails. */
+
+char *
+mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
+{
+ char const *dirbase = last_component (dir);
+ size_t dirbaselen = base_len (dirbase);
+ size_t dirlen = dirbase - dir + dirbaselen;
+ size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
+
+ char const *base = longest_relative_suffix (abase);
+ size_t baselen = strlen (base);
+
+ char *p_concat = malloc (dirlen + needs_separator + baselen + 1);
+ char *p;
+
+ if (p_concat == NULL)
+ return NULL;
+
+ p = mempcpy (p_concat, dir, dirlen);
+ *p = DIRECTORY_SEPARATOR;
+ p += needs_separator;
+
+ if (base_in_result)
+ *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
+
+ p = mempcpy (p, base, baselen);
+ *p = '\0';
+
+ return p_concat;
+}
diff --git a/lib/filenamecat.c b/lib/filenamecat.c
new file mode 100644
index 0000000..06cfeae
--- /dev/null
+++ b/lib/filenamecat.c
@@ -0,0 +1,41 @@
+/* Concatenate two arbitrary file names.
+
+ Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+/* Specification. */
+#include "filenamecat.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "xalloc.h"
+
+/* Just like mfile_name_concat (filenamecat-lgpl.c), except, rather than
+ returning NULL upon malloc failure, here, we report the
+ "memory exhausted" condition and exit. */
+
+char *
+file_name_concat (char const *dir, char const *abase, char **base_in_result)
+{
+ char *p = mfile_name_concat (dir, abase, base_in_result);
+ if (p == NULL)
+ xalloc_die ();
+ return p;
+}
diff --git a/lib/filenamecat.h b/lib/filenamecat.h
new file mode 100644
index 0000000..791a0af
--- /dev/null
+++ b/lib/filenamecat.h
@@ -0,0 +1,27 @@
+/* Concatenate two arbitrary file names.
+
+ Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#if GNULIB_FILENAMECAT
+char *file_name_concat (char const *dir, char const *base,
+ char **base_in_result);
+#endif
+
+char *mfile_name_concat (char const *dir, char const *base,
+ char **base_in_result);
diff --git a/lib/float+.h b/lib/float+.h
new file mode 100644
index 0000000..00fcc76
--- /dev/null
+++ b/lib/float+.h
@@ -0,0 +1,147 @@
+/* Supplemental information about the floating-point formats.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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/lib/float.c b/lib/float.c
new file mode 100644
index 0000000..1bad2ee
--- /dev/null
+++ b/lib/float.c
@@ -0,0 +1,33 @@
+/* Auxiliary definitions for <float.h>.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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/lib/float.in.h b/lib/float.in.h
new file mode 100644
index 0000000..0b93d90
--- /dev/null
+++ b/lib/float.in.h
@@ -0,0 +1,188 @@
+/* A correct <float.h>.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_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
+ <http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>. */
+#if defined __i386__ && defined __FreeBSD__
+/* 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.3621031431120935E-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. */
+union gl_long_double_union
+ {
+ struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
+ long double ld;
+ };
+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.. */
+union gl_long_double_union
+ {
+ struct { double hi; double lo; } dd;
+ long double ld;
+ };
+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/lib/fnmatch.c b/lib/fnmatch.c
new file mode 100644
index 0000000..cae3020
--- /dev/null
+++ b/lib/fnmatch.c
@@ -0,0 +1,350 @@
+/* Copyright (C) 1991-1993, 1996-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Enable GNU extensions in fnmatch.h. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#if ! defined __builtin_expect && __GNUC__ < 3
+# define __builtin_expect(expr, expected) (expr)
+#endif
+
+#include <fnmatch.h>
+
+#include <alloca.h>
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define WIDE_CHAR_SUPPORT \
+ (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \
+ && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY))
+
+/* For platform which support the ISO C amendment 1 functionality we
+ support user defined character classes. */
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+# include <wctype.h>
+# include <wchar.h>
+#endif
+
+/* 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/elem-hash.h"
+# include "../locale/coll-lookup.h"
+# include <shlib-compat.h>
+
+# define CONCAT(a,b) __CONCAT(a,b)
+# define mbsrtowcs __mbsrtowcs
+# define fnmatch __fnmatch
+extern int fnmatch (const char *pattern, const char *string, int flags);
+#endif
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#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))
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself, and have not detected a bug
+ in the library. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand 'configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
+
+
+# if ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK))
+# define isblank(c) ((c) == ' ' || (c) == '\t')
+# endif
+
+# define STREQ(s1, s2) (strcmp (s1, s2) == 0)
+
+# if defined _LIBC || WIDE_CHAR_SUPPORT
+/* The GNU C library provides support for user-defined character classes
+ and the functions from ISO C 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
+
+# ifdef _LIBC
+# define IS_CHAR_CLASS(string) __wctype (string)
+# else
+# define IS_CHAR_CLASS(string) wctype (string)
+# endif
+
+# ifdef _LIBC
+# define ISWCTYPE(WC, WT) __iswctype (WC, WT)
+# else
+# define ISWCTYPE(WC, WT) iswctype (WC, WT)
+# endif
+
+# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC
+/* In this case we are implementing the multibyte character handling. */
+# define HANDLE_MULTIBYTE 1
+# endif
+
+# else
+# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, 'xdigit'. */
+
+# define IS_CHAR_CLASS(string) \
+ (STREQ (string, "alpha") || STREQ (string, "upper") \
+ || STREQ (string, "lower") || STREQ (string, "digit") \
+ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
+ || STREQ (string, "space") || STREQ (string, "print") \
+ || STREQ (string, "punct") || STREQ (string, "graph") \
+ || STREQ (string, "cntrl") || STREQ (string, "blank"))
+# endif
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+/* Global variable. */
+static int posixly_correct;
+
+# ifndef internal_function
+/* Inside GNU libc we mark some function in a special way. In other
+ environments simply ignore the marking. */
+# define internal_function
+# endif
+
+/* 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 L_(CS) CS
+# ifdef _LIBC
+# define BTOWC(C) __btowc (C)
+# else
+# define BTOWC(C) btowc (C)
+# endif
+# define STRLEN(S) strlen (S)
+# define STRCAT(D, S) strcat (D, S)
+# ifdef _LIBC
+# define MEMPCPY(D, S, N) __mempcpy (D, S, N)
+# else
+# if HAVE_MEMPCPY
+# define MEMPCPY(D, S, N) mempcpy (D, S, N)
+# else
+# define MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
+# endif
+# endif
+# define MEMCHR(S, C, N) memchr (S, C, N)
+# include "fnmatch_loop.c"
+
+
+# if HANDLE_MULTIBYTE
+# 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)
+# ifdef _LIBC
+# define STRLEN(S) __wcslen (S)
+# define STRCAT(D, S) __wcscat (D, S)
+# define MEMPCPY(D, S, N) __wmempcpy (D, S, N)
+# else
+# define STRLEN(S) wcslen (S)
+# define STRCAT(D, S) wcscat (D, S)
+# if HAVE_WMEMPCPY
+# define MEMPCPY(D, S, N) wmempcpy (D, S, N)
+# else
+# define MEMPCPY(D, S, N) (wmemcpy (D, S, N) + (N))
+# endif
+# endif
+# define MEMCHR(S, C, N) wmemchr (S, C, N)
+# define WIDE_CHAR_VERSION 1
+
+# 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';
+
+# ifdef _LIBC
+ return __wctype (s);
+# else
+ return wctype (s);
+# endif
+}
+# define IS_CHAR_CLASS(string) is_char_class (string)
+
+# include "fnmatch_loop.c"
+# endif
+
+
+int
+fnmatch (const char *pattern, const char *string, int flags)
+{
+# if HANDLE_MULTIBYTE
+# define ALLOCA_LIMIT 2000
+ if (__builtin_expect (MB_CUR_MAX, 1) != 1)
+ {
+ mbstate_t ps;
+ size_t patsize;
+ size_t strsize;
+ size_t totsize;
+ wchar_t *wpattern;
+ wchar_t *wstring;
+ int res;
+
+ /* Calculate the size needed to convert the strings to
+ wide characters. */
+ memset (&ps, '\0', sizeof (ps));
+ patsize = mbsrtowcs (NULL, &pattern, 0, &ps) + 1;
+ if (__builtin_expect (patsize != 0, 1))
+ {
+ assert (mbsinit (&ps));
+ strsize = mbsrtowcs (NULL, &string, 0, &ps) + 1;
+ if (__builtin_expect (strsize != 0, 1))
+ {
+ assert (mbsinit (&ps));
+ totsize = patsize + strsize;
+ if (__builtin_expect (! (patsize <= totsize
+ && totsize <= SIZE_MAX / sizeof (wchar_t)),
+ 0))
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ /* Allocate room for the wide characters. */
+ if (__builtin_expect (totsize < ALLOCA_LIMIT, 1))
+ wpattern = (wchar_t *) alloca (totsize * sizeof (wchar_t));
+ else
+ {
+ wpattern = malloc (totsize * sizeof (wchar_t));
+ if (__builtin_expect (! wpattern, 0))
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ }
+ wstring = wpattern + patsize;
+
+ /* Convert the strings into wide characters. */
+ mbsrtowcs (wpattern, &pattern, patsize, &ps);
+ assert (mbsinit (&ps));
+ mbsrtowcs (wstring, &string, strsize, &ps);
+
+ res = internal_fnwmatch (wpattern, wstring, wstring + strsize - 1,
+ flags & FNM_PERIOD, flags);
+
+ if (__builtin_expect (! (totsize < ALLOCA_LIMIT), 0))
+ free (wpattern);
+ return res;
+ }
+ }
+ }
+
+# endif /* HANDLE_MULTIBYTE */
+
+ return internal_fnmatch (pattern, string, string + strlen (string),
+ flags & FNM_PERIOD, flags);
+}
+
+# ifdef _LIBC
+# 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)
+# endif
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/lib/fnmatch.in.h b/lib/fnmatch.in.h
new file mode 100644
index 0000000..890ee56
--- /dev/null
+++ b/lib/fnmatch.in.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2016 Free
+ Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _FNMATCH_H
+#define _FNMATCH_H 1
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* 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
+
+/* Match NAME against the file name pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+extern int fnmatch (const char *__pattern, const char *__name,
+ int __flags)
+ _GL_ARG_NONNULL ((1, 2));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c
new file mode 100644
index 0000000..e613c91
--- /dev/null
+++ b/lib/fnmatch_loop.c
@@ -0,0 +1,1219 @@
+/* Copyright (C) 1991-1993, 1996-2006, 2009-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Match STRING against the file name pattern PATTERN, returning zero if
+ it matches, nonzero if not. */
+static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
+ const CHAR *string_end, bool no_leading_period, int flags)
+ internal_function;
+static const CHAR *END (const CHAR *patternp) internal_function;
+
+static int
+internal_function
+FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
+ bool no_leading_period, int flags)
+{
+ register const CHAR *p = pattern, *n = string;
+ register 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 (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
+ {
+ int res;
+
+ res = EXT (c, p, n, string_end, no_leading_period,
+ flags);
+ 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 (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
+ {
+ int res;
+
+ res = EXT (c, p, n, string_end, no_leading_period,
+ flags);
+ if (res != -1)
+ return res;
+ }
+
+ 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_('/')
+ && __builtin_expect (flags & FNM_FILE_NAME, 0))
+ /* 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;
+
+ endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L_('/') : L_('\0'),
+ string_end - n);
+ if (endp == NULL)
+ endp = string_end;
+
+ if (c == L_('[')
+ || (__builtin_expect (flags & FNM_EXTMATCH, 0) != 0
+ && (c == L_('@') || c == L_('+') || c == L_('!'))
+ && *p == L_('(')))
+ {
+ int flags2 = ((flags & FNM_FILE_NAME)
+ ? flags : (flags & ~FNM_PERIOD));
+ bool no_leading_period2 = no_leading_period;
+
+ for (--p; n < endp; ++n, no_leading_period2 = false)
+ if (FCT (p, n, string_end, no_leading_period2, flags2)
+ == 0)
+ return 0;
+ }
+ 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)
+ == 0))
+ return 0;
+ }
+ else
+ {
+ int flags2 = ((flags & FNM_FILE_NAME)
+ ? flags : (flags & ~FNM_PERIOD));
+ int no_leading_period2 = no_leading_period;
+
+ if (c == L_('\\') && !(flags & FNM_NOESCAPE))
+ c = *p;
+ c = FOLD (c);
+ for (--p; n < endp; ++n, no_leading_period2 = false)
+ if (FOLD ((UCHAR) *n) == c
+ && (FCT (p, n, string_end, no_leading_period2, flags2)
+ == 0))
+ return 0;
+ }
+ }
+
+ /* 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;
+ register 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 (;;)
+ {
+ bool is_range = false;
+
+ 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;
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+ wctype_t wt;
+#endif
+ 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');
+
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+ 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
+#else
+ if ((STREQ (str, L_("alnum")) && isalnum ((UCHAR) *n))
+ || (STREQ (str, L_("alpha")) && isalpha ((UCHAR) *n))
+ || (STREQ (str, L_("blank")) && isblank ((UCHAR) *n))
+ || (STREQ (str, L_("cntrl")) && iscntrl ((UCHAR) *n))
+ || (STREQ (str, L_("digit")) && isdigit ((UCHAR) *n))
+ || (STREQ (str, L_("graph")) && isgraph ((UCHAR) *n))
+ || (STREQ (str, L_("lower")) && islower ((UCHAR) *n))
+ || (STREQ (str, L_("print")) && isprint ((UCHAR) *n))
+ || (STREQ (str, L_("punct")) && ispunct ((UCHAR) *n))
+ || (STREQ (str, L_("space")) && isspace ((UCHAR) *n))
+ || (STREQ (str, L_("upper")) && isupper ((UCHAR) *n))
+ || (STREQ (str, L_("xdigit")) && isxdigit ((UCHAR) *n)))
+ goto matched;
+#endif
+ c = *p++;
+ }
+#ifdef _LIBC
+ else if (c == L_('[') && *p == L_('='))
+ {
+ UCHAR str[1];
+ 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[0] = 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[0])
+ goto matched;
+ }
+ else
+ {
+ const int32_t *table;
+# if WIDE_CHAR_VERSION
+ const int32_t *weights;
+ const int32_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;
+
+ /* This #include defines a local function! */
+# if WIDE_CHAR_VERSION
+# include <locale/weightwc.h>
+# else
+# include <locale/weight.h>
+# endif
+
+# 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 int32_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 (&cp);
+ 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 (&np);
+ 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
+ {
+#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;
+# ifdef WIDE_CHAR_VERSION
+ char str[c1];
+ size_t strcnt;
+# else
+# define str (startp + 1)
+# endif
+ const unsigned char *extra;
+ int32_t idx;
+ int32_t elem;
+ int32_t second;
+ int32_t hash;
+
+# ifdef WIDE_CHAR_VERSION
+ /* We have to convert the name to a single-byte
+ string. This is possible since the names
+ consist of ASCII characters and the internal
+ representation is UCS4. */
+ for (strcnt = 0; strcnt < c1; ++strcnt)
+ str[strcnt] = startp[1 + strcnt];
+# 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);
+
+ /* Locate the character in the hashing table. */
+ hash = elem_hash (str, c1);
+
+ idx = 0;
+ elem = hash % table_size;
+ if (symb_table[2 * elem] != 0)
+ {
+ second = hash % (table_size - 2) + 1;
+
+ do
+ {
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ && (c1
+ == extra[symb_table[2 * elem + 1]])
+ && memcmp (str,
+ &extra[symb_table[2 * elem
+ + 1]
+ + 1], c1) == 0)
+ {
+ /* Yep, this is the entry. */
+ idx = symb_table[2 * elem + 1];
+ idx += 1 + extra[idx];
+ break;
+ }
+
+ /* Next entry. */
+ elem += second;
+ }
+ while (symb_table[2 * elem] != 0);
+ }
+
+ if (symb_table[2 * elem] != 0)
+ {
+ /* Compare the byte sequence but only if
+ this is not part of a range. */
+# ifdef WIDE_CHAR_VERSION
+ int32_t *wextra;
+
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+
+ wextra = (int32_t *) &extra[idx + 4];
+# endif
+
+ if (! is_range)
+ {
+# ifdef WIDE_CHAR_VERSION
+ for (c1 = 0;
+ (int32_t) c1 < wextra[idx];
+ ++c1)
+ if (n[c1] != wextra[1 + c1])
+ break;
+
+ if ((int32_t) c1 == wextra[idx])
+ goto matched;
+# else
+ for (c1 = 0; c1 < extra[idx]; ++c1)
+ if (n[c1] != extra[1 + c1])
+ break;
+
+ if (c1 == extra[idx])
+ goto matched;
+# endif
+ }
+
+ /* Get the collation sequence value. */
+ is_seqval = true;
+# ifdef WIDE_CHAR_VERSION
+ cold = wextra[1 + wextra[idx]];
+# else
+ /* Adjust for the alignment. */
+ idx += 1 + extra[idx];
+ idx = (idx + 3) & ~4;
+ 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 == str[0])
+ goto matched;
+
+ cold = str[0];
+ c = *p++;
+ }
+ else
+ return FNM_NOMATCH;
+ }
+ }
+ else
+# undef str
+#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++;
+
+# ifdef 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;
+# ifdef WIDE_CHAR_VERSION
+ char str[c1];
+ size_t strcnt;
+# else
+# define str (startp + 1)
+# endif
+ const unsigned char *extra;
+ int32_t idx;
+ int32_t elem;
+ int32_t second;
+ int32_t hash;
+
+# ifdef WIDE_CHAR_VERSION
+ /* We have to convert the name to a single-byte
+ string. This is possible since the names
+ consist of ASCII characters and the internal
+ representation is UCS4. */
+ for (strcnt = 0; strcnt < c1; ++strcnt)
+ str[strcnt] = startp[1 + strcnt];
+# 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);
+
+ /* Locate the character in the hashing
+ table. */
+ hash = elem_hash (str, c1);
+
+ idx = 0;
+ elem = hash % table_size;
+ if (symb_table[2 * elem] != 0)
+ {
+ second = hash % (table_size - 2) + 1;
+
+ do
+ {
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ && (c1
+ == extra[symb_table[2 * elem + 1]])
+ && memcmp (str,
+ &extra[symb_table[2 * elem + 1]
+ + 1], c1) == 0)
+ {
+ /* Yep, this is the entry. */
+ idx = symb_table[2 * elem + 1];
+ idx += 1 + extra[idx];
+ break;
+ }
+
+ /* Next entry. */
+ elem += second;
+ }
+ while (symb_table[2 * elem] != 0);
+ }
+
+ if (symb_table[2 * elem] != 0)
+ {
+ /* Compare the byte sequence but only if
+ this is not part of a range. */
+# ifdef WIDE_CHAR_VERSION
+ int32_t *wextra;
+
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~4;
+
+ wextra = (int32_t *) &extra[idx + 4];
+# endif
+ /* Get the collation sequence value. */
+ is_seqval = true;
+# ifdef WIDE_CHAR_VERSION
+ cend = wextra[1 + wextra[idx]];
+# else
+ /* Adjust for the alignment. */
+ idx += 1 + extra[idx];
+ idx = (idx + 3) & ~4;
+ cend = *((int32_t *) &extra[idx]);
+# endif
+ }
+ else if (symb_table[2 * elem] != 0 && c1 == 1)
+ {
+ cend = str[0];
+ c = *p++;
+ }
+ else
+ return FNM_NOMATCH;
+ }
+# undef str
+ }
+ 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 (
+# ifdef 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
+ {
+# ifdef 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;
+ }
+# ifdef 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 (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. */
+ do
+ {
+ ignore_next:
+ c = *p++;
+
+ 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;
+ goto ignore_next;
+ }
+ }
+ p += 2;
+ c = *p++;
+ }
+ 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;
+ c = *p++;
+ }
+ else if (c == L_('[') && *p == L_('.'))
+ {
+ ++p;
+ while (1)
+ {
+ c = *++p;
+ if (c == '\0')
+ return FNM_NOMATCH;
+
+ if (*p == L_('.') && p[1] == L_(']'))
+ break;
+ }
+ p += 2;
+ c = *p++;
+ }
+ }
+ while (c != L_(']'));
+ if (not)
+ return FNM_NOMATCH;
+ }
+ break;
+
+ case L_('+'):
+ case L_('@'):
+ case L_('!'):
+ if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
+ {
+ int res;
+
+ res = EXT (c, p, n, string_end, no_leading_period, flags);
+ 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 *
+internal_function
+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);
+ else if (*p == L_(')'))
+ break;
+
+ return p + 1;
+}
+
+
+static int
+internal_function
+EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
+ bool no_leading_period, int flags)
+{
+ const CHAR *startp;
+ size_t level;
+ struct patternlist
+ {
+ struct patternlist *next;
+ CHAR str[1];
+ } *list = NULL;
+ struct patternlist **lastp = &list;
+ size_t pattern_len = STRLEN (pattern);
+ const CHAR *p;
+ const CHAR *rs;
+ enum { ALLOCA_LIMIT = 8000 };
+
+ /* Parse the pattern. Store the individual parts in the list. */
+ level = 0;
+ for (startp = p = pattern + 1; ; ++p)
+ if (*p == L_('\0'))
+ /* This is an invalid pattern. */
+ return -1;
+ 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 -1;
+ }
+ 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; \
+ size_t plensize; \
+ size_t newpsize; \
+ \
+ plen = (opt == L_('?') || opt == L_('@') \
+ ? pattern_len \
+ : p - startp + 1UL); \
+ plensize = plen * sizeof (CHAR); \
+ newpsize = offsetof (struct patternlist, str) + plensize; \
+ if ((size_t) -1 / sizeof (CHAR) < plen \
+ || newpsize < offsetof (struct patternlist, str) \
+ || ALLOCA_LIMIT <= newpsize) \
+ return -1; \
+ newp = (struct patternlist *) alloca (newpsize); \
+ *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \
+ newp->next = NULL; \
+ *lastp = newp; \
+ lastp = &newp->next
+ NEW_PATTERN;
+ break;
+ }
+ }
+ 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) == 0)
+ return 0;
+ /* 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) == 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) == 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) == 0)))
+ /* It worked. Signal success. */
+ return 0;
+ }
+ while ((list = list->next) != NULL);
+
+ /* None of the patterns lead to a match. */
+ return FNM_NOMATCH;
+
+ case L_('?'):
+ if (FCT (p, string, string_end, no_leading_period, flags) == 0)
+ return 0;
+ /* 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) == 0)
+ /* It worked. Signal success. */
+ return 0;
+ while ((list = list->next) != NULL);
+
+ /* None of the patterns lead to a match. */
+ return FNM_NOMATCH;
+
+ 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) == 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)
+ == 0))
+ /* This is successful. */
+ return 0;
+ }
+
+ /* None of the patterns together with the rest of the pattern
+ lead to a match. */
+ return FNM_NOMATCH;
+
+ default:
+ assert (! "Invalid extended matching operator");
+ break;
+ }
+
+ return -1;
+}
+
+
+#undef FOLD
+#undef CHAR
+#undef UCHAR
+#undef INT
+#undef FCT
+#undef EXT
+#undef END
+#undef MEMPCPY
+#undef MEMCHR
+#undef STRLEN
+#undef STRCAT
+#undef L_
+#undef BTOWC
diff --git a/lib/freopen-safer.c b/lib/freopen-safer.c
new file mode 100644
index 0000000..0704c16
--- /dev/null
+++ b/lib/freopen-safer.c
@@ -0,0 +1,103 @@
+/* Invoke freopen, but avoid some glitches.
+
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+#include <config.h>
+
+#include "stdio-safer.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <unistd.h>
+
+/* Guarantee that FD is open; all smaller FDs must already be open.
+ Return true if successful. */
+static bool
+protect_fd (int fd)
+{
+ int value = open ("/dev/null", O_RDONLY);
+ if (value != fd)
+ {
+ if (0 <= value)
+ {
+ close (value);
+ errno = EBADF; /* Unexpected; this is as good as anything else. */
+ }
+ return false;
+ }
+ return true;
+}
+
+/* Like freopen, but guarantee that reopening stdin, stdout, or stderr
+ preserves the invariant that STDxxx_FILENO==fileno(stdxxx), and
+ that no other stream will interfere with the standard streams.
+ This is necessary because most freopen implementations will change
+ the associated fd of a stream to the lowest available slot. */
+
+FILE *
+freopen_safer (char const *name, char const *mode, FILE *f)
+{
+ /* Unfortunately, we cannot use the fopen_safer approach of using
+ fdopen (dup_safer (fileno (freopen (cmd, mode, f)))), because we
+ need to return f itself. The implementation of freopen(NULL,m,f)
+ is system-dependent, so the best we can do is guarantee that all
+ lower-valued standard fds are open prior to the freopen call,
+ even though this puts more pressure on open fds. */
+ bool protect_in = false;
+ bool protect_out = false;
+ bool protect_err = false;
+ int saved_errno;
+
+ switch (fileno (f))
+ {
+ default: /* -1 or not a standard stream. */
+ if (dup2 (STDERR_FILENO, STDERR_FILENO) != STDERR_FILENO)
+ protect_err = true;
+ /* fall through */
+ case STDERR_FILENO:
+ if (dup2 (STDOUT_FILENO, STDOUT_FILENO) != STDOUT_FILENO)
+ protect_out = true;
+ /* fall through */
+ case STDOUT_FILENO:
+ if (dup2 (STDIN_FILENO, STDIN_FILENO) != STDIN_FILENO)
+ protect_in = true;
+ /* fall through */
+ case STDIN_FILENO:
+ /* Nothing left to protect. */
+ break;
+ }
+ if (protect_in && !protect_fd (STDIN_FILENO))
+ f = NULL;
+ else if (protect_out && !protect_fd (STDOUT_FILENO))
+ f = NULL;
+ else if (protect_err && !protect_fd (STDERR_FILENO))
+ f = NULL;
+ else
+ f = freopen (name, mode, f);
+ saved_errno = errno;
+ if (protect_err)
+ close (STDERR_FILENO);
+ if (protect_out)
+ close (STDOUT_FILENO);
+ if (protect_in)
+ close (STDIN_FILENO);
+ if (!f)
+ errno = saved_errno;
+ return f;
+}
diff --git a/lib/freopen.c b/lib/freopen.c
new file mode 100644
index 0000000..4cf7528
--- /dev/null
+++ b/lib/freopen.c
@@ -0,0 +1,67 @@
+/* Open a stream to a file.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* If the user's config.h happens to include <stdio.h>, let it include only
+ the system's <stdio.h> here, so that orig_freopen doesn't recurse to
+ rpl_freopen. */
+#define __need_FILE
+#include <config.h>
+
+/* Get the original definition of freopen. It might be defined as a macro. */
+#include <stdio.h>
+#undef __need_FILE
+
+#include <errno.h>
+
+static FILE *
+orig_freopen (const char *filename, const char *mode, FILE *stream)
+{
+ return freopen (filename, mode, stream);
+}
+
+/* Specification. */
+/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates
+ this include because of the preliminary #include <stdio.h> above. */
+#include "stdio.h"
+
+#include <string.h>
+
+FILE *
+rpl_freopen (const char *filename, const char *mode, FILE *stream)
+{
+ FILE *result;
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ if (filename != NULL && strcmp (filename, "/dev/null") == 0)
+ filename = "NUL";
+#endif
+
+ /* Clear errno to check the success of freopen() with it */
+ errno = 0;
+
+ result = orig_freopen (filename, mode, stream);
+
+#ifdef __KLIBC__
+ /* On OS/2 kLIBC, freopen() returns NULL even if it is successful
+ if filename is NULL. */
+ if (!filename && !result && !errno)
+ result = stream;
+#endif
+
+ return result;
+}
diff --git a/lib/fstat.c b/lib/fstat.c
new file mode 100644
index 0000000..435c429
--- /dev/null
+++ b/lib/fstat.c
@@ -0,0 +1,88 @@
+/* fstat() replacement.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* If 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>
+#if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
+# define stat _stati64
+# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
+# define fstat _fstati64
+#endif
+#undef __need_system_sys_stat_h
+
+static int
+orig_fstat (int fd, struct stat *buf)
+{
+ return fstat (fd, buf);
+}
+
+/* Specification. */
+/* 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"
+
+#include <errno.h>
+#include <unistd.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+fstat_nothrow (int fd, struct stat *buf)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = orig_fstat (fd, buf);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ errno = EBADF;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+#else
+# define fstat_nothrow orig_fstat
+#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
+
+ return fstat_nothrow (fd, buf);
+}
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
new file mode 100644
index 0000000..d234055
--- /dev/null
+++ b/lib/getdtablesize.c
@@ -0,0 +1,121 @@
+/* getdtablesize() function for platforms that don't have it.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+# include <stdio.h>
+
+# include "msvc-inval.h"
+
+# 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;
+}
+# define _setmaxstdio _setmaxstdio_nothrow
+# 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 (bound) < 0; bound = bound / 2)
+ ;
+ _setmaxstdio (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/lib/getopt.c b/lib/getopt.c
new file mode 100644
index 0000000..8ccb901
--- /dev/null
+++ b/lib/getopt.c
@@ -0,0 +1,1275 @@
+/* Getopt for GNU.
+ NOTE: getopt is part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to drepper@gnu.org
+ before changing it!
+ Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2016 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include "getopt.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+#endif
+
+#if defined _LIBC && defined USE_IN_LIBIO
+# include <wchar.h>
+#endif
+
+/* This version of 'getopt' appears to the caller like standard Unix 'getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As 'getopt_long' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Using 'getopt' or setting the environment variable POSIXLY_CORRECT
+ disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "getopt_int.h"
+
+/* For communication from 'getopt' to the caller.
+ When 'getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when 'ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to 'getopt'.
+
+ On entry to 'getopt', zero means this is the first call; initialize.
+
+ When 'getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, 'optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Keep a global copy of all internal members of getopt_data. */
+
+static struct _getopt_data getopt_data;
+
+
+#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV
+extern char *getenv ();
+#endif
+
+#ifdef _LIBC
+/* Stored original parameters.
+ XXX This is no good solution. We should rather copy the args so
+ that we can compare them later. But we must not use malloc(3). */
+extern int __libc_argc;
+extern char **__libc_argv;
+
+/* Bash 2.0 gives us an environment variable containing flags
+ indicating ARGV elements that should not be considered arguments. */
+
+# ifdef USE_NONOPTION_FLAGS
+/* Defined in getopt_init.c */
+extern char *__getopt_nonoption_flags;
+# endif
+
+# ifdef USE_NONOPTION_FLAGS
+# define SWAP_FLAGS(ch1, ch2) \
+ if (d->__nonoption_flags_len > 0) \
+ { \
+ char __tmp = __getopt_nonoption_flags[ch1]; \
+ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
+ __getopt_nonoption_flags[ch2] = __tmp; \
+ }
+# else
+# define SWAP_FLAGS(ch1, ch2)
+# endif
+#else /* !_LIBC */
+# define SWAP_FLAGS(ch1, ch2)
+#endif /* _LIBC */
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ 'first_nonopt' and 'last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+static void
+exchange (char **argv, struct _getopt_data *d)
+{
+ int bottom = d->__first_nonopt;
+ int middle = d->__last_nonopt;
+ int top = d->optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
+ /* First make sure the handling of the '__getopt_nonoption_flags'
+ string can work normally. Our top argument must be in the range
+ of the string. */
+ if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
+ {
+ /* We must extend the array. The user plays games with us and
+ presents new arguments. */
+ char *new_str = malloc (top + 1);
+ if (new_str == NULL)
+ d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
+ else
+ {
+ memset (__mempcpy (new_str, __getopt_nonoption_flags,
+ d->__nonoption_flags_max_len),
+ '\0', top + 1 - d->__nonoption_flags_max_len);
+ d->__nonoption_flags_max_len = top + 1;
+ __getopt_nonoption_flags = new_str;
+ }
+ }
+#endif
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ register int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ register int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ SWAP_FLAGS (bottom + i, middle + i);
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ d->__first_nonopt += (d->optind - d->__last_nonopt);
+ d->__last_nonopt = d->optind;
+}
+
+/* Initialize the internal data when the first call is made. */
+
+static const char *
+_getopt_initialize (int argc _GL_UNUSED,
+ char **argv _GL_UNUSED, const char *optstring,
+ struct _getopt_data *d, int posixly_correct)
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ d->__first_nonopt = d->__last_nonopt = d->optind;
+
+ d->__nextchar = NULL;
+
+ d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT");
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ d->__ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ d->__ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (d->__posixly_correct)
+ d->__ordering = REQUIRE_ORDER;
+ else
+ d->__ordering = PERMUTE;
+
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
+ if (!d->__posixly_correct
+ && argc == __libc_argc && argv == __libc_argv)
+ {
+ if (d->__nonoption_flags_max_len == 0)
+ {
+ if (__getopt_nonoption_flags == NULL
+ || __getopt_nonoption_flags[0] == '\0')
+ d->__nonoption_flags_max_len = -1;
+ else
+ {
+ const char *orig_str = __getopt_nonoption_flags;
+ int len = d->__nonoption_flags_max_len = strlen (orig_str);
+ if (d->__nonoption_flags_max_len < argc)
+ d->__nonoption_flags_max_len = argc;
+ __getopt_nonoption_flags =
+ (char *) malloc (d->__nonoption_flags_max_len);
+ if (__getopt_nonoption_flags == NULL)
+ d->__nonoption_flags_max_len = -1;
+ else
+ memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', d->__nonoption_flags_max_len - len);
+ }
+ }
+ d->__nonoption_flags_len = d->__nonoption_flags_max_len;
+ }
+ else
+ d->__nonoption_flags_len = 0;
+#endif
+
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If 'getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If 'getopt' finds another option character, it returns that character,
+ updating 'optind' and 'nextchar' so that the next call to 'getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, 'getopt' returns -1.
+ Then 'optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set 'opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in 'optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in 'optarg', otherwise 'optarg' is set to zero.
+
+ If OPTSTRING starts with '-' or '+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with '--' instead of '-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a '=', or else the in next ARGV-element.
+ When 'getopt' finds a long-named option, it returns 0 if that option's
+ 'flag' field is nonzero, the value of the option's 'val' field
+ if the 'flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of 'struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal_r (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind,
+ int long_only, struct _getopt_data *d, int posixly_correct)
+{
+ int print_errors = d->opterr;
+
+ if (argc < 1)
+ return -1;
+
+ d->optarg = NULL;
+
+ if (d->optind == 0 || !d->__initialized)
+ {
+ if (d->optind == 0)
+ d->optind = 1; /* Don't scan ARGV[0], the program name. */
+ optstring = _getopt_initialize (argc, argv, optstring, d,
+ posixly_correct);
+ d->__initialized = 1;
+ }
+ else if (optstring[0] == '-' || optstring[0] == '+')
+ optstring++;
+ if (optstring[0] == ':')
+ print_errors = 0;
+
+ /* Test whether ARGV[optind] points to a non-option argument.
+ Either it does not have option syntax, or there is an environment flag
+ from the shell indicating it is not an option. The later information
+ is only used when the used in the GNU libc. */
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
+# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
+ || (d->optind < d->__nonoption_flags_len \
+ && __getopt_nonoption_flags[d->optind] == '1'))
+#else
+# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
+#endif
+
+ if (d->__nextchar == NULL || *d->__nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (d->__last_nonopt > d->optind)
+ d->__last_nonopt = d->optind;
+ if (d->__first_nonopt > d->optind)
+ d->__first_nonopt = d->optind;
+
+ if (d->__ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (d->__first_nonopt != d->__last_nonopt
+ && d->__last_nonopt != d->optind)
+ exchange ((char **) argv, d);
+ else if (d->__last_nonopt != d->optind)
+ d->__first_nonopt = d->optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (d->optind < argc && NONOPTION_P)
+ d->optind++;
+ d->__last_nonopt = d->optind;
+ }
+
+ /* The special ARGV-element '--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (d->optind != argc && !strcmp (argv[d->optind], "--"))
+ {
+ d->optind++;
+
+ if (d->__first_nonopt != d->__last_nonopt
+ && d->__last_nonopt != d->optind)
+ exchange ((char **) argv, d);
+ else if (d->__first_nonopt == d->__last_nonopt)
+ d->__first_nonopt = d->optind;
+ d->__last_nonopt = argc;
+
+ d->optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (d->optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (d->__first_nonopt != d->__last_nonopt)
+ d->optind = d->__first_nonopt;
+ return -1;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if (NONOPTION_P)
+ {
+ if (d->__ordering == REQUIRE_ORDER)
+ return -1;
+ d->optarg = argv[d->optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Skip the initial punctuation. */
+
+ d->__nextchar = (argv[d->optind] + 1
+ + (longopts != NULL && argv[d->optind][1] == '-'));
+ }
+
+ /* Decode the current option-ARGV-element. */
+
+ /* Check whether the ARGV-element is a long option.
+
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an abbreviation of
+ the long option, just like "--fu", and not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+
+ if (longopts != NULL
+ && (argv[d->optind][1] == '-'
+ || (long_only && (argv[d->optind][2]
+ || !strchr (optstring, argv[d->optind][1])))))
+ {
+ char *nameend;
+ unsigned int namelen;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ struct option_list
+ {
+ const struct option *p;
+ struct option_list *next;
+ } *ambig_list = NULL;
+#ifdef _LIBC
+/* malloc() not used for _LIBC to simplify failure messages. */
+# define free_option_list(l)
+#else
+# define free_option_list(l) \
+ while (l != NULL) \
+ { \
+ struct option_list *pn = l->next; \
+ free (l); \
+ l = pn; \
+ }
+#endif
+ int exact = 0;
+ int ambig = 0;
+ int indfound = -1;
+ int option_index;
+
+ for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+ namelen = nameend - d->__nextchar;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, d->__nextchar, namelen))
+ {
+ if (namelen == (unsigned int) strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else if (ambig)
+ ; /* Taking simpler path to handling ambiguities. */
+ else if (long_only
+ || pfound->has_arg != p->has_arg
+ || pfound->flag != p->flag
+ || pfound->val != p->val)
+ {
+ /* Second or later nonexact match found. */
+#ifdef _LIBC
+ struct option_list *newp = alloca (sizeof (*newp));
+#else
+ struct option_list *newp = malloc (sizeof (*newp));
+ if (newp == NULL)
+ {
+ free_option_list (ambig_list);
+ ambig_list = NULL;
+ ambig = 1; /* Use simpler fallback message. */
+ }
+ else
+#endif
+ {
+ newp->p = p;
+ newp->next = ambig_list;
+ ambig_list = newp;
+ }
+ }
+ }
+
+ if ((ambig || ambig_list) && !exact)
+ {
+ if (print_errors && ambig_list)
+ {
+ struct option_list first;
+ first.p = pfound;
+ first.next = ambig_list;
+ ambig_list = &first;
+
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf = NULL;
+ size_t buflen = 0;
+
+ FILE *fp = open_memstream (&buf, &buflen);
+ if (fp != NULL)
+ {
+ fprintf (fp,
+ _("%s: option '%s' is ambiguous; possibilities:"),
+ argv[0], argv[d->optind]);
+
+ do
+ {
+ fprintf (fp, " '--%s'", ambig_list->p->name);
+ ambig_list = ambig_list->next;
+ }
+ while (ambig_list != NULL);
+
+ fputc_unlocked ('\n', fp);
+
+ if (__builtin_expect (fclose (fp) != EOF, 1))
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+ }
+#else
+ fprintf (stderr,
+ _("%s: option '%s' is ambiguous; possibilities:"),
+ argv[0], argv[d->optind]);
+ do
+ {
+ fprintf (stderr, " '--%s'", ambig_list->p->name);
+ ambig_list = ambig_list->next;
+ }
+ while (ambig_list != NULL);
+
+ fputc ('\n', stderr);
+#endif
+ }
+ else if (print_errors && ambig)
+ {
+ fprintf (stderr,
+ _("%s: option '%s' is ambiguous\n"),
+ argv[0], argv[d->optind]);
+ }
+ d->__nextchar += strlen (d->__nextchar);
+ d->optind++;
+ d->optopt = 0;
+ free_option_list (ambig_list);
+ return '?';
+ }
+
+ free_option_list (ambig_list);
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ d->optind++;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ d->optarg = nameend + 1;
+ else
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+ int n;
+#endif
+
+ if (argv[d->optind - 1][1] == '-')
+ {
+ /* --option */
+#if defined _LIBC && defined USE_IN_LIBIO
+ n = __asprintf (&buf, _("\
+%s: option '--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+#else
+ fprintf (stderr, _("\
+%s: option '--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+#endif
+ }
+ else
+ {
+ /* +option or -option */
+#if defined _LIBC && defined USE_IN_LIBIO
+ n = __asprintf (&buf, _("\
+%s: option '%c%s' doesn't allow an argument\n"),
+ argv[0], argv[d->optind - 1][0],
+ pfound->name);
+#else
+ fprintf (stderr, _("\
+%s: option '%c%s' doesn't allow an argument\n"),
+ argv[0], argv[d->optind - 1][0],
+ pfound->name);
+#endif
+ }
+
+#if defined _LIBC && defined USE_IN_LIBIO
+ if (n >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2
+ |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#endif
+ }
+
+ d->__nextchar += strlen (d->__nextchar);
+
+ d->optopt = pfound->val;
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (d->optind < argc)
+ d->optarg = argv[d->optind++];
+ else
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+
+ if (__asprintf (&buf, _("\
+%s: option '--%s' requires an argument\n"),
+ argv[0], pfound->name) >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2
+ |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#else
+ fprintf (stderr,
+ _("%s: option '--%s' requires an argument\n"),
+ argv[0], pfound->name);
+#endif
+ }
+ d->__nextchar += strlen (d->__nextchar);
+ d->optopt = pfound->val;
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ d->__nextchar += strlen (d->__nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[d->optind][1] == '-'
+ || strchr (optstring, *d->__nextchar) == NULL)
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+ int n;
+#endif
+
+ if (argv[d->optind][1] == '-')
+ {
+ /* --option */
+#if defined _LIBC && defined USE_IN_LIBIO
+ n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"),
+ argv[0], d->__nextchar);
+#else
+ fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
+ argv[0], d->__nextchar);
+#endif
+ }
+ else
+ {
+ /* +option or -option */
+#if defined _LIBC && defined USE_IN_LIBIO
+ n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"),
+ argv[0], argv[d->optind][0], d->__nextchar);
+#else
+ fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
+ argv[0], argv[d->optind][0], d->__nextchar);
+#endif
+ }
+
+#if defined _LIBC && defined USE_IN_LIBIO
+ if (n >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#endif
+ }
+ d->__nextchar = (char *) "";
+ d->optind++;
+ d->optopt = 0;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *d->__nextchar++;
+ const char *temp = strchr (optstring, c);
+
+ /* Increment 'optind' when we start to process its last character. */
+ if (*d->__nextchar == '\0')
+ ++d->optind;
+
+ if (temp == NULL || c == ':' || c == ';')
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+ int n;
+#endif
+
+#if defined _LIBC && defined USE_IN_LIBIO
+ n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"),
+ argv[0], c);
+#else
+ fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
+#endif
+
+#if defined _LIBC && defined USE_IN_LIBIO
+ if (n >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#endif
+ }
+ d->optopt = c;
+ return '?';
+ }
+ /* Convenience. Treat POSIX -W foo same as long option --foo */
+ if (temp[0] == 'W' && temp[1] == ';')
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound = 0;
+ int option_index;
+
+ if (longopts == NULL)
+ goto no_longs;
+
+ /* This is an option that requires an argument. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ d->optind++;
+ }
+ else if (d->optind == argc)
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+
+ if (__asprintf (&buf,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c) >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#else
+ fprintf (stderr,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c);
+#endif
+ }
+ d->optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ return c;
+ }
+ else
+ /* We already incremented 'd->optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ d->optarg = argv[d->optind++];
+
+ /* optarg is now the argument, see if it's in the
+ table of longopts. */
+
+ for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
+ nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
+ {
+ if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else if (long_only
+ || pfound->has_arg != p->has_arg
+ || pfound->flag != p->flag
+ || pfound->val != p->val)
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+ if (ambig && !exact)
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+
+ if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
+ argv[0], d->optarg) >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#else
+ fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
+ argv[0], d->optarg);
+#endif
+ }
+ d->__nextchar += strlen (d->__nextchar);
+ d->optind++;
+ return '?';
+ }
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ d->optarg = nameend + 1;
+ else
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+
+ if (__asprintf (&buf, _("\
+%s: option '-W %s' doesn't allow an argument\n"),
+ argv[0], pfound->name) >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2
+ |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#else
+ fprintf (stderr, _("\
+%s: option '-W %s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+#endif
+ }
+
+ d->__nextchar += strlen (d->__nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (d->optind < argc)
+ d->optarg = argv[d->optind++];
+ else
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+
+ if (__asprintf (&buf, _("\
+%s: option '-W %s' requires an argument\n"),
+ argv[0], pfound->name) >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2
+ |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#else
+ fprintf (stderr, _("\
+%s: option '-W %s' requires an argument\n"),
+ argv[0], pfound->name);
+#endif
+ }
+ d->__nextchar += strlen (d->__nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ else
+ d->optarg = NULL;
+ d->__nextchar += strlen (d->__nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ no_longs:
+ d->__nextchar = NULL;
+ return 'W'; /* Let the application handle it. */
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ d->optind++;
+ }
+ else
+ d->optarg = NULL;
+ d->__nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ d->optind++;
+ }
+ else if (d->optind == argc)
+ {
+ if (print_errors)
+ {
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+
+ if (__asprintf (&buf, _("\
+%s: option requires an argument -- '%c'\n"),
+ argv[0], c) >= 0)
+ {
+ _IO_flockfile (stderr);
+
+ int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+ ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+ __fxprintf (NULL, "%s", buf);
+
+ ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ _IO_funlockfile (stderr);
+
+ free (buf);
+ }
+#else
+ fprintf (stderr,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c);
+#endif
+ }
+ d->optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented 'optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ d->optarg = argv[d->optind++];
+ d->__nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+_getopt_internal (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind, int long_only,
+ int posixly_correct)
+{
+ int result;
+
+ getopt_data.optind = optind;
+ getopt_data.opterr = opterr;
+
+ result = _getopt_internal_r (argc, argv, optstring, longopts,
+ longind, long_only, &getopt_data,
+ posixly_correct);
+
+ optind = getopt_data.optind;
+ optarg = getopt_data.optarg;
+ optopt = getopt_data.optopt;
+
+ return result;
+}
+
+/* glibc gets a LSB-compliant getopt.
+ Standalone applications get a POSIX-compliant getopt. */
+#if _LIBC
+enum { POSIXLY_CORRECT = 0 };
+#else
+enum { POSIXLY_CORRECT = 1 };
+#endif
+
+int
+getopt (int argc, char *const *argv, const char *optstring)
+{
+ return _getopt_internal (argc, (char **) argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0, POSIXLY_CORRECT);
+}
+
+#ifdef _LIBC
+int
+__posix_getopt (int argc, char *const *argv, const char *optstring)
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0, 1);
+}
+#endif
+
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of 'getopt'. */
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value '%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/getopt.in.h b/lib/getopt.in.h
new file mode 100644
index 0000000..0f72182
--- /dev/null
+++ b/lib/getopt.in.h
@@ -0,0 +1,255 @@
+/* Declarations for getopt.
+ Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2016 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_GETOPT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. We must
+ also inform the replacement unistd.h to not recursively use
+ <getopt.h>; our definitions will be present soon enough. */
+#if @HAVE_GETOPT_H@
+# define _GL_SYSTEM_GETOPT
+# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
+# undef _GL_SYSTEM_GETOPT
+#endif
+
+#ifndef _@GUARD_PREFIX@_GETOPT_H
+
+#ifndef __need_getopt
+# define _@GUARD_PREFIX@_GETOPT_H 1
+#endif
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in this header. When this happens, include the
+ headers that might declare getopt so that they will not cause
+ confusion if included after this file (if the system had <getopt.h>,
+ we have already included it). Then systematically rename
+ identifiers so that they do not collide with the system functions
+ and variables. Renaming avoids problems with some compilers and
+ linkers. */
+#if defined __GETOPT_PREFIX && !defined __need_getopt
+# if !@HAVE_GETOPT_H@
+# define __need_system_stdlib_h
+# include <stdlib.h>
+# undef __need_system_stdlib_h
+# include <stdio.h>
+# include <unistd.h>
+# endif
+# undef __need_getopt
+# undef getopt
+# undef getopt_long
+# undef getopt_long_only
+# undef optarg
+# undef opterr
+# undef optind
+# undef optopt
+# undef option
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# define getopt __GETOPT_ID (getopt)
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
+# define option __GETOPT_ID (option)
+# define _getopt_internal __GETOPT_ID (getopt_internal)
+#endif
+
+/* Standalone applications get correct prototypes for getopt_long and
+ getopt_long_only; they declare "char **argv". libc uses prototypes
+ with "char *const *argv" that are incorrect because getopt_long and
+ getopt_long_only can permute argv; this is required for backward
+ compatibility (e.g., for LSB 2.0.1).
+
+ This used to be '#if defined __GETOPT_PREFIX && !defined __need_getopt',
+ but it caused redefinition warnings if both unistd.h and getopt.h were
+ included, since unistd.h includes getopt.h having previously defined
+ __need_getopt.
+
+ The only place where __getopt_argv_const is used is in definitions
+ of getopt_long and getopt_long_only below, but these are visible
+ only if __need_getopt is not defined, so it is quite safe to rewrite
+ the conditional as follows:
+*/
+#if !defined __need_getopt
+# if defined __GETOPT_PREFIX
+# define __getopt_argv_const /* empty */
+# else
+# define __getopt_argv_const const
+# endif
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+ standalone, or this is the first header included in the source file.
+ If we are being used with glibc, we need to include <features.h>, but
+ that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
+ not defined, include <ctype.h>, which will pull in <features.h> for us
+ if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
+ doesn't flood the namespace with stuff the way some other headers do.) */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
+
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from 'getopt' to the caller.
+ When 'getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when 'ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to 'getopt'.
+
+ On entry to 'getopt', zero means this is the first call; initialize.
+
+ When 'getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, 'optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message 'getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of 'struct option' terminated by an element containing a name which is
+ zero.
+
+ The field 'has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field 'flag' is not NULL, it points to a variable that is set
+ to the value given in the field 'val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an 'int' to
+ a compiled-in constant, such as set a value from 'optarg', set the
+ option's 'flag' field to zero and its 'val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero 'flag' field, 'getopt'
+ returns the contents of the 'val' field. */
+
+# if !GNULIB_defined_struct_option
+struct option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+# define GNULIB_defined_struct_option 1
+# endif
+
+/* Names for the values of the 'has_arg' field of 'struct option'. */
+
+# define no_argument 0
+# define required_argument 1
+# define optional_argument 2
+#endif /* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, 'optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in 'optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU 'getopt'.
+
+ The argument '--' causes premature termination of argument
+ scanning, explicitly telling 'getopt' that there are no more
+ options.
+
+ If OPTS begins with '-', then non-option arguments are treated as
+ arguments to the option '\1'. This behavior is specific to the GNU
+ 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
+ the environment, then do not permute arguments. */
+
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+
+#ifndef __need_getopt
+extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations. */
+#undef __need_getopt
+
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
diff --git a/lib/getopt1.c b/lib/getopt1.c
new file mode 100644
index 0000000..63db74f
--- /dev/null
+++ b/lib/getopt1.c
@@ -0,0 +1,170 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2016 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# include <getopt.h>
+#else
+# include <config.h>
+# include "getopt.h"
+#endif
+#include "getopt_int.h"
+
+#include <stdio.h>
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, (char **) argv, options, long_options,
+ opt_index, 0, 0);
+}
+
+int
+_getopt_long_r (int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index,
+ struct _getopt_data *d)
+{
+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
+ 0, d, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (int argc, char *__getopt_argv_const *argv,
+ const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, (char **) argv, options, long_options,
+ opt_index, 1, 0);
+}
+
+int
+_getopt_long_only_r (int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index,
+ struct _getopt_data *d)
+{
+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
+ 1, d, 0);
+}
+
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static const struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value '%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value '%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/getopt_int.h b/lib/getopt_int.h
new file mode 100644
index 0000000..be4c22e
--- /dev/null
+++ b/lib/getopt_int.h
@@ -0,0 +1,135 @@
+/* Internal declarations for getopt.
+ Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2016 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_INT_H
+#define _GETOPT_INT_H 1
+
+#include <getopt.h>
+
+extern int _getopt_internal (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct);
+
+
+/* Reentrant versions which can handle parsing multiple argument
+ vectors at the same time. */
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using '+' as the first character
+ of the list of option characters, or by calling getopt.
+
+ PERMUTE is the default. We permute the contents of ARGV as we
+ scan, so that eventually all the non-options are at the end.
+ This allows options to be given in any order, even with programs
+ that were not written to expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were
+ written to expect options and other ARGV-elements in any order
+ and that care about the ordering of the two. We describe each
+ non-option ARGV-element as if it were the argument of an option
+ with character code 1. Using '-' as the first character of the
+ list of option characters selects this mode of operation.
+
+ The special argument '--' forces an end of option-scanning regardless
+ of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
+ '--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
+
+enum __ord
+ {
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+ };
+
+/* Data type for reentrant functions. */
+struct _getopt_data
+{
+ /* These have exactly the same meaning as the corresponding global
+ variables, except that they are used for the reentrant
+ versions of getopt. */
+ int optind;
+ int opterr;
+ int optopt;
+ char *optarg;
+
+ /* Internal members. */
+
+ /* True if the internal members have been initialized. */
+ int __initialized;
+
+ /* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+ char *__nextchar;
+
+ /* See __ord above. */
+ enum __ord __ordering;
+
+ /* If the POSIXLY_CORRECT environment variable is set
+ or getopt was called. */
+ int __posixly_correct;
+
+
+ /* Handle permutation of arguments. */
+
+ /* Describe the part of ARGV that contains non-options that have
+ been skipped. 'first_nonopt' is the index in ARGV of the first
+ of them; 'last_nonopt' is the index after the last of them. */
+
+ int __first_nonopt;
+ int __last_nonopt;
+
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
+ int __nonoption_flags_max_len;
+ int __nonoption_flags_len;
+#endif
+};
+
+/* The initializer is necessary to set OPTIND and OPTERR to their
+ default values and to clear the initialization flag. */
+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
+
+extern int _getopt_internal_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, struct _getopt_data *__data,
+ int __posixly_correct);
+
+extern int _getopt_long_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_only_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts,
+ int *__longind,
+ struct _getopt_data *__data);
+
+#endif /* getopt_int.h */
diff --git a/lib/gettext.h b/lib/gettext.h
new file mode 100644
index 0000000..9a232cc
--- /dev/null
+++ b/lib/gettext.h
@@ -0,0 +1,292 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if 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)
+
+#ifdef __GNUC__
+__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;
+}
+
+#ifdef __GNUC__
+__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>
+
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+ /* || __STDC_VERSION__ >= 199901L */ )
+# 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)
+
+#ifdef __GNUC__
+__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)
+
+#ifdef __GNUC__
+__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/lib/gettime.c b/lib/gettime.c
new file mode 100644
index 0000000..ea58eb0
--- /dev/null
+++ b/lib/gettime.c
@@ -0,0 +1,48 @@
+/* gettime -- get the system clock
+
+ Copyright (C) 2002, 2004-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+#include "timespec.h"
+
+#include <sys/time.h>
+
+/* Get the system time into *TS. */
+
+void
+gettime (struct timespec *ts)
+{
+#if HAVE_NANOTIME
+ nanotime (ts);
+#else
+
+# if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
+ if (clock_gettime (CLOCK_REALTIME, ts) == 0)
+ return;
+# endif
+
+ {
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+ ts->tv_sec = tv.tv_sec;
+ ts->tv_nsec = tv.tv_usec * 1000;
+ }
+
+#endif
+}
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
new file mode 100644
index 0000000..224ca6a
--- /dev/null
+++ b/lib/gettimeofday.c
@@ -0,0 +1,154 @@
+/* Provide gettimeofday for systems that don't have it or for which it's broken.
+
+ Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+/* Specification. */
+#include <sys/time.h>
+
+#include <time.h>
+
+#if HAVE_SYS_TIMEB_H
+# include <sys/timeb.h>
+#endif
+
+#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME
+
+/* 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. The tzset replacement is necessary for at least
+ Solaris 2.5, 2.5.1, and 2.6. */
+
+static struct tm tm_zero_buffer;
+static struct tm *localtime_buffer_addr = &tm_zero_buffer;
+
+# undef localtime
+extern struct tm *localtime (time_t const *);
+
+# undef gmtime
+extern struct tm *gmtime (time_t const *);
+
+/* This is a wrapper for localtime. It is used only on systems for which
+ gettimeofday clobbers the static buffer used for localtime's result.
+
+ On the first call, record the address of the static buffer that
+ localtime uses for its result. */
+
+struct tm *
+rpl_localtime (time_t const *timep)
+{
+ struct tm *tm = localtime (timep);
+
+ if (localtime_buffer_addr == &tm_zero_buffer)
+ localtime_buffer_addr = tm;
+
+ return tm;
+}
+
+/* Same as above, since gmtime and localtime use the same buffer. */
+struct tm *
+rpl_gmtime (time_t const *timep)
+{
+ struct tm *tm = gmtime (timep);
+
+ if (localtime_buffer_addr == &tm_zero_buffer)
+ localtime_buffer_addr = tm;
+
+ return tm;
+}
+
+#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */
+
+#if TZSET_CLOBBERS_LOCALTIME
+
+# undef tzset
+extern void tzset (void);
+
+/* This is a wrapper for tzset, for systems on which tzset may clobber
+ the static buffer used for localtime's result. */
+void
+rpl_tzset (void)
+{
+ /* Save and restore the contents of the buffer used for localtime's
+ result around the call to tzset. */
+ struct tm save = *localtime_buffer_addr;
+ tzset ();
+ *localtime_buffer_addr = save;
+}
+#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. */
+
+int
+gettimeofday (struct timeval *restrict tv, void *restrict tz)
+{
+#undef gettimeofday
+#if HAVE_GETTIMEOFDAY
+# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
+ /* Save and restore the contents of the buffer used for localtime's
+ result around the call to gettimeofday. */
+ struct tm save = *localtime_buffer_addr;
+# endif
+
+# 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
+
+# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
+ *localtime_buffer_addr = save;
+# endif
+
+ return result;
+
+#else
+
+# if HAVE__FTIME
+
+ struct _timeb timebuf;
+ _ftime (&timebuf);
+ tv->tv_sec = timebuf.time;
+ tv->tv_usec = timebuf.millitm * 1000;
+
+# 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;
+
+# endif
+
+ return 0;
+
+#endif
+}
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
new file mode 100644
index 0000000..c58afd2
--- /dev/null
+++ b/lib/gnulib.mk
@@ -0,0 +1,2863 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+## Process this file with automake to produce Makefile.in.
+# Copyright (C) 2002-2016 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 <http://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=gl --lib=libdiffutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=localename --avoid=lock --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen argmatch binary-io c-stack config-h diffseq dirname do-release-commit-and-tag dup2 error exclude exitfail extensions fcntl fdl file-type filenamecat fnmatch-gnu getopt gettext-h gettime git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload hard-locale inttostr inttypes isblank largefile lstat maintainer-makefile manywarnings mbrtowc mkstemp mktime progname propername rawmemchr readme-release regex sh-quote signal stat stat-macros stat-time stdint strcase strftime strptime strtoumax sys_wait system-quote unistd unlocked-io update-copyright vararrays verify version-etc version-etc-fsf wcwidth xalloc xfreopen xreadlink xstrtoumax xvasprintf
+
+
+MOSTLYCLEANFILES += core *.stackdump
+
+noinst_LIBRARIES += libdiffutils.a
+
+libdiffutils_a_SOURCES =
+libdiffutils_a_LIBADD = $(gl_LIBOBJS)
+libdiffutils_a_DEPENDENCIES = $(gl_LIBOBJS)
+EXTRA_libdiffutils_a_SOURCES =
+
+## 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__ || 60000000 <= __DECC_VER)
+
+## end gnulib module absolute-header
+
+## begin gnulib module alloca
+
+
+libdiffutils_a_LIBADD += @ALLOCA@
+libdiffutils_a_DEPENDENCIES += @ALLOCA@
+EXTRA_DIST += alloca.c
+
+EXTRA_libdiffutils_a_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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/alloca.in.h; \
+ } > $@-t && \
+ mv -f $@-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 allocator
+
+libdiffutils_a_SOURCES += allocator.c
+
+EXTRA_DIST += allocator.h
+
+## end gnulib module allocator
+
+## begin gnulib module announce-gen
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen
+
+## end gnulib module announce-gen
+
+## begin gnulib module areadlink
+
+libdiffutils_a_SOURCES += areadlink.c
+
+EXTRA_DIST += areadlink.h
+
+## end gnulib module areadlink
+
+## begin gnulib module argmatch
+
+libdiffutils_a_SOURCES += argmatch.c
+
+EXTRA_DIST += argmatch.h
+
+## end gnulib module argmatch
+
+## begin gnulib module assure
+
+
+EXTRA_DIST += assure.h
+
+## end gnulib module assure
+
+## begin gnulib module binary-io
+
+libdiffutils_a_SOURCES += binary-io.h binary-io.c
+
+## end gnulib module binary-io
+
+## begin gnulib module bitrotate
+
+libdiffutils_a_SOURCES += bitrotate.h bitrotate.c
+
+## end gnulib module bitrotate
+
+## begin gnulib module btowc
+
+
+EXTRA_DIST += btowc.c
+
+EXTRA_libdiffutils_a_SOURCES += btowc.c
+
+## end gnulib module btowc
+
+## begin gnulib module c-ctype
+
+libdiffutils_a_SOURCES += c-ctype.h c-ctype.c
+
+## end gnulib module c-ctype
+
+## begin gnulib module c-stack
+
+libdiffutils_a_SOURCES += c-stack.h c-stack.c
+
+## end gnulib module c-stack
+
+## begin gnulib module c-strcase
+
+libdiffutils_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
+
+## end gnulib module c-strcase
+
+## begin gnulib module c-strcaseeq
+
+
+EXTRA_DIST += c-strcaseeq.h
+
+## end gnulib module c-strcaseeq
+
+## begin gnulib module careadlinkat
+
+libdiffutils_a_SOURCES += careadlinkat.c
+
+EXTRA_DIST += careadlinkat.h
+
+## end gnulib module careadlinkat
+
+## begin gnulib module close
+
+
+EXTRA_DIST += close.c
+
+EXTRA_libdiffutils_a_SOURCES += close.c
+
+## end gnulib module close
+
+## begin gnulib module configmake
+
+# Listed in the same order as the GNU makefile conventions, and
+# provided by autoconf 2.59c+ or 2.70.
+# The Automake-defined pkg* macros are appended, in the order
+# listed in the Automake 1.10a+ documentation.
+configmake.h: Makefile
+ $(AM_V_GEN)rm -f $@-t && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo '#define PREFIX "$(prefix)"'; \
+ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
+ echo '#define BINDIR "$(bindir)"'; \
+ echo '#define SBINDIR "$(sbindir)"'; \
+ echo '#define LIBEXECDIR "$(libexecdir)"'; \
+ echo '#define DATAROOTDIR "$(datarootdir)"'; \
+ echo '#define DATADIR "$(datadir)"'; \
+ echo '#define SYSCONFDIR "$(sysconfdir)"'; \
+ echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
+ echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
+ echo '#define RUNSTATEDIR "$(runstatedir)"'; \
+ echo '#define INCLUDEDIR "$(includedir)"'; \
+ echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
+ echo '#define DOCDIR "$(docdir)"'; \
+ echo '#define INFODIR "$(infodir)"'; \
+ echo '#define HTMLDIR "$(htmldir)"'; \
+ echo '#define DVIDIR "$(dvidir)"'; \
+ echo '#define PDFDIR "$(pdfdir)"'; \
+ echo '#define PSDIR "$(psdir)"'; \
+ echo '#define LIBDIR "$(libdir)"'; \
+ echo '#define LISPDIR "$(lispdir)"'; \
+ echo '#define LOCALEDIR "$(localedir)"'; \
+ echo '#define MANDIR "$(mandir)"'; \
+ echo '#define MANEXT "$(manext)"'; \
+ echo '#define PKGDATADIR "$(pkgdatadir)"'; \
+ echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
+ echo '#define PKGLIBDIR "$(pkglibdir)"'; \
+ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
+ } | sed '/""/d' > $@-t && \
+ mv -f $@-t $@
+
+BUILT_SOURCES += configmake.h
+CLEANFILES += configmake.h configmake.h-t
+
+## end gnulib module configmake
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+ -e 's/@''GNULIB_ISBLANK''@/$(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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += ctype.h ctype.h-t
+
+EXTRA_DIST += ctype.in.h
+
+## end gnulib module ctype
+
+## begin gnulib module diffseq
+
+libdiffutils_a_SOURCES += diffseq.h
+
+## end gnulib module diffseq
+
+## begin gnulib module dirname
+
+libdiffutils_a_SOURCES += dirname.c basename.c
+
+EXTRA_DIST += stripslash.c
+
+EXTRA_libdiffutils_a_SOURCES += stripslash.c
+
+## end gnulib module dirname
+
+## begin gnulib module dirname-lgpl
+
+libdiffutils_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
+
+EXTRA_DIST += dirname.h
+
+## end gnulib module dirname-lgpl
+
+## begin gnulib module do-release-commit-and-tag
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag
+
+## end gnulib module do-release-commit-and-tag
+
+## begin gnulib module dosname
+
+
+EXTRA_DIST += dosname.h
+
+## end gnulib module dosname
+
+## begin gnulib module dup2
+
+
+EXTRA_DIST += dup2.c
+
+EXTRA_libdiffutils_a_SOURCES += dup2.c
+
+## end gnulib module dup2
+
+## 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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_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 && \
+ 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
+
+
+EXTRA_DIST += error.c error.h
+
+EXTRA_libdiffutils_a_SOURCES += error.c
+
+## end gnulib module error
+
+## begin gnulib module exclude
+
+libdiffutils_a_SOURCES += exclude.c
+
+EXTRA_DIST += exclude.h
+
+## end gnulib module exclude
+
+## begin gnulib module exitfail
+
+libdiffutils_a_SOURCES += exitfail.c
+
+EXTRA_DIST += exitfail.h
+
+## end gnulib module exitfail
+
+## begin gnulib module fcntl
+
+
+EXTRA_DIST += fcntl.c
+
+EXTRA_libdiffutils_a_SOURCES += fcntl.c
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end gnulib module fcntl-h
+
+## begin gnulib module fd-hook
+
+libdiffutils_a_SOURCES += fd-hook.c
+
+EXTRA_DIST += fd-hook.h
+
+## end gnulib module fd-hook
+
+## begin gnulib module file-type
+
+libdiffutils_a_SOURCES += file-type.c
+
+EXTRA_DIST += file-type.h
+
+## end gnulib module file-type
+
+## begin gnulib module filename
+
+
+EXTRA_DIST += filename.h
+
+## end gnulib module filename
+
+## begin gnulib module filenamecat
+
+libdiffutils_a_SOURCES += filenamecat.c
+
+## end gnulib module filenamecat
+
+## begin gnulib module filenamecat-lgpl
+
+libdiffutils_a_SOURCES += filenamecat-lgpl.c
+
+EXTRA_DIST += filenamecat.h
+
+## end gnulib module filenamecat-lgpl
+
+## 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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+ < $(srcdir)/float.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+float.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += float.h float.h-t
+
+EXTRA_DIST += float.c float.in.h itold.c
+
+EXTRA_libdiffutils_a_SOURCES += float.c itold.c
+
+## end gnulib module float
+
+## begin gnulib module fnmatch
+
+BUILT_SOURCES += $(FNMATCH_H)
+
+# We need the following in order to create <fnmatch.h> when the system
+# doesn't have one that supports the required API.
+if GL_GENERATE_FNMATCH_H
+fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ < $(srcdir)/fnmatch.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+else
+fnmatch.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
+
+EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c
+
+EXTRA_libdiffutils_a_SOURCES += fnmatch.c fnmatch_loop.c
+
+## end gnulib module fnmatch
+
+## begin gnulib module freopen
+
+
+EXTRA_DIST += freopen.c
+
+EXTRA_libdiffutils_a_SOURCES += freopen.c
+
+## end gnulib module freopen
+
+## begin gnulib module freopen-safer
+
+libdiffutils_a_SOURCES += freopen-safer.c
+
+EXTRA_DIST += stdio--.h stdio-safer.h
+
+## end gnulib module freopen-safer
+
+## begin gnulib module fstat
+
+
+EXTRA_DIST += fstat.c
+
+EXTRA_libdiffutils_a_SOURCES += fstat.c
+
+## end gnulib module fstat
+
+## begin gnulib module gendocs
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh
+
+## end gnulib module gendocs
+
+## begin gnulib module getdtablesize
+
+
+EXTRA_DIST += getdtablesize.c
+
+EXTRA_libdiffutils_a_SOURCES += getdtablesize.c
+
+## end gnulib module getdtablesize
+
+## begin gnulib module getopt-posix
+
+BUILT_SOURCES += $(GETOPT_H)
+
+# We need the following in order to create <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ < $(srcdir)/getopt.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+MOSTLYCLEANFILES += getopt.h getopt.h-t
+
+EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
+
+EXTRA_libdiffutils_a_SOURCES += getopt.c getopt1.c
+
+## end gnulib module getopt-posix
+
+## begin gnulib module gettext-h
+
+libdiffutils_a_SOURCES += gettext.h
+
+## end gnulib module gettext-h
+
+## begin gnulib module gettime
+
+libdiffutils_a_SOURCES += gettime.c
+
+## end gnulib module gettime
+
+## begin gnulib module gettimeofday
+
+
+EXTRA_DIST += gettimeofday.c
+
+EXTRA_libdiffutils_a_SOURCES += gettimeofday.c
+
+## end gnulib module gettimeofday
+
+## begin gnulib module git-version-gen
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/git-version-gen
+
+## end gnulib module git-version-gen
+
+## begin gnulib module gitlog-to-changelog
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog
+
+## end gnulib module gitlog-to-changelog
+
+## begin gnulib module gnu-make
+
+##Sample usage of gnu-make module:
+#if GNU_MAKE
+# [nicer features that work only with GNU Make]
+#else
+# [fallback features that work in any 'make' implementation; see
+# http://www.opengroup.org/susv3/utilities/make.html
+# for the 2004 POSIX specification]
+#endif
+
+## end gnulib module gnu-make
+
+## begin gnulib module gnu-web-doc-update
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/gnu-web-doc-update
+
+## end gnulib module gnu-web-doc-update
+
+## begin gnulib module gnumakefile
+
+distclean-local: clean-GNUmakefile
+clean-GNUmakefile:
+ test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
+
+EXTRA_DIST += $(top_srcdir)/GNUmakefile
+
+## end gnulib module gnumakefile
+
+## begin gnulib module gnupload
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/gnupload
+
+## end gnulib module gnupload
+
+## begin gnulib module gperf
+
+GPERF = gperf
+V_GPERF = $(V_GPERF_@AM_V@)
+V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
+V_GPERF_0 = @echo " GPERF " $@;
+
+## end gnulib module gperf
+
+## begin gnulib module hard-locale
+
+libdiffutils_a_SOURCES += hard-locale.c
+
+EXTRA_DIST += hard-locale.h
+
+## end gnulib module hard-locale
+
+## begin gnulib module hash
+
+libdiffutils_a_SOURCES += hash.c
+
+EXTRA_DIST += hash.h
+
+## end gnulib module hash
+
+## begin gnulib module havelib
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
+
+## end gnulib module havelib
+
+## begin gnulib module iconv-h
+
+BUILT_SOURCES += $(ICONV_H)
+
+# We need the following in order to create <iconv.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ICONV_H
+iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \
+ -e 's/@''GNULIB_ICONV''@/$(GNULIB_ICONV)/g' \
+ -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
+ -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
+ -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
+ -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|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)/iconv.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+iconv.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += iconv.h iconv.h-t
+
+EXTRA_DIST += iconv.in.h
+
+## end gnulib module iconv-h
+
+## begin gnulib module iconv_open
+
+iconv_open-aix.h: iconv_open-aix.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \
+ mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
+iconv_open-hpux.h: iconv_open-hpux.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \
+ mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
+iconv_open-irix.h: iconv_open-irix.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \
+ mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
+iconv_open-osf.h: iconv_open-osf.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \
+ mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
+iconv_open-solaris.h: iconv_open-solaris.gperf
+ $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \
+ mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
+BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
+MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
+MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
+EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
+
+EXTRA_DIST += iconv.c iconv_close.c iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c
+
+EXTRA_libdiffutils_a_SOURCES += iconv.c iconv_close.c iconv_open.c
+
+## end gnulib module iconv_open
+
+## begin gnulib module ignore-value
+
+
+EXTRA_DIST += ignore-value.h
+
+## end gnulib module ignore-value
+
+## begin gnulib module intprops
+
+
+EXTRA_DIST += intprops.h
+
+## end gnulib module intprops
+
+## begin gnulib module inttostr
+
+libdiffutils_a_SOURCES += imaxtostr.c inttostr.c offtostr.c uinttostr.c umaxtostr.c
+
+EXTRA_DIST += anytostr.c inttostr.h
+
+EXTRA_libdiffutils_a_SOURCES += anytostr.c
+
+## end gnulib module inttostr
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \
+ -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \
+ -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \
+ -e 's/@''GNULIB_STRTOUMAX''@/$(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/@''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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += inttypes.h inttypes.h-t
+
+EXTRA_DIST += inttypes.in.h
+
+## end gnulib module inttypes-incomplete
+
+## begin gnulib module isblank
+
+
+EXTRA_DIST += isblank.c
+
+EXTRA_libdiffutils_a_SOURCES += isblank.c
+
+## end gnulib module isblank
+
+## begin gnulib module iswblank
+
+
+EXTRA_DIST += iswblank.c
+
+EXTRA_libdiffutils_a_SOURCES += iswblank.c
+
+## end gnulib module iswblank
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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''@/$(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_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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += langinfo.h langinfo.h-t
+
+EXTRA_DIST += langinfo.in.h
+
+## end gnulib module langinfo
+
+## begin gnulib module localcharset
+
+libdiffutils_a_SOURCES += localcharset.h localcharset.c
+
+# We need the following in order to install a simple file in $(libdir)
+# which is shared with other installed packages. We use a list of referencing
+# packages so that "make uninstall" will remove the file if and only if it
+# is not used by another installed package.
+# On systems with glibc-2.1 or newer, the file is redundant, therefore we
+# avoid installing it.
+
+all-local: charset.alias ref-add.sed ref-del.sed
+
+charset_alias = $(DESTDIR)$(libdir)/charset.alias
+charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+install-exec-local: install-exec-localcharset
+install-exec-localcharset: all-local
+ if test $(GLIBC21) = no; then \
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+ darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+ esac ; \
+ else \
+ need_charset_alias=false ; \
+ fi ; \
+ if $$need_charset_alias; then \
+ $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
+ fi ; \
+ if test -f $(charset_alias); then \
+ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
+ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
+ rm -f $(charset_tmp) ; \
+ else \
+ if $$need_charset_alias; then \
+ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
+ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
+ rm -f $(charset_tmp) ; \
+ fi ; \
+ fi
+
+uninstall-local: uninstall-localcharset
+uninstall-localcharset: all-local
+ if test -f $(charset_alias); then \
+ sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
+ if grep '^# Packages using this file: $$' $(charset_tmp) \
+ > /dev/null; then \
+ rm -f $(charset_alias); \
+ else \
+ $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
+ fi; \
+ rm -f $(charset_tmp); \
+ fi
+
+charset.alias: config.charset
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
+ mv t-$@ $@
+
+SUFFIXES += .sed .sin
+.sin.sed:
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
+ mv t-$@ $@
+
+CLEANFILES += charset.alias ref-add.sed ref-del.sed
+
+EXTRA_DIST += config.charset ref-add.sin ref-del.sin
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+ -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \
+ -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \
+ -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \
+ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|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_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += locale.h locale.h-t
+
+EXTRA_DIST += locale.in.h
+
+## end gnulib module locale
+
+## begin gnulib module localeconv
+
+
+EXTRA_DIST += localeconv.c
+
+EXTRA_libdiffutils_a_SOURCES += localeconv.c
+
+## end gnulib module localeconv
+
+## begin gnulib module lstat
+
+
+EXTRA_DIST += lstat.c
+
+EXTRA_libdiffutils_a_SOURCES += lstat.c
+
+## end gnulib module lstat
+
+## begin gnulib module maintainer-makefile
+
+EXTRA_DIST += $(top_srcdir)/maint.mk
+
+## end gnulib module maintainer-makefile
+
+## begin gnulib module malloc-posix
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libdiffutils_a_SOURCES += malloc.c
+
+## end gnulib module malloc-posix
+
+## begin gnulib module malloca
+
+libdiffutils_a_SOURCES += malloca.c
+
+EXTRA_DIST += malloca.h malloca.valgrind
+
+## end gnulib module malloca
+
+## begin gnulib module mbchar
+
+libdiffutils_a_SOURCES += mbchar.c
+
+EXTRA_DIST += mbchar.h
+
+## end gnulib module mbchar
+
+## begin gnulib module mbiter
+
+libdiffutils_a_SOURCES += mbiter.h mbiter.c
+
+## end gnulib module mbiter
+
+## begin gnulib module mbrtowc
+
+
+EXTRA_DIST += mbrtowc.c
+
+EXTRA_libdiffutils_a_SOURCES += mbrtowc.c
+
+## end gnulib module mbrtowc
+
+## begin gnulib module mbscasecmp
+
+libdiffutils_a_SOURCES += mbscasecmp.c
+
+## end gnulib module mbscasecmp
+
+## begin gnulib module mbsinit
+
+
+EXTRA_DIST += mbsinit.c
+
+EXTRA_libdiffutils_a_SOURCES += mbsinit.c
+
+## end gnulib module mbsinit
+
+## begin gnulib module mbslen
+
+libdiffutils_a_SOURCES += mbslen.c
+
+## end gnulib module mbslen
+
+## begin gnulib module mbsrtowcs
+
+
+EXTRA_DIST += mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c
+
+EXTRA_libdiffutils_a_SOURCES += mbsrtowcs-state.c mbsrtowcs.c
+
+## end gnulib module mbsrtowcs
+
+## begin gnulib module mbsstr
+
+libdiffutils_a_SOURCES += mbsstr.c
+
+EXTRA_DIST += str-kmp.h
+
+## end gnulib module mbsstr
+
+## begin gnulib module mbtowc
+
+
+EXTRA_DIST += mbtowc-impl.h mbtowc.c
+
+EXTRA_libdiffutils_a_SOURCES += mbtowc.c
+
+## end gnulib module mbtowc
+
+## begin gnulib module mbuiter
+
+libdiffutils_a_SOURCES += mbuiter.h mbuiter.c
+
+## end gnulib module mbuiter
+
+## begin gnulib module memchr
+
+
+EXTRA_DIST += memchr.c memchr.valgrind
+
+EXTRA_libdiffutils_a_SOURCES += memchr.c
+
+## end gnulib module memchr
+
+## begin gnulib module mkstemp
+
+
+EXTRA_DIST += mkstemp.c
+
+EXTRA_libdiffutils_a_SOURCES += mkstemp.c
+
+## end gnulib module mkstemp
+
+## begin gnulib module mktime
+
+
+EXTRA_DIST += mktime-internal.h mktime.c
+
+EXTRA_libdiffutils_a_SOURCES += mktime.c
+
+## end gnulib module mktime
+
+## begin gnulib module mktime-internal
+
+
+EXTRA_DIST += mktime-internal.h mktime.c
+
+EXTRA_libdiffutils_a_SOURCES += mktime.c
+
+## end gnulib module mktime-internal
+
+## begin gnulib module msvc-inval
+
+
+EXTRA_DIST += msvc-inval.c msvc-inval.h
+
+EXTRA_libdiffutils_a_SOURCES += msvc-inval.c
+
+## end gnulib module msvc-inval
+
+## begin gnulib module msvc-nothrow
+
+
+EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h
+
+EXTRA_libdiffutils_a_SOURCES += msvc-nothrow.c
+
+## end gnulib module msvc-nothrow
+
+## begin gnulib module nl_langinfo
+
+
+EXTRA_DIST += nl_langinfo.c
+
+EXTRA_libdiffutils_a_SOURCES += nl_langinfo.c
+
+## end gnulib module nl_langinfo
+
+## begin gnulib module open
+
+
+EXTRA_DIST += open.c
+
+EXTRA_libdiffutils_a_SOURCES += open.c
+
+## end gnulib module open
+
+## begin gnulib module pathmax
+
+
+EXTRA_DIST += pathmax.h
+
+## end gnulib module pathmax
+
+## begin gnulib module progname
+
+libdiffutils_a_SOURCES += progname.h progname.c
+
+## end gnulib module progname
+
+## begin gnulib module propername
+
+libdiffutils_a_SOURCES += propername.h propername.c
+
+## end gnulib module propername
+
+## begin gnulib module quote
+
+
+EXTRA_DIST += quote.h
+
+## end gnulib module quote
+
+## begin gnulib module quotearg
+
+libdiffutils_a_SOURCES += quotearg.c
+
+EXTRA_DIST += quote.h quotearg.h
+
+## end gnulib module quotearg
+
+## begin gnulib module raise
+
+
+EXTRA_DIST += raise.c
+
+EXTRA_libdiffutils_a_SOURCES += raise.c
+
+## end gnulib module raise
+
+## begin gnulib module rawmemchr
+
+
+EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
+
+EXTRA_libdiffutils_a_SOURCES += rawmemchr.c
+
+## end gnulib module rawmemchr
+
+## begin gnulib module readlink
+
+
+EXTRA_DIST += readlink.c
+
+EXTRA_libdiffutils_a_SOURCES += readlink.c
+
+## end gnulib module readlink
+
+## begin gnulib module readme-release
+
+
+EXTRA_DIST += $(top_srcdir)/README-release
+
+## end gnulib module readme-release
+
+## begin gnulib module regex
+
+
+EXTRA_DIST += regcomp.c regex.c regex.h regex_internal.c regex_internal.h regexec.c
+
+EXTRA_libdiffutils_a_SOURCES += regcomp.c regex.c regex_internal.c regexec.c
+
+## end gnulib module regex
+
+## begin gnulib module secure_getenv
+
+
+EXTRA_DIST += secure_getenv.c
+
+EXTRA_libdiffutils_a_SOURCES += secure_getenv.c
+
+## end gnulib module secure_getenv
+
+## begin gnulib module setenv
+
+
+EXTRA_DIST += setenv.c
+
+EXTRA_libdiffutils_a_SOURCES += setenv.c
+
+## end gnulib module setenv
+
+## begin gnulib module sh-quote
+
+libdiffutils_a_SOURCES += sh-quote.h sh-quote.c
+
+## end gnulib module sh-quote
+
+## begin gnulib module sigaction
+
+libdiffutils_a_SOURCES += sig-handler.c
+
+EXTRA_DIST += sig-handler.h sigaction.c
+
+EXTRA_libdiffutils_a_SOURCES += sigaction.c
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+ -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
+ -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
+ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
+ -e 's/@''GNULIB_SIGACTION''@/$(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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += signal.h signal.h-t
+
+EXTRA_DIST += signal.in.h
+
+## end gnulib module signal-h
+
+## begin gnulib module sigprocmask
+
+
+EXTRA_DIST += sigprocmask.c
+
+EXTRA_libdiffutils_a_SOURCES += sigprocmask.c
+
+## end gnulib module sigprocmask
+
+## begin gnulib module size_max
+
+libdiffutils_a_SOURCES += size_max.h
+
+## end gnulib module size_max
+
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+## end gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_ARG_NONNULL/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+
+## end gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/_GL_CXXDEFS/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/c++defs.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+
+## end gnulib module snippet/c++defs
+
+## begin gnulib module snippet/unused-parameter
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += unused-parameter.h
+# The unused-parameter.h that gets inserted into generated .h files is the same
+# as build-aux/snippet/unused-parameter.h, except that it has the copyright
+# header cut off.
+unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+
+UNUSED_PARAMETER_H=unused-parameter.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h
+
+## end gnulib module snippet/unused-parameter
+
+## begin gnulib module snippet/warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/^.ifndef/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+
+## end gnulib module snippet/warn-on-use
+
+## begin gnulib module stat
+
+
+EXTRA_DIST += stat.c
+
+EXTRA_libdiffutils_a_SOURCES += stat.c
+
+## end gnulib module stat
+
+## begin gnulib module stat-macros
+
+
+EXTRA_DIST += stat-macros.h
+
+## end gnulib module stat-macros
+
+## begin gnulib module stat-time
+
+libdiffutils_a_SOURCES += stat-time.c
+
+EXTRA_DIST += stat-time.h
+
+## end gnulib module stat-time
+
+## begin gnulib module stdarg
+
+BUILT_SOURCES += $(STDARG_H)
+
+# We need the following in order to create <stdarg.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDARG_H
+stdarg.h: stdarg.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
+ < $(srcdir)/stdarg.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stdarg.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdarg.h stdarg.h-t
+
+EXTRA_DIST += stdarg.in.h
+
+## end gnulib module stdarg
+
+## begin gnulib module stdbool
+
+BUILT_SOURCES += $(STDBOOL_H)
+
+# 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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
+ } > $@-t && \
+ 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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_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 && \
+ 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
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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_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/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/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' \
+ < $(srcdir)/stdint.in.h; \
+ } > $@-t && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -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_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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += stdio.h stdio.h-t
+
+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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
+ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
+ -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
+ -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
+ -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
+ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
+ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
+ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
+ -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
+ -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
+ -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
+ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
+ -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
+ -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
+ -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
+ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
+ -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
+ -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
+ -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|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_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_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_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_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_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|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_CALLOC''@|$(REPLACE_CALLOC)|g' \
+ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
+ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|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_R''@|$(REPLACE_RANDOM_R)|g' \
+ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
+ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += stdlib.h stdlib.h-t
+
+EXTRA_DIST += stdlib.in.h
+
+## end gnulib module stdlib
+
+## begin gnulib module strcase
+
+
+EXTRA_DIST += strcasecmp.c strncasecmp.c
+
+EXTRA_libdiffutils_a_SOURCES += strcasecmp.c strncasecmp.c
+
+## end gnulib module strcase
+
+## begin gnulib module streq
+
+
+EXTRA_DIST += streq.h
+
+## end gnulib module streq
+
+## begin gnulib module strerror
+
+
+EXTRA_DIST += strerror.c
+
+EXTRA_libdiffutils_a_SOURCES += strerror.c
+
+## end gnulib module strerror
+
+## begin gnulib module strerror-override
+
+
+EXTRA_DIST += strerror-override.c strerror-override.h
+
+EXTRA_libdiffutils_a_SOURCES += strerror-override.c
+
+## end gnulib module strerror-override
+
+## begin gnulib module strftime
+
+libdiffutils_a_SOURCES += strftime.c
+
+EXTRA_DIST += strftime.h
+
+## end gnulib module strftime
+
+## begin gnulib module striconv
+
+libdiffutils_a_SOURCES += striconv.h striconv.c
+if GL_COND_LIBTOOL
+endif
+
+## end gnulib module striconv
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|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_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|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_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|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)'; \
+ < $(srcdir)/string.in.h; \
+ } > $@-t && \
+ 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -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''@|$(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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += strings.h strings.h-t
+
+EXTRA_DIST += strings.in.h
+
+## end gnulib module strings
+
+## begin gnulib module strndup
+
+
+EXTRA_DIST += strndup.c
+
+EXTRA_libdiffutils_a_SOURCES += strndup.c
+
+## end gnulib module strndup
+
+## begin gnulib module strnlen
+
+
+EXTRA_DIST += strnlen.c
+
+EXTRA_libdiffutils_a_SOURCES += strnlen.c
+
+## end gnulib module strnlen
+
+## begin gnulib module strnlen1
+
+libdiffutils_a_SOURCES += strnlen1.h strnlen1.c
+
+## end gnulib module strnlen1
+
+## begin gnulib module strptime
+
+
+EXTRA_DIST += strptime.c
+
+EXTRA_libdiffutils_a_SOURCES += strptime.c
+
+## end gnulib module strptime
+
+## begin gnulib module strtoull
+
+
+EXTRA_DIST += strtol.c strtoul.c strtoull.c
+
+EXTRA_libdiffutils_a_SOURCES += strtol.c strtoul.c strtoull.c
+
+## end gnulib module strtoull
+
+## begin gnulib module strtoumax
+
+
+EXTRA_DIST += strtoimax.c strtoumax.c
+
+EXTRA_libdiffutils_a_SOURCES += strtoimax.c strtoumax.c
+
+## end gnulib module strtoumax
+
+## 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+ -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
+ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
+ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
+ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
+ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
+ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
+ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
+ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
+ -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
+ -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
+ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
+ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/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_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_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_MKNOD''@|$(REPLACE_MKNOD)|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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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''@/$(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 && \
+ 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_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ < $(srcdir)/sys_types.in.h; \
+ } > $@-t && \
+ 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_wait
+
+BUILT_SOURCES += sys/wait.h
+
+# We need the following in order to create <sys/wait.h> when the system
+# has one that is incomplete.
+sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+ -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/sys_wait.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += sys/wait.h sys/wait.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_wait.in.h
+
+## end gnulib module sys_wait
+
+## begin gnulib module system-quote
+
+libdiffutils_a_SOURCES += system-quote.h system-quote.c
+
+## end gnulib module system-quote
+
+## begin gnulib module tempname
+
+libdiffutils_a_SOURCES += tempname.c
+
+EXTRA_DIST += tempname.h
+
+## end gnulib module tempname
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
+ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
+ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
+ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
+ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/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_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|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_TIMEGM''@|$(REPLACE_TIMEGM)|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 '/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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += time.h time.h-t
+
+EXTRA_DIST += time.in.h
+
+## end gnulib module time
+
+## begin gnulib module time_r
+
+
+EXTRA_DIST += time_r.c
+
+EXTRA_libdiffutils_a_SOURCES += time_r.c
+
+## end gnulib module time_r
+
+## begin gnulib module time_rz
+
+
+EXTRA_DIST += time-internal.h time_rz.c
+
+EXTRA_libdiffutils_a_SOURCES += time_rz.c
+
+## end gnulib module time_rz
+
+## begin gnulib module timegm
+
+
+EXTRA_DIST += mktime-internal.h timegm.c
+
+EXTRA_libdiffutils_a_SOURCES += timegm.c
+
+## end gnulib module timegm
+
+## begin gnulib module timespec
+
+libdiffutils_a_SOURCES += timespec.c
+
+EXTRA_DIST += timespec.h
+
+## end gnulib module timespec
+
+## begin gnulib module trim
+
+libdiffutils_a_SOURCES += trim.c
+
+EXTRA_DIST += trim.h
+
+## end gnulib module trim
+
+## begin gnulib module unistd
+
+BUILT_SOURCES += unistd.h
+libdiffutils_a_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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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_CHDIR''@/$(GNULIB_CHDIR)/g' \
+ -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
+ -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
+ -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
+ -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
+ -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+ -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
+ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
+ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
+ -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
+ -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
+ -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
+ -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
+ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
+ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
+ -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
+ -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
+ -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+ -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
+ -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
+ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
+ -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
+ -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
+ -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
+ -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
+ -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
+ -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
+ -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
+ -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
+ -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
+ -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
+ -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
+ -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
+ -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
+ -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
+ -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
+ -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
+ -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
+ -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
+ -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
+ -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
+ -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
+ -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
+ -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
+ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|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_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
+ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+ -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
+ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|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_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_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_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_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
+ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|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_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_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_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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += unistd.h unistd.h-t
+
+EXTRA_DIST += unistd.in.h
+
+## end gnulib module unistd
+
+## begin gnulib module unistr/base
+
+BUILT_SOURCES += $(LIBUNISTRING_UNISTR_H)
+
+unistr.h: unistr.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/unistr.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+MOSTLYCLEANFILES += unistr.h unistr.h-t
+
+EXTRA_DIST += unistr.in.h
+
+## end gnulib module unistr/base
+
+## begin gnulib module unistr/u8-mbtoucr
+
+if LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR
+libdiffutils_a_SOURCES += unistr/u8-mbtoucr.c
+endif
+
+## end gnulib module unistr/u8-mbtoucr
+
+## begin gnulib module unistr/u8-uctomb
+
+if LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB
+libdiffutils_a_SOURCES += unistr/u8-uctomb.c unistr/u8-uctomb-aux.c
+endif
+
+## end gnulib module unistr/u8-uctomb
+
+## begin gnulib module unitypes
+
+BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H)
+
+unitypes.h: unitypes.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/unitypes.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+MOSTLYCLEANFILES += unitypes.h unitypes.h-t
+
+EXTRA_DIST += unitypes.in.h
+
+## end gnulib module unitypes
+
+## begin gnulib module uniwidth/base
+
+BUILT_SOURCES += $(LIBUNISTRING_UNIWIDTH_H)
+
+uniwidth.h: uniwidth.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/uniwidth.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+MOSTLYCLEANFILES += uniwidth.h uniwidth.h-t
+
+EXTRA_DIST += localcharset.h uniwidth.in.h
+
+## end gnulib module uniwidth/base
+
+## begin gnulib module uniwidth/width
+
+if LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH
+libdiffutils_a_SOURCES += uniwidth/width.c
+endif
+
+EXTRA_DIST += uniwidth/cjk.h
+
+## end gnulib module uniwidth/width
+
+## begin gnulib module unlocked-io
+
+
+EXTRA_DIST += unlocked-io.h
+
+## end gnulib module unlocked-io
+
+## begin gnulib module unsetenv
+
+
+EXTRA_DIST += unsetenv.c
+
+EXTRA_libdiffutils_a_SOURCES += unsetenv.c
+
+## end gnulib module unsetenv
+
+## begin gnulib module update-copyright
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright
+
+## end gnulib module update-copyright
+
+## begin gnulib module useless-if-before-free
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free
+
+## end gnulib module useless-if-before-free
+
+## 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_libdiffutils_a_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_libdiffutils_a_SOURCES += asprintf.c vasprintf.c
+
+## end gnulib module vasprintf
+
+## begin gnulib module vc-list-files
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/vc-list-files
+
+## end gnulib module vc-list-files
+
+## begin gnulib module verify
+
+
+EXTRA_DIST += verify.h
+
+## end gnulib module verify
+
+## begin gnulib module version-etc
+
+libdiffutils_a_SOURCES += version-etc.h version-etc.c
+
+## end gnulib module version-etc
+
+## begin gnulib module version-etc-fsf
+
+libdiffutils_a_SOURCES += version-etc-fsf.c
+
+## end gnulib module version-etc-fsf
+
+## 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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''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/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
+ -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \
+ -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
+ -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
+ -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \
+ -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
+ -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
+ -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
+ -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
+ -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
+ -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \
+ -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \
+ -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \
+ -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \
+ -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \
+ -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \
+ -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \
+ -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \
+ -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \
+ -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \
+ -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \
+ -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \
+ -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \
+ -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \
+ -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \
+ -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \
+ -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \
+ -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \
+ -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
+ -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/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_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_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|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_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 '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += wchar.h wchar.h-t
+
+EXTRA_DIST += wchar.in.h
+
+## end gnulib module wchar
+
+## begin gnulib module wcrtomb
+
+
+EXTRA_DIST += wcrtomb.c
+
+EXTRA_libdiffutils_a_SOURCES += wcrtomb.c
+
+## end gnulib module wcrtomb
+
+## begin gnulib module wctype-h
+
+BUILT_SOURCES += wctype.h
+libdiffutils_a_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)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -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/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(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_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 && \
+ mv $@-t $@
+MOSTLYCLEANFILES += wctype.h wctype.h-t
+
+EXTRA_DIST += wctype.in.h
+
+## end gnulib module wctype-h
+
+## begin gnulib module wcwidth
+
+
+EXTRA_DIST += wcwidth.c
+
+EXTRA_libdiffutils_a_SOURCES += wcwidth.c
+
+## end gnulib module wcwidth
+
+## begin gnulib module xalloc
+
+libdiffutils_a_SOURCES += xmalloc.c
+
+EXTRA_DIST += xalloc.h
+
+## end gnulib module xalloc
+
+## begin gnulib module xalloc-die
+
+libdiffutils_a_SOURCES += xalloc-die.c
+
+## end gnulib module xalloc-die
+
+## begin gnulib module xalloc-oversized
+
+
+EXTRA_DIST += xalloc-oversized.h
+
+## end gnulib module xalloc-oversized
+
+## begin gnulib module xfreopen
+
+libdiffutils_a_SOURCES += xfreopen.c xfreopen.h
+
+## end gnulib module xfreopen
+
+## begin gnulib module xreadlink
+
+libdiffutils_a_SOURCES += xreadlink.c
+
+EXTRA_DIST += xreadlink.h
+
+## end gnulib module xreadlink
+
+## begin gnulib module xsize
+
+libdiffutils_a_SOURCES += xsize.h xsize.c
+
+## end gnulib module xsize
+
+## begin gnulib module xstriconv
+
+libdiffutils_a_SOURCES += xstriconv.h xstriconv.c
+
+## end gnulib module xstriconv
+
+## begin gnulib module xstrndup
+
+libdiffutils_a_SOURCES += xstrndup.h xstrndup.c
+
+## end gnulib module xstrndup
+
+## begin gnulib module xstrtol
+
+libdiffutils_a_SOURCES += xstrtol.c xstrtoul.c xstrtol-error.c
+
+EXTRA_DIST += xstrtol.h
+
+## end gnulib module xstrtol
+
+## begin gnulib module xstrtoumax
+
+libdiffutils_a_SOURCES += xstrtoumax.c
+
+## end gnulib module xstrtoumax
+
+## begin gnulib module xvasprintf
+
+libdiffutils_a_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; \
+ :
diff --git a/lib/hard-locale.c b/lib/hard-locale.c
new file mode 100644
index 0000000..c7d9da5
--- /dev/null
+++ b/lib/hard-locale.c
@@ -0,0 +1,72 @@
+/* hard-locale.c -- Determine whether a locale is hard.
+
+ Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "hard-locale.h"
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __GLIBC__
+# define GLIBC_VERSION __GLIBC__
+#elif defined __UCLIBC__
+# define GLIBC_VERSION 2
+#else
+# define GLIBC_VERSION 0
+#endif
+
+/* Return true if the current CATEGORY locale is hard, i.e. if you
+ can't get away with assuming traditional C or POSIX behavior. */
+bool
+hard_locale (int category)
+{
+ bool hard = true;
+ char const *p = setlocale (category, NULL);
+
+ if (p)
+ {
+ if (2 <= GLIBC_VERSION)
+ {
+ if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
+ hard = false;
+ }
+ else
+ {
+ char *locale = strdup (p);
+ if (locale)
+ {
+ /* Temporarily set the locale to the "C" and "POSIX" locales
+ to find their names, so that we can determine whether one
+ or the other is the caller's locale. */
+ if (((p = setlocale (category, "C"))
+ && strcmp (p, locale) == 0)
+ || ((p = setlocale (category, "POSIX"))
+ && strcmp (p, locale) == 0))
+ hard = false;
+
+ /* Restore the caller's locale. */
+ setlocale (category, locale);
+ free (locale);
+ }
+ }
+ }
+
+ return hard;
+}
diff --git a/lib/hard-locale.h b/lib/hard-locale.h
new file mode 100644
index 0000000..7644afa
--- /dev/null
+++ b/lib/hard-locale.h
@@ -0,0 +1,25 @@
+/* Determine whether a locale is hard.
+
+ Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef HARD_LOCALE_H_
+# define HARD_LOCALE_H_ 1
+
+# include <stdbool.h>
+
+bool hard_locale (int);
+
+#endif /* HARD_LOCALE_H_ */
diff --git a/lib/hash.c b/lib/hash.c
new file mode 100644
index 0000000..f9dede0
--- /dev/null
+++ b/lib/hash.c
@@ -0,0 +1,1225 @@
+/* hash - hashing table processing.
+
+ Copyright (C) 1998-2004, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+
+ Written by Jim Meyering, 1992.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* 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. */
+
+/* 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. */
+
+size_t
+hash_get_n_buckets (const Hash_table *table)
+{
+ return table->n_buckets;
+}
+
+/* Return the number of slots in use (non-empty buckets). */
+
+size_t
+hash_get_n_buckets_used (const Hash_table *table)
+{
+ return table->n_buckets_used;
+}
+
+/* Return the number of active entries. */
+
+size_t
+hash_get_n_entries (const Hash_table *table)
+{
+ return table->n_entries;
+}
+
+/* Return the length of the longest chain (bucket). */
+
+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;
+}
+
+/* Do a mild validation of a hash table, by traversing it and checking two
+ statistics. */
+
+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;
+}
+
+/* If ENTRY matches an entry already in the hash table, return the
+ entry from the table. Otherwise, return NULL. */
+
+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. */
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+
+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. */
+
+/* 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. */
+
+#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 (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;
+}
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+
+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;
+}
+
+/* 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. */
+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 (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;
+}
+
+/* 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. */
+
+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));
+}
+
+/* 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. */
+
+void *
+hash_delete (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;
+}
+
+/* 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/lib/hash.h b/lib/hash.h
new file mode 100644
index 0000000..b61bee6
--- /dev/null
+++ b/lib/hash.h
@@ -0,0 +1,103 @@
+/* hash - hashing table processing.
+ Copyright (C) 1998-1999, 2001, 2003, 2009-2016 Free Software Foundation,
+ Inc.
+ Written by Jim Meyering <meyering@ascend.com>, 1998.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* 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>
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The warn_unused_result attribute appeared first in gcc-3.4.0. */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_WUR __attribute__ ((__warn_unused_result__))
+# else
+# define _GL_ATTRIBUTE_WUR /* empty */
+# endif
+
+# ifndef _GL_ATTRIBUTE_DEPRECATED
+/* The __attribute__((__deprecated__)) feature
+ is available in gcc versions 3.1 and newer. */
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
+# define _GL_ATTRIBUTE_DEPRECATED /* empty */
+# else
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+# endif
+# endif
+
+typedef size_t (*Hash_hasher) (const void *, size_t);
+typedef bool (*Hash_comparator) (const void *, const void *);
+typedef void (*Hash_data_freer) (void *);
+typedef bool (*Hash_processor) (void *, void *);
+
+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. */
+size_t hash_get_n_buckets (const Hash_table *) _GL_ATTRIBUTE_PURE;
+size_t hash_get_n_buckets_used (const Hash_table *) _GL_ATTRIBUTE_PURE;
+size_t hash_get_n_entries (const Hash_table *) _GL_ATTRIBUTE_PURE;
+size_t hash_get_max_bucket_length (const Hash_table *) _GL_ATTRIBUTE_PURE;
+bool hash_table_ok (const Hash_table *) _GL_ATTRIBUTE_PURE;
+void hash_print_statistics (const Hash_table *, FILE *);
+void *hash_lookup (const Hash_table *, const void *);
+
+/* Walking. */
+void *hash_get_first (const Hash_table *) _GL_ATTRIBUTE_PURE;
+void *hash_get_next (const Hash_table *, const void *);
+size_t hash_get_entries (const Hash_table *, void **, size_t);
+size_t hash_do_for_each (const Hash_table *, Hash_processor, void *);
+
+/* Allocation and clean-up. */
+size_t hash_string (const char *, size_t) _GL_ATTRIBUTE_PURE;
+void hash_reset_tuning (Hash_tuning *);
+Hash_table *hash_initialize (size_t, const Hash_tuning *,
+ Hash_hasher, Hash_comparator,
+ Hash_data_freer) _GL_ATTRIBUTE_WUR;
+void hash_clear (Hash_table *);
+void hash_free (Hash_table *);
+
+/* Insertion and deletion. */
+bool hash_rehash (Hash_table *, size_t) _GL_ATTRIBUTE_WUR;
+void *hash_insert (Hash_table *, const void *) _GL_ATTRIBUTE_WUR;
+
+int hash_insert_if_absent (Hash_table *table, const void *entry,
+ const void **matched_ent);
+void *hash_delete (Hash_table *, const void *);
+
+#endif
diff --git a/lib/iconv.c b/lib/iconv.c
new file mode 100644
index 0000000..9ce9c01
--- /dev/null
+++ b/lib/iconv.c
@@ -0,0 +1,449 @@
+/* Character set conversion.
+ Copyright (C) 1999-2001, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <iconv.h>
+
+#include <stddef.h>
+
+#if REPLACE_ICONV_UTF
+# include <errno.h>
+# include <stdint.h>
+# include <stdlib.h>
+# include "unistr.h"
+# ifndef uintptr_t
+# define uintptr_t unsigned long
+# endif
+#endif
+
+#if REPLACE_ICONV_UTF
+
+/* UTF-{16,32}{BE,LE} converters taken from GNU libiconv 1.11. */
+
+/* Return code if invalid. (xxx_mbtowc) */
+# define RET_ILSEQ -1
+/* Return code if no bytes were read. (xxx_mbtowc) */
+# define RET_TOOFEW -2
+
+/* Return code if invalid. (xxx_wctomb) */
+# define RET_ILUNI -1
+/* Return code if output buffer is too small. (xxx_wctomb, xxx_reset) */
+# define RET_TOOSMALL -2
+
+/*
+ * UTF-16BE
+ */
+
+/* Specification: RFC 2781 */
+
+static int
+utf16be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+ if (n >= 2)
+ {
+ ucs4_t wc = (s[0] << 8) + s[1];
+ if (wc >= 0xd800 && wc < 0xdc00)
+ {
+ if (n >= 4)
+ {
+ ucs4_t wc2 = (s[2] << 8) + s[3];
+ if (!(wc2 >= 0xdc00 && wc2 < 0xe000))
+ return RET_ILSEQ;
+ *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00);
+ return 4;
+ }
+ }
+ else if (wc >= 0xdc00 && wc < 0xe000)
+ {
+ return RET_ILSEQ;
+ }
+ else
+ {
+ *pwc = wc;
+ return 2;
+ }
+ }
+ return RET_TOOFEW;
+}
+
+static int
+utf16be_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+ if (!(wc >= 0xd800 && wc < 0xe000))
+ {
+ if (wc < 0x10000)
+ {
+ if (n >= 2)
+ {
+ r[0] = (unsigned char) (wc >> 8);
+ r[1] = (unsigned char) wc;
+ return 2;
+ }
+ else
+ return RET_TOOSMALL;
+ }
+ else if (wc < 0x110000)
+ {
+ if (n >= 4)
+ {
+ ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10);
+ ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff);
+ r[0] = (unsigned char) (wc1 >> 8);
+ r[1] = (unsigned char) wc1;
+ r[2] = (unsigned char) (wc2 >> 8);
+ r[3] = (unsigned char) wc2;
+ return 4;
+ }
+ else
+ return RET_TOOSMALL;
+ }
+ }
+ return RET_ILUNI;
+}
+
+/*
+ * UTF-16LE
+ */
+
+/* Specification: RFC 2781 */
+
+static int
+utf16le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+ if (n >= 2)
+ {
+ ucs4_t wc = s[0] + (s[1] << 8);
+ if (wc >= 0xd800 && wc < 0xdc00)
+ {
+ if (n >= 4)
+ {
+ ucs4_t wc2 = s[2] + (s[3] << 8);
+ if (!(wc2 >= 0xdc00 && wc2 < 0xe000))
+ return RET_ILSEQ;
+ *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00);
+ return 4;
+ }
+ }
+ else if (wc >= 0xdc00 && wc < 0xe000)
+ {
+ return RET_ILSEQ;
+ }
+ else
+ {
+ *pwc = wc;
+ return 2;
+ }
+ }
+ return RET_TOOFEW;
+}
+
+static int
+utf16le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+ if (!(wc >= 0xd800 && wc < 0xe000))
+ {
+ if (wc < 0x10000)
+ {
+ if (n >= 2)
+ {
+ r[0] = (unsigned char) wc;
+ r[1] = (unsigned char) (wc >> 8);
+ return 2;
+ }
+ else
+ return RET_TOOSMALL;
+ }
+ else if (wc < 0x110000)
+ {
+ if (n >= 4)
+ {
+ ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10);
+ ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff);
+ r[0] = (unsigned char) wc1;
+ r[1] = (unsigned char) (wc1 >> 8);
+ r[2] = (unsigned char) wc2;
+ r[3] = (unsigned char) (wc2 >> 8);
+ return 4;
+ }
+ else
+ return RET_TOOSMALL;
+ }
+ }
+ return RET_ILUNI;
+}
+
+/*
+ * UTF-32BE
+ */
+
+/* Specification: Unicode 3.1 Standard Annex #19 */
+
+static int
+utf32be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+ if (n >= 4)
+ {
+ ucs4_t wc = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3];
+ if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+ {
+ *pwc = wc;
+ return 4;
+ }
+ else
+ return RET_ILSEQ;
+ }
+ return RET_TOOFEW;
+}
+
+static int
+utf32be_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+ if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+ {
+ if (n >= 4)
+ {
+ r[0] = 0;
+ r[1] = (unsigned char) (wc >> 16);
+ r[2] = (unsigned char) (wc >> 8);
+ r[3] = (unsigned char) wc;
+ return 4;
+ }
+ else
+ return RET_TOOSMALL;
+ }
+ return RET_ILUNI;
+}
+
+/*
+ * UTF-32LE
+ */
+
+/* Specification: Unicode 3.1 Standard Annex #19 */
+
+static int
+utf32le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+ if (n >= 4)
+ {
+ ucs4_t wc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24);
+ if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+ {
+ *pwc = wc;
+ return 4;
+ }
+ else
+ return RET_ILSEQ;
+ }
+ return RET_TOOFEW;
+}
+
+static int
+utf32le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+ if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+ {
+ if (n >= 4)
+ {
+ r[0] = (unsigned char) wc;
+ r[1] = (unsigned char) (wc >> 8);
+ r[2] = (unsigned char) (wc >> 16);
+ r[3] = 0;
+ return 4;
+ }
+ else
+ return RET_TOOSMALL;
+ }
+ return RET_ILUNI;
+}
+
+#endif
+
+size_t
+rpl_iconv (iconv_t cd,
+ ICONV_CONST char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft)
+#undef iconv
+{
+#if REPLACE_ICONV_UTF
+ switch ((uintptr_t) cd)
+ {
+ {
+ int (*xxx_wctomb) (unsigned char *, ucs4_t, size_t);
+
+ case (uintptr_t) _ICONV_UTF8_UTF16BE:
+ xxx_wctomb = utf16be_wctomb;
+ goto loop_from_utf8;
+ case (uintptr_t) _ICONV_UTF8_UTF16LE:
+ xxx_wctomb = utf16le_wctomb;
+ goto loop_from_utf8;
+ case (uintptr_t) _ICONV_UTF8_UTF32BE:
+ xxx_wctomb = utf32be_wctomb;
+ goto loop_from_utf8;
+ case (uintptr_t) _ICONV_UTF8_UTF32LE:
+ xxx_wctomb = utf32le_wctomb;
+ goto loop_from_utf8;
+
+ loop_from_utf8:
+ if (inbuf == NULL || *inbuf == NULL)
+ return 0;
+ {
+ ICONV_CONST char *inptr = *inbuf;
+ size_t inleft = *inbytesleft;
+ char *outptr = *outbuf;
+ size_t outleft = *outbytesleft;
+ size_t res = 0;
+ while (inleft > 0)
+ {
+ ucs4_t uc;
+ int m = u8_mbtoucr (&uc, (const uint8_t *) inptr, inleft);
+ if (m <= 0)
+ {
+ if (m == -1)
+ {
+ errno = EILSEQ;
+ res = (size_t)(-1);
+ break;
+ }
+ if (m == -2)
+ {
+ errno = EINVAL;
+ res = (size_t)(-1);
+ break;
+ }
+ abort ();
+ }
+ else
+ {
+ int n = xxx_wctomb ((uint8_t *) outptr, uc, outleft);
+ if (n < 0)
+ {
+ if (n == RET_ILUNI)
+ {
+ errno = EILSEQ;
+ res = (size_t)(-1);
+ break;
+ }
+ if (n == RET_TOOSMALL)
+ {
+ errno = E2BIG;
+ res = (size_t)(-1);
+ break;
+ }
+ abort ();
+ }
+ else
+ {
+ inptr += m;
+ inleft -= m;
+ outptr += n;
+ outleft -= n;
+ }
+ }
+ }
+ *inbuf = inptr;
+ *inbytesleft = inleft;
+ *outbuf = outptr;
+ *outbytesleft = outleft;
+ return res;
+ }
+ }
+
+ {
+ int (*xxx_mbtowc) (ucs4_t *, const unsigned char *, size_t);
+
+ case (uintptr_t) _ICONV_UTF16BE_UTF8:
+ xxx_mbtowc = utf16be_mbtowc;
+ goto loop_to_utf8;
+ case (uintptr_t) _ICONV_UTF16LE_UTF8:
+ xxx_mbtowc = utf16le_mbtowc;
+ goto loop_to_utf8;
+ case (uintptr_t) _ICONV_UTF32BE_UTF8:
+ xxx_mbtowc = utf32be_mbtowc;
+ goto loop_to_utf8;
+ case (uintptr_t) _ICONV_UTF32LE_UTF8:
+ xxx_mbtowc = utf32le_mbtowc;
+ goto loop_to_utf8;
+
+ loop_to_utf8:
+ if (inbuf == NULL || *inbuf == NULL)
+ return 0;
+ {
+ ICONV_CONST char *inptr = *inbuf;
+ size_t inleft = *inbytesleft;
+ char *outptr = *outbuf;
+ size_t outleft = *outbytesleft;
+ size_t res = 0;
+ while (inleft > 0)
+ {
+ ucs4_t uc;
+ int m = xxx_mbtowc (&uc, (const uint8_t *) inptr, inleft);
+ if (m <= 0)
+ {
+ if (m == RET_ILSEQ)
+ {
+ errno = EILSEQ;
+ res = (size_t)(-1);
+ break;
+ }
+ if (m == RET_TOOFEW)
+ {
+ errno = EINVAL;
+ res = (size_t)(-1);
+ break;
+ }
+ abort ();
+ }
+ else
+ {
+ int n = u8_uctomb ((uint8_t *) outptr, uc, outleft);
+ if (n < 0)
+ {
+ if (n == -1)
+ {
+ errno = EILSEQ;
+ res = (size_t)(-1);
+ break;
+ }
+ if (n == -2)
+ {
+ errno = E2BIG;
+ res = (size_t)(-1);
+ break;
+ }
+ abort ();
+ }
+ else
+ {
+ inptr += m;
+ inleft -= m;
+ outptr += n;
+ outleft -= n;
+ }
+ }
+ }
+ *inbuf = inptr;
+ *inbytesleft = inleft;
+ *outbuf = outptr;
+ *outbytesleft = outleft;
+ return res;
+ }
+ }
+ }
+#endif
+ return iconv (cd, inbuf, inbytesleft, outbuf, outbytesleft);
+}
diff --git a/lib/iconv.in.h b/lib/iconv.in.h
new file mode 100644
index 0000000..cb1da14
--- /dev/null
+++ b/lib/iconv.in.h
@@ -0,0 +1,110 @@
+/* A GNU-like <iconv.h>.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_ICONV_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_ICONV_H@
+
+#ifndef _@GUARD_PREFIX@_ICONV_H
+#define _@GUARD_PREFIX@_ICONV_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 @GNULIB_ICONV@
+# if @REPLACE_ICONV_OPEN@
+/* An iconv_open wrapper that supports the IANA standardized encoding names
+ ("ISO-8859-1" etc.) as far as possible. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iconv_open rpl_iconv_open
+# endif
+_GL_FUNCDECL_RPL (iconv_open, iconv_t,
+ (const char *tocode, const char *fromcode)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (iconv_open, iconv_t,
+ (const char *tocode, const char *fromcode));
+# else
+_GL_CXXALIAS_SYS (iconv_open, iconv_t,
+ (const char *tocode, const char *fromcode));
+# endif
+_GL_CXXALIASWARN (iconv_open);
+#endif
+
+#if @REPLACE_ICONV_UTF@
+/* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
+ Not public. */
+# define _ICONV_UTF8_UTF16BE (iconv_t)(-161)
+# define _ICONV_UTF8_UTF16LE (iconv_t)(-162)
+# define _ICONV_UTF8_UTF32BE (iconv_t)(-163)
+# define _ICONV_UTF8_UTF32LE (iconv_t)(-164)
+# define _ICONV_UTF16BE_UTF8 (iconv_t)(-165)
+# define _ICONV_UTF16LE_UTF8 (iconv_t)(-166)
+# define _ICONV_UTF32BE_UTF8 (iconv_t)(-167)
+# define _ICONV_UTF32LE_UTF8 (iconv_t)(-168)
+#endif
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iconv rpl_iconv
+# endif
+_GL_FUNCDECL_RPL (iconv, size_t,
+ (iconv_t cd,
+ @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft));
+_GL_CXXALIAS_RPL (iconv, size_t,
+ (iconv_t cd,
+ @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft));
+# else
+_GL_CXXALIAS_SYS (iconv, size_t,
+ (iconv_t cd,
+ @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft));
+# endif
+_GL_CXXALIASWARN (iconv);
+# ifndef ICONV_CONST
+# define ICONV_CONST @ICONV_CONST@
+# endif
+#endif
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iconv_close rpl_iconv_close
+# endif
+_GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
+_GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
+# else
+_GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
+# endif
+_GL_CXXALIASWARN (iconv_close);
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_ICONV_H */
+#endif /* _@GUARD_PREFIX@_ICONV_H */
diff --git a/lib/iconv_close.c b/lib/iconv_close.c
new file mode 100644
index 0000000..d1cd793
--- /dev/null
+++ b/lib/iconv_close.c
@@ -0,0 +1,46 @@
+/* Character set conversion.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <iconv.h>
+
+#include <stdint.h>
+#ifndef uintptr_t
+# define uintptr_t unsigned long
+#endif
+
+int
+rpl_iconv_close (iconv_t cd)
+#undef iconv_close
+{
+#if REPLACE_ICONV_UTF
+ switch ((uintptr_t) cd)
+ {
+ case (uintptr_t) _ICONV_UTF8_UTF16BE:
+ case (uintptr_t) _ICONV_UTF8_UTF16LE:
+ case (uintptr_t) _ICONV_UTF8_UTF32BE:
+ case (uintptr_t) _ICONV_UTF8_UTF32LE:
+ case (uintptr_t) _ICONV_UTF16BE_UTF8:
+ case (uintptr_t) _ICONV_UTF16LE_UTF8:
+ case (uintptr_t) _ICONV_UTF32BE_UTF8:
+ case (uintptr_t) _ICONV_UTF32LE_UTF8:
+ return 0;
+ }
+#endif
+ return iconv_close (cd);
+}
diff --git a/lib/iconv_open-aix.gperf b/lib/iconv_open-aix.gperf
new file mode 100644
index 0000000..6782b99
--- /dev/null
+++ b/lib/iconv_open-aix.gperf
@@ -0,0 +1,44 @@
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On AIX 5.1, look in /usr/lib/nls/loc/uconvTable.
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+CP437, "IBM-437"
+CP850, "IBM-850"
+CP852, "IBM-852"
+CP856, "IBM-856"
+CP857, "IBM-857"
+CP861, "IBM-861"
+CP865, "IBM-865"
+CP869, "IBM-869"
+ISO-8859-13, "IBM-921"
+CP922, "IBM-922"
+CP932, "IBM-932"
+CP943, "IBM-943"
+CP1046, "IBM-1046"
+CP1124, "IBM-1124"
+CP1125, "IBM-1125"
+CP1129, "IBM-1129"
+CP1252, "IBM-1252"
+GB2312, "IBM-eucCN"
+EUC-JP, "IBM-eucJP"
+EUC-KR, "IBM-eucKR"
+EUC-TW, "IBM-eucTW"
+BIG5, "big5"
diff --git a/lib/iconv_open-aix.h b/lib/iconv_open-aix.h
new file mode 100644
index 0000000..129e030
--- /dev/null
+++ b/lib/iconv_open-aix.h
@@ -0,0 +1,256 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -m 10 ./iconv_open-aix.gperf */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "./iconv_open-aix.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 32
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 44
+/* maximum key range = 39, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 0, 4, 25,
+ 0, 11, 24, 9, 17, 3, 14, 21, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 3, 45, 1, 45, 45, 45, 45, 0, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45
+ };
+ return len + asso_values[(unsigned char)str[3]+2] + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+ {
+ char stringpool_str6[sizeof("EUC-TW")];
+ char stringpool_str7[sizeof("EUC-KR")];
+ char stringpool_str8[sizeof("CP852")];
+ char stringpool_str9[sizeof("EUC-JP")];
+ char stringpool_str10[sizeof("ISO-8859-2")];
+ char stringpool_str11[sizeof("CP857")];
+ char stringpool_str12[sizeof("CP850")];
+ char stringpool_str13[sizeof("ISO-8859-7")];
+ char stringpool_str14[sizeof("CP932")];
+ char stringpool_str15[sizeof("GB2312")];
+ char stringpool_str16[sizeof("BIG5")];
+ char stringpool_str17[sizeof("CP437")];
+ char stringpool_str19[sizeof("ISO-8859-5")];
+ char stringpool_str20[sizeof("ISO-8859-15")];
+ char stringpool_str21[sizeof("ISO-8859-3")];
+ char stringpool_str22[sizeof("ISO-8859-13")];
+ char stringpool_str23[sizeof("CP1046")];
+ char stringpool_str24[sizeof("ISO-8859-8")];
+ char stringpool_str25[sizeof("CP856")];
+ char stringpool_str26[sizeof("CP1125")];
+ char stringpool_str27[sizeof("ISO-8859-6")];
+ char stringpool_str28[sizeof("CP865")];
+ char stringpool_str29[sizeof("CP922")];
+ char stringpool_str30[sizeof("CP1252")];
+ char stringpool_str31[sizeof("ISO-8859-9")];
+ char stringpool_str33[sizeof("CP943")];
+ char stringpool_str34[sizeof("ISO-8859-4")];
+ char stringpool_str35[sizeof("ISO-8859-1")];
+ char stringpool_str38[sizeof("CP1129")];
+ char stringpool_str40[sizeof("CP869")];
+ char stringpool_str41[sizeof("CP1124")];
+ char stringpool_str44[sizeof("CP861")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "EUC-TW",
+ "EUC-KR",
+ "CP852",
+ "EUC-JP",
+ "ISO-8859-2",
+ "CP857",
+ "CP850",
+ "ISO-8859-7",
+ "CP932",
+ "GB2312",
+ "BIG5",
+ "CP437",
+ "ISO-8859-5",
+ "ISO-8859-15",
+ "ISO-8859-3",
+ "ISO-8859-13",
+ "CP1046",
+ "ISO-8859-8",
+ "CP856",
+ "CP1125",
+ "ISO-8859-6",
+ "CP865",
+ "CP922",
+ "CP1252",
+ "ISO-8859-9",
+ "CP943",
+ "ISO-8859-4",
+ "ISO-8859-1",
+ "CP1129",
+ "CP869",
+ "CP1124",
+ "CP861"
+ };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 43 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"},
+#line 42 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"},
+#line 25 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"},
+#line 41 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"},
+#line 14 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"},
+#line 27 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"},
+#line 24 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"},
+#line 19 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"},
+#line 33 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"},
+#line 40 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"},
+#line 44 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "big5"},
+#line 23 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"},
+ {-1},
+#line 17 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"},
+#line 22 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"},
+#line 15 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"},
+#line 31 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"},
+#line 35 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"},
+#line 20 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"},
+#line 26 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"},
+#line 37 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"},
+#line 18 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
+#line 29 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"},
+#line 32 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"},
+#line 39 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"},
+#line 21 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"},
+ {-1},
+#line 34 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"},
+#line 16 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"},
+#line 13 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"},
+ {-1}, {-1},
+#line 38 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"},
+ {-1},
+#line 30 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"},
+#line 36 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
+ {-1}, {-1},
+#line 28 "./iconv_open-aix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"}
+ };
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct mapping *
+mapping_lookup (register const char *str, register unsigned int len)
+{
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = mapping_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = mappings[key].standard_name;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &mappings[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/lib/iconv_open-hpux.gperf b/lib/iconv_open-hpux.gperf
new file mode 100644
index 0000000..5a35c83
--- /dev/null
+++ b/lib/iconv_open-hpux.gperf
@@ -0,0 +1,56 @@
+struct mapping { int standard_name; const char vendor_name[9 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On HP-UX 11.11, look in /usr/lib/nls/iconv.
+ISO-8859-1, "iso88591"
+ISO-8859-2, "iso88592"
+ISO-8859-5, "iso88595"
+ISO-8859-6, "iso88596"
+ISO-8859-7, "iso88597"
+ISO-8859-8, "iso88598"
+ISO-8859-9, "iso88599"
+ISO-8859-15, "iso885915"
+CP437, "cp437"
+CP775, "cp775"
+CP850, "cp850"
+CP852, "cp852"
+CP855, "cp855"
+CP857, "cp857"
+CP861, "cp861"
+CP862, "cp862"
+CP864, "cp864"
+CP865, "cp865"
+CP866, "cp866"
+CP869, "cp869"
+CP874, "cp874"
+CP1250, "cp1250"
+CP1251, "cp1251"
+CP1252, "cp1252"
+CP1253, "cp1253"
+CP1254, "cp1254"
+CP1255, "cp1255"
+CP1256, "cp1256"
+CP1257, "cp1257"
+CP1258, "cp1258"
+HP-ROMAN8, "roman8"
+HP-ARABIC8, "arabic8"
+HP-GREEK8, "greek8"
+HP-HEBREW8, "hebrew8"
+HP-TURKISH8, "turkish8"
+HP-KANA8, "kana8"
+TIS-620, "tis620"
+GB2312, "hp15CN"
+EUC-JP, "eucJP"
+EUC-KR, "eucKR"
+EUC-TW, "eucTW"
+BIG5, "big5"
+SHIFT_JIS, "sjis"
+UTF-8, "utf8"
diff --git a/lib/iconv_open-hpux.h b/lib/iconv_open-hpux.h
new file mode 100644
index 0000000..3bcff76
--- /dev/null
+++ b/lib/iconv_open-hpux.h
@@ -0,0 +1,299 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "./iconv_open-hpux.gperf"
+struct mapping { int standard_name; const char vendor_name[9 + 1]; };
+
+#define TOTAL_KEYWORDS 44
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 49
+/* maximum key range = 44, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 1, 2,
+ 24, 43, 5, 10, 0, 13, 32, 3, 19, 18,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 5,
+ 50, 50, 50, 50, 14, 5, 0, 50, 50, 0,
+ 27, 50, 12, 14, 50, 50, 0, 5, 2, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50
+ };
+ return len + asso_values[(unsigned char)str[3]+4] + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+ {
+ char stringpool_str6[sizeof("CP1256")];
+ char stringpool_str7[sizeof("CP1250")];
+ char stringpool_str8[sizeof("CP1251")];
+ char stringpool_str9[sizeof("CP850")];
+ char stringpool_str10[sizeof("TIS-620")];
+ char stringpool_str11[sizeof("CP1254")];
+ char stringpool_str12[sizeof("ISO-8859-6")];
+ char stringpool_str13[sizeof("EUC-TW")];
+ char stringpool_str14[sizeof("ISO-8859-1")];
+ char stringpool_str15[sizeof("ISO-8859-9")];
+ char stringpool_str16[sizeof("CP1255")];
+ char stringpool_str17[sizeof("BIG5")];
+ char stringpool_str18[sizeof("CP855")];
+ char stringpool_str19[sizeof("CP1257")];
+ char stringpool_str20[sizeof("EUC-KR")];
+ char stringpool_str21[sizeof("CP857")];
+ char stringpool_str22[sizeof("ISO-8859-5")];
+ char stringpool_str23[sizeof("ISO-8859-15")];
+ char stringpool_str24[sizeof("CP866")];
+ char stringpool_str25[sizeof("ISO-8859-7")];
+ char stringpool_str26[sizeof("CP861")];
+ char stringpool_str27[sizeof("CP869")];
+ char stringpool_str28[sizeof("CP874")];
+ char stringpool_str29[sizeof("CP864")];
+ char stringpool_str30[sizeof("CP1252")];
+ char stringpool_str31[sizeof("CP437")];
+ char stringpool_str32[sizeof("CP852")];
+ char stringpool_str33[sizeof("CP775")];
+ char stringpool_str34[sizeof("CP865")];
+ char stringpool_str35[sizeof("EUC-JP")];
+ char stringpool_str36[sizeof("ISO-8859-2")];
+ char stringpool_str37[sizeof("SHIFT_JIS")];
+ char stringpool_str38[sizeof("CP1258")];
+ char stringpool_str39[sizeof("UTF-8")];
+ char stringpool_str40[sizeof("HP-KANA8")];
+ char stringpool_str41[sizeof("HP-ROMAN8")];
+ char stringpool_str42[sizeof("HP-HEBREW8")];
+ char stringpool_str43[sizeof("GB2312")];
+ char stringpool_str44[sizeof("ISO-8859-8")];
+ char stringpool_str45[sizeof("HP-TURKISH8")];
+ char stringpool_str46[sizeof("HP-GREEK8")];
+ char stringpool_str47[sizeof("HP-ARABIC8")];
+ char stringpool_str48[sizeof("CP862")];
+ char stringpool_str49[sizeof("CP1253")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "CP1256",
+ "CP1250",
+ "CP1251",
+ "CP850",
+ "TIS-620",
+ "CP1254",
+ "ISO-8859-6",
+ "EUC-TW",
+ "ISO-8859-1",
+ "ISO-8859-9",
+ "CP1255",
+ "BIG5",
+ "CP855",
+ "CP1257",
+ "EUC-KR",
+ "CP857",
+ "ISO-8859-5",
+ "ISO-8859-15",
+ "CP866",
+ "ISO-8859-7",
+ "CP861",
+ "CP869",
+ "CP874",
+ "CP864",
+ "CP1252",
+ "CP437",
+ "CP852",
+ "CP775",
+ "CP865",
+ "EUC-JP",
+ "ISO-8859-2",
+ "SHIFT_JIS",
+ "CP1258",
+ "UTF-8",
+ "HP-KANA8",
+ "HP-ROMAN8",
+ "HP-HEBREW8",
+ "GB2312",
+ "ISO-8859-8",
+ "HP-TURKISH8",
+ "HP-GREEK8",
+ "HP-ARABIC8",
+ "CP862",
+ "CP1253"
+ };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 40 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"},
+#line 34 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"},
+#line 35 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"},
+#line 23 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "cp850"},
+#line 49 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "tis620"},
+#line 38 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"},
+#line 16 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"},
+#line 53 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"},
+#line 13 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"},
+#line 19 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"},
+#line 39 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"},
+#line 54 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "big5"},
+#line 25 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp855"},
+#line 41 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"},
+#line 52 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"},
+#line 26 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp857"},
+#line 15 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"},
+#line 20 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"},
+#line 31 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "cp866"},
+#line 17 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"},
+#line 27 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "cp861"},
+#line 32 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "cp869"},
+#line 33 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "cp874"},
+#line 29 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp864"},
+#line 36 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
+#line 21 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp437"},
+#line 24 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "cp852"},
+#line 22 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp775"},
+#line 30 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp865"},
+#line 51 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"},
+#line 14 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"},
+#line 55 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "sjis"},
+#line 42 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"},
+#line 56 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "utf8"},
+#line 48 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "kana8"},
+#line 43 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "roman8"},
+#line 46 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"},
+#line 50 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"},
+#line 18 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"},
+#line 47 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"},
+#line 45 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "greek8"},
+#line 44 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"},
+#line 28 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str48, "cp862"},
+#line 37 "./iconv_open-hpux.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"}
+ };
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct mapping *
+mapping_lookup (register const char *str, register unsigned int len)
+{
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = mapping_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = mappings[key].standard_name;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &mappings[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/lib/iconv_open-irix.gperf b/lib/iconv_open-irix.gperf
new file mode 100644
index 0000000..3672a80
--- /dev/null
+++ b/lib/iconv_open-irix.gperf
@@ -0,0 +1,31 @@
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On IRIX 6.5, look in /usr/lib/iconv and /usr/lib/international/encodings.
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+KOI8-R, "KOI8"
+CP855, "DOS855"
+CP1251, "WIN1251"
+GB2312, "eucCN"
+EUC-JP, "eucJP"
+EUC-KR, "eucKR"
+EUC-TW, "eucTW"
+SHIFT_JIS, "sjis"
+TIS-620, "TIS620"
diff --git a/lib/iconv_open-irix.h b/lib/iconv_open-irix.h
new file mode 100644
index 0000000..74ceb8f
--- /dev/null
+++ b/lib/iconv_open-irix.h
@@ -0,0 +1,199 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -m 10 ./iconv_open-irix.gperf */
+/* Computed positions: -k'1,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "./iconv_open-irix.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 19
+#define MIN_WORD_LENGTH 5
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 5
+#define MAX_HASH_VALUE 23
+/* maximum key range = 19, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 8, 2,
+ 5, 12, 11, 0, 10, 9, 8, 7, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 0, 24, 0,
+ 24, 5, 24, 0, 24, 7, 24, 24, 24, 24,
+ 7, 24, 1, 0, 8, 24, 24, 0, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24
+ };
+ return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
+}
+
+struct stringpool_t
+ {
+ char stringpool_str5[sizeof("CP855")];
+ char stringpool_str6[sizeof("EUC-TW")];
+ char stringpool_str7[sizeof("EUC-KR")];
+ char stringpool_str8[sizeof("CP1251")];
+ char stringpool_str9[sizeof("SHIFT_JIS")];
+ char stringpool_str10[sizeof("ISO-8859-5")];
+ char stringpool_str11[sizeof("ISO-8859-15")];
+ char stringpool_str12[sizeof("ISO-8859-1")];
+ char stringpool_str13[sizeof("EUC-JP")];
+ char stringpool_str14[sizeof("KOI8-R")];
+ char stringpool_str15[sizeof("ISO-8859-2")];
+ char stringpool_str16[sizeof("GB2312")];
+ char stringpool_str17[sizeof("ISO-8859-9")];
+ char stringpool_str18[sizeof("ISO-8859-8")];
+ char stringpool_str19[sizeof("ISO-8859-7")];
+ char stringpool_str20[sizeof("ISO-8859-6")];
+ char stringpool_str21[sizeof("ISO-8859-4")];
+ char stringpool_str22[sizeof("ISO-8859-3")];
+ char stringpool_str23[sizeof("TIS-620")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "CP855",
+ "EUC-TW",
+ "EUC-KR",
+ "CP1251",
+ "SHIFT_JIS",
+ "ISO-8859-5",
+ "ISO-8859-15",
+ "ISO-8859-1",
+ "EUC-JP",
+ "KOI8-R",
+ "ISO-8859-2",
+ "GB2312",
+ "ISO-8859-9",
+ "ISO-8859-8",
+ "ISO-8859-7",
+ "ISO-8859-6",
+ "ISO-8859-4",
+ "ISO-8859-3",
+ "TIS-620"
+ };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1},
+#line 24 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"},
+#line 29 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"},
+#line 28 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"},
+#line 25 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"},
+#line 30 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "sjis"},
+#line 17 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"},
+#line 22 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
+#line 13 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"},
+#line 27 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"},
+#line 23 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"},
+#line 14 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"},
+#line 26 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"},
+#line 21 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"},
+#line 20 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"},
+#line 19 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"},
+#line 18 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"},
+#line 16 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"},
+#line 15 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"},
+#line 31 "./iconv_open-irix.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"}
+ };
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct mapping *
+mapping_lookup (register const char *str, register unsigned int len)
+{
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = mapping_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = mappings[key].standard_name;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &mappings[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/lib/iconv_open-osf.gperf b/lib/iconv_open-osf.gperf
new file mode 100644
index 0000000..f468ff6
--- /dev/null
+++ b/lib/iconv_open-osf.gperf
@@ -0,0 +1,50 @@
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On OSF/1 5.1, look in /usr/lib/nls/loc/iconv.
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+CP437, "cp437"
+CP775, "cp775"
+CP850, "cp850"
+CP852, "cp852"
+CP855, "cp855"
+CP857, "cp857"
+CP861, "cp861"
+CP862, "cp862"
+CP865, "cp865"
+CP866, "cp866"
+CP869, "cp869"
+CP874, "cp874"
+CP949, "KSC5601"
+CP1250, "cp1250"
+CP1251, "cp1251"
+CP1252, "cp1252"
+CP1253, "cp1253"
+CP1254, "cp1254"
+CP1255, "cp1255"
+CP1256, "cp1256"
+CP1257, "cp1257"
+CP1258, "cp1258"
+EUC-JP, "eucJP"
+EUC-KR, "eucKR"
+EUC-TW, "eucTW"
+BIG5, "big5"
+SHIFT_JIS, "SJIS"
+TIS-620, "TACTIS"
diff --git a/lib/iconv_open-osf.h b/lib/iconv_open-osf.h
new file mode 100644
index 0000000..4d35764
--- /dev/null
+++ b/lib/iconv_open-osf.h
@@ -0,0 +1,278 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -m 10 ./iconv_open-osf.gperf */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "./iconv_open-osf.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 38
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 47
+/* maximum key range = 42, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 2, 29,
+ 24, 34, 31, 0, 15, 14, 10, 13, 2, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 7, 48, 48, 48, 48, 48, 48,
+ 11, 48, 2, 7, 48, 48, 48, 1, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48
+ };
+ return len + asso_values[(unsigned char)str[3]+3] + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+ {
+ char stringpool_str6[sizeof("CP1255")];
+ char stringpool_str7[sizeof("CP775")];
+ char stringpool_str8[sizeof("CP1250")];
+ char stringpool_str9[sizeof("EUC-TW")];
+ char stringpool_str10[sizeof("EUC-KR")];
+ char stringpool_str11[sizeof("TIS-620")];
+ char stringpool_str12[sizeof("ISO-8859-5")];
+ char stringpool_str13[sizeof("ISO-8859-15")];
+ char stringpool_str14[sizeof("BIG5")];
+ char stringpool_str15[sizeof("CP855")];
+ char stringpool_str16[sizeof("CP1258")];
+ char stringpool_str17[sizeof("CP850")];
+ char stringpool_str18[sizeof("CP865")];
+ char stringpool_str19[sizeof("EUC-JP")];
+ char stringpool_str20[sizeof("CP1257")];
+ char stringpool_str21[sizeof("CP1256")];
+ char stringpool_str22[sizeof("ISO-8859-8")];
+ char stringpool_str23[sizeof("SHIFT_JIS")];
+ char stringpool_str25[sizeof("ISO-8859-9")];
+ char stringpool_str26[sizeof("ISO-8859-7")];
+ char stringpool_str27[sizeof("ISO-8859-6")];
+ char stringpool_str29[sizeof("CP857")];
+ char stringpool_str30[sizeof("CP1252")];
+ char stringpool_str31[sizeof("CP869")];
+ char stringpool_str32[sizeof("CP949")];
+ char stringpool_str33[sizeof("CP866")];
+ char stringpool_str34[sizeof("CP437")];
+ char stringpool_str35[sizeof("CP1251")];
+ char stringpool_str36[sizeof("ISO-8859-2")];
+ char stringpool_str37[sizeof("CP1254")];
+ char stringpool_str38[sizeof("CP874")];
+ char stringpool_str39[sizeof("CP852")];
+ char stringpool_str40[sizeof("CP1253")];
+ char stringpool_str41[sizeof("ISO-8859-1")];
+ char stringpool_str42[sizeof("CP862")];
+ char stringpool_str43[sizeof("ISO-8859-4")];
+ char stringpool_str46[sizeof("ISO-8859-3")];
+ char stringpool_str47[sizeof("CP861")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "CP1255",
+ "CP775",
+ "CP1250",
+ "EUC-TW",
+ "EUC-KR",
+ "TIS-620",
+ "ISO-8859-5",
+ "ISO-8859-15",
+ "BIG5",
+ "CP855",
+ "CP1258",
+ "CP850",
+ "CP865",
+ "EUC-JP",
+ "CP1257",
+ "CP1256",
+ "ISO-8859-8",
+ "SHIFT_JIS",
+ "ISO-8859-9",
+ "ISO-8859-7",
+ "ISO-8859-6",
+ "CP857",
+ "CP1252",
+ "CP869",
+ "CP949",
+ "CP866",
+ "CP437",
+ "CP1251",
+ "ISO-8859-2",
+ "CP1254",
+ "CP874",
+ "CP852",
+ "CP1253",
+ "ISO-8859-1",
+ "CP862",
+ "ISO-8859-4",
+ "ISO-8859-3",
+ "CP861"
+ };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 41 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"},
+#line 24 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp775"},
+#line 36 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"},
+#line 47 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"},
+#line 46 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"},
+#line 50 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"},
+#line 17 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"},
+#line 22 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"},
+#line 48 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "big5"},
+#line 27 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "cp855"},
+#line 44 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"},
+#line 25 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "cp850"},
+#line 31 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp865"},
+#line 45 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"},
+#line 43 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"},
+#line 42 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"},
+#line 20 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"},
+#line 49 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"},
+ {-1},
+#line 21 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"},
+#line 19 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"},
+#line 18 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
+ {-1},
+#line 28 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp857"},
+#line 38 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
+#line 33 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp869"},
+#line 35 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"},
+#line 32 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp866"},
+#line 23 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp437"},
+#line 37 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"},
+#line 14 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"},
+#line 40 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"},
+#line 34 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp874"},
+#line 26 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "cp852"},
+#line 39 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"},
+#line 13 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"},
+#line 30 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "cp862"},
+#line 16 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
+ {-1}, {-1},
+#line 15 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"},
+#line 29 "./iconv_open-osf.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "cp861"}
+ };
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct mapping *
+mapping_lookup (register const char *str, register unsigned int len)
+{
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = mapping_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = mappings[key].standard_name;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &mappings[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/lib/iconv_open-solaris.gperf b/lib/iconv_open-solaris.gperf
new file mode 100644
index 0000000..7d7da38
--- /dev/null
+++ b/lib/iconv_open-solaris.gperf
@@ -0,0 +1,30 @@
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but
+# not actually supported by the iconv() function and by the 'iconv' program.
+# For example:
+# $ echo abc | iconv -f 646 -t ISO-8859-1
+# Not supported 646 to ISO-8859-1
+# $ echo abc | iconv -f 646 -t ISO8859-1
+$ abc
+ASCII, "646"
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+CP1251, "ansi-1251"
diff --git a/lib/iconv_open-solaris.h b/lib/iconv_open-solaris.h
new file mode 100644
index 0000000..630cde1
--- /dev/null
+++ b/lib/iconv_open-solaris.h
@@ -0,0 +1,190 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */
+/* Computed positions: -k'10' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "./iconv_open-solaris.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 13
+#define MIN_WORD_LENGTH 5
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 5
+#define MAX_HASH_VALUE 19
+/* maximum key range = 15, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 0,
+ 9, 8, 7, 6, 5, 4, 3, 2, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20
+ };
+ register int hval = len;
+
+ switch (hval)
+ {
+ default:
+ hval += asso_values[(unsigned char)str[9]];
+ /*FALLTHROUGH*/
+ case 9:
+ case 8:
+ case 7:
+ case 6:
+ case 5:
+ break;
+ }
+ return hval;
+}
+
+struct stringpool_t
+ {
+ char stringpool_str5[sizeof("ASCII")];
+ char stringpool_str6[sizeof("CP1251")];
+ char stringpool_str7[sizeof("$ abc")];
+ char stringpool_str10[sizeof("ISO-8859-1")];
+ char stringpool_str11[sizeof("ISO-8859-15")];
+ char stringpool_str12[sizeof("ISO-8859-9")];
+ char stringpool_str13[sizeof("ISO-8859-8")];
+ char stringpool_str14[sizeof("ISO-8859-7")];
+ char stringpool_str15[sizeof("ISO-8859-6")];
+ char stringpool_str16[sizeof("ISO-8859-5")];
+ char stringpool_str17[sizeof("ISO-8859-4")];
+ char stringpool_str18[sizeof("ISO-8859-3")];
+ char stringpool_str19[sizeof("ISO-8859-2")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "ASCII",
+ "CP1251",
+ "$ abc",
+ "ISO-8859-1",
+ "ISO-8859-15",
+ "ISO-8859-9",
+ "ISO-8859-8",
+ "ISO-8859-7",
+ "ISO-8859-6",
+ "ISO-8859-5",
+ "ISO-8859-4",
+ "ISO-8859-3",
+ "ISO-8859-2"
+ };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1},
+#line 19 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "646"},
+#line 30 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
+#line 18 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str7},
+ {-1}, {-1},
+#line 20 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
+#line 29 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
+#line 28 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
+#line 27 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
+#line 26 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
+#line 25 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
+#line 24 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
+#line 23 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
+#line 22 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
+#line 21 "./iconv_open-solaris.gperf"
+ {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
+ };
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct mapping *
+mapping_lookup (register const char *str, register unsigned int len)
+{
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = mapping_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = mappings[key].standard_name;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &mappings[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/lib/iconv_open.c b/lib/iconv_open.c
new file mode 100644
index 0000000..d5c5a52
--- /dev/null
+++ b/lib/iconv_open.c
@@ -0,0 +1,172 @@
+/* Character set conversion.
+ Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <iconv.h>
+
+#include <errno.h>
+#include <string.h>
+#include "c-ctype.h"
+#include "c-strcase.h"
+
+#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
+
+/* Namespace cleanliness. */
+#define mapping_lookup rpl_iconv_open_mapping_lookup
+
+/* The macro ICONV_FLAVOR is defined to one of these or undefined. */
+
+#define ICONV_FLAVOR_AIX "iconv_open-aix.h"
+#define ICONV_FLAVOR_HPUX "iconv_open-hpux.h"
+#define ICONV_FLAVOR_IRIX "iconv_open-irix.h"
+#define ICONV_FLAVOR_OSF "iconv_open-osf.h"
+#define ICONV_FLAVOR_SOLARIS "iconv_open-solaris.h"
+
+#ifdef ICONV_FLAVOR
+# include ICONV_FLAVOR
+#endif
+
+iconv_t
+rpl_iconv_open (const char *tocode, const char *fromcode)
+#undef iconv_open
+{
+ char fromcode_upper[32];
+ char tocode_upper[32];
+ char *fromcode_upper_end;
+ char *tocode_upper_end;
+
+#if REPLACE_ICONV_UTF
+ /* Special handling of conversion between UTF-8 and UTF-{16,32}{BE,LE}.
+ Do this here, before calling the real iconv_open(), because OSF/1 5.1
+ iconv() to these encoding inserts a BOM, which is wrong.
+ We do not need to handle conversion between arbitrary encodings and
+ UTF-{16,32}{BE,LE}, because the 'striconveh' module implements two-step
+ conversion through UTF-8.
+ The _ICONV_* constants are chosen to be disjoint from any iconv_t
+ returned by the system's iconv_open() functions. Recall that iconv_t
+ is a scalar type. */
+ if (c_toupper (fromcode[0]) == 'U'
+ && c_toupper (fromcode[1]) == 'T'
+ && c_toupper (fromcode[2]) == 'F'
+ && fromcode[3] == '-')
+ {
+ if (c_toupper (tocode[0]) == 'U'
+ && c_toupper (tocode[1]) == 'T'
+ && c_toupper (tocode[2]) == 'F'
+ && tocode[3] == '-')
+ {
+ if (strcmp (fromcode + 4, "8") == 0)
+ {
+ if (c_strcasecmp (tocode + 4, "16BE") == 0)
+ return _ICONV_UTF8_UTF16BE;
+ if (c_strcasecmp (tocode + 4, "16LE") == 0)
+ return _ICONV_UTF8_UTF16LE;
+ if (c_strcasecmp (tocode + 4, "32BE") == 0)
+ return _ICONV_UTF8_UTF32BE;
+ if (c_strcasecmp (tocode + 4, "32LE") == 0)
+ return _ICONV_UTF8_UTF32LE;
+ }
+ else if (strcmp (tocode + 4, "8") == 0)
+ {
+ if (c_strcasecmp (fromcode + 4, "16BE") == 0)
+ return _ICONV_UTF16BE_UTF8;
+ if (c_strcasecmp (fromcode + 4, "16LE") == 0)
+ return _ICONV_UTF16LE_UTF8;
+ if (c_strcasecmp (fromcode + 4, "32BE") == 0)
+ return _ICONV_UTF32BE_UTF8;
+ if (c_strcasecmp (fromcode + 4, "32LE") == 0)
+ return _ICONV_UTF32LE_UTF8;
+ }
+ }
+ }
+#endif
+
+ /* Do *not* add special support for 8-bit encodings like ASCII or ISO-8859-1
+ here. This would lead to programs that work in some locales (such as the
+ "C" or "en_US" locales) but do not work in East Asian locales. It is
+ better if programmers make their programs depend on GNU libiconv (except
+ on glibc systems), e.g. by using the AM_ICONV macro and documenting the
+ dependency in an INSTALL or DEPENDENCIES file. */
+
+ /* Try with the original names first.
+ This covers the case when fromcode or tocode is a lowercase encoding name
+ that is understood by the system's iconv_open but not listed in our
+ mappings table. */
+ {
+ iconv_t cd = iconv_open (tocode, fromcode);
+ if (cd != (iconv_t)(-1))
+ return cd;
+ }
+
+ /* Convert the encodings to upper case, because
+ 1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case
+ matters,
+ 2. it makes searching in the table faster. */
+ {
+ const char *p = fromcode;
+ char *q = fromcode_upper;
+ while ((*q = c_toupper (*p)) != '\0')
+ {
+ p++;
+ q++;
+ if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
+ {
+ errno = EINVAL;
+ return (iconv_t)(-1);
+ }
+ }
+ fromcode_upper_end = q;
+ }
+
+ {
+ const char *p = tocode;
+ char *q = tocode_upper;
+ while ((*q = c_toupper (*p)) != '\0')
+ {
+ p++;
+ q++;
+ if (q == &tocode_upper[SIZEOF (tocode_upper)])
+ {
+ errno = EINVAL;
+ return (iconv_t)(-1);
+ }
+ }
+ tocode_upper_end = q;
+ }
+
+#ifdef ICONV_FLAVOR
+ /* Apply the mappings. */
+ {
+ const struct mapping *m =
+ mapping_lookup (fromcode_upper, fromcode_upper_end - fromcode_upper);
+
+ fromcode = (m != NULL ? m->vendor_name : fromcode_upper);
+ }
+ {
+ const struct mapping *m =
+ mapping_lookup (tocode_upper, tocode_upper_end - tocode_upper);
+
+ tocode = (m != NULL ? m->vendor_name : tocode_upper);
+ }
+#else
+ fromcode = fromcode_upper;
+ tocode = tocode_upper;
+#endif
+
+ return iconv_open (tocode, fromcode);
+}
diff --git a/lib/ignore-value.h b/lib/ignore-value.h
new file mode 100644
index 0000000..6713d96
--- /dev/null
+++ b/lib/ignore-value.h
@@ -0,0 +1,50 @@
+/* ignore a function return without a compiler warning. -*- coding: utf-8 -*-
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering, Eric Blake and Pádraig Brady. */
+
+/* Use "ignore_value" to avoid a warning when using a function declared with
+ gcc's warn_unused_result attribute, but for which you really do want to
+ ignore the result. Traditionally, people have used a "(void)" cast to
+ indicate that a function's return value is deliberately unused. However,
+ if the function is declared with __attribute__((warn_unused_result)),
+ gcc issues a warning even with the cast.
+
+ Caution: most of the time, you really should heed gcc's warning, and
+ check the return value. However, in those exceptional cases in which
+ you're sure you know what you're doing, use this function.
+
+ For the record, here's one of the ignorable warnings:
+ "copy.c:233: warning: ignoring return value of 'fchown',
+ declared with attribute warn_unused_result". */
+
+#ifndef _GL_IGNORE_VALUE_H
+#define _GL_IGNORE_VALUE_H
+
+/* Normally casting an expression to void discards its value, but GCC
+ versions 3.4 and newer have __attribute__ ((__warn_unused_result__))
+ which may cause unwanted diagnostics in that case. Use __typeof__
+ and __extension__ to work around the problem, if the workaround is
+ known to be needed. */
+#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
+# define ignore_value(x) \
+ (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
+#else
+# define ignore_value(x) ((void) (x))
+#endif
+
+#endif
diff --git a/lib/imaxtostr.c b/lib/imaxtostr.c
new file mode 100644
index 0000000..b91ac98
--- /dev/null
+++ b/lib/imaxtostr.c
@@ -0,0 +1,3 @@
+#define anytostr imaxtostr
+#define inttype intmax_t
+#include "anytostr.c"
diff --git a/lib/intprops.h b/lib/intprops.h
new file mode 100644
index 0000000..e1fce5c
--- /dev/null
+++ b/lib/intprops.h
@@ -0,0 +1,445 @@
+/* intprops.h -- properties of integer types
+
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef _GL_INTPROPS_H
+#define _GL_INTPROPS_H
+
+#include <limits.h>
+#include <verify.h>
+
+/* Return a value with the common real type of E and V and the value of V. */
+#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+
+/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */
+#define _GL_INT_NEGATE_CONVERT(e, v) (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. */
+#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+/* Minimum and maximum values for integer types and expressions. */
+
+/* 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 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+/* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E should not have side effects. */
+#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) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+
+/* 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.
+ As a sanity check, test the assumption for some signed types that
+ <limits.h> bounds. */
+verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+verify (TYPE_MINIMUM (short int) == SHRT_MIN);
+verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
+verify (TYPE_MINIMUM (int) == INT_MIN);
+verify (TYPE_MAXIMUM (int) == INT_MAX);
+verify (TYPE_MINIMUM (long int) == LONG_MIN);
+verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+#ifdef LLONG_MAX
+verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+#endif
+
+/* 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__ || 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. 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.
+ 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 0 when its argument is
+ signed, 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 (sizeof (t) * CHAR_BIT \
+ - _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. */
+#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 a bit harder to use than the
+ 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.
+
+ 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
+ <http://lists.gnu.org/archive/html/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) works when P is null. */
+#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
+
+/* 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_WITH_NULL
+# define _GL_ADD_OVERFLOW(a, b, min, max)
+ __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+ __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+ __builtin_mul_overflow (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 also store the low-order bits of the answer.
+ 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 *. The result type must be signed.
+
+ These macros are tuned for their last 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_WITH_NULL
+# 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 (0 * (b) + (a)), \
+ _GL_INT_MAXIMUM (0 * (b) + (a)))
+
+/* 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. */
+#define INT_ADD_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
+#define INT_SUBTRACT_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
+#define INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#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 older compilers that
+ lack __builtin_add_overflow. */
+#if __GNUC__
+# 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. BUILTIN is the builtin operation, and OVERFLOW the
+ overflow predicate. Return 1 if the result overflows. See above
+ for restrictions. */
+#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+ (_Generic \
+ (*(r), \
+ signed char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+ signed char, SCHAR_MIN, SCHAR_MAX), \
+ short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+ short int, SHRT_MIN, SHRT_MAX), \
+ int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX), \
+ long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX), \
+ long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX)))
+#else
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+ (sizeof *(r) == sizeof (signed char) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+ signed char, SCHAR_MIN, SCHAR_MAX) \
+ : sizeof *(r) == sizeof (short int) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+ short int, SHRT_MIN, SHRT_MAX) \
+ : sizeof *(r) == sizeof (int) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_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) \
+ ? _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 long int, \
+ long long int, LLONG_MIN, LLONG_MAX))
+# else
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_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 extremal values 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) \
+ (sizeof ((a) op (b)) < sizeof (t) \
+ ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
+ : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
+#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \
+ ((overflow (a, b) \
+ || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
+ || (tmax) < ((a) op (b))) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
+
+/* Return A <op> B, where the operation is given by OP. Use the
+ unsigned type UT for calculation to avoid overflow problems.
+ Convert the result to type T without overflow by subtracting TMIN
+ from large values before converting, and adding it afterwards.
+ Compilers can optimize all the operations except OP. */
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \
+ (((ut) (a) op (ut) (b)) <= (tmax) \
+ ? (t) ((ut) (a) op (ut) (b)) \
+ : ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
+
+#endif /* _GL_INTPROPS_H */
diff --git a/lib/inttostr.c b/lib/inttostr.c
new file mode 100644
index 0000000..c96b5ca
--- /dev/null
+++ b/lib/inttostr.c
@@ -0,0 +1,3 @@
+#define anytostr inttostr
+#define inttype int
+#include "anytostr.c"
diff --git a/lib/inttostr.h b/lib/inttostr.h
new file mode 100644
index 0000000..781ee6e
--- /dev/null
+++ b/lib/inttostr.h
@@ -0,0 +1,46 @@
+/* inttostr.h -- convert integers to printable strings
+
+ Copyright (C) 2001-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert */
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include "intprops.h"
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#if __GNUC_PREREQ (3,4)
+# undef __attribute_warn_unused_result__
+# define __attribute_warn_unused_result__ \
+ __attribute__ ((__warn_unused_result__))
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+
+char *imaxtostr (intmax_t, char *) __attribute_warn_unused_result__;
+char *inttostr (int, char *) __attribute_warn_unused_result__;
+char *offtostr (off_t, char *) __attribute_warn_unused_result__;
+char *uinttostr (unsigned int, char *) __attribute_warn_unused_result__;
+char *umaxtostr (uintmax_t, char *) __attribute_warn_unused_result__;
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
new file mode 100644
index 0000000..ed09db6
--- /dev/null
+++ b/lib/inttypes.in.h
@@ -0,0 +1,1144 @@
+/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Derek Price.
+ This file is part of gnulib.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/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@
+# 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. */
+#include <limits.h>
+/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# include <stdio.h>
+#endif
+
+#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
+# error "This file assumes that 'int' has exactly 32 bits. 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 || @PRI_MACROS_BROKEN@
+# undef PRId8
+# ifdef INT8_MAX
+# define PRId8 "d"
+# endif
+#endif
+#if !defined PRIi8 || @PRI_MACROS_BROKEN@
+# undef PRIi8
+# ifdef INT8_MAX
+# define PRIi8 "i"
+# endif
+#endif
+#if !defined PRIo8 || @PRI_MACROS_BROKEN@
+# undef PRIo8
+# ifdef UINT8_MAX
+# define PRIo8 "o"
+# endif
+#endif
+#if !defined PRIu8 || @PRI_MACROS_BROKEN@
+# undef PRIu8
+# ifdef UINT8_MAX
+# define PRIu8 "u"
+# endif
+#endif
+#if !defined PRIx8 || @PRI_MACROS_BROKEN@
+# undef PRIx8
+# ifdef UINT8_MAX
+# define PRIx8 "x"
+# endif
+#endif
+#if !defined PRIX8 || @PRI_MACROS_BROKEN@
+# undef PRIX8
+# ifdef UINT8_MAX
+# define PRIX8 "X"
+# endif
+#endif
+#if !defined PRId16 || @PRI_MACROS_BROKEN@
+# undef PRId16
+# ifdef INT16_MAX
+# define PRId16 "d"
+# endif
+#endif
+#if !defined PRIi16 || @PRI_MACROS_BROKEN@
+# undef PRIi16
+# ifdef INT16_MAX
+# define PRIi16 "i"
+# endif
+#endif
+#if !defined PRIo16 || @PRI_MACROS_BROKEN@
+# undef PRIo16
+# ifdef UINT16_MAX
+# define PRIo16 "o"
+# endif
+#endif
+#if !defined PRIu16 || @PRI_MACROS_BROKEN@
+# undef PRIu16
+# ifdef UINT16_MAX
+# define PRIu16 "u"
+# endif
+#endif
+#if !defined PRIx16 || @PRI_MACROS_BROKEN@
+# undef PRIx16
+# ifdef UINT16_MAX
+# define PRIx16 "x"
+# endif
+#endif
+#if !defined PRIX16 || @PRI_MACROS_BROKEN@
+# undef PRIX16
+# ifdef UINT16_MAX
+# define PRIX16 "X"
+# endif
+#endif
+#if !defined PRId32 || @PRI_MACROS_BROKEN@
+# undef PRId32
+# ifdef INT32_MAX
+# define PRId32 "d"
+# endif
+#endif
+#if !defined PRIi32 || @PRI_MACROS_BROKEN@
+# undef PRIi32
+# ifdef INT32_MAX
+# define PRIi32 "i"
+# endif
+#endif
+#if !defined PRIo32 || @PRI_MACROS_BROKEN@
+# undef PRIo32
+# ifdef UINT32_MAX
+# define PRIo32 "o"
+# endif
+#endif
+#if !defined PRIu32 || @PRI_MACROS_BROKEN@
+# undef PRIu32
+# ifdef UINT32_MAX
+# define PRIu32 "u"
+# endif
+#endif
+#if !defined PRIx32 || @PRI_MACROS_BROKEN@
+# undef PRIx32
+# ifdef UINT32_MAX
+# define PRIx32 "x"
+# endif
+#endif
+#if !defined PRIX32 || @PRI_MACROS_BROKEN@
+# undef 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 @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRId64 || @PRI_MACROS_BROKEN@
+# undef PRId64
+# define PRId64 _PRI64_PREFIX "d"
+# endif
+# if !defined PRIi64 || @PRI_MACROS_BROKEN@
+# undef 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 @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRIo64 || @PRI_MACROS_BROKEN@
+# undef PRIo64
+# define PRIo64 _PRIu64_PREFIX "o"
+# endif
+# if !defined PRIu64 || @PRI_MACROS_BROKEN@
+# undef PRIu64
+# define PRIu64 _PRIu64_PREFIX "u"
+# endif
+# if !defined PRIx64 || @PRI_MACROS_BROKEN@
+# undef PRIx64
+# define PRIx64 _PRIu64_PREFIX "x"
+# endif
+# if !defined PRIX64 || @PRI_MACROS_BROKEN@
+# undef PRIX64
+# define PRIX64 _PRIu64_PREFIX "X"
+# endif
+#endif
+
+#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST8
+# define PRIdLEAST8 "d"
+#endif
+#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST8
+# define PRIiLEAST8 "i"
+#endif
+#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST8
+# define PRIoLEAST8 "o"
+#endif
+#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST8
+# define PRIuLEAST8 "u"
+#endif
+#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST8
+# define PRIxLEAST8 "x"
+#endif
+#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST8
+# define PRIXLEAST8 "X"
+#endif
+#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST16
+# define PRIdLEAST16 "d"
+#endif
+#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST16
+# define PRIiLEAST16 "i"
+#endif
+#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST16
+# define PRIoLEAST16 "o"
+#endif
+#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST16
+# define PRIuLEAST16 "u"
+#endif
+#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST16
+# define PRIxLEAST16 "x"
+#endif
+#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST16
+# define PRIXLEAST16 "X"
+#endif
+#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST32
+# define PRIdLEAST32 "d"
+#endif
+#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST32
+# define PRIiLEAST32 "i"
+#endif
+#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST32
+# define PRIoLEAST32 "o"
+#endif
+#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST32
+# define PRIuLEAST32 "u"
+#endif
+#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST32
+# define PRIxLEAST32 "x"
+#endif
+#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST32
+# define PRIXLEAST32 "X"
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST64
+# define PRIdLEAST64 PRId64
+# endif
+# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST64
+# define PRIiLEAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST64
+# define PRIoLEAST64 PRIo64
+# endif
+# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST64
+# define PRIuLEAST64 PRIu64
+# endif
+# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST64
+# define PRIxLEAST64 PRIx64
+# endif
+# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST64
+# define PRIXLEAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
+# undef PRIdFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define PRIdFAST8 PRId64
+# else
+# define PRIdFAST8 "d"
+# endif
+#endif
+#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@
+# undef PRIiFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define PRIiFAST8 PRIi64
+# else
+# define PRIiFAST8 "i"
+# endif
+#endif
+#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
+# undef PRIoFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIoFAST8 PRIo64
+# else
+# define PRIoFAST8 "o"
+# endif
+#endif
+#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@
+# undef PRIuFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIuFAST8 PRIu64
+# else
+# define PRIuFAST8 "u"
+# endif
+#endif
+#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
+# undef PRIxFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIxFAST8 PRIx64
+# else
+# define PRIxFAST8 "x"
+# endif
+#endif
+#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@
+# undef PRIXFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIXFAST8 PRIX64
+# else
+# define PRIXFAST8 "X"
+# endif
+#endif
+#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
+# undef PRIdFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define PRIdFAST16 PRId64
+# else
+# define PRIdFAST16 "d"
+# endif
+#endif
+#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@
+# undef PRIiFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define PRIiFAST16 PRIi64
+# else
+# define PRIiFAST16 "i"
+# endif
+#endif
+#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
+# undef PRIoFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIoFAST16 PRIo64
+# else
+# define PRIoFAST16 "o"
+# endif
+#endif
+#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@
+# undef PRIuFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIuFAST16 PRIu64
+# else
+# define PRIuFAST16 "u"
+# endif
+#endif
+#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
+# undef PRIxFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIxFAST16 PRIx64
+# else
+# define PRIxFAST16 "x"
+# endif
+#endif
+#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@
+# undef PRIXFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIXFAST16 PRIX64
+# else
+# define PRIXFAST16 "X"
+# endif
+#endif
+#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
+# undef PRIdFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define PRIdFAST32 PRId64
+# else
+# define PRIdFAST32 "d"
+# endif
+#endif
+#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@
+# undef PRIiFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define PRIiFAST32 PRIi64
+# else
+# define PRIiFAST32 "i"
+# endif
+#endif
+#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
+# undef PRIoFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIoFAST32 PRIo64
+# else
+# define PRIoFAST32 "o"
+# endif
+#endif
+#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@
+# undef PRIuFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIuFAST32 PRIu64
+# else
+# define PRIuFAST32 "u"
+# endif
+#endif
+#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
+# undef PRIxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIxFAST32 PRIx64
+# else
+# define PRIxFAST32 "x"
+# endif
+#endif
+#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@
+# undef PRIXFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIXFAST32 PRIX64
+# else
+# define PRIXFAST32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
+# undef PRIdFAST64
+# define PRIdFAST64 PRId64
+# endif
+# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
+# undef PRIiFAST64
+# define PRIiFAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
+# undef PRIoFAST64
+# define PRIoFAST64 PRIo64
+# endif
+# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
+# undef PRIuFAST64
+# define PRIuFAST64 PRIu64
+# endif
+# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
+# undef PRIxFAST64
+# define PRIxFAST64 PRIx64
+# endif
+# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
+# undef PRIXFAST64
+# define PRIXFAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdMAX || @PRI_MACROS_BROKEN@
+# undef PRIdMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define PRIdMAX PRId64
+# else
+# define PRIdMAX "ld"
+# endif
+#endif
+#if !defined PRIiMAX || @PRI_MACROS_BROKEN@
+# undef PRIiMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define PRIiMAX PRIi64
+# else
+# define PRIiMAX "li"
+# endif
+#endif
+#if !defined PRIoMAX || @PRI_MACROS_BROKEN@
+# undef PRIoMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIoMAX PRIo64
+# else
+# define PRIoMAX "lo"
+# endif
+#endif
+#if !defined PRIuMAX || @PRI_MACROS_BROKEN@
+# undef PRIuMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIuMAX PRIu64
+# else
+# define PRIuMAX "lu"
+# endif
+#endif
+#if !defined PRIxMAX || @PRI_MACROS_BROKEN@
+# undef PRIxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIxMAX PRIx64
+# else
+# define PRIxMAX "lx"
+# endif
+#endif
+#if !defined PRIXMAX || @PRI_MACROS_BROKEN@
+# undef PRIXMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIXMAX PRIX64
+# else
+# define PRIXMAX "lX"
+# endif
+#endif
+
+#if !defined PRIdPTR || @PRI_MACROS_BROKEN@
+# undef PRIdPTR
+# ifdef INTPTR_MAX
+# define PRIdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined PRIiPTR || @PRI_MACROS_BROKEN@
+# undef PRIiPTR
+# ifdef INTPTR_MAX
+# define PRIiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined PRIoPTR || @PRI_MACROS_BROKEN@
+# undef PRIoPTR
+# ifdef UINTPTR_MAX
+# define PRIoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined PRIuPTR || @PRI_MACROS_BROKEN@
+# undef PRIuPTR
+# ifdef UINTPTR_MAX
+# define PRIuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined PRIxPTR || @PRI_MACROS_BROKEN@
+# undef PRIxPTR
+# ifdef UINTPTR_MAX
+# define PRIxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+#if !defined PRIXPTR || @PRI_MACROS_BROKEN@
+# undef PRIXPTR
+# ifdef UINTPTR_MAX
+# define PRIXPTR @PRIPTR_PREFIX@ "X"
+# endif
+#endif
+
+#if !defined SCNd8 || @PRI_MACROS_BROKEN@
+# undef SCNd8
+# ifdef INT8_MAX
+# define SCNd8 "hhd"
+# endif
+#endif
+#if !defined SCNi8 || @PRI_MACROS_BROKEN@
+# undef SCNi8
+# ifdef INT8_MAX
+# define SCNi8 "hhi"
+# endif
+#endif
+#if !defined SCNo8 || @PRI_MACROS_BROKEN@
+# undef SCNo8
+# ifdef UINT8_MAX
+# define SCNo8 "hho"
+# endif
+#endif
+#if !defined SCNu8 || @PRI_MACROS_BROKEN@
+# undef SCNu8
+# ifdef UINT8_MAX
+# define SCNu8 "hhu"
+# endif
+#endif
+#if !defined SCNx8 || @PRI_MACROS_BROKEN@
+# undef SCNx8
+# ifdef UINT8_MAX
+# define SCNx8 "hhx"
+# endif
+#endif
+#if !defined SCNd16 || @PRI_MACROS_BROKEN@
+# undef SCNd16
+# ifdef INT16_MAX
+# define SCNd16 "hd"
+# endif
+#endif
+#if !defined SCNi16 || @PRI_MACROS_BROKEN@
+# undef SCNi16
+# ifdef INT16_MAX
+# define SCNi16 "hi"
+# endif
+#endif
+#if !defined SCNo16 || @PRI_MACROS_BROKEN@
+# undef SCNo16
+# ifdef UINT16_MAX
+# define SCNo16 "ho"
+# endif
+#endif
+#if !defined SCNu16 || @PRI_MACROS_BROKEN@
+# undef SCNu16
+# ifdef UINT16_MAX
+# define SCNu16 "hu"
+# endif
+#endif
+#if !defined SCNx16 || @PRI_MACROS_BROKEN@
+# undef SCNx16
+# ifdef UINT16_MAX
+# define SCNx16 "hx"
+# endif
+#endif
+#if !defined SCNd32 || @PRI_MACROS_BROKEN@
+# undef SCNd32
+# ifdef INT32_MAX
+# define SCNd32 "d"
+# endif
+#endif
+#if !defined SCNi32 || @PRI_MACROS_BROKEN@
+# undef SCNi32
+# ifdef INT32_MAX
+# define SCNi32 "i"
+# endif
+#endif
+#if !defined SCNo32 || @PRI_MACROS_BROKEN@
+# undef SCNo32
+# ifdef UINT32_MAX
+# define SCNo32 "o"
+# endif
+#endif
+#if !defined SCNu32 || @PRI_MACROS_BROKEN@
+# undef SCNu32
+# ifdef UINT32_MAX
+# define SCNu32 "u"
+# endif
+#endif
+#if !defined SCNx32 || @PRI_MACROS_BROKEN@
+# undef 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 @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNd64 || @PRI_MACROS_BROKEN@
+# undef SCNd64
+# define SCNd64 _SCN64_PREFIX "d"
+# endif
+# if !defined SCNi64 || @PRI_MACROS_BROKEN@
+# undef 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 @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNo64 || @PRI_MACROS_BROKEN@
+# undef SCNo64
+# define SCNo64 _SCNu64_PREFIX "o"
+# endif
+# if !defined SCNu64 || @PRI_MACROS_BROKEN@
+# undef SCNu64
+# define SCNu64 _SCNu64_PREFIX "u"
+# endif
+# if !defined SCNx64 || @PRI_MACROS_BROKEN@
+# undef SCNx64
+# define SCNx64 _SCNu64_PREFIX "x"
+# endif
+#endif
+
+#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST8
+# define SCNdLEAST8 "hhd"
+#endif
+#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST8
+# define SCNiLEAST8 "hhi"
+#endif
+#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST8
+# define SCNoLEAST8 "hho"
+#endif
+#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST8
+# define SCNuLEAST8 "hhu"
+#endif
+#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST8
+# define SCNxLEAST8 "hhx"
+#endif
+#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST16
+# define SCNdLEAST16 "hd"
+#endif
+#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST16
+# define SCNiLEAST16 "hi"
+#endif
+#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST16
+# define SCNoLEAST16 "ho"
+#endif
+#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST16
+# define SCNuLEAST16 "hu"
+#endif
+#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST16
+# define SCNxLEAST16 "hx"
+#endif
+#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST32
+# define SCNdLEAST32 "d"
+#endif
+#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST32
+# define SCNiLEAST32 "i"
+#endif
+#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST32
+# define SCNoLEAST32 "o"
+#endif
+#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST32
+# define SCNuLEAST32 "u"
+#endif
+#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST32
+# define SCNxLEAST32 "x"
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST64
+# define SCNdLEAST64 SCNd64
+# endif
+# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST64
+# define SCNiLEAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST64
+# define SCNoLEAST64 SCNo64
+# endif
+# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST64
+# define SCNuLEAST64 SCNu64
+# endif
+# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST64
+# define SCNxLEAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef 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 || @PRI_MACROS_BROKEN@
+# undef SCNdFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define SCNdFAST32 SCNd64
+# else
+# define SCNdFAST32 "d"
+# endif
+#endif
+#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@
+# undef SCNiFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define SCNiFAST32 SCNi64
+# else
+# define SCNiFAST32 "i"
+# endif
+#endif
+#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
+# undef SCNoFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNoFAST32 SCNo64
+# else
+# define SCNoFAST32 "o"
+# endif
+#endif
+#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@
+# undef SCNuFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNuFAST32 SCNu64
+# else
+# define SCNuFAST32 "u"
+# endif
+#endif
+#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
+# undef SCNxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNxFAST32 SCNx64
+# else
+# define SCNxFAST32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
+# undef SCNdFAST64
+# define SCNdFAST64 SCNd64
+# endif
+# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
+# undef SCNiFAST64
+# define SCNiFAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
+# undef SCNoFAST64
+# define SCNoFAST64 SCNo64
+# endif
+# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
+# undef SCNuFAST64
+# define SCNuFAST64 SCNu64
+# endif
+# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
+# undef SCNxFAST64
+# define SCNxFAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdMAX || @PRI_MACROS_BROKEN@
+# undef SCNdMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define SCNdMAX SCNd64
+# else
+# define SCNdMAX "ld"
+# endif
+#endif
+#if !defined SCNiMAX || @PRI_MACROS_BROKEN@
+# undef SCNiMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define SCNiMAX SCNi64
+# else
+# define SCNiMAX "li"
+# endif
+#endif
+#if !defined SCNoMAX || @PRI_MACROS_BROKEN@
+# undef SCNoMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNoMAX SCNo64
+# else
+# define SCNoMAX "lo"
+# endif
+#endif
+#if !defined SCNuMAX || @PRI_MACROS_BROKEN@
+# undef SCNuMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNuMAX SCNu64
+# else
+# define SCNuMAX "lu"
+# endif
+#endif
+#if !defined SCNxMAX || @PRI_MACROS_BROKEN@
+# undef SCNxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNxMAX SCNx64
+# else
+# define SCNxMAX "lx"
+# endif
+#endif
+
+#if !defined SCNdPTR || @PRI_MACROS_BROKEN@
+# undef SCNdPTR
+# ifdef INTPTR_MAX
+# define SCNdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined SCNiPTR || @PRI_MACROS_BROKEN@
+# undef SCNiPTR
+# ifdef INTPTR_MAX
+# define SCNiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined SCNoPTR || @PRI_MACROS_BROKEN@
+# undef SCNoPTR
+# ifdef UINTPTR_MAX
+# define SCNoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined SCNuPTR || @PRI_MACROS_BROKEN@
+# undef SCNuPTR
+# ifdef UINTPTR_MAX
+# define SCNuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined SCNxPTR || @PRI_MACROS_BROKEN@
+# undef 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_DECL_IMAXDIV@
+# if !GNULIB_defined_imaxdiv_t
+typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+# define GNULIB_defined_imaxdiv_t 1
+# endif
+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 *, char **, int) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int));
+# else
+# if !@HAVE_DECL_STRTOIMAX@
+# undef strtoimax
+_GL_FUNCDECL_SYS (strtoimax, intmax_t,
+ (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, 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 *, char **, int) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int));
+# else
+# if !@HAVE_DECL_STRTOUMAX@
+# undef strtoumax
+_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
+ (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, 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/lib/isblank.c b/lib/isblank.c
new file mode 100644
index 0000000..6cc7379
--- /dev/null
+++ b/lib/isblank.c
@@ -0,0 +1,33 @@
+/* Test whether a character is a blank.
+
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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/lib/iswblank.c b/lib/iswblank.c
new file mode 100644
index 0000000..8d47ee5
--- /dev/null
+++ b/lib/iswblank.c
@@ -0,0 +1,26 @@
+/* Test wide character for being blank.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wctype.h>
+
+int
+iswblank (wint_t wc)
+{
+ return wc == ' ' || wc == '\t';
+}
diff --git a/lib/itold.c b/lib/itold.c
new file mode 100644
index 0000000..5533392
--- /dev/null
+++ b/lib/itold.c
@@ -0,0 +1,28 @@
+/* Replacement for 'int' to 'long double' conversion routine.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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/lib/langinfo.in.h b/lib/langinfo.in.h
new file mode 100644
index 0000000..e11617c
--- /dev/null
+++ b/lib/langinfo.in.h
@@ -0,0 +1,194 @@
+/* Substitute for and wrapper around <langinfo.h>.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/*
+ * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
+ * <http://www.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 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_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/lib/localcharset.c b/lib/localcharset.c
new file mode 100644
index 0000000..b2a0369
--- /dev/null
+++ b/lib/localcharset.c
@@ -0,0 +1,613 @@
+/* Determine a canonical name for the current locale's character encoding.
+
+ Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "localcharset.h"
+
+#include <fcntl.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 __WIN32__
+# 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
+# include <unistd.h>
+# if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+# else
+# if 0 /* see comment 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>
+#endif
+#if defined OS2
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+/* For MB_CUR_MAX_L */
+#if defined DARWIN7
+# include <xlocale.h>
+#endif
+
+#if ENABLE_RELOCATABLE
+# include "relocatable.h"
+#else
+# define relocate(pathname) (pathname)
+#endif
+
+/* Get LIBDIR. */
+#ifndef LIBDIR
+# include "configmake.h"
+#endif
+
+/* Define O_NOFOLLOW to 0 on platforms where it does not exist. */
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+ /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
+#ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
+#endif
+
+#if HAVE_DECL_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
+/* The following static variable is declared 'volatile' to avoid a
+ possible multithread problem in the function get_charset_aliases. If we
+ are running in a threaded environment, and if two threads initialize
+ 'charset_aliases' simultaneously, both will produce the same value,
+ and everything will be ok if the two assignments to 'charset_aliases'
+ are atomic. But I don't know what will happen if the two assignments mix. */
+#if __STDC__ != 1
+# define volatile /* empty */
+#endif
+/* Pointer to the contents of the charset.alias file, if it has already been
+ read, else NULL. Its format is:
+ ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
+static const char * volatile charset_aliases;
+
+/* Return a pointer to the contents of the charset.alias file. */
+static const char *
+get_charset_aliases (void)
+{
+ const char *cp;
+
+ cp = charset_aliases;
+ if (cp == NULL)
+ {
+#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__ || defined OS2)
+ const char *dir;
+ const char *base = "charset.alias";
+ char *file_name;
+
+ /* Make it possible to override the charset.alias location. This is
+ necessary for running the testsuite before "make install". */
+ dir = getenv ("CHARSETALIASDIR");
+ if (dir == NULL || dir[0] == '\0')
+ dir = relocate (LIBDIR);
+
+ /* Concatenate dir and base into freshly allocated file_name. */
+ {
+ size_t dir_len = strlen (dir);
+ size_t base_len = strlen (base);
+ int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+ file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+ if (file_name != NULL)
+ {
+ memcpy (file_name, dir, dir_len);
+ if (add_slash)
+ file_name[dir_len] = DIRECTORY_SEPARATOR;
+ memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+ }
+ }
+
+ if (file_name == NULL)
+ /* Out of memory. Treat the file as empty. */
+ cp = "";
+ else
+ {
+ int fd;
+
+ /* Open the file. Reject symbolic links on platforms that support
+ O_NOFOLLOW. This is a security feature. Without it, an attacker
+ could retrieve parts of the contents (namely, the tail of the
+ first line that starts with "* ") of an arbitrary file by placing
+ a symbolic link to that file under the name "charset.alias" in
+ some writable directory and defining the environment variable
+ CHARSETALIASDIR to point to that directory. */
+ fd = open (file_name,
+ O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
+ if (fd < 0)
+ /* File not found. Treat it as empty. */
+ cp = "";
+ else
+ {
+ FILE *fp;
+
+ fp = fdopen (fd, "r");
+ if (fp == NULL)
+ {
+ /* Out of memory. Treat the file as empty. */
+ close (fd);
+ cp = "";
+ }
+ else
+ {
+ /* Parse the file's contents. */
+ char *res_ptr = NULL;
+ size_t res_size = 0;
+
+ for (;;)
+ {
+ int c;
+ char buf1[50+1];
+ char buf2[50+1];
+ size_t l1, l2;
+ char *old_res_ptr;
+
+ c = getc (fp);
+ if (c == EOF)
+ break;
+ if (c == '\n' || c == ' ' || c == '\t')
+ continue;
+ if (c == '#')
+ {
+ /* Skip comment, to end of line. */
+ do
+ c = getc (fp);
+ while (!(c == EOF || c == '\n'));
+ if (c == EOF)
+ break;
+ continue;
+ }
+ ungetc (c, fp);
+ if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
+ break;
+ l1 = strlen (buf1);
+ l2 = strlen (buf2);
+ old_res_ptr = res_ptr;
+ if (res_size == 0)
+ {
+ res_size = l1 + 1 + l2 + 1;
+ res_ptr = (char *) malloc (res_size + 1);
+ }
+ else
+ {
+ res_size += l1 + 1 + l2 + 1;
+ res_ptr = (char *) realloc (res_ptr, res_size + 1);
+ }
+ if (res_ptr == NULL)
+ {
+ /* Out of memory. */
+ res_size = 0;
+ free (old_res_ptr);
+ break;
+ }
+ strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+ strcpy (res_ptr + res_size - (l2 + 1), buf2);
+ }
+ fclose (fp);
+ if (res_size == 0)
+ cp = "";
+ else
+ {
+ *(res_ptr + res_size) = '\0';
+ cp = res_ptr;
+ }
+ }
+ }
+
+ free (file_name);
+ }
+
+#else
+
+# if defined DARWIN7
+ /* To avoid the trouble of installing a file that is shared by many
+ GNU packages -- many packaging systems have problems with this --,
+ simply inline the aliases here. */
+ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+ "ISO8859-2" "\0" "ISO-8859-2" "\0"
+ "ISO8859-4" "\0" "ISO-8859-4" "\0"
+ "ISO8859-5" "\0" "ISO-8859-5" "\0"
+ "ISO8859-7" "\0" "ISO-8859-7" "\0"
+ "ISO8859-9" "\0" "ISO-8859-9" "\0"
+ "ISO8859-13" "\0" "ISO-8859-13" "\0"
+ "ISO8859-15" "\0" "ISO-8859-15" "\0"
+ "KOI8-R" "\0" "KOI8-R" "\0"
+ "KOI8-U" "\0" "KOI8-U" "\0"
+ "CP866" "\0" "CP866" "\0"
+ "CP949" "\0" "CP949" "\0"
+ "CP1131" "\0" "CP1131" "\0"
+ "CP1251" "\0" "CP1251" "\0"
+ "eucCN" "\0" "GB2312" "\0"
+ "GB2312" "\0" "GB2312" "\0"
+ "eucJP" "\0" "EUC-JP" "\0"
+ "eucKR" "\0" "EUC-KR" "\0"
+ "Big5" "\0" "BIG5" "\0"
+ "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
+ "GBK" "\0" "GBK" "\0"
+ "GB18030" "\0" "GB18030" "\0"
+ "SJIS" "\0" "SHIFT_JIS" "\0"
+ "ARMSCII-8" "\0" "ARMSCII-8" "\0"
+ "PT154" "\0" "PT154" "\0"
+ /*"ISCII-DEV" "\0" "?" "\0"*/
+ "*" "\0" "UTF-8" "\0";
+# endif
+
+# if defined VMS
+ /* To avoid the troubles of an extra file charset.alias_vms in the
+ sources of many GNU packages, simply inline the aliases here. */
+ /* 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". */
+ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+ "ISO8859-2" "\0" "ISO-8859-2" "\0"
+ "ISO8859-5" "\0" "ISO-8859-5" "\0"
+ "ISO8859-7" "\0" "ISO-8859-7" "\0"
+ "ISO8859-8" "\0" "ISO-8859-8" "\0"
+ "ISO8859-9" "\0" "ISO-8859-9" "\0"
+ /* Japanese */
+ "eucJP" "\0" "EUC-JP" "\0"
+ "SJIS" "\0" "SHIFT_JIS" "\0"
+ "DECKANJI" "\0" "DEC-KANJI" "\0"
+ "SDECKANJI" "\0" "EUC-JP" "\0"
+ /* Chinese */
+ "eucTW" "\0" "EUC-TW" "\0"
+ "DECHANYU" "\0" "DEC-HANYU" "\0"
+ "DECHANZI" "\0" "GB2312" "\0"
+ /* Korean */
+ "DECKOREAN" "\0" "EUC-KR" "\0";
+# endif
+
+# if defined WINDOWS_NATIVE || defined __CYGWIN__
+ /* To avoid the troubles of installing a separate file in the same
+ directory as the DLL and of retrieving the DLL's directory at
+ runtime, simply inline the aliases here. */
+
+ cp = "CP936" "\0" "GBK" "\0"
+ "CP1361" "\0" "JOHAB" "\0"
+ "CP20127" "\0" "ASCII" "\0"
+ "CP20866" "\0" "KOI8-R" "\0"
+ "CP20936" "\0" "GB2312" "\0"
+ "CP21866" "\0" "KOI8-RU" "\0"
+ "CP28591" "\0" "ISO-8859-1" "\0"
+ "CP28592" "\0" "ISO-8859-2" "\0"
+ "CP28593" "\0" "ISO-8859-3" "\0"
+ "CP28594" "\0" "ISO-8859-4" "\0"
+ "CP28595" "\0" "ISO-8859-5" "\0"
+ "CP28596" "\0" "ISO-8859-6" "\0"
+ "CP28597" "\0" "ISO-8859-7" "\0"
+ "CP28598" "\0" "ISO-8859-8" "\0"
+ "CP28599" "\0" "ISO-8859-9" "\0"
+ "CP28605" "\0" "ISO-8859-15" "\0"
+ "CP38598" "\0" "ISO-8859-8" "\0"
+ "CP51932" "\0" "EUC-JP" "\0"
+ "CP51936" "\0" "GB2312" "\0"
+ "CP51949" "\0" "EUC-KR" "\0"
+ "CP51950" "\0" "EUC-TW" "\0"
+ "CP54936" "\0" "GB18030" "\0"
+ "CP65001" "\0" "UTF-8" "\0";
+# endif
+# if defined OS2
+ /* To avoid the troubles of installing a separate file in the same
+ directory as the DLL and of retrieving the DLL's directory at
+ runtime, simply inline the aliases here. */
+
+ /* 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 "IBM Globalization - Code page identifiers":
+ <http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>. */
+ cp = "CP813" "\0" "ISO-8859-7" "\0"
+ "CP878" "\0" "KOI8-R" "\0"
+ "CP819" "\0" "ISO-8859-1" "\0"
+ "CP912" "\0" "ISO-8859-2" "\0"
+ "CP913" "\0" "ISO-8859-3" "\0"
+ "CP914" "\0" "ISO-8859-4" "\0"
+ "CP915" "\0" "ISO-8859-5" "\0"
+ "CP916" "\0" "ISO-8859-8" "\0"
+ "CP920" "\0" "ISO-8859-9" "\0"
+ "CP921" "\0" "ISO-8859-13" "\0"
+ "CP923" "\0" "ISO-8859-15" "\0"
+ "CP954" "\0" "EUC-JP" "\0"
+ "CP964" "\0" "EUC-TW" "\0"
+ "CP970" "\0" "EUC-KR" "\0"
+ "CP1089" "\0" "ISO-8859-6" "\0"
+ "CP1208" "\0" "UTF-8" "\0"
+ "CP1381" "\0" "GB2312" "\0"
+ "CP1386" "\0" "GBK" "\0"
+ "CP3372" "\0" "EUC-JP" "\0";
+# endif
+#endif
+
+ charset_aliases = cp;
+ }
+
+ return cp;
+}
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed in config.charset.
+ The result must not be freed; it is statically allocated.
+ 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;
+ const char *aliases;
+
+#if !(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 buf[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 (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
+ }
+
+ /* 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. */
+ sprintf (buf, "CP%u", GetACP ());
+ codeset = buf;
+ }
+# 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 SunOS 4 or 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");
+ }
+ }
+
+ /* On some old systems, one used to set locale = "iso8859_1". On others,
+ you set it to "language_COUNTRY.charset". In any case, we resolve it
+ through the charset.alias file. */
+ codeset = locale;
+
+# endif
+
+#elif defined WINDOWS_NATIVE
+
+ static char buf[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_ALL, NULL);
+ char *pdot;
+
+ /* If they set different locales for different categories,
+ 'setlocale' will return a semi-colon separated list of locale
+ values. To make sure we use the correct one, we choose LC_CTYPE. */
+ if (strchr (current_locale, ';'))
+ current_locale = setlocale (LC_CTYPE, NULL);
+
+ pdot = strrchr (current_locale, '.');
+ if (pdot)
+ 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 ());
+ }
+ codeset = buf;
+
+#elif defined OS2
+
+ const char *locale;
+ static char buf[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 (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
+
+ /* 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
+ {
+ sprintf (buf, "CP%u", cp[0]);
+ codeset = buf;
+ }
+ }
+
+#endif
+
+ if (codeset == NULL)
+ /* The canonical name cannot be determined. */
+ codeset = "";
+
+ /* Resolve alias. */
+ for (aliases = get_charset_aliases ();
+ *aliases != '\0';
+ aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
+ if (strcmp (codeset, aliases) == 0
+ || (aliases[0] == '*' && aliases[1] == '\0'))
+ {
+ codeset = aliases + strlen (aliases) + 1;
+ break;
+ }
+
+ /* 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";
+
+#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/lib/localcharset.h b/lib/localcharset.h
new file mode 100644
index 0000000..915182e
--- /dev/null
+++ b/lib/localcharset.h
@@ -0,0 +1,40 @@
+/* Determine a canonical name for the current locale's character encoding.
+ Copyright (C) 2000-2003, 2009-2016 Free Software Foundation, Inc.
+ This file is part of the GNU CHARSET Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#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 in config.charset.
+ The result must not be freed; it is statically allocated.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+extern const char * locale_charset (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LOCALCHARSET_H */
diff --git a/lib/locale.in.h b/lib/locale.in.h
new file mode 100644
index 0000000..4083507
--- /dev/null
+++ b/lib/locale.in.h
@@ -0,0 +1,216 @@
+/* A POSIX <locale.h>.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#ifdef _GL_ALREADY_INCLUDING_LOCALE_H
+
+/* Special invocation conventions 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
+
+/* 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
+ <http://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
+ <http://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
+_GL_CXXALIASWARN (localeconv);
+#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
+_GL_CXXALIASWARN (setlocale);
+#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_DUPLOCALE@
+# if @REPLACE_DUPLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef duplocale
+# define duplocale rpl_duplocale
+# 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
+#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
+
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
diff --git a/lib/localeconv.c b/lib/localeconv.c
new file mode 100644
index 0000000..8a1d6d7
--- /dev/null
+++ b/lib/localeconv.c
@@ -0,0 +1,103 @@
+/* Query locale dependent information for formatting numbers.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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/lib/lstat.c b/lib/lstat.c
new file mode 100644
index 0000000..03b0634
--- /dev/null
+++ b/lib/lstat.c
@@ -0,0 +1,97 @@
+/* Work around a bug of lstat on some systems
+
+ Copyright (C) 1997-2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering */
+
+/* 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. */
+/* 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"
+
+# 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)
+{
+ size_t len;
+ int lstat_result = orig_lstat (file, sbuf);
+
+ if (lstat_result != 0)
+ return lstat_result;
+
+ /* 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. */
+ len = strlen (file);
+ if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode))
+ return 0;
+
+ /* At this point, a trailing slash is only permitted 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;
+ }
+ return stat (file, sbuf);
+}
+
+#endif /* HAVE_LSTAT */
diff --git a/lib/malloc.c b/lib/malloc.c
new file mode 100644
index 0000000..e9b01d2
--- /dev/null
+++ b/lib/malloc.c
@@ -0,0 +1,56 @@
+/* malloc() function that is glibc compatible.
+
+ Copyright (C) 1997-1998, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
+#ifdef malloc
+# define NEED_MALLOC_GNU 1
+# undef malloc
+/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */
+#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
+#endif
+
+#include <stdlib.h>
+
+#include <errno.h>
+
+/* Allocate an N-byte block of memory from the heap.
+ If N is zero, allocate a 1-byte block. */
+
+void *
+rpl_malloc (size_t n)
+{
+ void *result;
+
+#if NEED_MALLOC_GNU
+ if (n == 0)
+ n = 1;
+#endif
+
+ result = malloc (n);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/lib/malloca.c b/lib/malloca.c
new file mode 100644
index 0000000..a613277
--- /dev/null
+++ b/lib/malloca.c
@@ -0,0 +1,149 @@
+/* Safe automatic memory allocation.
+ Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+
+/* Specification. */
+#include "malloca.h"
+
+#include <stdint.h>
+
+#include "verify.h"
+
+/* The speed critical point in this file is freea() applied to an alloca()
+ result: it must be fast, to match the speed of alloca(). The speed of
+ mmalloca() and freea() in the other case are not critical, because they
+ are only invoked for big memory sizes. */
+
+#if HAVE_ALLOCA
+
+/* Store the mmalloca() results in a hash table. This is needed to reliably
+ distinguish a mmalloca() result and an alloca() result.
+
+ Although it is possible that the same pointer is returned by alloca() and
+ by mmalloca() at different times in the same application, it does not lead
+ to a bug in freea(), because:
+ - Before a pointer returned by alloca() can point into malloc()ed memory,
+ the function must return, and once this has happened the programmer must
+ not call freea() on it anyway.
+ - Before a pointer returned by mmalloca() can point into the stack, it
+ must be freed. The only function that can free it is freea(), and
+ when freea() frees it, it also removes it from the hash table. */
+
+#define MAGIC_NUMBER 0x1415fb4a
+#define MAGIC_SIZE sizeof (int)
+/* This is how the header info would look like without any alignment
+ considerations. */
+struct preliminary_header { void *next; int magic; };
+/* But the header's size must be a multiple of sa_alignment_max. */
+#define HEADER_SIZE \
+ (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max)
+union header {
+ void *next;
+ struct {
+ char room[HEADER_SIZE - MAGIC_SIZE];
+ int word;
+ } magic;
+};
+verify (HEADER_SIZE == sizeof (union header));
+/* We make the hash table quite big, so that during lookups the probability
+ of empty hash buckets is quite high. There is no need to make the hash
+ table resizable, because when the hash table gets filled so much that the
+ lookup becomes slow, it means that the application has memory leaks. */
+#define HASH_TABLE_SIZE 257
+static void * mmalloca_results[HASH_TABLE_SIZE];
+
+#endif
+
+void *
+mmalloca (size_t n)
+{
+#if HAVE_ALLOCA
+ /* Allocate one more word, that serves as an indicator for malloc()ed
+ memory, so that freea() of an alloca() result is fast. */
+ size_t nplus = n + HEADER_SIZE;
+
+ if (nplus >= n)
+ {
+ void *p = malloc (nplus);
+
+ if (p != NULL)
+ {
+ size_t slot;
+ union header *h = p;
+
+ p = h + 1;
+
+ /* Put a magic number into the indicator word. */
+ h->magic.word = MAGIC_NUMBER;
+
+ /* Enter p into the hash table. */
+ slot = (uintptr_t) p % HASH_TABLE_SIZE;
+ h->next = mmalloca_results[slot];
+ mmalloca_results[slot] = p;
+
+ return p;
+ }
+ }
+ /* Out of memory. */
+ return NULL;
+#else
+# if !MALLOC_0_IS_NONNULL
+ if (n == 0)
+ n = 1;
+# endif
+ return malloc (n);
+#endif
+}
+
+#if HAVE_ALLOCA
+void
+freea (void *p)
+{
+ /* mmalloca() may have returned NULL. */
+ if (p != NULL)
+ {
+ /* Attempt to quickly distinguish the mmalloca() result - which has
+ a magic indicator word - and the alloca() result - which has an
+ uninitialized indicator word. It is for this test that sa_increment
+ additional bytes are allocated in the alloca() case. */
+ if (((int *) p)[-1] == MAGIC_NUMBER)
+ {
+ /* Looks like a mmalloca() result. To see whether it really is one,
+ perform a lookup in the hash table. */
+ size_t slot = (uintptr_t) p % HASH_TABLE_SIZE;
+ void **chain = &mmalloca_results[slot];
+ for (; *chain != NULL;)
+ {
+ union header *h = p;
+ if (*chain == p)
+ {
+ /* Found it. Remove it from the hash table and free it. */
+ union header *p_begin = h - 1;
+ *chain = p_begin->next;
+ free (p_begin);
+ return;
+ }
+ h = *chain;
+ chain = &h[-1].next;
+ }
+ }
+ /* At this point, we know it was not a mmalloca() result. */
+ }
+}
+#endif
diff --git a/lib/malloca.h b/lib/malloca.h
new file mode 100644
index 0000000..fa27a9e
--- /dev/null
+++ b/lib/malloca.h
@@ -0,0 +1,133 @@
+/* Safe automatic memory allocation.
+ Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _MALLOCA_H
+#define _MALLOCA_H
+
+#include <alloca.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
+ alloca(N); otherwise it returns NULL. It either returns N bytes of
+ memory allocated on the stack, that lasts until the function returns,
+ or NULL.
+ Use of safe_alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns.
+*/
+#if HAVE_ALLOCA
+/* The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots.
+ This must be a macro, not a function. */
+# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
+#else
+# define safe_alloca(N) ((void) (N), NULL)
+#endif
+
+/* malloca(N) is a safe variant of alloca(N). It allocates N bytes of
+ memory allocated on the stack, that must be freed using freea() before
+ the function returns. Upon failure, it returns NULL. */
+#if HAVE_ALLOCA
+# define malloca(N) \
+ ((N) < 4032 - sa_increment \
+ ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
+ : mmalloca (N))
+#else
+# define malloca(N) \
+ mmalloca (N)
+#endif
+extern void * mmalloca (size_t n);
+
+/* Free a block of memory allocated through malloca(). */
+#if HAVE_ALLOCA
+extern void freea (void *p);
+#else
+# define freea free
+#endif
+
+/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
+ It allocates an array of N objects, each with S bytes of memory,
+ on the stack. S must be positive and N must be nonnegative.
+ The array must be freed using freea() before the function returns. */
+#if 1
+/* Cf. the definition of xalloc_oversized. */
+# define nmalloca(n, s) \
+ ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \
+ ? NULL \
+ : malloca ((n) * (s)))
+#else
+extern void * nmalloca (size_t n, size_t s);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* ------------------- Auxiliary, non-public definitions ------------------- */
+
+/* Determine the alignment of a type at compile time. */
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
+# define sa_alignof __alignof__
+#elif defined __cplusplus
+ template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
+# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
+#elif defined __hpux
+ /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#elif defined _AIX
+ /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#else
+# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
+#endif
+
+enum
+{
+/* The desired alignment of memory allocations is the maximum alignment
+ among all elementary types. */
+ sa_alignment_long = sa_alignof (long),
+ sa_alignment_double = sa_alignof (double),
+#if HAVE_LONG_LONG_INT
+ sa_alignment_longlong = sa_alignof (long long),
+#endif
+ sa_alignment_longdouble = sa_alignof (long double),
+ sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
+#if HAVE_LONG_LONG_INT
+ | (sa_alignment_longlong - 1)
+#endif
+ | (sa_alignment_longdouble - 1)
+ ) + 1,
+/* The increment that guarantees room for a magic word must be >= sizeof (int)
+ and a multiple of sa_alignment_max. */
+ sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max
+};
+
+#endif /* _MALLOCA_H */
diff --git a/lib/malloca.valgrind b/lib/malloca.valgrind
new file mode 100644
index 0000000..52f0a50
--- /dev/null
+++ b/lib/malloca.valgrind
@@ -0,0 +1,7 @@
+# Suppress a valgrind message about use of uninitialized memory in freea().
+# This use is OK because it provides only a speedup.
+{
+ freea
+ Memcheck:Cond
+ fun:freea
+}
diff --git a/lib/mbchar.c b/lib/mbchar.c
new file mode 100644
index 0000000..27796c3
--- /dev/null
+++ b/lib/mbchar.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2001, 2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+#include <config.h>
+
+#define MBCHAR_INLINE _GL_EXTERN_INLINE
+
+#include <limits.h>
+
+#include "mbchar.h"
+
+#if IS_BASIC_ASCII
+
+/* Bit table of characters in the ISO C "basic character set". */
+const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] =
+{
+ 0x00001a00, /* '\t' '\v' '\f' */
+ 0xffffffef, /* ' '...'#' '%'...'?' */
+ 0xfffffffe, /* 'A'...'Z' '[' '\\' ']' '^' '_' */
+ 0x7ffffffe /* 'a'...'z' '{' '|' '}' '~' */
+ /* The remaining bits are 0. */
+};
+
+#endif /* IS_BASIC_ASCII */
diff --git a/lib/mbchar.h b/lib/mbchar.h
new file mode 100644
index 0000000..2017d86
--- /dev/null
+++ b/lib/mbchar.h
@@ -0,0 +1,360 @@
+/* Multibyte character data type.
+ Copyright (C) 2001, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+/* A multibyte character is a short subsequence of a char* string,
+ representing a single wide character.
+
+ We use multibyte characters instead of wide characters because of
+ the following goals:
+ 1) correct multibyte handling, i.e. operate according to the LC_CTYPE
+ locale,
+ 2) ease of maintenance, i.e. the maintainer needs not know all details
+ of the ISO C 99 standard,
+ 3) don't fail grossly if the input is not in the encoding set by the
+ locale, because often different encodings are in use in the same
+ countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...),
+ 4) fast in the case of ASCII characters,
+ 5) portability, i.e. don't make unportable assumptions about wchar_t.
+
+ Multibyte characters are only accessed through the mb* macros.
+
+ mb_ptr (mbc)
+ return a pointer to the beginning of the multibyte sequence.
+
+ mb_len (mbc)
+ returns the number of bytes occupied by the multibyte sequence.
+ Always > 0.
+
+ mb_iseq (mbc, sc)
+ returns true if mbc is the standard ASCII character sc.
+
+ mb_isnul (mbc)
+ returns true if mbc is the nul character.
+
+ mb_cmp (mbc1, mbc2)
+ returns a positive, zero, or negative value depending on whether mbc1
+ sorts after, same or before mbc2.
+
+ mb_casecmp (mbc1, mbc2)
+ returns a positive, zero, or negative value depending on whether mbc1
+ sorts after, same or before mbc2, modulo upper/lowercase conversion.
+
+ mb_equal (mbc1, mbc2)
+ returns true if mbc1 and mbc2 are equal.
+
+ mb_caseequal (mbc1, mbc2)
+ returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion.
+
+ mb_isalnum (mbc)
+ returns true if mbc is alphanumeric.
+
+ mb_isalpha (mbc)
+ returns true if mbc is alphabetic.
+
+ mb_isascii(mbc)
+ returns true if mbc is plain ASCII.
+
+ mb_isblank (mbc)
+ returns true if mbc is a blank.
+
+ mb_iscntrl (mbc)
+ returns true if mbc is a control character.
+
+ mb_isdigit (mbc)
+ returns true if mbc is a decimal digit.
+
+ mb_isgraph (mbc)
+ returns true if mbc is a graphic character.
+
+ mb_islower (mbc)
+ returns true if mbc is lowercase.
+
+ mb_isprint (mbc)
+ returns true if mbc is a printable character.
+
+ mb_ispunct (mbc)
+ returns true if mbc is a punctuation character.
+
+ mb_isspace (mbc)
+ returns true if mbc is a space character.
+
+ mb_isupper (mbc)
+ returns true if mbc is uppercase.
+
+ mb_isxdigit (mbc)
+ returns true if mbc is a hexadecimal digit.
+
+ mb_width (mbc)
+ returns the number of columns on the output device occupied by mbc.
+ Always >= 0.
+
+ mb_putc (mbc, stream)
+ outputs mbc on stream, a byte oriented FILE stream opened for output.
+
+ mb_setascii (&mbc, sc)
+ assigns the standard ASCII character sc to mbc.
+
+ mb_copy (&destmbc, &srcmbc)
+ copies srcmbc to destmbc.
+
+ Here are the function prototypes of the macros.
+
+ extern const char * mb_ptr (const mbchar_t mbc);
+ extern size_t mb_len (const mbchar_t mbc);
+ extern bool mb_iseq (const mbchar_t mbc, char sc);
+ extern bool mb_isnul (const mbchar_t mbc);
+ extern int mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2);
+ extern int mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2);
+ extern bool mb_equal (const mbchar_t mbc1, const mbchar_t mbc2);
+ extern bool mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2);
+ extern bool mb_isalnum (const mbchar_t mbc);
+ extern bool mb_isalpha (const mbchar_t mbc);
+ extern bool mb_isascii (const mbchar_t mbc);
+ extern bool mb_isblank (const mbchar_t mbc);
+ extern bool mb_iscntrl (const mbchar_t mbc);
+ extern bool mb_isdigit (const mbchar_t mbc);
+ extern bool mb_isgraph (const mbchar_t mbc);
+ extern bool mb_islower (const mbchar_t mbc);
+ extern bool mb_isprint (const mbchar_t mbc);
+ extern bool mb_ispunct (const mbchar_t mbc);
+ extern bool mb_isspace (const mbchar_t mbc);
+ extern bool mb_isupper (const mbchar_t mbc);
+ extern bool mb_isxdigit (const mbchar_t mbc);
+ extern int mb_width (const mbchar_t mbc);
+ extern void mb_putc (const mbchar_t mbc, FILE *stream);
+ extern void mb_setascii (mbchar_t *new, char sc);
+ extern void mb_copy (mbchar_t *new, const mbchar_t *old);
+ */
+
+#ifndef _MBCHAR_H
+#define _MBCHAR_H 1
+
+#include <stdbool.h>
+#include <string.h>
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
+ <wchar.h>. */
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBCHAR_INLINE
+# define MBCHAR_INLINE _GL_INLINE
+#endif
+
+#define MBCHAR_BUF_SIZE 24
+
+struct mbchar
+{
+ const char *ptr; /* pointer to current character */
+ size_t bytes; /* number of bytes of current character, > 0 */
+ bool wc_valid; /* true if wc is a valid wide character */
+ wchar_t wc; /* if wc_valid: the current character */
+ char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */
+};
+
+/* EOF (not a real character) is represented with bytes = 0 and
+ wc_valid = false. */
+
+typedef struct mbchar mbchar_t;
+
+/* Access the current character. */
+#define mb_ptr(mbc) ((mbc).ptr)
+#define mb_len(mbc) ((mbc).bytes)
+
+/* Comparison of characters. */
+#define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc))
+#define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0)
+#define mb_cmp(mbc1, mbc2) \
+ ((mbc1).wc_valid \
+ ? ((mbc2).wc_valid \
+ ? (int) (mbc1).wc - (int) (mbc2).wc \
+ : -1) \
+ : ((mbc2).wc_valid \
+ ? 1 \
+ : (mbc1).bytes == (mbc2).bytes \
+ ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \
+ : (mbc1).bytes < (mbc2).bytes \
+ ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \
+ : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1)))
+#define mb_casecmp(mbc1, mbc2) \
+ ((mbc1).wc_valid \
+ ? ((mbc2).wc_valid \
+ ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc) \
+ : -1) \
+ : ((mbc2).wc_valid \
+ ? 1 \
+ : (mbc1).bytes == (mbc2).bytes \
+ ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \
+ : (mbc1).bytes < (mbc2).bytes \
+ ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \
+ : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1)))
+#define mb_equal(mbc1, mbc2) \
+ ((mbc1).wc_valid && (mbc2).wc_valid \
+ ? (mbc1).wc == (mbc2).wc \
+ : (mbc1).bytes == (mbc2).bytes \
+ && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0)
+#define mb_caseequal(mbc1, mbc2) \
+ ((mbc1).wc_valid && (mbc2).wc_valid \
+ ? towlower ((mbc1).wc) == towlower ((mbc2).wc) \
+ : (mbc1).bytes == (mbc2).bytes \
+ && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0)
+
+/* <ctype.h>, <wctype.h> classification. */
+#define mb_isascii(mbc) \
+ ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127)
+#define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc))
+#define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc))
+#define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc))
+#define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc))
+#define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc))
+#define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc))
+#define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc))
+#define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc))
+#define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc))
+#define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc))
+#define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc))
+#define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc))
+
+/* Extra <wchar.h> function. */
+
+/* Unprintable characters appear as a small box of width 1. */
+#define MB_UNPRINTABLE_WIDTH 1
+
+MBCHAR_INLINE int
+mb_width_aux (wint_t wc)
+{
+ int w = wcwidth (wc);
+ /* For unprintable characters, arbitrarily return 0 for control characters
+ and MB_UNPRINTABLE_WIDTH otherwise. */
+ return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH);
+}
+
+#define mb_width(mbc) \
+ ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH)
+
+/* Output. */
+#define mb_putc(mbc, stream) fwrite ((mbc).ptr, 1, (mbc).bytes, (stream))
+
+/* Assignment. */
+#define mb_setascii(mbc, sc) \
+ ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \
+ (mbc)->wc = (mbc)->buf[0] = (sc))
+
+/* Copying a character. */
+MBCHAR_INLINE void
+mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc)
+{
+ if (old_mbc->ptr == &old_mbc->buf[0])
+ {
+ memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes);
+ new_mbc->ptr = &new_mbc->buf[0];
+ }
+ else
+ new_mbc->ptr = old_mbc->ptr;
+ new_mbc->bytes = old_mbc->bytes;
+ if ((new_mbc->wc_valid = old_mbc->wc_valid))
+ new_mbc->wc = old_mbc->wc;
+}
+
+
+/* is_basic(c) tests whether the single-byte character c is in the
+ ISO C "basic character set".
+ This is a convenience function, and is in this file only to share code
+ between mbiter_multi.h and mbfile_multi.h. */
+#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
+/* The character set is ISO-646, not EBCDIC. */
+# define IS_BASIC_ASCII 1
+
+extern const unsigned int is_basic_table[];
+
+MBCHAR_INLINE bool
+is_basic (char c)
+{
+ return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
+ & 1;
+}
+
+#else
+
+MBCHAR_INLINE bool
+is_basic (char c)
+{
+ switch (c)
+ {
+ case '\t': case '\v': case '\f':
+ case ' ': case '!': case '"': case '#': case '%':
+ case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>':
+ case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y':
+ case 'Z':
+ case '[': case '\\': case ']': case '^': case '_':
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}': case '~':
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _MBCHAR_H */
diff --git a/lib/mbiter.c b/lib/mbiter.c
new file mode 100644
index 0000000..22a1ff8
--- /dev/null
+++ b/lib/mbiter.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define MBITER_INLINE _GL_EXTERN_INLINE
+#include "mbiter.h"
diff --git a/lib/mbiter.h b/lib/mbiter.h
new file mode 100644
index 0000000..d72b0a7
--- /dev/null
+++ b/lib/mbiter.h
@@ -0,0 +1,225 @@
+/* Iterating through multibyte strings: macros for multi-byte encodings.
+ Copyright (C) 2001, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+/* The macros in this file implement forward iteration through a
+ multi-byte string.
+
+ With these macros, an iteration loop that looks like
+
+ char *iter;
+ for (iter = buf; iter < buf + buflen; iter++)
+ {
+ do_something (*iter);
+ }
+
+ becomes
+
+ mbi_iterator_t iter;
+ for (mbi_init (iter, buf, buflen); mbi_avail (iter); mbi_advance (iter))
+ {
+ do_something (mbi_cur_ptr (iter), mb_len (mbi_cur (iter)));
+ }
+
+ The benefit of these macros over plain use of mbrtowc is:
+ - Handling of invalid multibyte sequences is possible without
+ making the code more complicated, while still preserving the
+ invalid multibyte sequences.
+
+ mbi_iterator_t
+ is a type usable for variable declarations.
+
+ mbi_init (iter, startptr, length)
+ initializes the iterator, starting at startptr and crossing length bytes.
+
+ mbi_avail (iter)
+ returns true if there are more multibyte characters available before
+ the end of string is reached. In this case, mbi_cur (iter) is
+ initialized to the next multibyte character.
+
+ mbi_advance (iter)
+ advances the iterator by one multibyte character.
+
+ mbi_cur (iter)
+ returns the current multibyte character, of type mbchar_t. All the
+ macros defined in mbchar.h can be used on it.
+
+ mbi_cur_ptr (iter)
+ return a pointer to the beginning of the current multibyte character.
+
+ mbi_reloc (iter, ptrdiff)
+ relocates iterator when the string is moved by ptrdiff bytes.
+
+ mbi_copy (&destiter, &srciter)
+ copies srciter to destiter.
+
+ Here are the function prototypes of the macros.
+
+ extern void mbi_init (mbi_iterator_t iter,
+ const char *startptr, size_t length);
+ extern bool mbi_avail (mbi_iterator_t iter);
+ extern void mbi_advance (mbi_iterator_t iter);
+ extern mbchar_t mbi_cur (mbi_iterator_t iter);
+ extern const char * mbi_cur_ptr (mbi_iterator_t iter);
+ extern void mbi_reloc (mbi_iterator_t iter, ptrdiff_t ptrdiff);
+ extern void mbi_copy (mbi_iterator_t *new, const mbi_iterator_t *old);
+ */
+
+#ifndef _MBITER_H
+#define _MBITER_H 1
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
+ <wchar.h>. */
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+#include "mbchar.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBITER_INLINE
+# define MBITER_INLINE _GL_INLINE
+#endif
+
+struct mbiter_multi
+{
+ const char *limit; /* pointer to end of string */
+ bool in_shift; /* true if next byte may not be interpreted as ASCII */
+ mbstate_t state; /* if in_shift: current shift state */
+ bool next_done; /* true if mbi_avail has already filled the following */
+ struct mbchar cur; /* the current character:
+ const char *cur.ptr pointer to current character
+ The following are only valid after mbi_avail.
+ size_t cur.bytes number of bytes of current character
+ bool cur.wc_valid true if wc is a valid wide character
+ wchar_t cur.wc if wc_valid: the current character
+ */
+};
+
+MBITER_INLINE void
+mbiter_multi_next (struct mbiter_multi *iter)
+{
+ if (iter->next_done)
+ return;
+ if (iter->in_shift)
+ goto with_shift;
+ /* Handle most ASCII characters quickly, without calling mbrtowc(). */
+ if (is_basic (*iter->cur.ptr))
+ {
+ /* These characters are part of the basic character set. ISO C 99
+ guarantees that their wide character code is identical to their
+ char code. */
+ iter->cur.bytes = 1;
+ iter->cur.wc = *iter->cur.ptr;
+ iter->cur.wc_valid = true;
+ }
+ else
+ {
+ assert (mbsinit (&iter->state));
+ iter->in_shift = true;
+ with_shift:
+ iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr,
+ iter->limit - iter->cur.ptr, &iter->state);
+ if (iter->cur.bytes == (size_t) -1)
+ {
+ /* An invalid multibyte sequence was encountered. */
+ iter->cur.bytes = 1;
+ iter->cur.wc_valid = false;
+ /* Whether to set iter->in_shift = false and reset iter->state
+ or not is not very important; the string is bogus anyway. */
+ }
+ else if (iter->cur.bytes == (size_t) -2)
+ {
+ /* An incomplete multibyte character at the end. */
+ iter->cur.bytes = iter->limit - iter->cur.ptr;
+ iter->cur.wc_valid = false;
+ /* Whether to set iter->in_shift = false and reset iter->state
+ or not is not important; the string end is reached anyway. */
+ }
+ else
+ {
+ if (iter->cur.bytes == 0)
+ {
+ /* A null wide character was encountered. */
+ iter->cur.bytes = 1;
+ assert (*iter->cur.ptr == '\0');
+ assert (iter->cur.wc == 0);
+ }
+ iter->cur.wc_valid = true;
+
+ /* When in the initial state, we can go back treating ASCII
+ characters more quickly. */
+ if (mbsinit (&iter->state))
+ iter->in_shift = false;
+ }
+ }
+ iter->next_done = true;
+}
+
+MBITER_INLINE void
+mbiter_multi_reloc (struct mbiter_multi *iter, ptrdiff_t ptrdiff)
+{
+ iter->cur.ptr += ptrdiff;
+ iter->limit += ptrdiff;
+}
+
+MBITER_INLINE void
+mbiter_multi_copy (struct mbiter_multi *new_iter, const struct mbiter_multi *old_iter)
+{
+ new_iter->limit = old_iter->limit;
+ if ((new_iter->in_shift = old_iter->in_shift))
+ memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t));
+ else
+ memset (&new_iter->state, 0, sizeof (mbstate_t));
+ new_iter->next_done = old_iter->next_done;
+ mb_copy (&new_iter->cur, &old_iter->cur);
+}
+
+/* Iteration macros. */
+typedef struct mbiter_multi mbi_iterator_t;
+#define mbi_init(iter, startptr, length) \
+ ((iter).cur.ptr = (startptr), (iter).limit = (iter).cur.ptr + (length), \
+ (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \
+ (iter).next_done = false)
+#define mbi_avail(iter) \
+ ((iter).cur.ptr < (iter).limit && (mbiter_multi_next (&(iter)), true))
+#define mbi_advance(iter) \
+ ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false)
+
+/* Access to the current character. */
+#define mbi_cur(iter) (iter).cur
+#define mbi_cur_ptr(iter) (iter).cur.ptr
+
+/* Relocation. */
+#define mbi_reloc(iter, ptrdiff) mbiter_multi_reloc (&iter, ptrdiff)
+
+/* Copying an iterator. */
+#define mbi_copy mbiter_multi_copy
+
+_GL_INLINE_HEADER_END
+
+#endif /* _MBITER_H */
diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c
new file mode 100644
index 0000000..cdd874b
--- /dev/null
+++ b/lib/mbrtowc.c
@@ -0,0 +1,407 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#if C_LOCALE_MAYBE_EILSEQ
+# include "hard-locale.h"
+# include <locale.h>
+#endif
+
+#if GNULIB_defined_mbstate_t
+/* Implement mbrtowc() on top of mbtowc(). */
+
+# include <errno.h>
+# include <stdlib.h>
+
+# include "localcharset.h"
+# include "streq.h"
+# include "verify.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)
+{
+ 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;
+
+ 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. */
+
+# if __GLIBC__ || defined __UCLIBC__
+ /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
+ mbtowc (NULL, NULL, 0);
+# endif
+ {
+ int res = mbtowc (pwc, p, m);
+
+ if (res >= 0)
+ {
+ if (pwc != NULL && ((*pwc == 0) != (res == 0)))
+ abort ();
+ if (nstate >= (res > 0 ? res : 1))
+ abort ();
+ res -= nstate;
+ pstate[0] = 0;
+ return res;
+ }
+
+ /* 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.
+ Use specialized code for each. */
+ if (m >= 4 || m >= MB_CUR_MAX)
+ goto invalid;
+ /* Here MB_CUR_MAX > 1 and 0 < m < 4. */
+ {
+ const char *encoding = locale_charset ();
+
+ if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+ {
+ /* Cf. unistr/u8-mblen.c. */
+ unsigned char c = (unsigned char) p[0];
+
+ if (c >= 0xc2)
+ {
+ if (c < 0xe0)
+ {
+ if (m == 1)
+ goto incomplete;
+ }
+ else if (c < 0xf0)
+ {
+ if (m == 1)
+ goto incomplete;
+ if (m == 2)
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40
+ && (c >= 0xe1 || c2 >= 0xa0)
+ && (c != 0xed || c2 < 0xa0))
+ goto incomplete;
+ }
+ }
+ else if (c <= 0xf4)
+ {
+ if (m == 1)
+ goto incomplete;
+ else /* m == 2 || m == 3 */
+ {
+ 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 /* m == 3 */
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if ((c3 ^ 0x80) < 0x40)
+ goto incomplete;
+ }
+ }
+ }
+ }
+ }
+ goto invalid;
+ }
+
+ /* As a reference for this code, you can use the GNU libiconv
+ implementation. Look for uses of the RET_TOOFEW macro. */
+
+ if (STREQ_OPT (encoding,
+ "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+ {
+ 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;
+ }
+ 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))
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c >= 0xa1 && c < 0xff)
+ goto incomplete;
+ }
+ goto invalid;
+ }
+ if (STREQ_OPT (encoding,
+ "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+ {
+ 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;
+ }
+ if (STREQ_OPT (encoding,
+ "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+ {
+ 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;
+ }
+ if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+ {
+ 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;
+ }
+
+ /* An unknown multibyte encoding. */
+ goto incomplete;
+ }
+
+ 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);
+ }
+ }
+}
+
+#else
+/* Override the system's mbrtowc() function. */
+
+# 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
+
+ ret = mbrtowc (pwc, s, n, ps);
+
+# if MBRTOWC_NUL_RETVAL_BUG
+ if (ret < (size_t) -2 && !*pwc)
+ return 0;
+# endif
+
+# if 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/lib/mbscasecmp.c b/lib/mbscasecmp.c
new file mode 100644
index 0000000..7e7c941
--- /dev/null
+++ b/lib/mbscasecmp.c
@@ -0,0 +1,98 @@
+/* Case-insensitive string comparison function.
+ Copyright (C) 1998-1999, 2005-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2005,
+ based on earlier glibc code.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <limits.h>
+
+#include "mbuiter.h"
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* 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! */
+int
+mbscasecmp (const char *s1, const char *s2)
+{
+ if (s1 == s2)
+ return 0;
+
+ /* Be careful not to look at the entire extent of s1 or s2 until needed.
+ This is useful because when two strings differ, the difference is
+ most often already in the very few first characters. */
+ if (MB_CUR_MAX > 1)
+ {
+ mbui_iterator_t iter1;
+ mbui_iterator_t iter2;
+
+ mbui_init (iter1, s1);
+ mbui_init (iter2, s2);
+
+ while (mbui_avail (iter1) && mbui_avail (iter2))
+ {
+ int cmp = mb_casecmp (mbui_cur (iter1), mbui_cur (iter2));
+
+ if (cmp != 0)
+ return cmp;
+
+ mbui_advance (iter1);
+ mbui_advance (iter2);
+ }
+ if (mbui_avail (iter1))
+ /* s2 terminated before s1. */
+ return 1;
+ if (mbui_avail (iter2))
+ /* s1 terminated before s2. */
+ return -1;
+ return 0;
+ }
+ else
+ {
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ 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 (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+ }
+}
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
new file mode 100644
index 0000000..372b523
--- /dev/null
+++ b/lib/mbsinit.c
@@ -0,0 +1,61 @@
+/* Test for initial conversion state.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "verify.h"
+
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+
+/* On native Windows, 'mbstate_t' is defined as 'int'. */
+
+int
+mbsinit (const mbstate_t *ps)
+{
+ return ps == NULL || *ps == 0;
+}
+
+#else
+
+/* 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.
+ - 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;
+}
+
+#endif
diff --git a/lib/mbslen.c b/lib/mbslen.c
new file mode 100644
index 0000000..ed13a42
--- /dev/null
+++ b/lib/mbslen.c
@@ -0,0 +1,44 @@
+/* Counting the multibyte characters in a string.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <stdlib.h>
+
+#include "mbuiter.h"
+
+/* Return the number of multibyte characters in the character string STRING. */
+size_t
+mbslen (const char *string)
+{
+ if (MB_CUR_MAX > 1)
+ {
+ size_t count;
+ mbui_iterator_t iter;
+
+ count = 0;
+ for (mbui_init (iter, string); mbui_avail (iter); mbui_advance (iter))
+ count++;
+
+ return count;
+ }
+ else
+ return strlen (string);
+}
diff --git a/lib/mbsrtowcs-impl.h b/lib/mbsrtowcs-impl.h
new file mode 100644
index 0000000..f99fa34
--- /dev/null
+++ b/lib/mbsrtowcs-impl.h
@@ -0,0 +1,122 @@
+/* Convert string to wide string.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+{
+ if (ps == NULL)
+ ps = &_gl_mbsrtowcs_state;
+ {
+ const char *src = *srcp;
+
+ if (dest != NULL)
+ {
+ wchar_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/lib/mbsrtowcs-state.c b/lib/mbsrtowcs-state.c
new file mode 100644
index 0000000..905547a
--- /dev/null
+++ b/lib/mbsrtowcs-state.c
@@ -0,0 +1,37 @@
+/* Convert string to wide string.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <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 <http://lists.gnu.org/archive/html/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/lib/mbsrtowcs.c b/lib/mbsrtowcs.c
new file mode 100644
index 0000000..54bf6f7
--- /dev/null
+++ b/lib/mbsrtowcs.c
@@ -0,0 +1,32 @@
+/* Convert string to wide string.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "strnlen1.h"
+
+
+extern mbstate_t _gl_mbsrtowcs_state;
+
+#include "mbsrtowcs-impl.h"
diff --git a/lib/mbsstr.c b/lib/mbsstr.c
new file mode 100644
index 0000000..bc738d4
--- /dev/null
+++ b/lib/mbsstr.c
@@ -0,0 +1,384 @@
+/* Searching in a string. -*- coding: utf-8 -*-
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2005.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <stdbool.h>
+#include <stddef.h> /* for NULL, in case a nonstandard string.h lacks it */
+
+#include "malloca.h"
+#include "mbuiter.h"
+
+/* Knuth-Morris-Pratt algorithm. */
+#define UNIT unsigned char
+#define CANON_ELEMENT(c) c
+#include "str-kmp.h"
+
+/* Knuth-Morris-Pratt algorithm.
+ See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
+ Return a boolean indicating success:
+ Return true and set *RESULTP if the search was completed.
+ Return false if it was aborted because not enough memory was available. */
+static bool
+knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
+ const char **resultp)
+{
+ size_t m = mbslen (needle);
+ mbchar_t *needle_mbchars;
+ size_t *table;
+
+ /* Allocate room for needle_mbchars and the table. */
+ void *memory = nmalloca (m, sizeof (mbchar_t) + sizeof (size_t));
+ void *table_memory;
+ if (memory == NULL)
+ return false;
+ needle_mbchars = memory;
+ table_memory = needle_mbchars + m;
+ table = table_memory;
+
+ /* Fill needle_mbchars. */
+ {
+ mbui_iterator_t iter;
+ size_t j;
+
+ j = 0;
+ for (mbui_init (iter, needle); mbui_avail (iter); mbui_advance (iter), j++)
+ mb_copy (&needle_mbchars[j], &mbui_cur (iter));
+ }
+
+ /* Fill the table.
+ For 0 < i < m:
+ 0 < table[i] <= i is defined such that
+ forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x],
+ and table[i] is as large as possible with this property.
+ This implies:
+ 1) For 0 < i < m:
+ If table[i] < i,
+ needle[table[i]..i-1] = needle[0..i-1-table[i]].
+ 2) For 0 < i < m:
+ rhaystack[0..i-1] == needle[0..i-1]
+ and exists h, i <= h < m: rhaystack[h] != needle[h]
+ implies
+ forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1].
+ table[0] remains uninitialized. */
+ {
+ size_t i, j;
+
+ /* i = 1: Nothing to verify for x = 0. */
+ table[1] = 1;
+ j = 0;
+
+ for (i = 2; i < m; i++)
+ {
+ /* Here: j = i-1 - table[i-1].
+ The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold
+ for x < table[i-1], by induction.
+ Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */
+ mbchar_t *b = &needle_mbchars[i - 1];
+
+ for (;;)
+ {
+ /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x]
+ is known to hold for x < i-1-j.
+ Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */
+ if (mb_equal (*b, needle_mbchars[j]))
+ {
+ /* Set table[i] := i-1-j. */
+ table[i] = i - ++j;
+ break;
+ }
+ /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+ for x = i-1-j, because
+ needle[i-1] != needle[j] = needle[i-1-x]. */
+ if (j == 0)
+ {
+ /* The inequality holds for all possible x. */
+ table[i] = i;
+ break;
+ }
+ /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+ for i-1-j < x < i-1-j+table[j], because for these x:
+ needle[x..i-2]
+ = needle[x-(i-1-j)..j-1]
+ != needle[0..j-1-(x-(i-1-j))] (by definition of table[j])
+ = needle[0..i-2-x],
+ hence needle[x..i-1] != needle[0..i-1-x].
+ Furthermore
+ needle[i-1-j+table[j]..i-2]
+ = needle[table[j]..j-1]
+ = needle[0..j-1-table[j]] (by definition of table[j]). */
+ j = j - table[j];
+ }
+ /* Here: j = i - table[i]. */
+ }
+ }
+
+ /* Search, using the table to accelerate the processing. */
+ {
+ size_t j;
+ mbui_iterator_t rhaystack;
+ mbui_iterator_t phaystack;
+
+ *resultp = NULL;
+ j = 0;
+ mbui_init (rhaystack, haystack);
+ mbui_init (phaystack, haystack);
+ /* Invariant: phaystack = rhaystack + j. */
+ while (mbui_avail (phaystack))
+ if (mb_equal (needle_mbchars[j], mbui_cur (phaystack)))
+ {
+ j++;
+ mbui_advance (phaystack);
+ if (j == m)
+ {
+ /* The entire needle has been found. */
+ *resultp = mbui_cur_ptr (rhaystack);
+ break;
+ }
+ }
+ else if (j > 0)
+ {
+ /* Found a match of needle[0..j-1], mismatch at needle[j]. */
+ size_t count = table[j];
+ j -= count;
+ for (; count > 0; count--)
+ {
+ if (!mbui_avail (rhaystack))
+ abort ();
+ mbui_advance (rhaystack);
+ }
+ }
+ else
+ {
+ /* Found a mismatch at needle[0] already. */
+ if (!mbui_avail (rhaystack))
+ abort ();
+ mbui_advance (rhaystack);
+ mbui_advance (phaystack);
+ }
+ }
+
+ freea (memory);
+ return true;
+}
+
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. */
+char *
+mbsstr (const char *haystack, const char *needle)
+{
+ /* Be careful not to look at the entire extent of haystack or needle
+ until needed. This is useful because of these two cases:
+ - haystack may be very long, and a match of needle found early,
+ - needle may be very long, and not even a short initial segment of
+ needle may be found in haystack. */
+ if (MB_CUR_MAX > 1)
+ {
+ mbui_iterator_t iter_needle;
+
+ mbui_init (iter_needle, needle);
+ if (mbui_avail (iter_needle))
+ {
+ /* Minimizing the worst-case complexity:
+ Let n = mbslen(haystack), m = mbslen(needle).
+ The naïve algorithm is O(n*m) worst-case.
+ The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a
+ memory allocation.
+ To achieve linear complexity and yet amortize the cost of the
+ memory allocation, we activate the Knuth-Morris-Pratt algorithm
+ only once the naïve algorithm has already run for some time; more
+ precisely, when
+ - the outer loop count is >= 10,
+ - the average number of comparisons per outer loop is >= 5,
+ - the total number of comparisons is >= m.
+ But we try it only once. If the memory allocation attempt failed,
+ we don't retry it. */
+ bool try_kmp = true;
+ size_t outer_loop_count = 0;
+ size_t comparison_count = 0;
+ size_t last_ccount = 0; /* last comparison count */
+ mbui_iterator_t iter_needle_last_ccount; /* = needle + last_ccount */
+
+ mbui_iterator_t iter_haystack;
+
+ mbui_init (iter_needle_last_ccount, needle);
+ mbui_init (iter_haystack, haystack);
+ for (;; mbui_advance (iter_haystack))
+ {
+ if (!mbui_avail (iter_haystack))
+ /* No match. */
+ return NULL;
+
+ /* See whether it's advisable to use an asymptotically faster
+ algorithm. */
+ if (try_kmp
+ && outer_loop_count >= 10
+ && comparison_count >= 5 * outer_loop_count)
+ {
+ /* See if needle + comparison_count now reaches the end of
+ needle. */
+ size_t count = comparison_count - last_ccount;
+ for (;
+ count > 0 && mbui_avail (iter_needle_last_ccount);
+ count--)
+ mbui_advance (iter_needle_last_ccount);
+ last_ccount = comparison_count;
+ if (!mbui_avail (iter_needle_last_ccount))
+ {
+ /* Try the Knuth-Morris-Pratt algorithm. */
+ const char *result;
+ bool success =
+ knuth_morris_pratt_multibyte (haystack, needle,
+ &result);
+ if (success)
+ return (char *) result;
+ try_kmp = false;
+ }
+ }
+
+ outer_loop_count++;
+ comparison_count++;
+ if (mb_equal (mbui_cur (iter_haystack), mbui_cur (iter_needle)))
+ /* The first character matches. */
+ {
+ mbui_iterator_t rhaystack;
+ mbui_iterator_t rneedle;
+
+ memcpy (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t));
+ mbui_advance (rhaystack);
+
+ mbui_init (rneedle, needle);
+ if (!mbui_avail (rneedle))
+ abort ();
+ mbui_advance (rneedle);
+
+ for (;; mbui_advance (rhaystack), mbui_advance (rneedle))
+ {
+ if (!mbui_avail (rneedle))
+ /* Found a match. */
+ return (char *) mbui_cur_ptr (iter_haystack);
+ if (!mbui_avail (rhaystack))
+ /* No match. */
+ return NULL;
+ comparison_count++;
+ if (!mb_equal (mbui_cur (rhaystack), mbui_cur (rneedle)))
+ /* Nothing in this round. */
+ break;
+ }
+ }
+ }
+ }
+ else
+ return (char *) haystack;
+ }
+ else
+ {
+ if (*needle != '\0')
+ {
+ /* Minimizing the worst-case complexity:
+ Let n = strlen(haystack), m = strlen(needle).
+ The naïve algorithm is O(n*m) worst-case.
+ The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a
+ memory allocation.
+ To achieve linear complexity and yet amortize the cost of the
+ memory allocation, we activate the Knuth-Morris-Pratt algorithm
+ only once the naïve algorithm has already run for some time; more
+ precisely, when
+ - the outer loop count is >= 10,
+ - the average number of comparisons per outer loop is >= 5,
+ - the total number of comparisons is >= m.
+ But we try it only once. If the memory allocation attempt failed,
+ we don't retry it. */
+ bool try_kmp = true;
+ size_t outer_loop_count = 0;
+ size_t comparison_count = 0;
+ size_t last_ccount = 0; /* last comparison count */
+ const char *needle_last_ccount = needle; /* = needle + last_ccount */
+
+ /* Speed up the following searches of needle by caching its first
+ character. */
+ char b = *needle++;
+
+ for (;; haystack++)
+ {
+ if (*haystack == '\0')
+ /* No match. */
+ return NULL;
+
+ /* See whether it's advisable to use an asymptotically faster
+ algorithm. */
+ if (try_kmp
+ && outer_loop_count >= 10
+ && comparison_count >= 5 * outer_loop_count)
+ {
+ /* See if needle + comparison_count now reaches the end of
+ needle. */
+ if (needle_last_ccount != NULL)
+ {
+ needle_last_ccount +=
+ strnlen (needle_last_ccount,
+ comparison_count - last_ccount);
+ if (*needle_last_ccount == '\0')
+ needle_last_ccount = NULL;
+ last_ccount = comparison_count;
+ }
+ if (needle_last_ccount == NULL)
+ {
+ /* Try the Knuth-Morris-Pratt algorithm. */
+ const unsigned char *result;
+ bool success =
+ knuth_morris_pratt ((const unsigned char *) haystack,
+ (const unsigned char *) (needle - 1),
+ strlen (needle - 1),
+ &result);
+ if (success)
+ return (char *) result;
+ try_kmp = false;
+ }
+ }
+
+ outer_loop_count++;
+ comparison_count++;
+ if (*haystack == b)
+ /* The first character matches. */
+ {
+ const char *rhaystack = haystack + 1;
+ const char *rneedle = needle;
+
+ for (;; rhaystack++, rneedle++)
+ {
+ if (*rneedle == '\0')
+ /* Found a match. */
+ return (char *) haystack;
+ if (*rhaystack == '\0')
+ /* No match. */
+ return NULL;
+ comparison_count++;
+ if (*rhaystack != *rneedle)
+ /* Nothing in this round. */
+ break;
+ }
+ }
+ }
+ }
+ else
+ return (char *) haystack;
+ }
+}
diff --git a/lib/mbtowc-impl.h b/lib/mbtowc-impl.h
new file mode 100644
index 0000000..4be2994
--- /dev/null
+++ b/lib/mbtowc-impl.h
@@ -0,0 +1,44 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT 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/>. */
+
+/* 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/lib/mbtowc.c b/lib/mbtowc.c
new file mode 100644
index 0000000..fb2b651
--- /dev/null
+++ b/lib/mbtowc.c
@@ -0,0 +1,26 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "mbtowc-impl.h"
diff --git a/lib/mbuiter.c b/lib/mbuiter.c
new file mode 100644
index 0000000..9167580
--- /dev/null
+++ b/lib/mbuiter.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define MBUITER_INLINE _GL_EXTERN_INLINE
+#include "mbuiter.h"
diff --git a/lib/mbuiter.h b/lib/mbuiter.h
new file mode 100644
index 0000000..aad4fea
--- /dev/null
+++ b/lib/mbuiter.h
@@ -0,0 +1,232 @@
+/* Iterating through multibyte strings: macros for multi-byte encodings.
+ Copyright (C) 2001, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+/* The macros in this file implement forward iteration through a
+ multi-byte string, without knowing its length a-priori.
+
+ With these macros, an iteration loop that looks like
+
+ char *iter;
+ for (iter = buf; *iter != '\0'; iter++)
+ {
+ do_something (*iter);
+ }
+
+ becomes
+
+ mbui_iterator_t iter;
+ for (mbui_init (iter, buf); mbui_avail (iter); mbui_advance (iter))
+ {
+ do_something (mbui_cur_ptr (iter), mb_len (mbui_cur (iter)));
+ }
+
+ The benefit of these macros over plain use of mbrtowc is:
+ - Handling of invalid multibyte sequences is possible without
+ making the code more complicated, while still preserving the
+ invalid multibyte sequences.
+
+ Compared to mbiter.h, the macros here don't need to know the string's
+ length a-priori. The downside is that at each step, the look-ahead
+ that guards against overrunning the terminating '\0' is more expensive.
+ The mbui_* macros are therefore suitable when there is a high probability
+ that only the first few multibyte characters need to be inspected.
+ Whereas the mbi_* macros are better if usually the iteration runs
+ through the entire string.
+
+ mbui_iterator_t
+ is a type usable for variable declarations.
+
+ mbui_init (iter, startptr)
+ initializes the iterator, starting at startptr.
+
+ mbui_avail (iter)
+ returns true if there are more multibyte characters available before
+ the end of string is reached. In this case, mbui_cur (iter) is
+ initialized to the next multibyte character.
+
+ mbui_advance (iter)
+ advances the iterator by one multibyte character.
+
+ mbui_cur (iter)
+ returns the current multibyte character, of type mbchar_t. All the
+ macros defined in mbchar.h can be used on it.
+
+ mbui_cur_ptr (iter)
+ return a pointer to the beginning of the current multibyte character.
+
+ mbui_reloc (iter, ptrdiff)
+ relocates iterator when the string is moved by ptrdiff bytes.
+
+ mbui_copy (&destiter, &srciter)
+ copies srciter to destiter.
+
+ Here are the function prototypes of the macros.
+
+ extern void mbui_init (mbui_iterator_t iter, const char *startptr);
+ extern bool mbui_avail (mbui_iterator_t iter);
+ extern void mbui_advance (mbui_iterator_t iter);
+ extern mbchar_t mbui_cur (mbui_iterator_t iter);
+ extern const char * mbui_cur_ptr (mbui_iterator_t iter);
+ extern void mbui_reloc (mbui_iterator_t iter, ptrdiff_t ptrdiff);
+ extern void mbui_copy (mbui_iterator_t *new, const mbui_iterator_t *old);
+ */
+
+#ifndef _MBUITER_H
+#define _MBUITER_H 1
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
+ <wchar.h>. */
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+#include "mbchar.h"
+#include "strnlen1.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBUITER_INLINE
+# define MBUITER_INLINE _GL_INLINE
+#endif
+
+struct mbuiter_multi
+{
+ bool in_shift; /* true if next byte may not be interpreted as ASCII */
+ mbstate_t state; /* if in_shift: current shift state */
+ bool next_done; /* true if mbui_avail has already filled the following */
+ struct mbchar cur; /* the current character:
+ const char *cur.ptr pointer to current character
+ The following are only valid after mbui_avail.
+ size_t cur.bytes number of bytes of current character
+ bool cur.wc_valid true if wc is a valid wide character
+ wchar_t cur.wc if wc_valid: the current character
+ */
+};
+
+MBUITER_INLINE void
+mbuiter_multi_next (struct mbuiter_multi *iter)
+{
+ if (iter->next_done)
+ return;
+ if (iter->in_shift)
+ goto with_shift;
+ /* Handle most ASCII characters quickly, without calling mbrtowc(). */
+ if (is_basic (*iter->cur.ptr))
+ {
+ /* These characters are part of the basic character set. ISO C 99
+ guarantees that their wide character code is identical to their
+ char code. */
+ iter->cur.bytes = 1;
+ iter->cur.wc = *iter->cur.ptr;
+ iter->cur.wc_valid = true;
+ }
+ else
+ {
+ assert (mbsinit (&iter->state));
+ iter->in_shift = true;
+ with_shift:
+ iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr,
+ strnlen1 (iter->cur.ptr, MB_CUR_MAX),
+ &iter->state);
+ if (iter->cur.bytes == (size_t) -1)
+ {
+ /* An invalid multibyte sequence was encountered. */
+ iter->cur.bytes = 1;
+ iter->cur.wc_valid = false;
+ /* Whether to set iter->in_shift = false and reset iter->state
+ or not is not very important; the string is bogus anyway. */
+ }
+ else if (iter->cur.bytes == (size_t) -2)
+ {
+ /* An incomplete multibyte character at the end. */
+ iter->cur.bytes = strlen (iter->cur.ptr);
+ iter->cur.wc_valid = false;
+ /* Whether to set iter->in_shift = false and reset iter->state
+ or not is not important; the string end is reached anyway. */
+ }
+ else
+ {
+ if (iter->cur.bytes == 0)
+ {
+ /* A null wide character was encountered. */
+ iter->cur.bytes = 1;
+ assert (*iter->cur.ptr == '\0');
+ assert (iter->cur.wc == 0);
+ }
+ iter->cur.wc_valid = true;
+
+ /* When in the initial state, we can go back treating ASCII
+ characters more quickly. */
+ if (mbsinit (&iter->state))
+ iter->in_shift = false;
+ }
+ }
+ iter->next_done = true;
+}
+
+MBUITER_INLINE void
+mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff)
+{
+ iter->cur.ptr += ptrdiff;
+}
+
+MBUITER_INLINE void
+mbuiter_multi_copy (struct mbuiter_multi *new_iter, const struct mbuiter_multi *old_iter)
+{
+ if ((new_iter->in_shift = old_iter->in_shift))
+ memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t));
+ else
+ memset (&new_iter->state, 0, sizeof (mbstate_t));
+ new_iter->next_done = old_iter->next_done;
+ mb_copy (&new_iter->cur, &old_iter->cur);
+}
+
+/* Iteration macros. */
+typedef struct mbuiter_multi mbui_iterator_t;
+#define mbui_init(iter, startptr) \
+ ((iter).cur.ptr = (startptr), \
+ (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \
+ (iter).next_done = false)
+#define mbui_avail(iter) \
+ (mbuiter_multi_next (&(iter)), !mb_isnul ((iter).cur))
+#define mbui_advance(iter) \
+ ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false)
+
+/* Access to the current character. */
+#define mbui_cur(iter) (iter).cur
+#define mbui_cur_ptr(iter) (iter).cur.ptr
+
+/* Relocation. */
+#define mbui_reloc(iter, ptrdiff) mbuiter_multi_reloc (&iter, ptrdiff)
+
+/* Copying an iterator. */
+#define mbui_copy mbuiter_multi_copy
+
+_GL_INLINE_HEADER_END
+
+#endif /* _MBUITER_H */
diff --git a/lib/memchr.c b/lib/memchr.c
new file mode 100644
index 0000000..b565542
--- /dev/null
+++ b/lib/memchr.c
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
+ 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 program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#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/lib/memchr.valgrind b/lib/memchr.valgrind
new file mode 100644
index 0000000..60f247e
--- /dev/null
+++ b/lib/memchr.valgrind
@@ -0,0 +1,14 @@
+# Suppress a valgrind message about use of uninitialized memory in memchr().
+# 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/lib/mkstemp.c b/lib/mkstemp.c
new file mode 100644
index 0000000..90ed78e
--- /dev/null
+++ b/lib/mkstemp.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2016 Free Software
+ Foundation, Inc.
+ This file is derived from the one in the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if !_LIBC
+# 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/lib/mktime-internal.h b/lib/mktime-internal.h
new file mode 100644
index 0000000..2f586ae
--- /dev/null
+++ b/lib/mktime-internal.h
@@ -0,0 +1,37 @@
+/* mktime variant that also uses an offset guess
+
+ Copyright 2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <time.h>
+
+/* mktime_offset_t is a signed type wide enough to hold a UTC offset
+ in seconds, and used as part of the type of the offset-guess
+ argument to mktime_internal. Use time_t on platforms where time_t
+ is signed, to be compatible with platforms like BeOS that export
+ this implementation detail of mktime. On platforms where time_t is
+ unsigned, GNU and POSIX code can assume 'int' is at least 32 bits
+ which is wide enough for a UTC offset. */
+
+#if TIME_T_IS_SIGNED
+typedef time_t mktime_offset_t;
+#else
+typedef int mktime_offset_t;
+#endif
+
+time_t mktime_internal (struct tm *,
+ struct tm * (*) (time_t const *, struct tm *),
+ mktime_offset_t *);
diff --git a/lib/mktime.c b/lib/mktime.c
new file mode 100644
index 0000000..8ee4e5e
--- /dev/null
+++ b/lib/mktime.c
@@ -0,0 +1,630 @@
+/* Convert a 'struct tm' to a time_t value.
+ Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Paul Eggert <eggert@twinsun.com>.
+
+ The GNU C Library is free software; you can redistribute 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.
+
+ 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Define this to 1 to have a standalone program to test this implementation of
+ mktime. */
+#ifndef DEBUG_MKTIME
+# define DEBUG_MKTIME 0
+#endif
+
+#if !defined _LIBC && !DEBUG_MKTIME
+# include <config.h>
+#endif
+
+/* Assume that leap seconds are possible, unless told otherwise.
+ If the host has a 'zic' command with a '-L leapsecondfilename' option,
+ then it supports leap seconds; otherwise it probably doesn't. */
+#ifndef LEAP_SECONDS_POSSIBLE
+# define LEAP_SECONDS_POSSIBLE 1
+#endif
+
+#include <time.h>
+
+#include <limits.h>
+#include <stdbool.h>
+
+#include <intprops.h>
+#include <verify.h>
+
+#if DEBUG_MKTIME
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+/* Make it work even if the system's libc has its own mktime routine. */
+# undef mktime
+# define mktime my_mktime
+#endif
+
+/* A signed type that can represent an integer number of years
+ multiplied by three times the number of seconds in a year. It is
+ needed when converting a tm_year value times the number of seconds
+ in a year. The factor of three comes because these products need
+ to be subtracted from each other, and sometimes with an offset
+ added to them, without worrying about overflow.
+
+ Much of the code uses long_int to represent time_t values, to
+ lessen the hassle of dealing with platforms where time_t is
+ unsigned, and because long_int should suffice to represent all
+ time_t values that mktime can generate even on platforms where
+ time_t is excessively wide. */
+
+#if INT_MAX <= LONG_MAX / 3 / 366 / 24 / 60 / 60
+typedef long int long_int;
+#else
+typedef long long int long_int;
+#endif
+verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 3 / 366 / 24 / 60 / 60);
+
+/* Shift A right by B bits portably, by dividing A by 2**B and
+ truncating towards minus infinity. B should be in the range 0 <= B
+ <= LONG_INT_BITS - 2, where LONG_INT_BITS is the number of useful
+ bits in a long_int. LONG_INT_BITS is at least 32.
+
+ ISO C99 says that A >> B is implementation-defined if A < 0. Some
+ implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift
+ right in the usual way when A < 0, so SHR falls back on division if
+ ordinary A >> B doesn't seem to be the usual signed shift. */
+
+static long_int
+shr (long_int a, int b)
+{
+ long_int one = 1;
+ return (-one >> 1 == -1
+ ? a >> b
+ : a / (one << b) - (a % (one << b) < 0));
+}
+
+/* Bounds for the intersection of time_t and long_int. */
+
+static long_int const mktime_min
+ = ((TYPE_SIGNED (time_t) && TYPE_MINIMUM (time_t) < TYPE_MINIMUM (long_int))
+ ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (time_t));
+static long_int const mktime_max
+ = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (time_t)
+ ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (time_t));
+
+verify (TYPE_IS_INTEGER (time_t));
+
+#define EPOCH_YEAR 1970
+#define TM_YEAR_BASE 1900
+verify (TM_YEAR_BASE % 100 == 0);
+
+/* Is YEAR + TM_YEAR_BASE a leap year? */
+static bool
+leapyear (long_int year)
+{
+ /* Don't add YEAR to TM_YEAR_BASE, as that might overflow.
+ Also, work even if YEAR is negative. */
+ return
+ ((year & 3) == 0
+ && (year % 100 != 0
+ || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3)));
+}
+
+/* How many days come before each month (0-12). */
+#ifndef _LIBC
+static
+#endif
+const unsigned short int __mon_yday[2][13] =
+ {
+ /* Normal years. */
+ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
+ /* Leap years. */
+ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
+ };
+
+
+#ifdef _LIBC
+typedef time_t mktime_offset_t;
+#else
+/* Portable standalone applications should supply a <time.h> that
+ declares a POSIX-compliant localtime_r, for the benefit of older
+ implementations that lack localtime_r or have a nonstandard one.
+ See the gnulib time_r module for one way to implement this. */
+# undef __localtime_r
+# define __localtime_r localtime_r
+# define __mktime_internal mktime_internal
+# include "mktime-internal.h"
+#endif
+
+/* Do the values A and B differ according to the rules for tm_isdst?
+ A and B differ if one is zero and the other positive. */
+static bool
+isdst_differ (int a, int b)
+{
+ return (!a != !b) && (0 <= a) && (0 <= b);
+}
+
+/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
+ (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks
+ were not adjusted between the time stamps.
+
+ The YEAR values uses the same numbering as TP->tm_year. Values
+ need not be in the usual range. However, YEAR1 must not overflow
+ when multiplied by three times the number of seconds in a year, and
+ likewise for YDAY1 and three times the number of seconds in a day. */
+
+static long_int
+ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
+ int year0, int yday0, int hour0, int min0, int sec0)
+{
+ verify (-1 / 2 == 0);
+
+ /* Compute intervening leap days correctly even if year is negative.
+ Take care to avoid integer overflow here. */
+ int a4 = shr (year1, 2) + shr (TM_YEAR_BASE, 2) - ! (year1 & 3);
+ int b4 = shr (year0, 2) + shr (TM_YEAR_BASE, 2) - ! (year0 & 3);
+ int a100 = a4 / 25 - (a4 % 25 < 0);
+ int b100 = b4 / 25 - (b4 % 25 < 0);
+ int a400 = shr (a100, 2);
+ int b400 = shr (b100, 2);
+ int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
+
+ /* Compute the desired time without overflowing. */
+ long_int years = year1 - year0;
+ long_int days = 365 * years + yday1 - yday0 + intervening_leap_days;
+ long_int hours = 24 * days + hour1 - hour0;
+ long_int minutes = 60 * hours + min1 - min0;
+ long_int seconds = 60 * minutes + sec1 - sec0;
+ return seconds;
+}
+
+/* Return the average of A and B, even if A + B would overflow.
+ Round toward positive infinity. */
+static long_int
+long_int_avg (long_int a, long_int b)
+{
+ return shr (a, 1) + shr (b, 1) + ((a | b) & 1);
+}
+
+/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC),
+ assuming that T corresponds to *TP and that no clock adjustments
+ occurred between *TP and the desired time.
+ Although T and the returned value are of type long_int,
+ they represent time_t values and must be in time_t range.
+ If TP is null, return a value not equal to T; this avoids false matches.
+ YEAR and YDAY must not be so large that multiplying them by three times the
+ number of seconds in a year (or day, respectively) would overflow long_int.
+ If the returned value would be out of range, yield the minimal or
+ maximal in-range value, except do not yield a value equal to T. */
+static long_int
+guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
+ long_int t, const struct tm *tp)
+{
+ if (tp)
+ {
+ long_int result;
+ long_int d = ydhms_diff (year, yday, hour, min, sec,
+ tp->tm_year, tp->tm_yday,
+ tp->tm_hour, tp->tm_min, tp->tm_sec);
+ if (! INT_ADD_WRAPV (t, d, &result))
+ return result;
+ }
+
+ /* Overflow occurred one way or another. Return the nearest result
+ that is actually in range, except don't report a zero difference
+ if the actual difference is nonzero, as that would cause a false
+ match; and don't oscillate between two values, as that would
+ confuse the spring-forward gap detector. */
+ return (t < long_int_avg (mktime_min, mktime_max)
+ ? (t <= mktime_min + 1 ? t + 1 : mktime_min)
+ : (mktime_max - 1 <= t ? t - 1 : mktime_max));
+}
+
+/* Use CONVERT to convert T to a struct tm value in *TM. T must be in
+ range for time_t. Return TM if successful, NULL if T is out of
+ range for CONVERT. */
+static struct tm *
+convert_time (struct tm *(*convert) (const time_t *, struct tm *),
+ long_int t, struct tm *tm)
+{
+ time_t x = t;
+ return convert (&x, tm);
+}
+
+/* Use CONVERT to convert *T to a broken down time in *TP.
+ If *T is out of range for conversion, adjust it so that
+ it is the nearest in-range value and then convert that.
+ A value is in range if it fits in both time_t and long_int. */
+static struct tm *
+ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
+ long_int *t, struct tm *tp)
+{
+ struct tm *r;
+ if (*t < mktime_min)
+ *t = mktime_min;
+ else if (mktime_max < *t)
+ *t = mktime_max;
+ r = convert_time (convert, *t, tp);
+
+ if (!r && *t)
+ {
+ long_int bad = *t;
+ long_int ok = 0;
+
+ /* BAD is a known unconvertible value, and OK is a known good one.
+ Use binary search to narrow the range between BAD and OK until
+ they differ by 1. */
+ while (true)
+ {
+ long_int mid = long_int_avg (ok, bad);
+ if (mid != ok && mid != bad)
+ break;
+ r = convert_time (convert, mid, tp);
+ if (r)
+ ok = mid;
+ else
+ bad = mid;
+ }
+
+ if (!r && ok)
+ {
+ /* The last conversion attempt failed;
+ revert to the most recent successful attempt. */
+ r = convert_time (convert, ok, tp);
+ }
+ }
+
+ return r;
+}
+
+/* Convert *TP to a time_t value, inverting
+ the monotonic and mostly-unit-linear conversion function CONVERT.
+ Use *OFFSET to keep track of a guess at the offset of the result,
+ compared to what the result would be for UTC without leap seconds.
+ If *OFFSET's guess is correct, only one CONVERT call is needed.
+ This function is external because it is used also by timegm.c. */
+time_t
+__mktime_internal (struct tm *tp,
+ struct tm *(*convert) (const time_t *, struct tm *),
+ mktime_offset_t *offset)
+{
+ long_int t, gt, t0, t1, t2, dt;
+ struct tm tm;
+
+ /* The maximum number of probes (calls to CONVERT) should be enough
+ to handle any combinations of time zone rule changes, solar time,
+ leap seconds, and oscillations around a spring-forward gap.
+ POSIX.1 prohibits leap seconds, but some hosts have them anyway. */
+ int remaining_probes = 6;
+
+ /* Time requested. Copy it in case CONVERT modifies *TP; this can
+ occur if TP is localtime's returned value and CONVERT is localtime. */
+ int sec = tp->tm_sec;
+ int min = tp->tm_min;
+ int hour = tp->tm_hour;
+ int mday = tp->tm_mday;
+ int mon = tp->tm_mon;
+ int year_requested = tp->tm_year;
+ int isdst = tp->tm_isdst;
+
+ /* 1 if the previous probe was DST. */
+ int dst2;
+
+ /* Ensure that mon is in range, and set year accordingly. */
+ int mon_remainder = mon % 12;
+ int negative_mon_remainder = mon_remainder < 0;
+ int mon_years = mon / 12 - negative_mon_remainder;
+ long_int lyear_requested = year_requested;
+ long_int year = lyear_requested + mon_years;
+
+ /* The other values need not be in range:
+ the remaining code handles overflows correctly. */
+
+ /* Calculate day of year from year, month, and day of month.
+ The result need not be in range. */
+ int mon_yday = ((__mon_yday[leapyear (year)]
+ [mon_remainder + 12 * negative_mon_remainder])
+ - 1);
+ long_int lmday = mday;
+ long_int yday = mon_yday + lmday;
+
+ int negative_offset_guess;
+
+ int sec_requested = sec;
+
+ if (LEAP_SECONDS_POSSIBLE)
+ {
+ /* Handle out-of-range seconds specially,
+ since ydhms_tm_diff assumes every minute has 60 seconds. */
+ if (sec < 0)
+ sec = 0;
+ if (59 < sec)
+ sec = 59;
+ }
+
+ /* Invert CONVERT by probing. First assume the same offset as last
+ time. */
+
+ INT_SUBTRACT_WRAPV (0, *offset, &negative_offset_guess);
+ t0 = ydhms_diff (year, yday, hour, min, sec,
+ EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, negative_offset_guess);
+
+ /* Repeatedly use the error to improve the guess. */
+
+ for (t = t1 = t2 = t0, dst2 = 0;
+ (gt = guess_time_tm (year, yday, hour, min, sec, t,
+ ranged_convert (convert, &t, &tm)),
+ t != gt);
+ t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0)
+ if (t == t1 && t != t2
+ && (tm.tm_isdst < 0
+ || (isdst < 0
+ ? dst2 <= (tm.tm_isdst != 0)
+ : (isdst != 0) != (tm.tm_isdst != 0))))
+ /* We can't possibly find a match, as we are oscillating
+ between two values. The requested time probably falls
+ within a spring-forward gap of size GT - T. Follow the common
+ practice in this case, which is to return a time that is GT - T
+ away from the requested time, preferring a time whose
+ tm_isdst differs from the requested value. (If no tm_isdst
+ was requested and only one of the two values has a nonzero
+ tm_isdst, prefer that value.) In practice, this is more
+ useful than returning -1. */
+ goto offset_found;
+ else if (--remaining_probes == 0)
+ return -1;
+
+ /* We have a match. Check whether tm.tm_isdst has the requested
+ value, if any. */
+ if (isdst_differ (isdst, tm.tm_isdst))
+ {
+ /* tm.tm_isdst has the wrong value. Look for a neighboring
+ time with the right value, and use its UTC offset.
+
+ Heuristic: probe the adjacent timestamps in both directions,
+ looking for the desired isdst. This should work for all real
+ time zone histories in the tz database. */
+
+ /* Distance between probes when looking for a DST boundary. In
+ tzdata2003a, the shortest period of DST is 601200 seconds
+ (e.g., America/Recife starting 2000-10-08 01:00), and the
+ shortest period of non-DST surrounded by DST is 694800
+ seconds (Africa/Tunis starting 1943-04-17 01:00). Use the
+ minimum of these two values, so we don't miss these short
+ periods when probing. */
+ int stride = 601200;
+
+ /* The longest period of DST in tzdata2003a is 536454000 seconds
+ (e.g., America/Jujuy starting 1946-10-01 01:00). The longest
+ period of non-DST is much longer, but it makes no real sense
+ to search for more than a year of non-DST, so use the DST
+ max. */
+ int duration_max = 536454000;
+
+ /* Search in both directions, so the maximum distance is half
+ the duration; add the stride to avoid off-by-1 problems. */
+ int delta_bound = duration_max / 2 + stride;
+
+ int delta, direction;
+
+ for (delta = stride; delta < delta_bound; delta += stride)
+ for (direction = -1; direction <= 1; direction += 2)
+ {
+ long_int ot;
+ if (! INT_ADD_WRAPV (t, delta * direction, &ot))
+ {
+ struct tm otm;
+ ranged_convert (convert, &ot, &otm);
+ if (! isdst_differ (isdst, otm.tm_isdst))
+ {
+ /* We found the desired tm_isdst.
+ Extrapolate back to the desired time. */
+ t = guess_time_tm (year, yday, hour, min, sec, ot, &otm);
+ ranged_convert (convert, &t, &tm);
+ goto offset_found;
+ }
+ }
+ }
+ }
+
+ offset_found:
+ /* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS.
+ This is just a heuristic to speed up the next mktime call, and
+ correctness is unaffected if integer overflow occurs here. */
+ INT_SUBTRACT_WRAPV (t, t0, &dt);
+ INT_SUBTRACT_WRAPV (dt, negative_offset_guess, offset);
+
+ if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec)
+ {
+ /* Adjust time to reflect the tm_sec requested, not the normalized value.
+ Also, repair any damage from a false match due to a leap second. */
+ long_int sec_adjustment = sec == 0 && tm.tm_sec == 60;
+ sec_adjustment -= sec;
+ sec_adjustment += sec_requested;
+ if (INT_ADD_WRAPV (t, sec_adjustment, &t)
+ || ! (mktime_min <= t && t <= mktime_max)
+ || ! convert_time (convert, t, &tm))
+ return -1;
+ }
+
+ *tp = tm;
+ return t;
+}
+
+
+static mktime_offset_t localtime_offset;
+
+/* Convert *TP to a time_t value. */
+time_t
+mktime (struct tm *tp)
+{
+#ifdef _LIBC
+ /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
+ time zone names contained in the external variable 'tzname' shall
+ be set as if the tzset() function had been called. */
+ __tzset ();
+#elif HAVE_TZSET
+ tzset ();
+#endif
+
+ return __mktime_internal (tp, __localtime_r, &localtime_offset);
+}
+
+#ifdef weak_alias
+weak_alias (mktime, timelocal)
+#endif
+
+#ifdef _LIBC
+libc_hidden_def (mktime)
+libc_hidden_weak (timelocal)
+#endif
+
+#if DEBUG_MKTIME
+
+static int
+not_equal_tm (const struct tm *a, const struct tm *b)
+{
+ return ((a->tm_sec ^ b->tm_sec)
+ | (a->tm_min ^ b->tm_min)
+ | (a->tm_hour ^ b->tm_hour)
+ | (a->tm_mday ^ b->tm_mday)
+ | (a->tm_mon ^ b->tm_mon)
+ | (a->tm_year ^ b->tm_year)
+ | (a->tm_yday ^ b->tm_yday)
+ | isdst_differ (a->tm_isdst, b->tm_isdst));
+}
+
+static void
+print_tm (const struct tm *tp)
+{
+ if (tp)
+ printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
+ tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
+ tp->tm_hour, tp->tm_min, tp->tm_sec,
+ tp->tm_yday, tp->tm_wday, tp->tm_isdst);
+ else
+ printf ("0");
+}
+
+static int
+check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt)
+{
+ if (tk != tl || !lt || not_equal_tm (&tmk, lt))
+ {
+ printf ("mktime (");
+ print_tm (lt);
+ printf (")\nyields (");
+ print_tm (&tmk);
+ printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl);
+ return 1;
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ int status = 0;
+ struct tm tm, tmk, tml;
+ struct tm *lt;
+ time_t tk, tl, tl1;
+ char trailer;
+
+ /* Sanity check, plus call tzset. */
+ tl = 0;
+ if (! localtime (&tl))
+ {
+ printf ("localtime (0) fails\n");
+ status = 1;
+ }
+
+ if ((argc == 3 || argc == 4)
+ && (sscanf (argv[1], "%d-%d-%d%c",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
+ == 3)
+ && (sscanf (argv[2], "%d:%d:%d%c",
+ &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
+ == 3))
+ {
+ tm.tm_year -= TM_YEAR_BASE;
+ tm.tm_mon--;
+ tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]);
+ tmk = tm;
+ tl = mktime (&tmk);
+ lt = localtime_r (&tl, &tml);
+ printf ("mktime returns %ld == ", (long int) tl);
+ print_tm (&tmk);
+ printf ("\n");
+ status = check_result (tl, tmk, tl, lt);
+ }
+ else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0))
+ {
+ time_t from = atol (argv[1]);
+ time_t by = atol (argv[2]);
+ time_t to = atol (argv[3]);
+
+ if (argc == 4)
+ for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
+ {
+ lt = localtime_r (&tl, &tml);
+ if (lt)
+ {
+ tmk = tml;
+ tk = mktime (&tmk);
+ status |= check_result (tk, tmk, tl, &tml);
+ }
+ else
+ {
+ printf ("localtime_r (%ld) yields 0\n", (long int) tl);
+ status = 1;
+ }
+ tl1 = tl + by;
+ if ((tl1 < tl) != (by < 0))
+ break;
+ }
+ else
+ for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
+ {
+ /* Null benchmark. */
+ lt = localtime_r (&tl, &tml);
+ if (lt)
+ {
+ tmk = tml;
+ tk = tl;
+ status |= check_result (tk, tmk, tl, &tml);
+ }
+ else
+ {
+ printf ("localtime_r (%ld) yields 0\n", (long int) tl);
+ status = 1;
+ }
+ tl1 = tl + by;
+ if ((tl1 < tl) != (by < 0))
+ break;
+ }
+ }
+ else
+ printf ("Usage:\
+\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
+\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
+\t%s FROM BY TO - # Do not test those values (for benchmark).\n",
+ argv[0], argv[0], argv[0]);
+
+ return status;
+}
+
+#endif /* DEBUG_MKTIME */
+
+/*
+Local Variables:
+compile-command: "gcc -DDEBUG_MKTIME -I. -Wall -W -O2 -g mktime.c -o mktime"
+End:
+*/
diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c
new file mode 100644
index 0000000..baaf39e
--- /dev/null
+++ b/lib/msvc-inval.c
@@ -0,0 +1,129 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "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/lib/msvc-inval.h b/lib/msvc-inval.h
new file mode 100644
index 0000000..027c949
--- /dev/null
+++ b/lib/msvc-inval.h
@@ -0,0 +1,222 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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
+ <http://msdn.microsoft.com/en-us/library/het71c37.aspx>.
+ 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
+ <http://msdn.microsoft.com/en-us/library/s58ftw19.aspx>.
+ 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/lib/msvc-nothrow.c b/lib/msvc-nothrow.c
new file mode 100644
index 0000000..ba75bbf
--- /dev/null
+++ b/lib/msvc-nothrow.c
@@ -0,0 +1,49 @@
+/* Wrappers that don't throw invalid parameter notifications
+ with MSVC runtime libraries.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "msvc-nothrow.h"
+
+/* Get declarations of the native Windows API functions. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "msvc-inval.h"
+
+#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/lib/msvc-nothrow.h b/lib/msvc-nothrow.h
new file mode 100644
index 0000000..3493b84
--- /dev/null
+++ b/lib/msvc-nothrow.h
@@ -0,0 +1,43 @@
+/* Wrappers that don't throw invalid parameter notifications
+ with MSVC runtime libraries.
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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 __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/lib/nl_langinfo.c b/lib/nl_langinfo.c
new file mode 100644
index 0000000..699511a
--- /dev/null
+++ b/lib/nl_langinfo.c
@@ -0,0 +1,322 @@
+/* nl_langinfo() replacement: query locale dependent information.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <langinfo.h>
+
+#include <locale.h>
+#include <string.h>
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+# include <stdio.h>
+#endif
+
+/* Return the codeset of the current locale, if this is easily deducible.
+ Otherwise, return "". */
+static char *
+ctype_codeset (void)
+{
+ static char buf[2 + 10 + 1];
+ size_t buflen = 0;
+ char const *locale = setlocale (LC_CTYPE, NULL);
+ char *codeset = buf;
+ size_t codesetlen;
+ codeset[0] = '\0';
+
+ if (locale && 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 __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 ());
+ codeset = memcpy (buf, "CP", 2);
+#endif
+ return codeset;
+}
+
+
+#if REPLACE_NL_LANGINFO
+
+/* Override nl_langinfo with support for added nl_item values. */
+
+# undef nl_langinfo
+
+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 "%I:%M:%S %p";
+# 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 "";
+ 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 "\0\0\0\0\0\0\0\0\0\0";
+# endif
+# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS
+ case YESEXPR:
+ return "^[yY]";
+ case NOEXPR:
+ return "^[nN]";
+# endif
+ default:
+ break;
+ }
+ return nl_langinfo (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)
+{
+ static char nlbuf[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 "UTF-8";
+# else
+ return "ISO-8859-1";
+# endif
+ /* nl_langinfo items of the LC_NUMERIC category */
+ case RADIXCHAR:
+ return localeconv () ->decimal_point;
+ case THOUSEP:
+ return localeconv () ->thousands_sep;
+ case GROUPING:
+ return localeconv () ->grouping;
+ /* nl_langinfo items of the LC_TIME category.
+ TODO: Really use the locale. */
+ case D_T_FMT:
+ case ERA_D_T_FMT:
+ return "%a %b %e %H:%M:%S %Y";
+ case D_FMT:
+ case ERA_D_FMT:
+ return "%m/%d/%y";
+ case T_FMT:
+ case ERA_T_FMT:
+ return "%H:%M:%S";
+ case T_FMT_AMPM:
+ return "%I:%M:%S %p";
+ case AM_STR:
+ if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
+ return "AM";
+ return nlbuf;
+ case PM_STR:
+ tmm.tm_hour = 12;
+ if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
+ return "PM";
+ return nlbuf;
+ case DAY_1:
+ case DAY_2:
+ case DAY_3:
+ case DAY_4:
+ case DAY_5:
+ case DAY_6:
+ case DAY_7:
+ {
+ static char const days[][sizeof "Wednesday"] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday", "Saturday"
+ };
+ tmm.tm_wday = item - DAY_1;
+ if (!strftime (nlbuf, sizeof nlbuf, "%A", &tmm))
+ return (char *) days[item - DAY_1];
+ return nlbuf;
+ }
+ case ABDAY_1:
+ case ABDAY_2:
+ case ABDAY_3:
+ case ABDAY_4:
+ case ABDAY_5:
+ case ABDAY_6:
+ case ABDAY_7:
+ {
+ static char const abdays[][sizeof "Sun"] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+ tmm.tm_wday = item - ABDAY_1;
+ if (!strftime (nlbuf, sizeof nlbuf, "%a", &tmm))
+ return (char *) abdays[item - ABDAY_1];
+ return nlbuf;
+ }
+ 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 const months[][sizeof "September"] = {
+ "January", "February", "March", "April", "May", "June", "July",
+ "September", "October", "November", "December"
+ };
+ tmm.tm_mon = item - MON_1;
+ if (!strftime (nlbuf, sizeof nlbuf, "%B", &tmm))
+ return (char *) months[item - MON_1];
+ return nlbuf;
+ }
+ 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 const abmonths[][sizeof "Jan"] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
+ "Sep", "Oct", "Nov", "Dec"
+ };
+ tmm.tm_mon = item - ABMON_1;
+ if (!strftime (nlbuf, sizeof nlbuf, "%b", &tmm))
+ return (char *) abmonths[item - ABMON_1];
+ return nlbuf;
+ }
+ case ERA:
+ return "";
+ case ALT_DIGITS:
+ return "\0\0\0\0\0\0\0\0\0\0";
+ /* nl_langinfo items of the LC_MONETARY category. */
+ case CRNCYSTR:
+ return localeconv () ->currency_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;
+ /* nl_langinfo items of the LC_MESSAGES category
+ TODO: Really use the locale. */
+ case YESEXPR:
+ return "^[yY]";
+ case NOEXPR:
+ return "^[nN]";
+ default:
+ return "";
+ }
+}
+
+#endif
diff --git a/lib/offtostr.c b/lib/offtostr.c
new file mode 100644
index 0000000..96082aa
--- /dev/null
+++ b/lib/offtostr.c
@@ -0,0 +1,3 @@
+#define anytostr offtostr
+#define inttype off_t
+#include "anytostr.c"
diff --git a/lib/open.c b/lib/open.c
new file mode 100644
index 0000000..e9c3120
--- /dev/null
+++ b/lib/open.c
@@ -0,0 +1,181 @@
+/* Open a descriptor to a file.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* 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)
+{
+ return open (filename, flags, mode);
+}
+
+/* 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 <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, ...)
+{
+ 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 __WIN32__) && ! defined __CYGWIN__
+ if (strcmp (filename, "/dev/null") == 0)
+ filename = "NUL";
+#endif
+
+#if OPEN_TRAILING_SLASH_BUG
+ /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR
+ is specified, then fail.
+ Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
+ says that
+ "A pathname that contains at least one non-slash character and that
+ ends with one or more trailing slashes shall be resolved as if a
+ single dot character ( '.' ) were appended to the pathname."
+ and
+ "The special filename dot shall refer to the directory specified by
+ its predecessor."
+ 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
+ <http://www.opengroup.org/susv3/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 | O_WRONLY | O_RDWR))
+ {
+ size_t len = strlen (filename);
+ if (len > 0 && filename[len - 1] == '/')
+ {
+ errno = EISDIR;
+ return -1;
+ }
+ }
+#endif
+
+ fd = orig_open (filename, flags, mode);
+
+#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 <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
+ says that
+ "A pathname that contains at least one non-slash character and that
+ ends with one or more trailing slashes shall be resolved as if a
+ single dot character ( '.' ) were appended to the pathname."
+ and
+ "The special filename dot shall refer to the directory specified by
+ its predecessor."
+ 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/lib/pathmax.h b/lib/pathmax.h
new file mode 100644
index 0000000..aee22f8
--- /dev/null
+++ b/lib/pathmax.h
@@ -0,0 +1,83 @@
+/* Define PATH_MAX somehow. Requires sys/types.h.
+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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.
+ <http://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 __WIN32__) && ! defined __CYGWIN__
+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
+ section "Maximum Path Length Limitation",
+ <http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath>
+ 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/lib/prepargs.c b/lib/prepargs.c
new file mode 100644
index 0000000..f4a2f12
--- /dev/null
+++ b/lib/prepargs.c
@@ -0,0 +1,91 @@
+/* Parse arguments from a string and prepend them to an argv.
+
+ Copyright (C) 1999-2002, 2006, 2009-2013, 2015-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert <eggert@twinsun.com>. */
+
+#include <config.h>
+
+#include "prepargs.h"
+#include <string.h>
+#include <sys/types.h>
+#include <xalloc.h>
+
+#include <ctype.h>
+
+/* IN_CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given
+ as an argument to <ctype.h> macros like "isspace". */
+#ifdef STDC_HEADERS
+# define IN_CTYPE_DOMAIN(c) 1
+#else
+# define IN_CTYPE_DOMAIN(c) ((c) <= 0177)
+#endif
+
+#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
+
+/* Find the white-space-separated options specified by OPTIONS, and
+ using BUF to store copies of these options, set ARGV[0], ARGV[1],
+ etc. to the option copies. Return the number N of options found.
+ Do not set ARGV[N]. If ARGV is zero, do not store ARGV[0] etc.
+ Backslash can be used to escape whitespace (and backslashes). */
+static int
+prepend_args (char const *options, char *buf, char **argv)
+{
+ char const *o = options;
+ char *b = buf;
+ int n = 0;
+
+ for (;;)
+ {
+ while (ISSPACE ((unsigned char) *o))
+ o++;
+ if (!*o)
+ return n;
+ if (argv)
+ argv[n] = b;
+ n++;
+
+ do
+ if ((*b++ = *o++) == '\\' && *o)
+ b[-1] = *o++;
+ while (*o && ! ISSPACE ((unsigned char) *o));
+
+ *b++ = '\0';
+ }
+}
+
+/* Prepend the whitespace-separated options in OPTIONS to the argument
+ vector of a main program with argument count *PARGC and argument
+ vector *PARGV. */
+void
+prepend_default_options (char const *options, int *pargc, char ***pargv)
+{
+ if (options)
+ {
+ char *buf = xmalloc (strlen (options) + 1);
+ int prepended = prepend_args (options, buf, (char **) 0);
+ int argc = *pargc;
+ char * const *argv = *pargv;
+ char **pp = xmalloc ((prepended + argc + 1) * sizeof *pp);
+ *pargc = prepended + argc;
+ *pargv = pp;
+ *pp++ = *argv++;
+ pp += prepend_args (options, buf, pp);
+ while ((*pp++ = *argv++))
+ continue;
+ }
+}
diff --git a/lib/prepargs.h b/lib/prepargs.h
new file mode 100644
index 0000000..ce93ea8
--- /dev/null
+++ b/lib/prepargs.h
@@ -0,0 +1,3 @@
+/* Parse arguments from a string and prepend them to an argv. */
+
+void prepend_default_options (char const *, int *, char ***);
diff --git a/lib/printf-args.c b/lib/printf-args.c
new file mode 100644
index 0000000..cfaed99
--- /dev/null
+++ b/lib/printf-args.c
@@ -0,0 +1,187 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* 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;
+#if HAVE_LONG_LONG_INT
+ 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;
+#endif
+ 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;
+#if HAVE_LONG_LONG_INT
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+ break;
+#endif
+#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/lib/printf-args.h b/lib/printf-args.h
new file mode 100644
index 0000000..256c413
--- /dev/null
+++ b/lib/printf-args.h
@@ -0,0 +1,158 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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,
+#if HAVE_LONG_LONG_INT
+ TYPE_LONGLONGINT,
+ TYPE_ULONGLONGINT,
+#endif
+ 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
+#if HAVE_LONG_LONG_INT
+, TYPE_COUNT_LONGLONGINT_POINTER
+#endif
+#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;
+#if HAVE_LONG_LONG_INT
+ long long int a_longlongint;
+ unsigned long long int a_ulonglongint;
+#endif
+ 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;
+#if HAVE_LONG_LONG_INT
+ long long int * a_count_longlongint_pointer;
+#endif
+#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/lib/printf-parse.c b/lib/printf-parse.c
new file mode 100644
index 0000000..fad5d3d
--- /dev/null
+++ b/lib/printf-parse.c
@@ -0,0 +1,638 @@
+/* Formatted output to strings.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* 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. */
+#if defined IN_LIBINTL || defined IN_LIBASPRINTF
+# if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+# endif
+# if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+# endif
+#else
+# include <stdint.h>
+#endif
+
+/* 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 __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 HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGLONGINT;
+ else
+#endif
+ /* If 'long long' exists and 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 HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_ULONGLONGINT;
+ else
+#endif
+ /* If 'unsigned long long' exists and 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 HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_COUNT_LONGLONGINT_POINTER;
+ else
+#endif
+ /* If 'long long' exists and 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/lib/printf-parse.h b/lib/printf-parse.h
new file mode 100644
index 0000000..a46d946
--- /dev/null
+++ b/lib/printf-parse.h
@@ -0,0 +1,193 @@
+/* Parse printf format string.
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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/lib/progname.c b/lib/progname.c
new file mode 100644
index 0000000..debb760
--- /dev/null
+++ b/lib/progname.c
@@ -0,0 +1,92 @@
+/* Program name management.
+ Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+#include <config.h>
+
+/* Specification. */
+#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */
+#include "progname.h"
+
+#include <errno.h> /* get program_invocation_name declaration */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* String containing name the program is called with.
+ To be initialized by main(). */
+const char *program_name = NULL;
+
+/* Set program_name, based on argv[0].
+ argv0 must be a string allocated with indefinite extent, and must not be
+ modified after this call. */
+void
+set_program_name (const char *argv0)
+{
+ /* libtool creates a temporary executable whose name is sometimes prefixed
+ with "lt-" (depends on the platform). It also makes argv[0] absolute.
+ But the name of the temporary executable is a detail that should not be
+ visible to the end user and to the test suite.
+ Remove this "<dirname>/.libs/" or "<dirname>/.libs/lt-" prefix here. */
+ const char *slash;
+ const char *base;
+
+ /* Sanity check. POSIX requires the invoking process to pass a non-NULL
+ argv[0]. */
+ if (argv0 == NULL)
+ {
+ /* It's a bug in the invoking program. Help diagnosing it. */
+ fputs ("A NULL argv[0] was passed through an exec system call.\n",
+ stderr);
+ abort ();
+ }
+
+ slash = strrchr (argv0, '/');
+ base = (slash != NULL ? slash + 1 : argv0);
+ if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
+ {
+ argv0 = base;
+ if (strncmp (base, "lt-", 3) == 0)
+ {
+ argv0 = base + 3;
+ /* On glibc systems, remove the "lt-" prefix from the variable
+ program_invocation_short_name. */
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+ program_invocation_short_name = (char *) argv0;
+#endif
+ }
+ }
+
+ /* But don't strip off a leading <dirname>/ in general, because when the user
+ runs
+ /some/hidden/place/bin/cp foo foo
+ he should get the error message
+ /some/hidden/place/bin/cp: `foo' and `foo' are the same file
+ not
+ cp: `foo' and `foo' are the same file
+ */
+
+ program_name = argv0;
+
+ /* On glibc systems, the error() function comes from libc and uses the
+ variable program_invocation_name, not program_name. So set this variable
+ as well. */
+#if HAVE_DECL_PROGRAM_INVOCATION_NAME
+ program_invocation_name = (char *) argv0;
+#endif
+}
diff --git a/lib/progname.h b/lib/progname.h
new file mode 100644
index 0000000..0a57407
--- /dev/null
+++ b/lib/progname.h
@@ -0,0 +1,62 @@
+/* Program name management.
+ Copyright (C) 2001-2004, 2006, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _PROGNAME_H
+#define _PROGNAME_H
+
+/* Programs using this file should do the following in main():
+ set_program_name (argv[0]);
+ */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* String containing name the program is called with. */
+extern const char *program_name;
+
+/* Set program_name, based on argv[0].
+ argv0 must be a string allocated with indefinite extent, and must not be
+ modified after this call. */
+extern void set_program_name (const char *argv0);
+
+#if ENABLE_RELOCATABLE
+
+/* Set program_name, based on argv[0], and original installation prefix and
+ directory, for relocatability. */
+extern void set_program_name_and_installdir (const char *argv0,
+ const char *orig_installprefix,
+ const char *orig_installdir);
+#undef set_program_name
+#define set_program_name(ARG0) \
+ set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
+
+/* Return the full pathname of the current executable, based on the earlier
+ call to set_program_name_and_installdir. Return NULL if unknown. */
+extern char *get_full_program_name (void);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _PROGNAME_H */
diff --git a/lib/propername.c b/lib/propername.c
new file mode 100644
index 0000000..90ad284
--- /dev/null
+++ b/lib/propername.c
@@ -0,0 +1,318 @@
+/* Localization of proper names.
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that
+ the proper_name function might be candidate for attribute 'const' */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
+#endif
+
+#include <config.h>
+
+/* Specification. */
+#include "propername.h"
+
+#include <ctype.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+#include "trim.h"
+#include "mbchar.h"
+#include "mbuiter.h"
+#include "localcharset.h"
+#include "c-strcase.h"
+#include "xstriconv.h"
+#include "xalloc.h"
+#include "gettext.h"
+
+
+/* Tests whether STRING contains trim (SUB), starting and ending at word
+ boundaries.
+ Here, instead of implementing Unicode Standard Annex #29 for determining
+ word boundaries, we assume that trim (SUB) starts and ends with words and
+ only test whether the part before it ends with a non-word and the part
+ after it starts with a non-word. */
+static bool
+mbsstr_trimmed_wordbounded (const char *string, const char *sub)
+{
+ char *tsub = trim (sub);
+ bool found = false;
+
+ for (; *string != '\0';)
+ {
+ const char *tsub_in_string = mbsstr (string, tsub);
+ if (tsub_in_string == NULL)
+ break;
+ else
+ {
+ if (MB_CUR_MAX > 1)
+ {
+ mbui_iterator_t string_iter;
+ bool word_boundary_before;
+ bool word_boundary_after;
+
+ mbui_init (string_iter, string);
+ word_boundary_before = true;
+ if (mbui_cur_ptr (string_iter) < tsub_in_string)
+ {
+ mbchar_t last_char_before_tsub;
+ do
+ {
+ if (!mbui_avail (string_iter))
+ abort ();
+ last_char_before_tsub = mbui_cur (string_iter);
+ mbui_advance (string_iter);
+ }
+ while (mbui_cur_ptr (string_iter) < tsub_in_string);
+ if (mb_isalnum (last_char_before_tsub))
+ word_boundary_before = false;
+ }
+
+ mbui_init (string_iter, tsub_in_string);
+ {
+ mbui_iterator_t tsub_iter;
+
+ for (mbui_init (tsub_iter, tsub);
+ mbui_avail (tsub_iter);
+ mbui_advance (tsub_iter))
+ {
+ if (!mbui_avail (string_iter))
+ abort ();
+ mbui_advance (string_iter);
+ }
+ }
+ word_boundary_after = true;
+ if (mbui_avail (string_iter))
+ {
+ mbchar_t first_char_after_tsub = mbui_cur (string_iter);
+ if (mb_isalnum (first_char_after_tsub))
+ word_boundary_after = false;
+ }
+
+ if (word_boundary_before && word_boundary_after)
+ {
+ found = true;
+ break;
+ }
+
+ mbui_init (string_iter, tsub_in_string);
+ if (!mbui_avail (string_iter))
+ break;
+ string = tsub_in_string + mb_len (mbui_cur (string_iter));
+ }
+ else
+ {
+ bool word_boundary_before;
+ const char *p;
+ bool word_boundary_after;
+
+ word_boundary_before = true;
+ if (string < tsub_in_string)
+ if (isalnum ((unsigned char) tsub_in_string[-1]))
+ word_boundary_before = false;
+
+ p = tsub_in_string + strlen (tsub);
+ word_boundary_after = true;
+ if (*p != '\0')
+ if (isalnum ((unsigned char) *p))
+ word_boundary_after = false;
+
+ if (word_boundary_before && word_boundary_after)
+ {
+ found = true;
+ break;
+ }
+
+ if (*tsub_in_string == '\0')
+ break;
+ string = tsub_in_string + 1;
+ }
+ }
+ }
+ free (tsub);
+ return found;
+}
+
+/* Return the localization of NAME. NAME is written in ASCII. */
+
+const char *
+proper_name (const char *name)
+{
+ /* See whether there is a translation. */
+ const char *translation = gettext (name);
+
+ if (translation != name)
+ {
+ /* See whether the translation contains the original name. */
+ if (mbsstr_trimmed_wordbounded (translation, name))
+ return translation;
+ else
+ {
+ /* Return "TRANSLATION (NAME)". */
+ char *result =
+ XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+
+ sprintf (result, "%s (%s)", translation, name);
+ return result;
+ }
+ }
+ else
+ return name;
+}
+
+/* Return the localization of a name whose original writing is not ASCII.
+ NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
+ escape sequences. NAME_ASCII is a fallback written only with ASCII
+ characters. */
+
+const char *
+proper_name_utf8 (const char *name_ascii, const char *name_utf8)
+{
+ /* See whether there is a translation. */
+ const char *translation = gettext (name_ascii);
+
+ /* Try to convert NAME_UTF8 to the locale encoding. */
+ const char *locale_code = locale_charset ();
+ char *alloc_name_converted = NULL;
+ char *alloc_name_converted_translit = NULL;
+ const char *name_converted = NULL;
+ const char *name_converted_translit = NULL;
+ const char *name;
+
+ if (c_strcasecmp (locale_code, "UTF-8") != 0)
+ {
+#if HAVE_ICONV
+ name_converted = alloc_name_converted =
+ xstr_iconv (name_utf8, "UTF-8", locale_code);
+
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
+ && !defined __UCLIBC__) \
+ || _LIBICONV_VERSION >= 0x0105
+ {
+ char *converted_translit;
+
+ size_t len = strlen (locale_code);
+ char *locale_code_translit = XNMALLOC (len + 10 + 1, char);
+ memcpy (locale_code_translit, locale_code, len);
+ memcpy (locale_code_translit + len, "//TRANSLIT", 10 + 1);
+
+ converted_translit =
+ xstr_iconv (name_utf8, "UTF-8", locale_code_translit);
+
+ free (locale_code_translit);
+
+ if (converted_translit != NULL)
+ {
+# if !_LIBICONV_VERSION
+ /* Don't use the transliteration if it added question marks.
+ glibc's transliteration falls back to question marks; libiconv's
+ transliteration does not.
+ mbschr is equivalent to strchr in this case. */
+ if (strchr (converted_translit, '?') != NULL)
+ free (converted_translit);
+ else
+# endif
+ name_converted_translit = alloc_name_converted_translit =
+ converted_translit;
+ }
+ }
+# endif
+#endif
+ }
+ else
+ {
+ name_converted = name_utf8;
+ name_converted_translit = name_utf8;
+ }
+
+ /* The name in locale encoding. */
+ name = (name_converted != NULL ? name_converted :
+ name_converted_translit != NULL ? name_converted_translit :
+ name_ascii);
+
+ /* See whether we have a translation. Some translators have not understood
+ that they should use the UTF-8 form of the name, if possible. So if the
+ translator provided a no-op translation, we ignore it. */
+ if (strcmp (translation, name_ascii) != 0)
+ {
+ /* See whether the translation contains the original name. */
+ if (mbsstr_trimmed_wordbounded (translation, name_ascii)
+ || (name_converted != NULL
+ && mbsstr_trimmed_wordbounded (translation, name_converted))
+ || (name_converted_translit != NULL
+ && mbsstr_trimmed_wordbounded (translation, name_converted_translit)))
+ {
+ if (alloc_name_converted != NULL)
+ free (alloc_name_converted);
+ if (alloc_name_converted_translit != NULL)
+ free (alloc_name_converted_translit);
+ return translation;
+ }
+ else
+ {
+ /* Return "TRANSLATION (NAME)". */
+ char *result =
+ XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+
+ sprintf (result, "%s (%s)", translation, name);
+
+ if (alloc_name_converted != NULL)
+ free (alloc_name_converted);
+ if (alloc_name_converted_translit != NULL)
+ free (alloc_name_converted_translit);
+ return result;
+ }
+ }
+ else
+ {
+ if (alloc_name_converted != NULL && alloc_name_converted != name)
+ free (alloc_name_converted);
+ if (alloc_name_converted_translit != NULL
+ && alloc_name_converted_translit != name)
+ free (alloc_name_converted_translit);
+ return name;
+ }
+}
+
+#ifdef TEST1
+# include <locale.h>
+int
+main (int argc, char *argv[])
+{
+ setlocale (LC_ALL, "");
+ if (mbsstr_trimmed_wordbounded (argv[1], argv[2]))
+ printf("found\n");
+ return 0;
+}
+#endif
+
+#ifdef TEST2
+# include <locale.h>
+# include <stdio.h>
+int
+main (int argc, char *argv[])
+{
+ setlocale (LC_ALL, "");
+ printf ("%s\n", proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard"));
+ return 0;
+}
+#endif
diff --git a/lib/propername.h b/lib/propername.h
new file mode 100644
index 0000000..83fac08
--- /dev/null
+++ b/lib/propername.h
@@ -0,0 +1,106 @@
+/* Localization of proper names. -*- coding: utf-8 -*-
+ Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* INTRODUCTION
+
+ What do
+
+ Torbjörn Granlund (coreutils)
+ François Pinard (coreutils)
+ Danilo Šegan (gettext)
+
+ have in common?
+
+ A non-ASCII name. This causes trouble in the --version output. The simple
+ "solution" unfortunately mutilates the name.
+
+ $ du --version | grep Granlund
+ Écrit par Torbjorn Granlund, David MacKenzie, Paul Eggert et Jim Meyering.
+
+ $ ptx --version | grep Pinard
+ Écrit par F. Pinard.
+
+ What is desirable, is to print the full name if the output character set
+ allows it, and the ASCIIfied name only as a fallback.
+
+ $ recode-sr-latin --version
+ ...
+ Written by Danilo Šegan and Bruno Haible.
+
+ $ LC_ALL=C recode-sr-latin --version
+ ...
+ Written by Danilo Segan and Bruno Haible.
+
+ The 'propername' module does exactly this. Plus, for languages that use
+ a different writing system than the Latin alphabet, it allows a translator
+ to write the name using that different writing system. In that case the
+ output will look like this:
+ <translated name> (<original name in English>)
+
+ To use the 'propername' module requires three simple steps:
+
+ 1) Add it to the list of gnulib modules to import,
+
+ 2) Change the arguments of version_etc(),
+
+ from "Paul Eggert"
+ to proper_name ("Paul Eggert")
+
+ from "Torbjorn Granlund"
+ to proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund")
+
+ from "F. Pinard"
+ to proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard")
+
+ (Optionally, here you can also add / * TRANSLATORS: ... * / comments
+ explaining how the name is written or pronounced.)
+
+ 3) If you are using GNU gettext version 0.16.1 or older, in po/Makevars,
+ in the definition of the XGETTEXT_OPTIONS variable, add:
+
+ --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."'
+
+ This specifies automatic comments for the translator. (Requires
+ xgettext >= 0.15. The double-quotes inside the quoted string are on
+ purpose: they are part of the --keyword argument syntax.)
+ */
+
+#ifndef _PROPERNAME_H
+#define _PROPERNAME_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return the localization of NAME. NAME is written in ASCII. */
+extern const char * proper_name (const char *name) /* NOT attribute const */;
+
+/* Return the localization of a name whose original writing is not ASCII.
+ NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
+ escape sequences. NAME_ASCII is a fallback written only with ASCII
+ characters. */
+extern const char * proper_name_utf8 (const char *name_ascii,
+ const char *name_utf8);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _PROPERNAME_H */
diff --git a/lib/quote.h b/lib/quote.h
new file mode 100644
index 0000000..b53d0ea
--- /dev/null
+++ b/lib/quote.h
@@ -0,0 +1,46 @@
+/* quote.h - prototypes for quote.c
+
+ Copyright (C) 1998-2001, 2003, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef QUOTE_H_
+# define QUOTE_H_ 1
+
+# include <stddef.h>
+
+/* The quoting options used by quote_n and quote. Its type is incomplete,
+ so it's useful only in expressions like '&quote_quoting_options'. */
+extern struct quoting_options quote_quoting_options;
+
+/* Return an unambiguous printable representation of ARG (of size
+ ARGSIZE), allocated in slot N, suitable for diagnostics. If
+ ARGSIZE is SIZE_MAX, use the string length of the argument for
+ ARGSIZE. */
+char const *quote_n_mem (int n, char const *arg, size_t argsize);
+
+/* Return an unambiguous printable representation of ARG (of size
+ ARGSIZE), suitable for diagnostics. If ARGSIZE is SIZE_MAX, use
+ the string length of the argument for ARGSIZE. */
+char const *quote_mem (char const *arg, size_t argsize);
+
+/* Return an unambiguous printable representation of ARG, allocated in
+ slot N, suitable for diagnostics. */
+char const *quote_n (int n, char const *arg);
+
+/* Return an unambiguous printable representation of ARG, suitable for
+ diagnostics. */
+char const *quote (char const *arg);
+
+#endif /* !QUOTE_H_ */
diff --git a/lib/quotearg.c b/lib/quotearg.c
new file mode 100644
index 0000000..73a5084
--- /dev/null
+++ b/lib/quotearg.c
@@ -0,0 +1,1031 @@
+/* quotearg.c - quote arguments for output
+
+ Copyright (C) 1998-2002, 2004-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert <eggert@twinsun.com> */
+
+/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that
+ the quoting_options_from_style function might be candidate for
+ attribute 'pure' */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+#endif
+
+#include <config.h>
+
+#include "quotearg.h"
+#include "quote.h"
+
+#include "xalloc.h"
+#include "c-strcaseeq.h"
+#include "localcharset.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+
+#define INT_BITS (sizeof (int) * CHAR_BIT)
+
+struct quoting_options
+{
+ /* Basic quoting style. */
+ enum quoting_style style;
+
+ /* Additional flags. Bitwise combination of enum quoting_flags. */
+ int flags;
+
+ /* Quote the characters indicated by this bit vector even if the
+ quoting style would not normally require them to be quoted. */
+ unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1];
+
+ /* The left quote for custom_quoting_style. */
+ char const *left_quote;
+
+ /* The right quote for custom_quoting_style. */
+ char const *right_quote;
+};
+
+/* Names of quoting styles. */
+char const *const quoting_style_args[] =
+{
+ "literal",
+ "shell",
+ "shell-always",
+ "shell-escape",
+ "shell-escape-always",
+ "c",
+ "c-maybe",
+ "escape",
+ "locale",
+ "clocale",
+ 0
+};
+
+/* Correspondences to quoting style names. */
+enum quoting_style const quoting_style_vals[] =
+{
+ literal_quoting_style,
+ shell_quoting_style,
+ shell_always_quoting_style,
+ shell_escape_quoting_style,
+ shell_escape_always_quoting_style,
+ c_quoting_style,
+ c_maybe_quoting_style,
+ escape_quoting_style,
+ locale_quoting_style,
+ clocale_quoting_style
+};
+
+/* The default quoting options. */
+static struct quoting_options default_quoting_options;
+
+/* Allocate a new set of quoting options, with contents initially identical
+ to O if O is not null, or to the default if O is null.
+ It is the caller's responsibility to free the result. */
+struct quoting_options *
+clone_quoting_options (struct quoting_options *o)
+{
+ int e = errno;
+ struct quoting_options *p = xmemdup (o ? o : &default_quoting_options,
+ sizeof *o);
+ errno = e;
+ return p;
+}
+
+/* Get the value of O's quoting style. If O is null, use the default. */
+enum quoting_style
+get_quoting_style (struct quoting_options const *o)
+{
+ return (o ? o : &default_quoting_options)->style;
+}
+
+/* In O (or in the default if O is null),
+ set the value of the quoting style to S. */
+void
+set_quoting_style (struct quoting_options *o, enum quoting_style s)
+{
+ (o ? o : &default_quoting_options)->style = s;
+}
+
+/* In O (or in the default if O is null),
+ set the value of the quoting options for character C to I.
+ Return the old value. Currently, the only values defined for I are
+ 0 (the default) and 1 (which means to quote the character even if
+ it would not otherwise be quoted). */
+int
+set_char_quoting (struct quoting_options *o, char c, int i)
+{
+ unsigned char uc = c;
+ unsigned int *p =
+ (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
+ int shift = uc % INT_BITS;
+ int r = (*p >> shift) & 1;
+ *p ^= ((i & 1) ^ r) << shift;
+ return r;
+}
+
+/* In O (or in the default if O is null),
+ set the value of the quoting options flag to I, which can be a
+ bitwise combination of enum quoting_flags, or 0 for default
+ behavior. Return the old value. */
+int
+set_quoting_flags (struct quoting_options *o, int i)
+{
+ int r;
+ if (!o)
+ o = &default_quoting_options;
+ r = o->flags;
+ o->flags = i;
+ return r;
+}
+
+void
+set_custom_quoting (struct quoting_options *o,
+ char const *left_quote, char const *right_quote)
+{
+ if (!o)
+ o = &default_quoting_options;
+ o->style = custom_quoting_style;
+ if (!left_quote || !right_quote)
+ abort ();
+ o->left_quote = left_quote;
+ o->right_quote = right_quote;
+}
+
+/* Return quoting options for STYLE, with no extra quoting. */
+static struct quoting_options /* NOT PURE!! */
+quoting_options_from_style (enum quoting_style style)
+{
+ struct quoting_options o = { literal_quoting_style, 0, { 0 }, NULL, NULL };
+ if (style == custom_quoting_style)
+ abort ();
+ o.style = style;
+ return o;
+}
+
+/* MSGID approximates a quotation mark. Return its translation if it
+ has one; otherwise, return either it or "\"", depending on S.
+
+ S is either clocale_quoting_style or locale_quoting_style. */
+static char const *
+gettext_quote (char const *msgid, enum quoting_style s)
+{
+ char const *translation = _(msgid);
+ char const *locale_code;
+
+ if (translation != msgid)
+ return translation;
+
+ /* For UTF-8 and GB-18030, use single quotes U+2018 and U+2019.
+ Here is a list of other locales that include U+2018 and U+2019:
+
+ ISO-8859-7 0xA1 KOI8-T 0x91
+ CP869 0x8B CP874 0x91
+ CP932 0x81 0x65 CP936 0xA1 0xAE
+ CP949 0xA1 0xAE CP950 0xA1 0xA5
+ CP1250 0x91 CP1251 0x91
+ CP1252 0x91 CP1253 0x91
+ CP1254 0x91 CP1255 0x91
+ CP1256 0x91 CP1257 0x91
+ EUC-JP 0xA1 0xC6 EUC-KR 0xA1 0xAE
+ EUC-TW 0xA1 0xE4 BIG5 0xA1 0xA5
+ BIG5-HKSCS 0xA1 0xA5 EUC-CN 0xA1 0xAE
+ GBK 0xA1 0xAE Georgian-PS 0x91
+ PT154 0x91
+
+ None of these is still in wide use; using iconv is overkill. */
+ locale_code = locale_charset ();
+ if (STRCASEEQ (locale_code, "UTF-8", 'U','T','F','-','8',0,0,0,0))
+ return msgid[0] == '`' ? "\xe2\x80\x98": "\xe2\x80\x99";
+ if (STRCASEEQ (locale_code, "GB18030", 'G','B','1','8','0','3','0',0,0))
+ return msgid[0] == '`' ? "\xa1\ae": "\xa1\xaf";
+
+ return (s == clocale_quoting_style ? "\"" : "'");
+}
+
+/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
+ argument ARG (of size ARGSIZE), using QUOTING_STYLE, FLAGS, and
+ QUOTE_THESE_TOO to control quoting.
+ Terminate the output with a null character, and return the written
+ size of the output, not counting the terminating null.
+ If BUFFERSIZE is too small to store the output string, return the
+ value that would have been returned had BUFFERSIZE been large enough.
+ If ARGSIZE is SIZE_MAX, use the string length of the argument for ARGSIZE.
+
+ This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG,
+ ARGSIZE, O), except it breaks O into its component pieces and is
+ not careful about errno. */
+
+static size_t
+quotearg_buffer_restyled (char *buffer, size_t buffersize,
+ char const *arg, size_t argsize,
+ enum quoting_style quoting_style, int flags,
+ unsigned int const *quote_these_too,
+ char const *left_quote,
+ char const *right_quote)
+{
+ size_t i;
+ size_t len = 0;
+ char const *quote_string = 0;
+ size_t quote_string_len = 0;
+ bool backslash_escapes = false;
+ bool unibyte_locale = MB_CUR_MAX == 1;
+ bool elide_outer_quotes = (flags & QA_ELIDE_OUTER_QUOTES) != 0;
+ bool pending_shell_escape_end = false;
+
+#define STORE(c) \
+ do \
+ { \
+ if (len < buffersize) \
+ buffer[len] = (c); \
+ len++; \
+ } \
+ while (0)
+
+#define START_ESC() \
+ do \
+ { \
+ if (elide_outer_quotes) \
+ goto force_outer_quoting_style; \
+ escaping = true; \
+ if (quoting_style == shell_always_quoting_style \
+ && ! pending_shell_escape_end) \
+ { \
+ STORE ('\''); \
+ STORE ('$'); \
+ STORE ('\''); \
+ pending_shell_escape_end = true; \
+ } \
+ STORE ('\\'); \
+ } \
+ while (0)
+
+#define END_ESC() \
+ do \
+ { \
+ if (pending_shell_escape_end && ! escaping) \
+ { \
+ STORE ('\''); \
+ STORE ('\''); \
+ pending_shell_escape_end = false; \
+ } \
+ } \
+ while (0)
+
+ switch (quoting_style)
+ {
+ case c_maybe_quoting_style:
+ quoting_style = c_quoting_style;
+ elide_outer_quotes = true;
+ /* Fall through. */
+ case c_quoting_style:
+ if (!elide_outer_quotes)
+ STORE ('"');
+ backslash_escapes = true;
+ quote_string = "\"";
+ quote_string_len = 1;
+ break;
+
+ case escape_quoting_style:
+ backslash_escapes = true;
+ elide_outer_quotes = false;
+ break;
+
+ case locale_quoting_style:
+ case clocale_quoting_style:
+ case custom_quoting_style:
+ {
+ if (quoting_style != custom_quoting_style)
+ {
+ /* TRANSLATORS:
+ Get translations for open and closing quotation marks.
+ The message catalog should translate "`" to a left
+ quotation mark suitable for the locale, and similarly for
+ "'". For example, a French Unicode local should translate
+ these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+ QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+ QUOTATION MARK), respectively.
+
+ If the catalog has no translation, we will try to
+ use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+ Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+ current locale is not Unicode, locale_quoting_style
+ will quote 'like this', and clocale_quoting_style will
+ quote "like this". You should always include translations
+ for "`" and "'" even if U+2018 and U+2019 are appropriate
+ for your locale.
+
+ If you don't know what to put here, please see
+ <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+ and use glyphs suitable for your language. */
+ left_quote = gettext_quote (N_("`"), quoting_style);
+ right_quote = gettext_quote (N_("'"), quoting_style);
+ }
+ if (!elide_outer_quotes)
+ for (quote_string = left_quote; *quote_string; quote_string++)
+ STORE (*quote_string);
+ backslash_escapes = true;
+ quote_string = right_quote;
+ quote_string_len = strlen (quote_string);
+ }
+ break;
+
+ case shell_escape_quoting_style:
+ backslash_escapes = true;
+ /* Fall through. */
+ case shell_quoting_style:
+ elide_outer_quotes = true;
+ /* Fall through. */
+ case shell_escape_always_quoting_style:
+ if (!elide_outer_quotes)
+ backslash_escapes = true;
+ /* Fall through. */
+ case shell_always_quoting_style:
+ quoting_style = shell_always_quoting_style;
+ if (!elide_outer_quotes)
+ STORE ('\'');
+ quote_string = "'";
+ quote_string_len = 1;
+ break;
+
+ case literal_quoting_style:
+ elide_outer_quotes = false;
+ break;
+
+ default:
+ abort ();
+ }
+
+ for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++)
+ {
+ unsigned char c;
+ unsigned char esc;
+ bool is_right_quote = false;
+ bool escaping = false;
+
+ if (backslash_escapes
+ && quoting_style != shell_always_quoting_style
+ && quote_string_len
+ && (i + quote_string_len
+ <= (argsize == SIZE_MAX && 1 < quote_string_len
+ /* Use strlen only if we must: when argsize is SIZE_MAX,
+ and when the quote string is more than 1 byte long.
+ If we do call strlen, save the result. */
+ ? (argsize = strlen (arg)) : argsize))
+ && memcmp (arg + i, quote_string, quote_string_len) == 0)
+ {
+ if (elide_outer_quotes)
+ goto force_outer_quoting_style;
+ is_right_quote = true;
+ }
+
+ c = arg[i];
+ switch (c)
+ {
+ case '\0':
+ if (backslash_escapes)
+ {
+ START_ESC ();
+ /* If quote_string were to begin with digits, we'd need to
+ test for the end of the arg as well. However, it's
+ hard to imagine any locale that would use digits in
+ quotes, and set_custom_quoting is documented not to
+ accept them. Use only a single \0 with shell-escape
+ as currently digits are not printed within $'...' */
+ if (quoting_style != shell_always_quoting_style
+ && i + 1 < argsize && '0' <= arg[i + 1] && arg[i + 1] <= '9')
+ {
+ STORE ('0');
+ STORE ('0');
+ }
+ c = '0';
+ /* We don't have to worry that this last '0' will be
+ backslash-escaped because, again, quote_string should
+ not start with it and because quote_these_too is
+ documented as not accepting it. */
+ }
+ else if (flags & QA_ELIDE_NULL_BYTES)
+ continue;
+ break;
+
+ case '?':
+ switch (quoting_style)
+ {
+ case shell_always_quoting_style:
+ if (elide_outer_quotes)
+ goto force_outer_quoting_style;
+ break;
+
+ case c_quoting_style:
+ if ((flags & QA_SPLIT_TRIGRAPHS)
+ && i + 2 < argsize && arg[i + 1] == '?')
+ switch (arg[i + 2])
+ {
+ case '!': case '\'':
+ case '(': case ')': case '-': case '/':
+ case '<': case '=': case '>':
+ /* Escape the second '?' in what would otherwise be
+ a trigraph. */
+ if (elide_outer_quotes)
+ goto force_outer_quoting_style;
+ c = arg[i + 2];
+ i += 2;
+ STORE ('?');
+ STORE ('"');
+ STORE ('"');
+ STORE ('?');
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case '\a': esc = 'a'; goto c_escape;
+ case '\b': esc = 'b'; goto c_escape;
+ case '\f': esc = 'f'; goto c_escape;
+ case '\n': esc = 'n'; goto c_and_shell_escape;
+ case '\r': esc = 'r'; goto c_and_shell_escape;
+ case '\t': esc = 't'; goto c_and_shell_escape;
+ case '\v': esc = 'v'; goto c_escape;
+ case '\\': esc = c;
+ /* Never need to escape '\' in shell case. */
+ if (quoting_style == shell_always_quoting_style)
+ {
+ if (elide_outer_quotes)
+ goto force_outer_quoting_style;
+ goto store_c;
+ }
+
+ /* No need to escape the escape if we are trying to elide
+ outer quotes and nothing else is problematic. */
+ if (backslash_escapes && elide_outer_quotes && quote_string_len)
+ goto store_c;
+
+ c_and_shell_escape:
+ if (quoting_style == shell_always_quoting_style
+ && elide_outer_quotes)
+ goto force_outer_quoting_style;
+ /* Fall through. */
+ c_escape:
+ if (backslash_escapes)
+ {
+ c = esc;
+ goto store_escape;
+ }
+ break;
+
+ case '{': case '}': /* sometimes special if isolated */
+ if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1))
+ break;
+ /* Fall through. */
+ case '#': case '~':
+ if (i != 0)
+ break;
+ /* Fall through. */
+ case ' ':
+ case '!': /* special in bash */
+ case '"': case '$': case '&':
+ case '(': case ')': case '*': case ';':
+ case '<':
+ case '=': /* sometimes special in 0th or (with "set -k") later args */
+ case '>': case '[':
+ case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
+ case '`': case '|':
+ /* A shell special character. In theory, '$' and '`' could
+ be the first bytes of multibyte characters, which means
+ we should check them with mbrtowc, but in practice this
+ doesn't happen so it's not worth worrying about. */
+ if (quoting_style == shell_always_quoting_style
+ && elide_outer_quotes)
+ goto force_outer_quoting_style;
+ break;
+
+ case '\'':
+ if (quoting_style == shell_always_quoting_style)
+ {
+ if (elide_outer_quotes)
+ goto force_outer_quoting_style;
+ STORE ('\'');
+ STORE ('\\');
+ STORE ('\'');
+ pending_shell_escape_end = false;
+ }
+ break;
+
+ case '%': case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9': case ':':
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case ']': case '_': case 'a': case 'b':
+ case 'c': case 'd': case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
+ case 'o': case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
+ /* These characters don't cause problems, no matter what the
+ quoting style is. They cannot start multibyte sequences.
+ A digit or a special letter would cause trouble if it
+ appeared at the beginning of quote_string because we'd then
+ escape by prepending a backslash. However, it's hard to
+ imagine any locale that would use digits or letters as
+ quotes, and set_custom_quoting is documented not to accept
+ them. Also, a digit or a special letter would cause
+ trouble if it appeared in quote_these_too, but that's also
+ documented as not accepting them. */
+ break;
+
+ default:
+ /* If we have a multibyte sequence, copy it until we reach
+ its end, find an error, or come back to the initial shift
+ state. For C-like styles, if the sequence has
+ unprintable characters, escape the whole sequence, since
+ we can't easily escape single characters within it. */
+ {
+ /* Length of multibyte sequence found so far. */
+ size_t m;
+
+ bool printable;
+
+ if (unibyte_locale)
+ {
+ m = 1;
+ printable = isprint (c) != 0;
+ }
+ else
+ {
+ mbstate_t mbstate;
+ memset (&mbstate, 0, sizeof mbstate);
+
+ m = 0;
+ printable = true;
+ if (argsize == SIZE_MAX)
+ argsize = strlen (arg);
+
+ do
+ {
+ wchar_t w;
+ size_t bytes = mbrtowc (&w, &arg[i + m],
+ argsize - (i + m), &mbstate);
+ if (bytes == 0)
+ break;
+ else if (bytes == (size_t) -1)
+ {
+ printable = false;
+ break;
+ }
+ else if (bytes == (size_t) -2)
+ {
+ printable = false;
+ while (i + m < argsize && arg[i + m])
+ m++;
+ break;
+ }
+ else
+ {
+ /* Work around a bug with older shells that "see" a '\'
+ that is really the 2nd byte of a multibyte character.
+ In practice the problem is limited to ASCII
+ chars >= '@' that are shell special chars. */
+ if ('[' == 0x5b && elide_outer_quotes
+ && quoting_style == shell_always_quoting_style)
+ {
+ size_t j;
+ for (j = 1; j < bytes; j++)
+ switch (arg[i + m + j])
+ {
+ case '[': case '\\': case '^':
+ case '`': case '|':
+ goto force_outer_quoting_style;
+
+ default:
+ break;
+ }
+ }
+
+ if (! iswprint (w))
+ printable = false;
+ m += bytes;
+ }
+ }
+ while (! mbsinit (&mbstate));
+ }
+
+ if (1 < m || (backslash_escapes && ! printable))
+ {
+ /* Output a multibyte sequence, or an escaped
+ unprintable unibyte character. */
+ size_t ilim = i + m;
+
+ for (;;)
+ {
+ if (backslash_escapes && ! printable)
+ {
+ START_ESC ();
+ STORE ('0' + (c >> 6));
+ STORE ('0' + ((c >> 3) & 7));
+ c = '0' + (c & 7);
+ }
+ else if (is_right_quote)
+ {
+ STORE ('\\');
+ is_right_quote = false;
+ }
+ if (ilim <= i + 1)
+ break;
+ END_ESC ();
+ STORE (c);
+ c = arg[++i];
+ }
+
+ goto store_c;
+ }
+ }
+ }
+
+ if (! (((backslash_escapes && quoting_style != shell_always_quoting_style)
+ || elide_outer_quotes)
+ && quote_these_too
+ && quote_these_too[c / INT_BITS] >> (c % INT_BITS) & 1)
+ && !is_right_quote)
+ goto store_c;
+
+ store_escape:
+ START_ESC ();
+
+ store_c:
+ END_ESC ();
+ STORE (c);
+ }
+
+ if (len == 0 && quoting_style == shell_always_quoting_style
+ && elide_outer_quotes)
+ goto force_outer_quoting_style;
+
+ if (quote_string && !elide_outer_quotes)
+ for (; *quote_string; quote_string++)
+ STORE (*quote_string);
+
+ if (len < buffersize)
+ buffer[len] = '\0';
+ return len;
+
+ force_outer_quoting_style:
+ /* Don't reuse quote_these_too, since the addition of outer quotes
+ sufficiently quotes the specified characters. */
+ if (quoting_style == shell_always_quoting_style && backslash_escapes)
+ quoting_style = shell_escape_always_quoting_style;
+ return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
+ quoting_style,
+ flags & ~QA_ELIDE_OUTER_QUOTES, NULL,
+ left_quote, right_quote);
+}
+
+/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
+ argument ARG (of size ARGSIZE), using O to control quoting.
+ If O is null, use the default.
+ Terminate the output with a null character, and return the written
+ size of the output, not counting the terminating null.
+ If BUFFERSIZE is too small to store the output string, return the
+ value that would have been returned had BUFFERSIZE been large enough.
+ If ARGSIZE is SIZE_MAX, use the string length of the argument for
+ ARGSIZE. */
+size_t
+quotearg_buffer (char *buffer, size_t buffersize,
+ char const *arg, size_t argsize,
+ struct quoting_options const *o)
+{
+ struct quoting_options const *p = o ? o : &default_quoting_options;
+ int e = errno;
+ size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
+ p->style, p->flags, p->quote_these_too,
+ p->left_quote, p->right_quote);
+ errno = e;
+ return r;
+}
+
+/* Equivalent to quotearg_alloc (ARG, ARGSIZE, NULL, O). */
+char *
+quotearg_alloc (char const *arg, size_t argsize,
+ struct quoting_options const *o)
+{
+ return quotearg_alloc_mem (arg, argsize, NULL, o);
+}
+
+/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly
+ allocated storage containing the quoted string, and store the
+ resulting size into *SIZE, if non-NULL. The result can contain
+ embedded null bytes only if ARGSIZE is not SIZE_MAX, SIZE is not
+ NULL, and set_quoting_flags has not set the null byte elision
+ flag. */
+char *
+quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size,
+ struct quoting_options const *o)
+{
+ struct quoting_options const *p = o ? o : &default_quoting_options;
+ int e = errno;
+ /* Elide embedded null bytes if we can't return a size. */
+ int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES);
+ size_t bufsize = quotearg_buffer_restyled (0, 0, arg, argsize, p->style,
+ flags, p->quote_these_too,
+ p->left_quote,
+ p->right_quote) + 1;
+ char *buf = xcharalloc (bufsize);
+ quotearg_buffer_restyled (buf, bufsize, arg, argsize, p->style, flags,
+ p->quote_these_too,
+ p->left_quote, p->right_quote);
+ errno = e;
+ if (size)
+ *size = bufsize - 1;
+ return buf;
+}
+
+/* A storage slot with size and pointer to a value. */
+struct slotvec
+{
+ size_t size;
+ char *val;
+};
+
+/* Preallocate a slot 0 buffer, so that the caller can always quote
+ one small component of a "memory exhausted" message in slot 0. */
+static char slot0[256];
+static unsigned int nslots = 1;
+static struct slotvec slotvec0 = {sizeof slot0, slot0};
+static struct slotvec *slotvec = &slotvec0;
+
+void
+quotearg_free (void)
+{
+ struct slotvec *sv = slotvec;
+ unsigned int i;
+ for (i = 1; i < nslots; i++)
+ free (sv[i].val);
+ if (sv[0].val != slot0)
+ {
+ free (sv[0].val);
+ slotvec0.size = sizeof slot0;
+ slotvec0.val = slot0;
+ }
+ if (sv != &slotvec0)
+ {
+ free (sv);
+ slotvec = &slotvec0;
+ }
+ nslots = 1;
+}
+
+/* Use storage slot N to return a quoted version of argument ARG.
+ ARG is of size ARGSIZE, but if that is SIZE_MAX, ARG is a
+ null-terminated string.
+ OPTIONS specifies the quoting options.
+ The returned value points to static storage that can be
+ reused by the next call to this function with the same value of N.
+ N must be nonnegative. N is deliberately declared with type "int"
+ to allow for future extensions (using negative values). */
+static char *
+quotearg_n_options (int n, char const *arg, size_t argsize,
+ struct quoting_options const *options)
+{
+ int e = errno;
+
+ unsigned int n0 = n;
+ struct slotvec *sv = slotvec;
+
+ if (n < 0)
+ abort ();
+
+ if (nslots <= n0)
+ {
+ /* FIXME: technically, the type of n1 should be 'unsigned int',
+ but that evokes an unsuppressible warning from gcc-4.0.1 and
+ older. If gcc ever provides an option to suppress that warning,
+ revert to the original type, so that the test in xalloc_oversized
+ is once again performed only at compile time. */
+ size_t n1 = n0 + 1;
+ bool preallocated = (sv == &slotvec0);
+
+ if (xalloc_oversized (n1, sizeof *sv))
+ xalloc_die ();
+
+ slotvec = sv = xrealloc (preallocated ? NULL : sv, n1 * sizeof *sv);
+ if (preallocated)
+ *sv = slotvec0;
+ memset (sv + nslots, 0, (n1 - nslots) * sizeof *sv);
+ nslots = n1;
+ }
+
+ {
+ size_t size = sv[n].size;
+ char *val = sv[n].val;
+ /* Elide embedded null bytes since we don't return a size. */
+ int flags = options->flags | QA_ELIDE_NULL_BYTES;
+ size_t qsize = quotearg_buffer_restyled (val, size, arg, argsize,
+ options->style, flags,
+ options->quote_these_too,
+ options->left_quote,
+ options->right_quote);
+
+ if (size <= qsize)
+ {
+ sv[n].size = size = qsize + 1;
+ if (val != slot0)
+ free (val);
+ sv[n].val = val = xcharalloc (size);
+ quotearg_buffer_restyled (val, size, arg, argsize, options->style,
+ flags, options->quote_these_too,
+ options->left_quote,
+ options->right_quote);
+ }
+
+ errno = e;
+ return val;
+ }
+}
+
+char *
+quotearg_n (int n, char const *arg)
+{
+ return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options);
+}
+
+char *
+quotearg_n_mem (int n, char const *arg, size_t argsize)
+{
+ return quotearg_n_options (n, arg, argsize, &default_quoting_options);
+}
+
+char *
+quotearg (char const *arg)
+{
+ return quotearg_n (0, arg);
+}
+
+char *
+quotearg_mem (char const *arg, size_t argsize)
+{
+ return quotearg_n_mem (0, arg, argsize);
+}
+
+char *
+quotearg_n_style (int n, enum quoting_style s, char const *arg)
+{
+ struct quoting_options const o = quoting_options_from_style (s);
+ return quotearg_n_options (n, arg, SIZE_MAX, &o);
+}
+
+char *
+quotearg_n_style_mem (int n, enum quoting_style s,
+ char const *arg, size_t argsize)
+{
+ struct quoting_options const o = quoting_options_from_style (s);
+ return quotearg_n_options (n, arg, argsize, &o);
+}
+
+char *
+quotearg_style (enum quoting_style s, char const *arg)
+{
+ return quotearg_n_style (0, s, arg);
+}
+
+char *
+quotearg_style_mem (enum quoting_style s, char const *arg, size_t argsize)
+{
+ return quotearg_n_style_mem (0, s, arg, argsize);
+}
+
+char *
+quotearg_char_mem (char const *arg, size_t argsize, char ch)
+{
+ struct quoting_options options;
+ options = default_quoting_options;
+ set_char_quoting (&options, ch, 1);
+ return quotearg_n_options (0, arg, argsize, &options);
+}
+
+char *
+quotearg_char (char const *arg, char ch)
+{
+ return quotearg_char_mem (arg, SIZE_MAX, ch);
+}
+
+char *
+quotearg_colon (char const *arg)
+{
+ return quotearg_char (arg, ':');
+}
+
+char *
+quotearg_colon_mem (char const *arg, size_t argsize)
+{
+ return quotearg_char_mem (arg, argsize, ':');
+}
+
+char *
+quotearg_n_style_colon (int n, enum quoting_style s, char const *arg)
+{
+ struct quoting_options options;
+ options = quoting_options_from_style (s);
+ set_char_quoting (&options, ':', 1);
+ return quotearg_n_options (n, arg, SIZE_MAX, &options);
+}
+
+char *
+quotearg_n_custom (int n, char const *left_quote,
+ char const *right_quote, char const *arg)
+{
+ return quotearg_n_custom_mem (n, left_quote, right_quote, arg,
+ SIZE_MAX);
+}
+
+char *
+quotearg_n_custom_mem (int n, char const *left_quote,
+ char const *right_quote,
+ char const *arg, size_t argsize)
+{
+ struct quoting_options o = default_quoting_options;
+ set_custom_quoting (&o, left_quote, right_quote);
+ return quotearg_n_options (n, arg, argsize, &o);
+}
+
+char *
+quotearg_custom (char const *left_quote, char const *right_quote,
+ char const *arg)
+{
+ return quotearg_n_custom (0, left_quote, right_quote, arg);
+}
+
+char *
+quotearg_custom_mem (char const *left_quote, char const *right_quote,
+ char const *arg, size_t argsize)
+{
+ return quotearg_n_custom_mem (0, left_quote, right_quote, arg,
+ argsize);
+}
+
+
+/* The quoting option used by the functions of quote.h. */
+struct quoting_options quote_quoting_options =
+ {
+ locale_quoting_style,
+ 0,
+ { 0 },
+ NULL, NULL
+ };
+
+char const *
+quote_n_mem (int n, char const *arg, size_t argsize)
+{
+ return quotearg_n_options (n, arg, argsize, &quote_quoting_options);
+}
+
+char const *
+quote_mem (char const *arg, size_t argsize)
+{
+ return quote_n_mem (0, arg, argsize);
+}
+
+char const *
+quote_n (int n, char const *arg)
+{
+ return quote_n_mem (n, arg, SIZE_MAX);
+}
+
+char const *
+quote (char const *arg)
+{
+ return quote_n (0, arg);
+}
diff --git a/lib/quotearg.h b/lib/quotearg.h
new file mode 100644
index 0000000..bc29052
--- /dev/null
+++ b/lib/quotearg.h
@@ -0,0 +1,425 @@
+/* quotearg.h - quote arguments for output
+
+ Copyright (C) 1998-2002, 2004, 2006, 2008-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert <eggert@twinsun.com> */
+
+#ifndef QUOTEARG_H_
+# define QUOTEARG_H_ 1
+
+# include <stddef.h>
+
+/* Basic quoting styles. For each style, an example is given on the
+ input strings "simple", "\0 \t\n'\"\033?""?/\\", and "a:b", using
+ quotearg_buffer, quotearg_mem, and quotearg_colon_mem with that
+ style and the default flags and quoted characters. Note that the
+ examples are shown here as valid C strings rather than what
+ displays on a terminal (with "??/" as a trigraph for "\\"). */
+enum quoting_style
+ {
+ /* Output names as-is (ls --quoting-style=literal). Can result in
+ embedded null bytes if QA_ELIDE_NULL_BYTES is not in
+ effect.
+
+ quotearg_buffer:
+ "simple", "\0 \t\n'\"\033??/\\", "a:b"
+ quotearg:
+ "simple", " \t\n'\"\033??/\\", "a:b"
+ quotearg_colon:
+ "simple", " \t\n'\"\033??/\\", "a:b"
+ */
+ literal_quoting_style,
+
+ /* Quote names for the shell if they contain shell metacharacters
+ or would cause ambiguous output (ls --quoting-style=shell).
+ Can result in embedded null bytes if QA_ELIDE_NULL_BYTES is not
+ in effect.
+
+ quotearg_buffer:
+ "simple", "'\0 \t\n'\\''\"\033??/\\'", "a:b"
+ quotearg:
+ "simple", "' \t\n'\\''\"\033??/\\'", "a:b"
+ quotearg_colon:
+ "simple", "' \t\n'\\''\"\033??/\\'", "'a:b'"
+ */
+ shell_quoting_style,
+
+ /* Quote names for the shell, even if they would normally not
+ require quoting (ls --quoting-style=shell-always). Can result
+ in embedded null bytes if QA_ELIDE_NULL_BYTES is not in effect.
+ Behaves like shell_quoting_style if QA_ELIDE_OUTER_QUOTES is in
+ effect.
+
+ quotearg_buffer:
+ "'simple'", "'\0 \t\n'\\''\"\033??/\\'", "'a:b'"
+ quotearg:
+ "'simple'", "' \t\n'\\''\"\033??/\\'", "'a:b'"
+ quotearg_colon:
+ "'simple'", "' \t\n'\\''\"\033??/\\'", "'a:b'"
+ */
+ shell_always_quoting_style,
+
+ /* Quote names for the shell if they contain shell metacharacters
+ or other problematic characters (ls --quoting-style=shell-escape).
+ Non printable characters are quoted using the $'...' syntax,
+ which originated in ksh93 and is widely supported by most shells,
+ and proposed for inclusion in POSIX.
+
+ quotearg_buffer:
+ "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "a:b"
+ quotearg:
+ "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "a:b"
+ quotearg_colon:
+ "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "'a:b'"
+ */
+ shell_escape_quoting_style,
+
+ /* Quote names for the shell even if they would normally not
+ require quoting (ls --quoting-style=shell-escape).
+ Non printable characters are quoted using the $'...' syntax,
+ which originated in ksh93 and is widely supported by most shells,
+ and proposed for inclusion in POSIX. Behaves like
+ shell_escape_quoting_style if QA_ELIDE_OUTER_QUOTES is in effect.
+
+ quotearg_buffer:
+ "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "a:b"
+ quotearg:
+ "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "a:b"
+ quotearg_colon:
+ "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "'a:b'"
+ */
+ shell_escape_always_quoting_style,
+
+ /* Quote names as for a C language string (ls --quoting-style=c).
+ Behaves like c_maybe_quoting_style if QA_ELIDE_OUTER_QUOTES is
+ in effect. Split into consecutive strings if
+ QA_SPLIT_TRIGRAPHS.
+
+ quotearg_buffer:
+ "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\""
+ quotearg:
+ "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\""
+ quotearg_colon:
+ "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a\\:b\""
+ */
+ c_quoting_style,
+
+ /* Like c_quoting_style except omit the surrounding double-quote
+ characters if no quoted characters are encountered.
+
+ quotearg_buffer:
+ "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "a:b"
+ quotearg:
+ "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "a:b"
+ quotearg_colon:
+ "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\""
+ */
+ c_maybe_quoting_style,
+
+ /* Like c_quoting_style except always omit the surrounding
+ double-quote characters and ignore QA_SPLIT_TRIGRAPHS
+ (ls --quoting-style=escape).
+
+ quotearg_buffer:
+ "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b"
+ quotearg:
+ "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b"
+ quotearg_colon:
+ "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a\\:b"
+ */
+ escape_quoting_style,
+
+ /* Like clocale_quoting_style, but use single quotes in the
+ default C locale or if the program does not use gettext
+ (ls --quoting-style=locale). For UTF-8 locales, quote
+ characters will use Unicode.
+
+ LC_MESSAGES=C
+ quotearg_buffer:
+ "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a:b'"
+ quotearg:
+ "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a:b'"
+ quotearg_colon:
+ "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a\\:b'"
+
+ LC_MESSAGES=pt_PT.utf8
+ quotearg_buffer:
+ "\302\253simple\302\273",
+ "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273"
+ quotearg:
+ "\302\253simple\302\273",
+ "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273"
+ quotearg_colon:
+ "\302\253simple\302\273",
+ "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273"
+ */
+ locale_quoting_style,
+
+ /* Like c_quoting_style except use quotation marks appropriate for
+ the locale and ignore QA_SPLIT_TRIGRAPHS
+ (ls --quoting-style=clocale).
+
+ LC_MESSAGES=C
+ quotearg_buffer:
+ "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\""
+ quotearg:
+ "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\""
+ quotearg_colon:
+ "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a\\:b\""
+
+ LC_MESSAGES=pt_PT.utf8
+ quotearg_buffer:
+ "\302\253simple\302\273",
+ "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273"
+ quotearg:
+ "\302\253simple\302\273",
+ "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273"
+ quotearg_colon:
+ "\302\253simple\302\273",
+ "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273"
+ */
+ clocale_quoting_style,
+
+ /* Like clocale_quoting_style except use the custom quotation marks
+ set by set_custom_quoting. If custom quotation marks are not
+ set, the behavior is undefined.
+
+ left_quote = right_quote = "'"
+ quotearg_buffer:
+ "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'"
+ quotearg:
+ "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'"
+ quotearg_colon:
+ "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a\\:b'"
+
+ left_quote = "(" and right_quote = ")"
+ quotearg_buffer:
+ "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)"
+ quotearg:
+ "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)"
+ quotearg_colon:
+ "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a\\:b)"
+
+ left_quote = ":" and right_quote = " "
+ quotearg_buffer:
+ ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b "
+ quotearg:
+ ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b "
+ quotearg_colon:
+ ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a\\:b "
+
+ left_quote = "\"'" and right_quote = "'\""
+ Notice that this is treated as a single level of quotes or two
+ levels where the outer quote need not be escaped within the inner
+ quotes. For two levels where the outer quote must be escaped
+ within the inner quotes, you must use separate quotearg
+ invocations.
+ quotearg_buffer:
+ "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\""
+ quotearg:
+ "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\""
+ quotearg_colon:
+ "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a\\:b'\""
+ */
+ custom_quoting_style
+ };
+
+/* Flags for use in set_quoting_flags. */
+enum quoting_flags
+ {
+ /* Always elide null bytes from styles that do not quote them,
+ even when the length of the result is available to the
+ caller. */
+ QA_ELIDE_NULL_BYTES = 0x01,
+
+ /* Omit the surrounding quote characters if no escaped characters
+ are encountered. Note that if no other character needs
+ escaping, then neither does the escape character. */
+ QA_ELIDE_OUTER_QUOTES = 0x02,
+
+ /* In the c_quoting_style and c_maybe_quoting_style, split ANSI
+ trigraph sequences into concatenated strings (for example,
+ "?""?/" rather than "??/", which could be confused with
+ "\\"). */
+ QA_SPLIT_TRIGRAPHS = 0x04
+ };
+
+/* For now, --quoting-style=literal is the default, but this may change. */
+# ifndef DEFAULT_QUOTING_STYLE
+# define DEFAULT_QUOTING_STYLE literal_quoting_style
+# endif
+
+/* Names of quoting styles and their corresponding values. */
+extern char const *const quoting_style_args[];
+extern enum quoting_style const quoting_style_vals[];
+
+struct quoting_options;
+
+/* The functions listed below set and use a hidden variable
+ that contains the default quoting style options. */
+
+/* Allocate a new set of quoting options, with contents initially identical
+ to O if O is not null, or to the default if O is null.
+ It is the caller's responsibility to free the result. */
+struct quoting_options *clone_quoting_options (struct quoting_options *o);
+
+/* Get the value of O's quoting style. If O is null, use the default. */
+enum quoting_style get_quoting_style (struct quoting_options const *o);
+
+/* In O (or in the default if O is null),
+ set the value of the quoting style to S. */
+void set_quoting_style (struct quoting_options *o, enum quoting_style s);
+
+/* In O (or in the default if O is null),
+ set the value of the quoting options for character C to I.
+ Return the old value. Currently, the only values defined for I are
+ 0 (the default) and 1 (which means to quote the character even if
+ it would not otherwise be quoted). C must never be a digit or a
+ letter that has special meaning after a backslash (for example, "\t"
+ for tab). */
+int set_char_quoting (struct quoting_options *o, char c, int i);
+
+/* In O (or in the default if O is null),
+ set the value of the quoting options flag to I, which can be a
+ bitwise combination of enum quoting_flags, or 0 for default
+ behavior. Return the old value. */
+int set_quoting_flags (struct quoting_options *o, int i);
+
+/* In O (or in the default if O is null),
+ set the value of the quoting style to custom_quoting_style,
+ set the left quote to LEFT_QUOTE, and set the right quote to
+ RIGHT_QUOTE. Each of LEFT_QUOTE and RIGHT_QUOTE must be
+ null-terminated and can be the empty string. Because backslashes are
+ used for escaping, it does not make sense for RIGHT_QUOTE to contain
+ a backslash. RIGHT_QUOTE must not begin with a digit or a letter
+ that has special meaning after a backslash (for example, "\t" for
+ tab). */
+void set_custom_quoting (struct quoting_options *o,
+ char const *left_quote,
+ char const *right_quote);
+
+/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
+ argument ARG (of size ARGSIZE), using O to control quoting.
+ If O is null, use the default.
+ Terminate the output with a null character, and return the written
+ size of the output, not counting the terminating null.
+ If BUFFERSIZE is too small to store the output string, return the
+ value that would have been returned had BUFFERSIZE been large enough.
+ If ARGSIZE is -1, use the string length of the argument for ARGSIZE.
+ On output, BUFFER might contain embedded null bytes if ARGSIZE was
+ not -1, the style of O does not use backslash escapes, and the
+ flags of O do not request elision of null bytes.*/
+size_t quotearg_buffer (char *buffer, size_t buffersize,
+ char const *arg, size_t argsize,
+ struct quoting_options const *o);
+
+/* Like quotearg_buffer, except return the result in a newly allocated
+ buffer. It is the caller's responsibility to free the result. The
+ result will not contain embedded null bytes. */
+char *quotearg_alloc (char const *arg, size_t argsize,
+ struct quoting_options const *o);
+
+/* Like quotearg_alloc, except that the length of the result,
+ excluding the terminating null byte, is stored into SIZE if it is
+ non-NULL. The result might contain embedded null bytes if ARGSIZE
+ was not -1, SIZE was not NULL, the style of O does not use
+ backslash escapes, and the flags of O do not request elision of
+ null bytes.*/
+char *quotearg_alloc_mem (char const *arg, size_t argsize,
+ size_t *size, struct quoting_options const *o);
+
+/* Use storage slot N to return a quoted version of the string ARG.
+ Use the default quoting options.
+ The returned value points to static storage that can be
+ reused by the next call to this function with the same value of N.
+ N must be nonnegative. The output of all functions in the
+ quotearg_n family are guaranteed to not contain embedded null
+ bytes.*/
+char *quotearg_n (int n, char const *arg);
+
+/* Equivalent to quotearg_n (0, ARG). */
+char *quotearg (char const *arg);
+
+/* Use storage slot N to return a quoted version of the argument ARG
+ of size ARGSIZE. This is like quotearg_n (N, ARG), except it can
+ quote null bytes. */
+char *quotearg_n_mem (int n, char const *arg, size_t argsize);
+
+/* Equivalent to quotearg_n_mem (0, ARG, ARGSIZE). */
+char *quotearg_mem (char const *arg, size_t argsize);
+
+/* Use style S and storage slot N to return a quoted version of the string ARG.
+ This is like quotearg_n (N, ARG), except that it uses S with no other
+ options to specify the quoting method. */
+char *quotearg_n_style (int n, enum quoting_style s, char const *arg);
+
+/* Use style S and storage slot N to return a quoted version of the
+ argument ARG of size ARGSIZE. This is like quotearg_n_style
+ (N, S, ARG), except it can quote null bytes. */
+char *quotearg_n_style_mem (int n, enum quoting_style s,
+ char const *arg, size_t argsize);
+
+/* Equivalent to quotearg_n_style (0, S, ARG). */
+char *quotearg_style (enum quoting_style s, char const *arg);
+
+/* Equivalent to quotearg_n_style_mem (0, S, ARG, ARGSIZE). */
+char *quotearg_style_mem (enum quoting_style s,
+ char const *arg, size_t argsize);
+
+/* Like quotearg (ARG), except also quote any instances of CH.
+ See set_char_quoting for a description of acceptable CH values. */
+char *quotearg_char (char const *arg, char ch);
+
+/* Like quotearg_char (ARG, CH), except it can quote null bytes. */
+char *quotearg_char_mem (char const *arg, size_t argsize, char ch);
+
+/* Equivalent to quotearg_char (ARG, ':'). */
+char *quotearg_colon (char const *arg);
+
+/* Like quotearg_colon (ARG), except it can quote null bytes. */
+char *quotearg_colon_mem (char const *arg, size_t argsize);
+
+/* Like quotearg_n_style, except with ':' quoting enabled. */
+char *quotearg_n_style_colon (int n, enum quoting_style s, char const *arg);
+
+/* Like quotearg_n_style (N, S, ARG) but with S as custom_quoting_style
+ with left quote as LEFT_QUOTE and right quote as RIGHT_QUOTE. See
+ set_custom_quoting for a description of acceptable LEFT_QUOTE and
+ RIGHT_QUOTE values. */
+char *quotearg_n_custom (int n, char const *left_quote,
+ char const *right_quote, char const *arg);
+
+/* Like quotearg_n_custom (N, LEFT_QUOTE, RIGHT_QUOTE, ARG) except it
+ can quote null bytes. */
+char *quotearg_n_custom_mem (int n, char const *left_quote,
+ char const *right_quote,
+ char const *arg, size_t argsize);
+
+/* Equivalent to quotearg_n_custom (0, LEFT_QUOTE, RIGHT_QUOTE, ARG). */
+char *quotearg_custom (char const *left_quote, char const *right_quote,
+ char const *arg);
+
+/* Equivalent to quotearg_n_custom_mem (0, LEFT_QUOTE, RIGHT_QUOTE, ARG,
+ ARGSIZE). */
+char *quotearg_custom_mem (char const *left_quote,
+ char const *right_quote,
+ char const *arg, size_t argsize);
+
+/* Free any dynamically allocated memory. */
+void quotearg_free (void);
+
+#endif /* !QUOTEARG_H_ */
diff --git a/lib/raise.c b/lib/raise.c
new file mode 100644
index 0000000..bf24c3e
--- /dev/null
+++ b/lib/raise.c
@@ -0,0 +1,79 @@
+/* Provide a non-threads replacement for the POSIX raise function.
+
+ Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Specification. */
+#include <signal.h>
+
+#if HAVE_RAISE
+/* Native Windows platform. */
+
+# include <errno.h>
+
+# include "msvc-inval.h"
+
+# undef raise
+
+# if 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;
+}
+# else
+# define raise_nothrow raise
+# endif
+
+#else
+/* An old Unix platform. */
+
+# include <unistd.h>
+
+# define rpl_raise raise
+
+#endif
+
+int
+rpl_raise (int sig)
+{
+#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
+}
diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c
new file mode 100644
index 0000000..dbe01bd
--- /dev/null
+++ b/lib/rawmemchr.c
@@ -0,0 +1,136 @@
+/* Searching in a string.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+/* Find the first occurrence of C in S. */
+void *
+rawmemchr (const void *s, int c_in)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned char c;
+
+ c = (unsigned char) c_in;
+
+ /* Handle the first few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s;
+ (size_t) char_ptr % sizeof (longword) != 0;
+ ++char_ptr)
+ if (*char_ptr == c)
+ return (void *) char_ptr;
+
+ longword_ptr = (const longword *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will
+ test a longword at a time. The tricky part is testing if *any of
+ the four* bytes in the longword in question are equal to NUL or
+ c. We first use an xor with repeated_c. This reduces the task
+ to testing whether *any of the four* bytes in longword1 is zero.
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ The test whether any byte in longword1 is zero is equivalent
+ to testing whether tmp is nonzero.
+
+ This test can read beyond the end of a string, depending on where
+ C_IN is encountered. However, this is considered safe since the
+ initialization phase ensured that the read will be aligned,
+ therefore, the read will not cross page boundaries and will not
+ cause a fault. */
+
+ while (1)
+ {
+ longword longword1 = *longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1)
+ & (repeated_one << 7)) != 0)
+ break;
+ longword_ptr++;
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that one of the sizeof (longword) bytes
+ starting at char_ptr is == c. On little-endian machines, we
+ could determine the first such byte without any further memory
+ accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines.
+ Choose code that works in both cases. */
+
+ char_ptr = (unsigned char *) longword_ptr;
+ while (*char_ptr != c)
+ char_ptr++;
+ return (void *) char_ptr;
+}
diff --git a/lib/rawmemchr.valgrind b/lib/rawmemchr.valgrind
new file mode 100644
index 0000000..6363923
--- /dev/null
+++ b/lib/rawmemchr.valgrind
@@ -0,0 +1,12 @@
+# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
+# This use is OK because it provides only a speedup.
+{
+ rawmemchr-value4
+ Memcheck:Value4
+ fun:rawmemchr
+}
+{
+ rawmemchr-value8
+ Memcheck:Value8
+ fun:rawmemchr
+}
diff --git a/lib/readlink.c b/lib/readlink.c
new file mode 100644
index 0000000..e6c3925
--- /dev/null
+++ b/lib/readlink.c
@@ -0,0 +1,74 @@
+/* Stub for readlink().
+ Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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 (const char *name, char *buf _GL_UNUSED,
+ size_t bufsize _GL_UNUSED)
+{
+ 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 (name, &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 (const char *name, char *buf, size_t bufsize)
+{
+# if READLINK_TRAILING_SLASH_BUG
+ size_t len = strlen (name);
+ if (len && name[len - 1] == '/')
+ {
+ /* Even if name 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 (name, &st) == 0)
+ errno = EINVAL;
+ return -1;
+ }
+# endif /* READLINK_TRAILING_SLASH_BUG */
+ return readlink (name, buf, bufsize);
+}
+
+#endif /* HAVE_READLINK */
diff --git a/lib/ref-add.sin b/lib/ref-add.sin
new file mode 100644
index 0000000..42d3ab0
--- /dev/null
+++ b/lib/ref-add.sin
@@ -0,0 +1,29 @@
+# Add this package to a list of references stored in a text file.
+#
+# Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# Written by Bruno Haible <haible@clisp.cons.org>.
+#
+/^# Packages using this file: / {
+ s/# Packages using this file://
+ ta
+ :a
+ s/ @PACKAGE@ / @PACKAGE@ /
+ tb
+ s/ $/ @PACKAGE@ /
+ :b
+ s/^/# Packages using this file:/
+}
diff --git a/lib/ref-del.sin b/lib/ref-del.sin
new file mode 100644
index 0000000..c77b33b
--- /dev/null
+++ b/lib/ref-del.sin
@@ -0,0 +1,24 @@
+# Remove this package from a list of references stored in a text file.
+#
+# Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# Written by Bruno Haible <haible@clisp.cons.org>.
+#
+/^# Packages using this file: / {
+ s/# Packages using this file://
+ s/ @PACKAGE@ / /
+ s/^/# Packages using this file:/
+}
diff --git a/lib/regcomp.c b/lib/regcomp.c
new file mode 100644
index 0000000..aaa66b9
--- /dev/null
+++ b/lib/regcomp.c
@@ -0,0 +1,3937 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2016 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 General Public
+ License as published by the Free Software Foundation; either
+ version 3 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://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);
+#ifdef RE_ENABLE_I18N
+static void free_charset (re_charset_t *cset);
+#endif /* RE_ENABLE_I18N */
+static void free_workarea_compile (regex_t *preg);
+static reg_errcode_t create_initial_state (re_dfa_t *dfa);
+#ifdef RE_ENABLE_I18N
+static void optimize_utf8 (re_dfa_t *dfa);
+#endif
+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) internal_function;
+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);
+#ifdef RE_ENABLE_I18N
+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);
+#else /* not RE_ENABLE_I18N */
+static reg_errcode_t build_equiv_class (bitset_t sbcset,
+ const unsigned char *name);
+static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
+ bitset_t sbcset,
+ const char *class_name,
+ reg_syntax_t syntax);
+#endif /* not RE_ENABLE_I18N */
+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]);
+}
+#ifdef _LIBC
+weak_alias (__re_compile_pattern, re_compile_pattern)
+#endif
+
+/* 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;
+}
+#ifdef _LIBC
+weak_alias (__re_set_syntax, re_set_syntax)
+#endif
+
+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;
+}
+#ifdef _LIBC
+weak_alias (__re_compile_fastmap, re_compile_fastmap)
+#endif
+
+static inline void
+__attribute__ ((always_inline))
+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);
+#ifdef RE_ENABLE_I18N
+ 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]);
+ }
+#endif
+ }
+ 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);
+ }
+ }
+#ifdef RE_ENABLE_I18N
+ 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);
+ }
+ }
+ }
+ }
+#endif /* RE_ENABLE_I18N */
+ else if (type == OP_PERIOD
+#ifdef RE_ENABLE_I18N
+ || type == OP_UTF8_PERIOD
+#endif /* RE_ENABLE_I18N */
+ || 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 (BE (preg->fastmap == NULL, 0))
+ 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 (BE (ret == REG_NOERROR, 1))
+ /* 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;
+}
+#ifdef _LIBC
+weak_alias (__regcomp, regcomp)
+#endif
+
+/* 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;
+
+ if (BE (errcode < 0
+ || errcode >= (int) (sizeof (__re_error_msgid_idx)
+ / sizeof (__re_error_msgid_idx[0])), 0))
+ /* 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 (BE (errbuf_size != 0, 1))
+ {
+ size_t cpy_size = msg_size;
+ if (BE (msg_size > errbuf_size, 0))
+ {
+ cpy_size = errbuf_size - 1;
+ errbuf[cpy_size] = '\0';
+ }
+ memcpy (errbuf, msg, cpy_size);
+ }
+
+ return msg_size;
+}
+#ifdef _LIBC
+weak_alias (__regerror, regerror)
+#endif
+
+
+#ifdef RE_ENABLE_I18N
+/* 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__ && !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
+};
+#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);
+#ifdef RE_ENABLE_I18N
+ if (dfa->sb_char != utf8_sb_map)
+ re_free (dfa->sb_char);
+#endif
+ 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 (BE (dfa != NULL, 1))
+ {
+ 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;
+}
+#ifdef _LIBC
+weak_alias (__regfree, regfree)
+#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
+
+/* 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 = (char *) malloc (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 (BE (preg->allocated < sizeof (re_dfa_t), 0))
+ {
+ /* 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 (BE (err == REG_NOERROR && lock_init (dfa->lock) != 0, 0))
+ err = REG_ESPACE;
+ if (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (dfa->str_tree == NULL, 0))
+ goto re_compile_internal_free_return;
+
+ /* Analyze the tree and create the nfa. */
+ err = analyze (preg);
+ if (BE (err != REG_NOERROR, 0))
+ goto re_compile_internal_free_return;
+
+#ifdef RE_ENABLE_I18N
+ /* 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);
+#endif
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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
+#ifdef RE_ENABLE_I18N
+ size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
+#else
+ size_t max_i18n_object_size = 0;
+#endif
+ 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 (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 <= pat_len, 0))
+ 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
+
+#ifdef RE_ENABLE_I18N
+ 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 (BE (dfa->sb_char == NULL, 0))
+ 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
+ }
+ }
+ }
+#endif
+
+ if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0))
+ 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
+internal_function
+init_word_char (re_dfa_t *dfa)
+{
+ int i = 0;
+ int j;
+ int ch = 0;
+ dfa->word_ops_used = 1;
+ if (BE (dfa->map_notascii == 0, 1))
+ {
+ 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)
+ {
+ 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 (BE (dfa->is_utf8, 1))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (dfa->init_state == NULL, 0))
+ 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 (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL, 0))
+ 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;
+}
+
+#ifdef RE_ENABLE_I18N
+/* 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;
+}
+#endif
+
+/* 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 (BE (dfa->nexts == NULL || dfa->org_indices == NULL || dfa->edests == NULL
+ || dfa->eclosures == NULL, 0))
+ 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)
+ {
+ free (dfa->subexp_map);
+ dfa->subexp_map = NULL;
+ }
+ }
+
+ ret = postorder (dfa->str_tree, lower_subexps, preg);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ ret = postorder (dfa->str_tree, calc_first, dfa);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ preorder (dfa->str_tree, calc_next, dfa);
+ ret = preorder (dfa->str_tree, link_nfa_nodes, dfa);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ ret = calc_eclosure (dfa);
+ if (BE (ret != REG_NOERROR, 0))
+ 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 (BE (dfa->inveclosures == NULL, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (tree == NULL || tree1 == NULL || op == NULL || cls == NULL, 0))
+ {
+ *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 (BE (node->node_idx == -1, 0))
+ 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:
+ 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;
+ assert (left > -1);
+ 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:
+ 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
+internal_function
+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 (BE (clone_dest == -1, 0))
+ return REG_ESPACE;
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (! ok, 0))
+ 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 (BE (! ok, 0))
+ 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 (BE (clone_dest == -1, 0))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (! ok, 0))
+ 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 (BE (clone_dest == -1, 0))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (! ok, 0))
+ return REG_ESPACE;
+ err = duplicate_node_closure (dfa, org_dest, clone_dest,
+ root_node, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ 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 (BE (! ok, 0))
+ return REG_ESPACE;
+ }
+
+ org_dest = dfa->edests[org_node].elems[1];
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (BE (clone_dest == -1, 0))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (! ok, 0))
+ 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 (BE (dup_idx != -1, 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 (BE (! ok, 0))
+ 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;
+#ifdef DEBUG
+ assert (dfa->nodes_len > 0);
+#endif
+ 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;
+ }
+
+#ifdef DEBUG
+ assert (dfa->eclosures[node_idx].nelem != -1);
+#endif
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ 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 ok;
+ bool incomplete = false;
+ err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ else
+ eclosure_elem = dfa->eclosures[edest];
+ /* Merge the epsilon closure of 'edest'. */
+ err = re_node_set_merge (&eclosure, &eclosure_elem);
+ if (BE (err != REG_NOERROR, 0))
+ 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);
+ }
+ }
+
+ /* An epsilon closure includes itself. */
+ ok = re_node_set_insert (&eclosure, node);
+ if (BE (! ok, 0))
+ return REG_ESPACE;
+ 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
+internal_function
+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
+internal_function
+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;
+#ifdef RE_ENABLE_I18N
+ 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;
+ }
+#endif
+ 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;
+#ifdef RE_ENABLE_I18N
+ 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
+#endif
+ 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;
+#ifdef RE_ENABLE_I18N
+ 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
+#endif
+ 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
+internal_function
+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;
+
+#ifdef RE_ENABLE_I18N
+ if (input->mb_cur_max > 1 &&
+ !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ return 1;
+ }
+#endif /* RE_ENABLE_I18N */
+
+ 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;
+ }
+ /* else fall through. */
+ default:
+ token->type = CHARACTER;
+ token->opr.c = c;
+ token_len = 1;
+ break;
+ }
+ return token_len;
+ }
+ switch (c)
+ {
+ case '-':
+ token->type = OP_CHARSET_RANGE;
+ break;
+ case ']':
+ token->type = OP_CLOSE_BRACKET;
+ break;
+ case '^':
+ token->type = OP_NON_MATCH_LIST;
+ break;
+ 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 (BE (*err != REG_NOERROR && tree == NULL, 0))
+ 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 (BE (eor == NULL || root == NULL, 0))
+ {
+ *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 (BE (*err != REG_NOERROR && tree == NULL, 0))
+ 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 (BE (*err != REG_NOERROR && branch == NULL, 0))
+ {
+ 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 (BE (tree == NULL, 0))
+ {
+ *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 (BE (*err != REG_NOERROR && tree == NULL, 0))
+ 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 (BE (*err != REG_NOERROR && expr == NULL, 0))
+ {
+ 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 (BE (tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+#ifdef RE_ENABLE_I18N
+ 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 (BE (mbc_remain == NULL || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ }
+#endif
+ break;
+ case OP_OPEN_SUBEXP:
+ tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_OPEN_BRACKET:
+ tree = parse_bracket_exp (regexp, dfa, token, syntax, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_BACK_REF:
+ if (!BE (dfa->completed_bkref_map & (1 << token->opr.idx), 1))
+ {
+ *err = REG_ESUBREG;
+ return NULL;
+ }
+ dfa->used_bkref_map |= 1 << token->opr.idx;
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (BE (tree == NULL, 0))
+ {
+ *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);
+ }
+ /* else fall through */
+ case OP_CLOSE_SUBEXP:
+ if ((token->type == OP_CLOSE_SUBEXP) &&
+ !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
+ {
+ *err = REG_ERPAREN;
+ return NULL;
+ }
+ /* else fall through */
+ 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 (BE (tree == NULL, 0))
+ {
+ *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 (BE (tree_first == NULL || tree_last == NULL || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ else
+ {
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (BE (tree == NULL, 0))
+ {
+ *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 (BE (tree == NULL, 0))
+ {
+ *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 (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_SPACE:
+ case OP_NOTSPACE:
+ tree = build_charclass_op (dfa, regexp->trans,
+ "space",
+ "",
+ token->type == OP_NOTSPACE, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_ALT:
+ case END_OF_RE:
+ return NULL;
+ case BACK_SLASH:
+ *err = REG_EESCAPE;
+ return NULL;
+ default:
+ /* Must not happen? */
+#ifdef DEBUG
+ assert (0);
+#endif
+ 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 (BE (*err != REG_NOERROR && dup_tree == NULL, 0))
+ {
+ 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 (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_EPAREN;
+ }
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+
+ if (cur_nsub <= '9' - '1')
+ dfa->completed_bkref_map |= 1 << cur_nsub;
+
+ tree = create_tree (dfa, tree, NULL, SUBEXP);
+ if (BE (tree == NULL, 0))
+ {
+ *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 (BE (start != -2, 1))
+ {
+ /* 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 (BE (start == -2 || end == -2, 0))
+ {
+ /* Invalid sequence. */
+ if (BE (!(syntax & RE_INVALID_INTERVAL_ORD), 0))
+ {
+ 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 (BE ((end != -1 && start > end)
+ || token->type != OP_CLOSE_DUP_NUM, 0))
+ {
+ /* First number greater than second. */
+ *err = REG_BADBR;
+ return NULL;
+ }
+
+ if (BE (RE_DUP_MAX < (end == -1 ? start : end), 0))
+ {
+ *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 (BE (elem == NULL, 0))
+ return NULL;
+ if (BE (start == 0 && end == 0, 0))
+ {
+ postorder (elem, free_tree, NULL);
+ return NULL;
+ }
+
+ /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}". */
+ if (BE (start > 0, 0))
+ {
+ tree = elem;
+ for (i = 2; i <= start; ++i)
+ {
+ elem = duplicate_tree (elem, dfa);
+ tree = create_tree (dfa, tree, elem, CONCAT);
+ if (BE (elem == NULL || tree == NULL, 0))
+ goto parse_dup_op_espace;
+ }
+
+ if (start == end)
+ return tree;
+
+ /* Duplicate ELEM before it is marked optional. */
+ elem = duplicate_tree (elem, dfa);
+ if (BE (elem == NULL, 0))
+ 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 (BE (tree == NULL, 0))
+ goto parse_dup_op_espace;
+
+/* From gnulib's "intprops.h":
+ True if the arithmetic type T is signed. */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+ /* 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 (BE (elem == NULL || tree == NULL, 0))
+ goto parse_dup_op_espace;
+
+ tree = create_tree (dfa, tree, NULL, OP_ALT);
+ if (BE (tree == NULL, 0))
+ 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
+
+# ifdef RE_ENABLE_I18N
+/* Convert the byte B to the corresponding wide character. In a
+ unibyte locale, treat B as itself if it is an encoding error.
+ In a multibyte locale, return WEOF if B is an encoding error. */
+static wint_t
+parse_byte (unsigned char b, re_charset_t *mbcset)
+{
+ wint_t wc = __btowc (b);
+ return wc == WEOF && !mbcset ? b : wc;
+}
+#endif
+
+ /* Local function for parse_bracket_exp only used in case of NOT _LIBC.
+ 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
+internal_function
+# ifdef RE_ENABLE_I18N
+build_range_exp (const reg_syntax_t syntax,
+ bitset_t sbcset,
+ re_charset_t *mbcset,
+ Idx *range_alloc,
+ const bracket_elem_t *start_elem,
+ const bracket_elem_t *end_elem)
+# else /* not RE_ENABLE_I18N */
+build_range_exp (const reg_syntax_t syntax,
+ bitset_t sbcset,
+ const bracket_elem_t *start_elem,
+ const bracket_elem_t *end_elem)
+# endif /* not RE_ENABLE_I18N */
+{
+ unsigned int start_ch, end_ch;
+ /* Equivalence Classes and Character Classes can't be a range start/end. */
+ if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS,
+ 0))
+ return REG_ERANGE;
+
+ /* We can handle no multi character collating elements without libc
+ support. */
+ if (BE ((start_elem->type == COLL_SYM
+ && strlen ((char *) start_elem->opr.name) > 1)
+ || (end_elem->type == COLL_SYM
+ && strlen ((char *) end_elem->opr.name) > 1), 0))
+ return REG_ECOLLATE;
+
+# ifdef RE_ENABLE_I18N
+ {
+ wchar_t wc;
+ wint_t start_wc;
+ wint_t end_wc;
+
+ 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));
+ start_wc = ((start_elem->type == SB_CHAR || start_elem->type == COLL_SYM)
+ ? parse_byte (start_ch, mbcset) : start_elem->opr.wch);
+ end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM)
+ ? parse_byte (end_ch, mbcset) : end_elem->opr.wch);
+ if (start_wc == WEOF || end_wc == WEOF)
+ return REG_ECOLLATE;
+ else if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_wc > end_wc, 0))
+ 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 (mbcset)
+ {
+ /* Check the space of the arrays. */
+ if (BE (*range_alloc == mbcset->nranges, 0))
+ {
+ /* 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 (BE (new_array_start == NULL || new_array_end == NULL, 0))
+ {
+ 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 (wc = 0; wc < SBC_MAX; ++wc)
+ {
+ if (start_wc <= wc && wc <= end_wc)
+ bitset_set (sbcset, wc);
+ }
+ }
+# else /* not RE_ENABLE_I18N */
+ {
+ unsigned int ch;
+ 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));
+ if (start_ch > end_ch)
+ return REG_ERANGE;
+ /* Build the table for single byte characters. */
+ for (ch = 0; ch < SBC_MAX; ++ch)
+ if (start_ch <= ch && ch <= end_ch)
+ bitset_set (sbcset, ch);
+ }
+# endif /* not RE_ENABLE_I18N */
+ 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
+internal_function
+# ifdef RE_ENABLE_I18N
+build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *coll_sym_alloc, const unsigned char *name)
+# else /* not RE_ENABLE_I18N */
+build_collating_symbol (bitset_t sbcset, const unsigned char *name)
+# endif /* not RE_ENABLE_I18N */
+{
+ size_t name_len = strlen ((const char *) name);
+ if (BE (name_len != 1, 0))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+}
+#endif /* not _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)
+{
+#ifdef _LIBC
+ const unsigned char *collseqmb;
+ const char *collseqwc;
+ uint32_t nrules;
+ int32_t table_size;
+ const int32_t *symb_table;
+ const unsigned char *extra;
+
+ /* 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. */
+
+ auto inline int32_t
+ __attribute__ ((always_inline))
+ seek_collating_symbol_entry (const unsigned char *name, size_t name_len)
+ {
+ int32_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. */
+
+ auto inline unsigned int
+ __attribute__ ((always_inline))
+ lookup_collation_sequence_value (bracket_elem_t *br_elem)
+ {
+ 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);
+ 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. */
+
+ auto inline reg_errcode_t
+ __attribute__ ((always_inline))
+ build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc,
+ bracket_elem_t *start_elem, bracket_elem_t *end_elem)
+ {
+ unsigned int ch;
+ uint32_t start_collseq;
+ uint32_t end_collseq;
+
+ /* Equivalence Classes and Character Classes can't be a range
+ start/end. */
+ if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS,
+ 0))
+ return REG_ERANGE;
+
+ /* FIXME: Implement rational ranges here, too. */
+ start_collseq = lookup_collation_sequence_value (start_elem);
+ end_collseq = lookup_collation_sequence_value (end_elem);
+ /* Check start/end collation sequence values. */
+ if (BE (start_collseq == UINT_MAX || end_collseq == UINT_MAX, 0))
+ return REG_ECOLLATE;
+ if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_collseq > end_collseq, 0))
+ 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 (BE (*range_alloc == mbcset->nranges, 0))
+ {
+ /* There is not enough space, need realloc. */
+ uint32_t *new_array_start;
+ uint32_t *new_array_end;
+ Idx 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 (BE (new_array_start == NULL || new_array_end == NULL, 0))
+ 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. */
+
+ auto inline reg_errcode_t
+ __attribute__ ((always_inline))
+ build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *coll_sym_alloc, const unsigned char *name)
+ {
+ int32_t elem, idx;
+ size_t name_len = strlen ((const char *) name);
+ if (nrules != 0)
+ {
+ elem = seek_collating_symbol_entry (name, name_len);
+ 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 (BE (*coll_sym_alloc == mbcset->ncoll_syms, 0))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->ncoll_syms is 0. */
+ Idx 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 (BE (new_coll_syms == NULL, 0))
+ 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 (BE (name_len != 1, 0))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ }
+ }
+#endif
+
+ re_token_t br_token;
+ re_bitset_ptr_t sbcset;
+#ifdef RE_ENABLE_I18N
+ re_charset_t *mbcset;
+ Idx coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0;
+ Idx equiv_class_alloc = 0, char_class_alloc = 0;
+#endif /* not RE_ENABLE_I18N */
+ 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 = (const int32_t *) _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);
+#ifdef RE_ENABLE_I18N
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+#endif /* RE_ENABLE_I18N */
+#ifdef RE_ENABLE_I18N
+ if (BE (sbcset == NULL || mbcset == NULL, 0))
+#else
+ if (BE (sbcset == NULL, 0))
+#endif /* RE_ENABLE_I18N */
+ {
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ re_free (mbcset);
+#endif
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_NON_MATCH_LIST)
+ {
+#ifdef RE_ENABLE_I18N
+ mbcset->non_match = 1;
+#endif /* not RE_ENABLE_I18N */
+ 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 (BE (token->type == END_OF_RE, 0))
+ {
+ *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 (BE (ret != REG_NOERROR, 0))
+ {
+ *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 (BE (token->type == END_OF_RE, 0))
+ {
+ *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 (BE (token2.type == END_OF_RE, 0))
+ {
+ *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 (BE (ret != REG_NOERROR, 0))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+
+#ifdef _LIBC
+ *err = build_range_exp (sbcset, mbcset, &range_alloc,
+ &start_elem, &end_elem);
+#else
+# ifdef RE_ENABLE_I18N
+ *err = build_range_exp (syntax, sbcset,
+ dfa->mb_cur_max > 1 ? mbcset : NULL,
+ &range_alloc, &start_elem, &end_elem);
+# else
+ *err = build_range_exp (syntax, sbcset, &start_elem, &end_elem);
+# endif
+#endif /* RE_ENABLE_I18N */
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ }
+ else
+ {
+ switch (start_elem.type)
+ {
+ case SB_CHAR:
+ bitset_set (sbcset, start_elem.opr.ch);
+ break;
+#ifdef RE_ENABLE_I18N
+ case MB_CHAR:
+ /* Check whether the array has enough space. */
+ if (BE (mbchar_alloc == mbcset->nmbchars, 0))
+ {
+ 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 (BE (new_mbchars == NULL, 0))
+ goto parse_bracket_exp_espace;
+ mbcset->mbchars = new_mbchars;
+ }
+ mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch;
+ break;
+#endif /* RE_ENABLE_I18N */
+ case EQUIV_CLASS:
+ *err = build_equiv_class (sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &equiv_class_alloc,
+#endif /* RE_ENABLE_I18N */
+ start_elem.opr.name);
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ break;
+ case COLL_SYM:
+ *err = build_collating_symbol (sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &coll_sym_alloc,
+#endif /* RE_ENABLE_I18N */
+ start_elem.opr.name);
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ break;
+ case CHAR_CLASS:
+ *err = build_charclass (regexp->trans, sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &char_class_alloc,
+#endif /* RE_ENABLE_I18N */
+ (const char *) start_elem.opr.name,
+ syntax);
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ break;
+ default:
+ assert (0);
+ break;
+ }
+ }
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *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);
+
+#ifdef RE_ENABLE_I18N
+ /* 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 (BE (mbc_tree == NULL, 0))
+ 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 (BE (work_tree == NULL, 0))
+ goto parse_bracket_exp_espace;
+
+ /* Then join them by ALT node. */
+ work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
+ if (BE (work_tree == NULL, 0))
+ goto parse_bracket_exp_espace;
+ }
+ else
+ {
+ re_free (sbcset);
+ work_tree = mbc_tree;
+ }
+ }
+ else
+#endif /* not RE_ENABLE_I18N */
+ {
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif
+ /* 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 (BE (work_tree == NULL, 0))
+ goto parse_bracket_exp_espace;
+ }
+ return work_tree;
+
+ parse_bracket_exp_espace:
+ *err = REG_ESPACE;
+ parse_bracket_exp_free_return:
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif /* RE_ENABLE_I18N */
+ 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)
+{
+#ifdef RE_ENABLE_I18N
+ 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;
+ }
+#endif /* RE_ENABLE_I18N */
+ 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 (BE (token->type == OP_CHARSET_RANGE, 0) && !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
+#ifdef RE_ENABLE_I18N
+build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *equiv_class_alloc, const unsigned char *name)
+#else /* not RE_ENABLE_I18N */
+build_equiv_class (bitset_t sbcset, const unsigned char *name)
+#endif /* not RE_ENABLE_I18N */
+{
+#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 (BE (idx1 == 0 || *cp != '\0', 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))
+ {
+ int cnt = 0;
+
+ while (cnt <= len &&
+ weights[(idx1 & 0xffffff) + 1 + cnt]
+ == weights[(idx2 & 0xffffff) + 1 + cnt])
+ ++cnt;
+
+ if (cnt > len)
+ bitset_set (sbcset, ch);
+ }
+ }
+ /* Check whether the array has enough space. */
+ if (BE (*equiv_class_alloc == mbcset->nequiv_classes, 0))
+ {
+ /* 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 (BE (new_equiv_classes == NULL, 0))
+ 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 (BE (strlen ((const char *) name) != 1, 0))
+ 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
+#ifdef RE_ENABLE_I18N
+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)
+#else /* not RE_ENABLE_I18N */
+build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
+ const char *class_name, reg_syntax_t syntax)
+#endif /* not RE_ENABLE_I18N */
+{
+ 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";
+
+#ifdef RE_ENABLE_I18N
+ /* Check the space of the arrays. */
+ if (BE (*char_class_alloc == mbcset->nchar_classes, 0))
+ {
+ /* 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 (BE (new_char_classes == NULL, 0))
+ return REG_ESPACE;
+ mbcset->char_classes = new_char_classes;
+ *char_class_alloc = new_char_class_alloc;
+ }
+ mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
+#endif /* RE_ENABLE_I18N */
+
+#define BUILD_CHARCLASS_LOOP(ctype_func) \
+ do { \
+ if (BE (trans != NULL, 0)) \
+ { \
+ 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;
+#ifdef RE_ENABLE_I18N
+ re_charset_t *mbcset;
+ Idx alloc = 0;
+#endif /* not RE_ENABLE_I18N */
+ reg_errcode_t ret;
+ re_token_t br_token;
+ bin_tree_t *tree;
+
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ if (BE (sbcset == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+#ifdef RE_ENABLE_I18N
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+ if (BE (mbcset == NULL, 0))
+ {
+ re_free (sbcset);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ mbcset->non_match = non_match;
+#endif /* RE_ENABLE_I18N */
+
+ /* We don't care the syntax in this case. */
+ ret = build_charclass (trans, sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &alloc,
+#endif /* RE_ENABLE_I18N */
+ class_name, 0);
+
+ if (BE (ret != REG_NOERROR, 0))
+ {
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif /* RE_ENABLE_I18N */
+ *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);
+
+#ifdef RE_ENABLE_I18N
+ /* Ensure only single byte characters are set. */
+ if (dfa->mb_cur_max > 1)
+ bitset_mask (sbcset, dfa->sb_char);
+#endif
+
+ /* Build a tree for simple bracket. */
+#if defined GCC_LINT || defined lint
+ memset (&br_token, 0, sizeof br_token);
+#endif
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (BE (tree == NULL, 0))
+ goto build_word_op_espace;
+
+#ifdef RE_ENABLE_I18N
+ 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 (BE (mbc_tree == NULL, 0))
+ goto build_word_op_espace;
+ /* Then join them by ALT node. */
+ tree = create_tree (dfa, tree, mbc_tree, OP_ALT);
+ if (BE (mbc_tree != NULL, 1))
+ return tree;
+ }
+ else
+ {
+ free_charset (mbcset);
+ return tree;
+ }
+#else /* not RE_ENABLE_I18N */
+ return tree;
+#endif /* not RE_ENABLE_I18N */
+
+ build_word_op_espace:
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif /* RE_ENABLE_I18N */
+ *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 (BE (token->type == END_OF_RE, 0))
+ 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;
+}
+
+#ifdef RE_ENABLE_I18N
+static void
+free_charset (re_charset_t *cset)
+{
+ re_free (cset->mbchars);
+# ifdef _LIBC
+ re_free (cset->coll_syms);
+ re_free (cset->equiv_classes);
+ re_free (cset->range_starts);
+ re_free (cset->range_ends);
+# endif
+ re_free (cset->char_classes);
+ re_free (cset);
+}
+#endif /* RE_ENABLE_I18N */
+
+/* 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;
+#if defined GCC_LINT || defined lint
+ memset (&t, 0, sizeof t);
+#endif
+ 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 (BE (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE, 0))
+ {
+ 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)
+{
+#ifdef RE_ENABLE_I18N
+ if (node->type == COMPLEX_BRACKET && node->duplicated == 0)
+ free_charset (node->opr.mbcset);
+ else
+#endif /* RE_ENABLE_I18N */
+ 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/lib/regex.c b/lib/regex.c
new file mode 100644
index 0000000..432b465
--- /dev/null
+++ b/lib/regex.c
@@ -0,0 +1,81 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2016 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 General Public
+ License as published by the Free Software Foundation; either
+ version 3 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+
+# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# endif
+# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# 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/lib/regex.h b/lib/regex.h
new file mode 100644
index 0000000..31f4e4d
--- /dev/null
+++ b/lib/regex.h
@@ -0,0 +1,659 @@
+/* Definitions for data structures and routines for the regular
+ expression library.
+ Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2016 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 General Public
+ License as published by the Free Software Foundation; either
+ version 3 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://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. */
+
+#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);
+
+
+/* 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);
+
+
+/* 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);
+
+
+/* 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);
+
+
+/* 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);
+
+
+/* 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)
+# ifndef _CRAY
+/* 4.2 bsd compatibility. */
+extern char *re_comp (const char *);
+extern int re_exec (const char *);
+# endif
+#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, so pick a
+ different name. */
+#ifndef _Restrict_
+# if 199901L <= __STDC_VERSION__
+# define _Restrict_ restrict
+# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
+# define _Restrict_ __restrict
+# else
+# define _Restrict_
+# endif
+#endif
+/* gcc 3.1 and up support the [restrict] syntax. Don't trust
+ sys/cdefs.h's definition of __restrict_arr, though, as it
+ mishandles gcc -ansi -pedantic. */
+#ifndef _Restrict_arr_
+# if ((199901L <= __STDC_VERSION__ \
+ || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
+ && !defined __STRICT_ANSI__)) \
+ && !defined __GNUG__)
+# 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_],
+ int __eflags);
+
+extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
+ char *_Restrict_ __errbuf, size_t __errbuf_size);
+
+extern void regfree (regex_t *__preg);
+
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
new file mode 100644
index 0000000..a3b10dd
--- /dev/null
+++ b/lib/regex_internal.c
@@ -0,0 +1,1741 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2016 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 General Public
+ License as published by the Free Software Foundation; either
+ version 3 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://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) internal_function;
+static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa,
+ const re_node_set *nodes,
+ re_hashval_t hash) internal_function;
+static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int context,
+ re_hashval_t hash) internal_function;
+
+/* 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
+internal_function __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 (BE (ret != REG_NOERROR, 0))
+ 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
+internal_function __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 (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+
+ if (icase)
+ {
+#ifdef RE_ENABLE_I18N
+ if (dfa->mb_cur_max > 1)
+ {
+ while (1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (BE (ret != REG_NOERROR, 0))
+ 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 (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ }
+ else
+#endif /* RE_ENABLE_I18N */
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+#ifdef RE_ENABLE_I18N
+ if (dfa->mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+#endif /* RE_ENABLE_I18N */
+ {
+ 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
+internal_function __attribute_warn_unused_result__
+re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
+{
+#ifdef RE_ENABLE_I18N
+ 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 (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_buf_len, 0))
+ return REG_ESPACE;
+
+ new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
+ if (BE (new_wcs == NULL, 0))
+ return REG_ESPACE;
+ pstr->wcs = new_wcs;
+ if (pstr->offsets != NULL)
+ {
+ Idx *new_offsets = re_realloc (pstr->offsets, Idx, new_buf_len);
+ if (BE (new_offsets == NULL, 0))
+ return REG_ESPACE;
+ pstr->offsets = new_offsets;
+ }
+ }
+#endif /* RE_ENABLE_I18N */
+ if (pstr->mbs_allocated)
+ {
+ unsigned char *new_mbs = re_realloc (pstr->mbs, unsigned char,
+ new_buf_len);
+ if (BE (new_mbs == NULL, 0))
+ return REG_ESPACE;
+ pstr->mbs = new_mbs;
+ }
+ pstr->bufs_len = new_buf_len;
+ return REG_NOERROR;
+}
+
+
+static void
+internal_function
+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;
+}
+
+#ifdef RE_ENABLE_I18N
+
+/* 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
+internal_function
+build_wcs_buffer (re_string_t *pstr)
+{
+#ifdef _LIBC
+ unsigned char buf[MB_LEN_MAX];
+ 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 (BE (pstr->trans != NULL, 0))
+ {
+ 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 (BE (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0))
+ {
+ /* We treat these cases as a singlebyte character. */
+ mbclen = 1;
+ wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ if (BE (pstr->trans != NULL, 0))
+ wc = pstr->trans[wc];
+ pstr->cur_state = prev_st;
+ }
+ else if (BE (mbclen == (size_t) -2, 0))
+ {
+ /* 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
+internal_function __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];
+ assert (MB_LEN_MAX >= pstr->mb_cur_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;
+
+ if (isascii (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx])
+ && mbsinit (&pstr->cur_state))
+ {
+ /* In case of a singlebyte character. */
+ pstr->mbs[byte_idx]
+ = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]);
+ /* The next step uses the assumption that wchar_t is encoded
+ ASCII-safe: all ASCII values can be converted like this. */
+ pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx];
+ ++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 (BE (mbclen < (size_t) -2, 1))
+ {
+ wchar_t wcu = __towupper (wc);
+ if (wcu != wc)
+ {
+ size_t mbcdlen;
+
+ mbcdlen = __wcrtomb (buf, wcu, &prev_st);
+ if (BE (mbclen == mbcdlen, 1))
+ 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. */
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ pstr->mbs[byte_idx] = ch;
+ /* And also cast it to wide char. */
+ pstr->wcs[byte_idx++] = (wchar_t) ch;
+ if (BE (mbclen == (size_t) -1, 0))
+ 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 (BE (pstr->trans != NULL, 0))
+ {
+ 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 (BE (mbclen < (size_t) -2, 1))
+ {
+ wchar_t wcu = __towupper (wc);
+ if (wcu != wc)
+ {
+ size_t mbcdlen;
+
+ mbcdlen = wcrtomb ((char *) buf, wcu, &prev_st);
+ if (BE (mbclen == mbcdlen, 1))
+ 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 (BE (pstr->offsets_needed != 0, 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 (BE (pstr->trans != NULL, 0))
+ ch = pstr->trans [ch];
+ pstr->mbs[byte_idx] = ch;
+
+ if (BE (pstr->offsets_needed != 0, 0))
+ pstr->offsets[byte_idx] = src_idx;
+ ++src_idx;
+
+ /* And also cast it to wide char. */
+ pstr->wcs[byte_idx++] = (wchar_t) ch;
+ if (BE (mbclen == (size_t) -1, 0))
+ 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
+internal_function
+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 (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 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;
+}
+#endif /* RE_ENABLE_I18N */
+
+/* Build the buffer PSTR->MBS, and apply the translation if we need.
+ This function is used in case of REG_ICASE. */
+
+static void
+internal_function
+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 (BE (pstr->trans != NULL, 0))
+ 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
+internal_function
+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
+internal_function __attribute_warn_unused_result__
+re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
+{
+ Idx offset;
+
+ if (BE (pstr->raw_mbs_idx <= idx, 0))
+ offset = idx - pstr->raw_mbs_idx;
+ else
+ {
+ /* Reset buffer. */
+#ifdef RE_ENABLE_I18N
+ if (pstr->mb_cur_max > 1)
+ memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+#endif /* RE_ENABLE_I18N */
+ 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 (BE (offset != 0, 1))
+ {
+ /* Should the already checked characters be kept? */
+ if (BE (offset < pstr->valid_raw_len, 1))
+ {
+ /* Yes, move them to the front of the buffer. */
+#ifdef RE_ENABLE_I18N
+ if (BE (pstr->offsets_needed, 0))
+ {
+ 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
+#endif
+ {
+ pstr->tip_context = re_string_context_at (pstr, offset - 1,
+ eflags);
+#ifdef RE_ENABLE_I18N
+ if (pstr->mb_cur_max > 1)
+ memmove (pstr->wcs, pstr->wcs + offset,
+ (pstr->valid_len - offset) * sizeof (wint_t));
+#endif /* RE_ENABLE_I18N */
+ if (BE (pstr->mbs_allocated, 0))
+ memmove (pstr->mbs, pstr->mbs + offset,
+ pstr->valid_len - offset);
+ pstr->valid_len -= offset;
+ pstr->valid_raw_len -= offset;
+#if defined DEBUG && DEBUG
+ assert (pstr->valid_len > 0);
+#endif
+ }
+ }
+ else
+ {
+#ifdef RE_ENABLE_I18N
+ /* No, skip all characters until IDX. */
+ Idx prev_valid_len = pstr->valid_len;
+
+ if (BE (pstr->offsets_needed, 0))
+ {
+ pstr->len = pstr->raw_len - idx + offset;
+ pstr->stop = pstr->raw_stop - idx + offset;
+ pstr->offsets_needed = 0;
+ }
+#endif
+ pstr->valid_len = 0;
+#ifdef RE_ENABLE_I18N
+ 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) && BE (pstr->trans == NULL, 1))
+ {
+ 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 (BE (pstr->trans != NULL, 0))
+ {
+ 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 = ((BE (pstr->word_ops_used != 0, 0)
+ && IS_WIDE_WORD_CHAR (wc))
+ ? CONTEXT_WORD
+ : ((IS_WIDE_NEWLINE (wc)
+ && pstr->newline_anchor)
+ ? CONTEXT_NEWLINE : 0));
+ if (BE (pstr->valid_len, 0))
+ {
+ 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
+#endif /* RE_ENABLE_I18N */
+ {
+ 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 (!BE (pstr->mbs_allocated, 0))
+ pstr->mbs += offset;
+ }
+ pstr->raw_mbs_idx = idx;
+ pstr->len -= offset;
+ pstr->stop -= offset;
+
+ /* Then build the buffers. */
+#ifdef RE_ENABLE_I18N
+ if (pstr->mb_cur_max > 1)
+ {
+ if (pstr->icase)
+ {
+ reg_errcode_t ret = build_wcs_upper_buffer (pstr);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ else
+ build_wcs_buffer (pstr);
+ }
+ else
+#endif /* RE_ENABLE_I18N */
+ if (BE (pstr->mbs_allocated, 0))
+ {
+ 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
+internal_function __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 (BE (!pstr->mbs_allocated, 1))
+ return re_string_peek_byte (pstr, idx);
+
+#ifdef RE_ENABLE_I18N
+ if (pstr->mb_cur_max > 1
+ && ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx))
+ return re_string_peek_byte (pstr, idx);
+#endif
+
+ off = pstr->cur_idx + idx;
+#ifdef RE_ENABLE_I18N
+ if (pstr->offsets_needed)
+ off = pstr->offsets[off];
+#endif
+
+ ch = pstr->raw_mbs[pstr->raw_mbs_idx + off];
+
+#ifdef RE_ENABLE_I18N
+ /* 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);
+#endif
+
+ return ch;
+}
+
+static unsigned char
+internal_function
+re_string_fetch_byte_case (re_string_t *pstr)
+{
+ if (BE (!pstr->mbs_allocated, 1))
+ return re_string_fetch_byte (pstr);
+
+#ifdef RE_ENABLE_I18N
+ 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;
+ }
+#endif
+
+ return pstr->raw_mbs[pstr->raw_mbs_idx + pstr->cur_idx++];
+}
+
+static void
+internal_function
+re_string_destruct (re_string_t *pstr)
+{
+#ifdef RE_ENABLE_I18N
+ re_free (pstr->wcs);
+ re_free (pstr->offsets);
+#endif /* RE_ENABLE_I18N */
+ if (pstr->mbs_allocated)
+ re_free (pstr->mbs);
+}
+
+/* Return the context at IDX in INPUT. */
+
+static unsigned int
+internal_function
+re_string_context_at (const re_string_t *input, Idx idx, int eflags)
+{
+ int c;
+ if (BE (idx < 0, 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 (BE (idx == input->len, 0))
+ return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
+ : CONTEXT_NEWLINE | CONTEXT_ENDBUF);
+#ifdef RE_ENABLE_I18N
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc;
+ Idx wc_idx = idx;
+ while(input->wcs[wc_idx] == WEOF)
+ {
+#if defined DEBUG && DEBUG
+ /* It must not happen. */
+ assert (wc_idx >= 0);
+#endif
+ --wc_idx;
+ if (wc_idx < 0)
+ return input->tip_context;
+ }
+ wc = input->wcs[wc_idx];
+ if (BE (input->word_ops_used != 0, 0) && IS_WIDE_WORD_CHAR (wc))
+ return CONTEXT_WORD;
+ return (IS_WIDE_NEWLINE (wc) && input->newline_anchor
+ ? CONTEXT_NEWLINE : 0);
+ }
+ else
+#endif
+ {
+ 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
+internal_function __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 (BE (set->elems == NULL, 0) && (MALLOC_0_IS_NONNULL || size != 0))
+ return REG_ESPACE;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+internal_function __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 (BE (set->elems == NULL, 0))
+ {
+ set->alloc = set->nelem = 0;
+ return REG_ESPACE;
+ }
+ set->elems[0] = elem;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+internal_function __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 (BE (set->elems == NULL, 0))
+ 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
+internal_function __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 (BE (dest->elems == NULL, 0))
+ {
+ 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
+internal_function __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 (BE (new_elems == NULL, 0))
+ 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
+internal_function __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 (BE (dest->elems == NULL, 0))
+ 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
+internal_function __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 (BE (new_buffer == NULL, 0))
+ return REG_ESPACE;
+ dest->elems = new_buffer;
+ dest->alloc = new_alloc;
+ }
+
+ if (BE (dest->nelem == 0, 0))
+ {
+ 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
+internal_function __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 BE (re_node_set_init_1 (set, elem) == REG_NOERROR, 1);
+
+ if (BE (set->nelem, 0) == 0)
+ {
+ /* We already guaranteed above that set->alloc != 0. */
+ 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 (BE (new_elems == NULL, 0))
+ 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])
+ {
+ idx = 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];
+ }
+
+ /* 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
+internal_function __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 (BE (new_elems == NULL, 0))
+ 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
+internal_function __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
+internal_function __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
+internal_function
+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
+internal_function
+re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
+{
+ if (BE (dfa->nodes_len >= dfa->nodes_alloc, 0))
+ {
+ 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 (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_nodes_alloc, 0))
+ return -1;
+
+ new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
+ if (BE (new_nodes == NULL, 0))
+ return -1;
+ dfa->nodes = new_nodes;
+ new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc);
+ new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc);
+ new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
+ new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
+ if (BE (new_nexts == NULL || new_indices == NULL
+ || new_edests == NULL || new_eclosures == NULL, 0))
+ {
+ re_free (new_nexts);
+ re_free (new_indices);
+ re_free (new_edests);
+ re_free (new_eclosures);
+ return -1;
+ }
+ dfa->nexts = new_nexts;
+ dfa->org_indices = new_indices;
+ dfa->edests = new_edests;
+ dfa->eclosures = new_eclosures;
+ dfa->nodes_alloc = new_nodes_alloc;
+ }
+ dfa->nodes[dfa->nodes_len] = token;
+ dfa->nodes[dfa->nodes_len].constraint = 0;
+#ifdef RE_ENABLE_I18N
+ dfa->nodes[dfa->nodes_len].accept_mb =
+ ((token.type == OP_PERIOD && dfa->mb_cur_max > 1)
+ || token.type == COMPLEX_BRACKET);
+#endif
+ 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
+internal_function
+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 *
+internal_function __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 (BE (nodes->nelem == 0, 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 (BE (new_state == NULL, 0))
+ *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 *
+internal_function __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 (BE (new_state == NULL, 0))
+ *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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (spot->alloc <= spot->num, 0))
+ {
+ Idx new_alloc = 2 * spot->num + 2;
+ re_dfastate_t **new_array = re_realloc (spot->array, re_dfastate_t *,
+ new_alloc);
+ if (BE (new_array == NULL, 0))
+ 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 *
+internal_function __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 (BE (newstate == NULL, 0))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ 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;
+#ifdef RE_ENABLE_I18N
+ newstate->accept_mb |= node->accept_mb;
+#endif /* RE_ENABLE_I18N */
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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 *
+internal_function __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 (BE (newstate == NULL, 0))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ 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;
+#ifdef RE_ENABLE_I18N
+ newstate->accept_mb |= node->accept_mb;
+#endif /* RE_ENABLE_I18N */
+
+ /* 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)
+ {
+ newstate->entrance_nodes = re_malloc (re_node_set, 1);
+ if (BE (newstate->entrance_nodes == NULL, 0))
+ {
+ free_state (newstate);
+ return NULL;
+ }
+ if (re_node_set_init_copy (newstate->entrance_nodes, nodes)
+ != REG_NOERROR)
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
new file mode 100644
index 0000000..ec074be
--- /dev/null
+++ b/lib/regex_internal.h
@@ -0,0 +1,903 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2016 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 General Public
+ License as published by the Free Software Foundation; either
+ version 3 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _REGEX_INTERNAL_H
+#define _REGEX_INTERNAL_H 1
+
+#include <assert.h>
+#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>
+
+#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) 0
+# define lock_lock(lock) __libc_lock_lock (lock)
+# define lock_unlock(lock) __libc_lock_unlock (lock)
+#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO
+# include "glthread/lock.h"
+ /* Use gl_lock_define if empty macro arguments are known to work.
+ Otherwise, fall back on less-portable substitutes. */
+# if ((defined __GNUC__ && !defined __STRICT_ANSI__) \
+ || (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__))
+# define lock_define(name) gl_lock_define (, name)
+# elif USE_POSIX_THREADS
+# define lock_define(name) pthread_mutex_t name;
+# elif USE_PTH_THREADS
+# define lock_define(name) pth_mutex_t name;
+# elif USE_SOLARIS_THREADS
+# define lock_define(name) mutex_t name;
+# elif USE_WINDOWS_THREADS
+# define lock_define(name) gl_lock_t name;
+# else
+# define lock_define(name)
+# endif
+# 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 USE_UNLOCKED_IO
+# 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
+
+#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
+# define gettext(msgid) (msgid)
+#endif
+
+#ifndef gettext_noop
+/* This define is so xgettext can find the internationalizable
+ strings. */
+# define gettext_noop(String) String
+#endif
+
+#if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE) || _LIBC
+# define RE_ENABLE_I18N
+#endif
+
+#if __GNUC__ >= 3
+# define BE(expr, val) __builtin_expect (expr, val)
+#else
+# define BE(expr, val) (expr)
+#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 __iswctype
+# 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
+# define attribute_hidden
+#endif /* not _LIBC */
+
+#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1)
+# define __attribute__(arg)
+#endif
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#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. For portability to hosts with
+ padding bits, do not use '(sizeof (bitset_word_t) * CHAR_BIT)';
+ instead, deduce it directly from BITSET_WORD_MAX. Avoid
+ greater-than-32-bit integers and unconditional shifts by more than
+ 31 bits, as they're not portable. */
+#if BITSET_WORD_MAX == 0xffffffffUL
+# define BITSET_WORD_BITS 32
+#elif BITSET_WORD_MAX >> 31 >> 4 == 1
+# define BITSET_WORD_BITS 36
+#elif BITSET_WORD_MAX >> 31 >> 16 == 1
+# define BITSET_WORD_BITS 48
+#elif BITSET_WORD_MAX >> 31 >> 28 == 1
+# define BITSET_WORD_BITS 60
+#elif BITSET_WORD_MAX >> 31 >> 31 >> 1 == 1
+# define BITSET_WORD_BITS 64
+#elif BITSET_WORD_MAX >> 31 >> 31 >> 9 == 1
+# define BITSET_WORD_BITS 72
+#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 3 == 1
+# define BITSET_WORD_BITS 128
+#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 == 1
+# define BITSET_WORD_BITS 256
+#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 > 1
+# define BITSET_WORD_BITS 257 /* any value > SBC_MAX will do here */
+# if BITSET_WORD_BITS <= SBC_MAX
+# error "Invalid SBC_MAX"
+# endif
+#else
+# error "Add case for new bitset_word_t size"
+#endif
+
+/* 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,
+#ifdef RE_ENABLE_I18N
+ COMPLEX_BRACKET = 6,
+ OP_UTF8_PERIOD = 7,
+#endif /* RE_ENABLE_I18N */
+
+ /* 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;
+
+#ifdef RE_ENABLE_I18N
+typedef struct
+{
+ /* Multibyte characters. */
+ wchar_t *mbchars;
+
+ /* Collating symbols. */
+# ifdef _LIBC
+ int32_t *coll_syms;
+# endif
+
+ /* Equivalence classes. */
+# ifdef _LIBC
+ int32_t *equiv_classes;
+# endif
+
+ /* Range expressions. */
+# ifdef _LIBC
+ uint32_t *range_starts;
+ uint32_t *range_ends;
+# else /* not _LIBC */
+ wchar_t *range_starts;
+ wchar_t *range_ends;
+# endif /* not _LIBC */
+
+ /* 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;
+#endif /* RE_ENABLE_I18N */
+
+typedef struct
+{
+ union
+ {
+ unsigned char c; /* for CHARACTER */
+ re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
+#ifdef RE_ENABLE_I18N
+ re_charset_t *mbcset; /* for COMPLEX_BRACKET */
+#endif /* RE_ENABLE_I18N */
+ Idx idx; /* for BACK_REF */
+ re_context_type ctx_type; /* for ANCHOR */
+ } opr;
+#if __GNUC__ >= 2 && !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;
+#ifdef RE_ENABLE_I18N
+ 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;
+#endif
+ 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;
+#ifdef RE_ENABLE_I18N
+ /* Store the wide character string which is corresponding to MBS. */
+ wint_t *wcs;
+ Idx *offsets;
+ mbstate_t cur_state;
+#endif
+ /* 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 internal_function
+# define IS_IN(libc) false
+#endif
+
+static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
+ Idx new_buf_len)
+ internal_function;
+#ifdef RE_ENABLE_I18N
+static void build_wcs_buffer (re_string_t *pstr) internal_function;
+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr)
+ internal_function;
+#endif /* RE_ENABLE_I18N */
+static void build_upper_buffer (re_string_t *pstr) internal_function;
+static void re_string_translate_buffer (re_string_t *pstr) internal_function;
+static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
+ int eflags)
+ internal_function __attribute__ ((pure));
+
+#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))
+
+#if defined _LIBC || HAVE_ALLOCA
+# include <alloca.h>
+#endif
+
+#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
+/* alloca is implemented with malloc, so just use malloc. */
+# define __libc_use_alloca(n) 0
+# undef alloca
+# define alloca(n) malloc (n)
+# endif
+#endif
+
+#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;
+ char more;
+ char unused;
+ unsigned short int eps_reachable_subexps_map;
+};
+
+typedef struct
+{
+ /* The string object corresponding to the input string. */
+ re_string_t input;
+#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+ const re_dfa_t *const dfa;
+#else
+ const re_dfa_t *dfa;
+#endif
+ /* 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 void
+bitset_set (bitset_t set, Idx i)
+{
+ set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS;
+}
+
+static void
+bitset_clear (bitset_t set, Idx i)
+{
+ set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS);
+}
+
+static bool
+bitset_contain (const bitset_t set, Idx i)
+{
+ return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1;
+}
+
+static void
+bitset_empty (bitset_t set)
+{
+ memset (set, '\0', sizeof (bitset_t));
+}
+
+static 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 void
+bitset_copy (bitset_t dest, const bitset_t src)
+{
+ memcpy (dest, src, sizeof (bitset_t));
+}
+
+static void __attribute__ ((unused))
+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 void __attribute__ ((unused))
+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 void __attribute__ ((unused))
+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];
+}
+
+#ifdef RE_ENABLE_I18N
+/* Functions for re_string. */
+static int
+internal_function __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
+internal_function __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
+internal_function __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;
+ }
+ else
+# endif /* _LIBC */
+ return 1;
+}
+#endif /* RE_ENABLE_I18N */
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#if __GNUC_PREREQ (3,4)
+# undef __attribute_warn_unused_result__
+# define __attribute_warn_unused_result__ \
+ __attribute__ ((__warn_unused_result__))
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+
+#endif /* _REGEX_INTERNAL_H */
diff --git a/lib/regexec.c b/lib/regexec.c
new file mode 100644
index 0000000..fd10911
--- /dev/null
+++ b/lib/regexec.c
@@ -0,0 +1,4391 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2016 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 General Public
+ License as published by the Free Software Foundation; either
+ version 3 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
+ Idx n) internal_function;
+static void match_ctx_clean (re_match_context_t *mctx) internal_function;
+static void match_ctx_free (re_match_context_t *cache) internal_function;
+static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node,
+ Idx str_idx, Idx from, Idx to)
+ internal_function;
+static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
+ internal_function;
+static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node,
+ Idx str_idx) internal_function;
+static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop,
+ Idx node, Idx str_idx)
+ internal_function;
+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)
+ internal_function;
+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) internal_function;
+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) internal_function;
+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) internal_function;
+static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
+ Idx nregs, int regs_allocated) internal_function;
+static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx)
+ internal_function;
+static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match,
+ Idx *p_match_first) internal_function;
+static Idx check_halt_state_context (const re_match_context_t *mctx,
+ const re_dfastate_t *state, Idx idx)
+ internal_function;
+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) internal_function;
+static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs,
+ Idx str_idx, Idx dest_node, Idx nregs,
+ regmatch_t *regs,
+ re_node_set *eps_via_nodes)
+ internal_function;
+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) internal_function;
+static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs)
+ internal_function;
+
+#ifdef RE_ENABLE_I18N
+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)
+ internal_function;
+#endif /* RE_ENABLE_I18N */
+static reg_errcode_t sift_states_backward (const re_match_context_t *mctx,
+ re_sift_context_t *sctx)
+ internal_function;
+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)
+ internal_function;
+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)
+ internal_function;
+static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates)
+ internal_function;
+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) internal_function;
+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)
+ internal_function;
+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) internal_function;
+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) internal_function;
+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)
+ internal_function;
+static reg_errcode_t merge_state_array (const re_dfa_t *dfa,
+ re_dfastate_t **dst,
+ re_dfastate_t **src, Idx num)
+ internal_function;
+static re_dfastate_t *find_recover_state (reg_errcode_t *err,
+ re_match_context_t *mctx) internal_function;
+static re_dfastate_t *transit_state (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *state) internal_function;
+static re_dfastate_t *merge_state_with_log (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *next_state)
+ internal_function;
+static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx,
+ re_node_set *cur_nodes,
+ Idx str_idx) internal_function;
+#if 0
+static re_dfastate_t *transit_state_sb (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *pstate)
+ internal_function;
+#endif
+#ifdef RE_ENABLE_I18N
+static reg_errcode_t transit_state_mb (re_match_context_t *mctx,
+ re_dfastate_t *pstate)
+ internal_function;
+#endif /* RE_ENABLE_I18N */
+static reg_errcode_t transit_state_bkref (re_match_context_t *mctx,
+ const re_node_set *nodes)
+ internal_function;
+static reg_errcode_t get_subexp (re_match_context_t *mctx,
+ Idx bkref_node, Idx bkref_str_idx)
+ internal_function;
+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)
+ internal_function;
+static Idx find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
+ Idx subexp_idx, int type) internal_function;
+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) internal_function;
+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)
+ internal_function;
+static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa,
+ re_node_set *cur_nodes,
+ Idx ex_subexp, int type)
+ internal_function;
+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) internal_function;
+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)
+ internal_function;
+static bool build_trtable (const re_dfa_t *dfa,
+ re_dfastate_t *state) internal_function;
+#ifdef RE_ENABLE_I18N
+static int check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
+ const re_string_t *input, Idx idx)
+ internal_function;
+# ifdef _LIBC
+static unsigned int find_collation_sequence_value (const unsigned char *mbs,
+ size_t name_len)
+ internal_function;
+# endif /* _LIBC */
+#endif /* RE_ENABLE_I18N */
+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) internal_function;
+static bool check_node_accept (const re_match_context_t *mctx,
+ const re_token_t *node, Idx idx)
+ internal_function;
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len)
+ internal_function;
+
+/* 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.
+
+ We return 0 if we find a match and REG_NOMATCH if not. */
+
+int
+regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string,
+ size_t nmatch, regmatch_t pmatch[], 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
+# 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[], 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. Return value -1 means no
+ match was found and -2 indicates an internal 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
+internal_function
+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 = length1 + length2;
+ char *s = NULL;
+
+ if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
+ return -2;
+
+ /* Concatenate the strings. */
+ if (length2 > 0)
+ if (length1 > 0)
+ {
+ s = re_malloc (char, len);
+
+ if (BE (s == NULL, 0))
+ 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
+internal_function
+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 (BE (start < 0 || start > length, 0))
+ return -1;
+ if (BE (length < last_start || (0 <= range && last_start < start), 0))
+ last_start = length;
+ else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0))
+ 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 (BE (bufp->no_sub, 0))
+ regs = NULL;
+
+ /* We need at least 1 register. */
+ if (regs == NULL)
+ nregs = 1;
+ else if (BE (bufp->regs_allocated == REGS_FIXED
+ && regs->num_regs <= bufp->re_nsub, 0))
+ {
+ nregs = regs->num_regs;
+ if (BE (nregs < 1, 0))
+ {
+ /* Nothing can be copied to regs. */
+ regs = NULL;
+ nregs = 1;
+ }
+ }
+ else
+ nregs = bufp->re_nsub + 1;
+ pmatch = re_malloc (regmatch_t, nregs);
+ if (BE (pmatch == NULL, 0))
+ {
+ 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 (BE (bufp->regs_allocated == REGS_UNALLOCATED, 0))
+ rval = -2;
+ }
+
+ if (BE (rval == 0, 1))
+ {
+ if (ret_len)
+ {
+ 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
+internal_function
+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 (BE (regs->start == NULL, 0))
+ return REGS_UNALLOCATED;
+ regs->end = re_malloc (regoff_t, need_regs);
+ if (BE (regs->end == NULL, 0))
+ {
+ 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 (BE (need_regs > regs->num_regs, 0))
+ {
+ regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs);
+ regoff_t *new_end;
+ if (BE (new_start == NULL, 0))
+ return REGS_UNALLOCATED;
+ new_end = re_realloc (regs->end, regoff_t, need_regs);
+ if (BE (new_end == NULL, 0))
+ {
+ re_free (new_start);
+ return REGS_UNALLOCATED;
+ }
+ regs->start = new_start;
+ regs->end = new_end;
+ regs->num_regs = need_regs;
+ }
+ }
+ else
+ {
+ assert (regs_allocated == REGS_FIXED);
+ /* This function may not be called with REGS_FIXED and nregs too big. */
+ assert (regs->num_regs >= nregs);
+ 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__ internal_function
+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;
+#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+ re_match_context_t mctx = { .dfa = dfa };
+#else
+ re_match_context_t mctx;
+#endif
+ char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate
+ && start != last_start && !preg->can_be_null)
+ ? preg->fastmap : NULL);
+ RE_TRANSLATE_TYPE t = preg->translate;
+
+#if !(defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+ memset (&mctx, '\0', sizeof (re_match_context_t));
+ mctx.dfa = dfa;
+#endif
+
+ extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0;
+ nmatch -= extra_nmatch;
+
+ /* Check if the DFA haven't been compiled. */
+ if (BE (preg->used == 0 || dfa->init_state == NULL
+ || dfa->init_state_word == NULL || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL, 0))
+ return REG_NOMATCH;
+
+#ifdef DEBUG
+ /* We assume front-end functions already check them. */
+ assert (0 <= last_start && last_start <= length);
+#endif
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+ <= mctx.input.bufs_len), 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+
+ mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1);
+ if (BE (mctx.state_log == NULL, 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ }
+ else
+ mctx.state_log = NULL;
+
+ 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 (BE (match_first < right_lim, 1)
+ && !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 (BE (match_first < right_lim, 1)
+ && !fastmap[(unsigned char) string[match_first]])
+ ++match_first;
+
+ forward_match_found_start_or_reached_end:
+ if (BE (match_first == right_lim, 0))
+ {
+ 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 (BE (offset >= (__re_size_t) mctx.input.valid_raw_len, 0))
+ {
+ err = re_string_reconstruct (&mctx.input, match_first,
+ eflags);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+
+ offset = match_first - mctx.input.raw_mbs_idx;
+ }
+ /* If MATCH_FIRST is out of the buffer, leave it as '\0'.
+ Note that MATCH_FIRST must not be smaller than 0. */
+ ch = (match_first >= length
+ ? 0 : re_string_byte_at (&mctx.input, offset));
+ 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 (BE (err != REG_NOERROR, 0))
+ goto free_return;
+
+#ifdef RE_ENABLE_I18N
+ /* 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;
+#endif
+
+ /* 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 (BE (match_last == -2, 0))
+ {
+ 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 (BE (err != REG_NOMATCH, 0))
+ goto free_return;
+ match_last = -1;
+ }
+ else
+ break; /* We found a match. */
+ }
+ }
+
+ match_ctx_clean (&mctx);
+ }
+
+#ifdef DEBUG
+ assert (match_last != -1);
+ assert (err == REG_NOERROR);
+#endif
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ 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)
+ {
+#ifdef RE_ENABLE_I18N
+ if (BE (mctx.input.offsets_needed != 0, 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]);
+ }
+#else
+ assert (mctx.input.offsets_needed == 0);
+#endif
+ 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
+internal_function __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;
+#ifdef DEBUG
+ assert (mctx->state_log != NULL);
+#endif
+ match_last = mctx->match_last;
+ halt_node = mctx->last_node;
+
+ /* Avoid overflow. */
+ if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0))
+ return REG_ESPACE;
+
+ sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (BE (sifted_states == NULL, 0))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ if (dfa->nbackref)
+ {
+ lim_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (BE (lim_states == NULL, 0))
+ {
+ 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 (BE (ret != REG_NOERROR, 0))
+ 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 (BE (ret != REG_NOERROR, 0))
+ 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 (BE (ret != REG_NOERROR, 0))
+ 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 inline re_dfastate_t *
+__attribute__ ((always_inline)) internal_function
+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
+internal_function __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 (BE (cur_state == NULL, 0))
+ {
+ 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 (BE (dfa->nbackref, 0))
+ {
+ at_init_state = false;
+ err = check_subexp_matching_top (mctx, &cur_state->nodes, 0);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+
+ if (cur_state->has_backref)
+ {
+ err = transit_state_bkref (mctx, &cur_state->nodes);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ }
+
+ /* If the RE accepts NULL string. */
+ if (BE (cur_state->halt, 0))
+ {
+ 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 ((BE (next_char_idx >= mctx->input.bufs_len, 0)
+ && mctx->input.bufs_len < mctx->input.len)
+ || (BE (next_char_idx >= mctx->input.valid_len, 0)
+ && mctx->input.valid_len < mctx->input.len))
+ {
+ err = extend_buffers (mctx, next_char_idx + 1);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ return -2;
+
+ if (mctx->state_log == NULL
+ || (match && !fl_longest_match)
+ || (cur_state = find_recover_state (&err, mctx)) == NULL)
+ break;
+ }
+
+ if (BE (at_init_state, 0))
+ {
+ 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
+internal_function
+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
+internal_function
+check_halt_state_context (const re_match_context_t *mctx,
+ const re_dfastate_t *state, Idx idx)
+{
+ Idx i;
+ unsigned int context;
+#ifdef DEBUG
+ assert (state->halt);
+#endif
+ 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 in case of errors. */
+
+static Idx
+internal_function
+proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
+ Idx *pidx, Idx node, re_node_set *eps_via_nodes,
+ struct re_fail_stack_t *fs)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx i;
+ bool ok;
+ 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];
+ Idx dest_node;
+ ok = re_node_set_insert (eps_via_nodes, node);
+ if (BE (! ok, 0))
+ return -2;
+ /* Pick up a valid destination, or return -1 if none
+ is found. */
+ for (dest_node = -1, 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,
+ 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;
+
+#ifdef RE_ENABLE_I18N
+ if (dfa->nodes[node].accept_mb)
+ naccepted = check_node_accept_bytes (dfa, node, &mctx->input, *pidx);
+ else
+#endif /* RE_ENABLE_I18N */
+ if (type == OP_BACK_REF)
+ {
+ Idx subexp_idx = dfa->nodes[node].opr.idx + 1;
+ naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
+ if (fs != NULL)
+ {
+ if (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 (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+ naccepted) != 0)
+ return -1;
+ }
+ }
+
+ if (naccepted == 0)
+ {
+ Idx dest_node;
+ ok = re_node_set_insert (eps_via_nodes, node);
+ if (BE (! ok, 0))
+ 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
+internal_function __attribute_warn_unused_result__
+push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
+ Idx nregs, regmatch_t *regs, re_node_set *eps_via_nodes)
+{
+ reg_errcode_t err;
+ Idx num = fs->num++;
+ if (fs->num == fs->alloc)
+ {
+ struct re_fail_stack_ent_t *new_array;
+ new_array = realloc (fs->stack, (sizeof (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, nregs);
+ if (fs->stack[num].regs == NULL)
+ return REG_ESPACE;
+ memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
+ err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
+ return err;
+}
+
+static Idx
+internal_function
+pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs,
+ regmatch_t *regs, re_node_set *eps_via_nodes)
+{
+ Idx num = --fs->num;
+ assert (num >= 0);
+ *pidx = fs->stack[num].idx;
+ memcpy (regs, fs->stack[num].regs, 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;
+ return fs->stack[num].node;
+}
+
+/* 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
+internal_function __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 };
+ regmatch_t *prev_idx_match;
+ bool prev_idx_match_malloced = false;
+
+#ifdef DEBUG
+ assert (nmatch > 1);
+ assert (mctx->state_log != NULL);
+#endif
+ 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 (__libc_use_alloca (nmatch * sizeof (regmatch_t)))
+ prev_idx_match = (regmatch_t *) alloca (nmatch * sizeof (regmatch_t));
+ else
+ {
+ prev_idx_match = re_malloc (regmatch_t, nmatch);
+ if (prev_idx_match == NULL)
+ {
+ free_fail_stack_return (fs);
+ return REG_ESPACE;
+ }
+ prev_idx_match_malloced = true;
+ }
+ 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)
+ {
+ Idx reg_idx;
+ if (fs)
+ {
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
+ break;
+ if (reg_idx == nmatch)
+ {
+ re_node_set_free (&eps_via_nodes);
+ if (prev_idx_match_malloced)
+ re_free (prev_idx_match);
+ return free_fail_stack_return (fs);
+ }
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ &eps_via_nodes);
+ }
+ else
+ {
+ re_node_set_free (&eps_via_nodes);
+ if (prev_idx_match_malloced)
+ re_free (prev_idx_match);
+ return REG_NOERROR;
+ }
+ }
+
+ /* Proceed to next node. */
+ cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node,
+ &eps_via_nodes, fs);
+
+ if (BE (cur_node < 0, 0))
+ {
+ if (BE (cur_node == -2, 0))
+ {
+ re_node_set_free (&eps_via_nodes);
+ if (prev_idx_match_malloced)
+ re_free (prev_idx_match);
+ free_fail_stack_return (fs);
+ return REG_ESPACE;
+ }
+ if (fs)
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ &eps_via_nodes);
+ else
+ {
+ re_node_set_free (&eps_via_nodes);
+ if (prev_idx_match_malloced)
+ re_free (prev_idx_match);
+ return REG_NOMATCH;
+ }
+ }
+ }
+ re_node_set_free (&eps_via_nodes);
+ if (prev_idx_match_malloced)
+ re_free (prev_idx_match);
+ return free_fail_stack_return (fs);
+}
+
+static reg_errcode_t
+internal_function
+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
+internal_function
+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)
+ {
+ Idx reg_num = dfa->nodes[cur_node].opr.idx + 1;
+ if (reg_num < nmatch)
+ {
+ /* We are at the last node of this sub expression. */
+ 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
+internal_function
+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;
+
+#ifdef DEBUG
+ assert (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
+#endif
+
+ /* 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
+ if (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ err = REG_NOERROR;
+ free_return:
+ re_node_set_free (&cur_dest);
+ return err;
+}
+
+static reg_errcode_t
+internal_function __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;
+
+#ifdef DEBUG
+ re_token_type_t type = dfa->nodes[prev_node].type;
+ assert (!IS_EPSILON_NODE (type));
+#endif
+#ifdef RE_ENABLE_I18N
+ /* 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);
+#endif /* RE_ENABLE_I18N */
+
+ /* 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 (BE (! ok, 0))
+ return REG_ESPACE;
+ }
+
+ return REG_NOERROR;
+}
+
+/* Helper functions. */
+
+static reg_errcode_t
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ if (top < next_state_log_idx)
+ {
+ 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
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ return err;
+ dst[st_idx] = re_acquire_state (&err, dfa, &merged_set);
+ re_node_set_free (&merged_set);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+
+ sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ if (candidates && mctx->state_log[str_idx]->has_backref)
+ {
+ err = sift_states_bkref (mctx, sctx, str_idx, candidates);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+internal_function __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 (BE (err != REG_NOERROR, 0))
+ return err;
+
+ if (!state->inveclosure.alloc)
+ {
+ err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem);
+ if (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ return REG_ESPACE;
+ }
+ }
+ return re_node_set_add_intersect (dest_nodes, candidates,
+ &state->inveclosure);
+}
+
+static reg_errcode_t
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ {
+ 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
+internal_function
+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
+internal_function
+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
+internal_function
+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
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+internal_function __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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (! ok, 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ cur_state = local_sctx.sifted_states[str_idx];
+ err = sift_states_backward (mctx, &local_sctx);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ if (sctx->limited_states != NULL)
+ {
+ err = merge_state_array (dfa, sctx->limited_states,
+ local_sctx.sifted_states,
+ str_idx + 1);
+ if (BE (err != REG_NOERROR, 0))
+ 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;
+}
+
+
+#ifdef RE_ENABLE_I18N
+static int
+internal_function
+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
+ could't accept the current input "multi byte". */
+ naccepted = 0;
+ /* Otherwise, it is sure that the node could accept
+ 'naccepted' bytes input. */
+ return naccepted;
+}
+#endif /* RE_ENABLE_I18N */
+
+
+/* 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.
+ If STATE can accept a multibyte char/collating element/back reference
+ update the destination of STATE_LOG. */
+
+static re_dfastate_t *
+internal_function __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;
+
+#ifdef RE_ENABLE_I18N
+ /* If the current state can accept multibyte. */
+ if (BE (state->accept_mb, 0))
+ {
+ *err = transit_state_mb (mctx, state);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+#endif /* RE_ENABLE_I18N */
+
+ /* 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 (BE (trtable != NULL, 1))
+ return trtable[ch];
+
+ trtable = state->word_trtable;
+ if (BE (trtable != NULL, 1))
+ {
+ 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 *
+internal_function
+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 (BE (*err != REG_NOERROR, 0))
+ 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 (BE (dfa->nbackref, 0) && 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 (BE (*err != REG_NOERROR, 0))
+ return NULL;
+
+ /* If the next state has back references. */
+ if (next_state->has_backref)
+ {
+ *err = transit_state_bkref (mctx, &next_state->nodes);
+ if (BE (*err != REG_NOERROR, 0))
+ 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 *
+internal_function
+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
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ 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. */
+
+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 (BE (*err != REG_NOERROR, 0))
+ 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 (BE (*err != REG_NOERROR, 0))
+ {
+ 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
+
+#ifdef RE_ENABLE_I18N
+static reg_errcode_t
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ return err;
+#ifdef DEBUG
+ assert (dfa->nexts[cur_node_idx] != -1);
+#endif
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (mctx->state_log[dest_idx] == NULL && err != REG_NOERROR, 0))
+ return err;
+ }
+ return REG_NOERROR;
+}
+#endif /* RE_ENABLE_I18N */
+
+static reg_errcode_t
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ goto free_return;
+
+ /* And add the epsilon closures (which is 'new_dest_nodes') of
+ the backreference to appropriate state_log. */
+#ifdef DEBUG
+ assert (dfa->nexts[node_idx] != -1);
+#endif
+ 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 (BE (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ err = transit_state_bkref (mctx, new_dest_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ 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
+internal_function __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 (BE (bkref_str_off + sl_str_diff > mctx->input.valid_len, 0))
+ {
+ /* 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (bkref_str_off >= mctx->input.valid_len, 0))
+ {
+ /* 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str);
+ if (BE (sub_last == NULL, 0))
+ return REG_ESPACE;
+ err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+ if (err == REG_NOMATCH)
+ continue;
+ }
+ }
+ 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
+internal_function
+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 (BE (err != REG_NOERROR, 0))
+ 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
+internal_function
+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, or REG_NOMATCH otherwise. */
+
+static reg_errcode_t
+internal_function __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 (BE (path->alloc < last_str + mctx->max_mb_elem_len + 1, 0))
+ {
+ 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 (BE (IDX_MAX - old_alloc < incr_alloc, 0))
+ return REG_ESPACE;
+ new_alloc = old_alloc + incr_alloc;
+ if (BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0))
+ return REG_ESPACE;
+ new_array = re_realloc (path->array, re_dfastate_t *, new_alloc);
+ if (BE (new_array == NULL, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (BE (cur_state == NULL && err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ err = expand_bkref_cache (mctx, &next_nodes, str_idx,
+ subexp_num, type);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (cur_state == NULL && err != REG_NOERROR, 0))
+ {
+ 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
+internal_function __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;
+#ifdef RE_ENABLE_I18N
+ reg_errcode_t err = REG_NOERROR;
+#endif
+ 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];
+#ifdef DEBUG
+ re_token_type_t type = dfa->nodes[cur_node].type;
+ assert (!IS_EPSILON_NODE (type));
+#endif
+#ifdef RE_ENABLE_I18N
+ /* 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 (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ ok = re_node_set_insert (&union_set, next_node);
+ if (BE (! ok, 0))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ mctx->state_log[next_idx] = re_acquire_state (&err, dfa,
+ &union_set);
+ if (BE (mctx->state_log[next_idx] == NULL
+ && err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ }
+#endif /* RE_ENABLE_I18N */
+ if (naccepted
+ || check_node_accept (mctx, dfa->nodes + cur_node, str_idx))
+ {
+ ok = re_node_set_insert (next_nodes, dfa->nexts[cur_node]);
+ if (BE (! ok, 0))
+ {
+ 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
+internal_function
+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;
+#ifdef DEBUG
+ assert (cur_nodes->nelem);
+#endif
+ err = re_node_set_alloc (&new_nodes, cur_nodes->nelem);
+ if (BE (err != REG_NOERROR, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ {
+ 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
+internal_function __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 (BE (! ok, 0))
+ return REG_ESPACE;
+ }
+ break;
+ }
+ ok = re_node_set_insert (dst_nodes, cur_node);
+ if (BE (! ok, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ 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
+internal_function __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 (BE (err != REG_NOERROR || err2 != REG_NOERROR
+ || err3 != REG_NOERROR, 0))
+ {
+ 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 (BE (err != REG_NOERROR || ! ok, 0))
+ {
+ 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 (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set);
+ re_node_set_free (&union_set);
+ if (BE (mctx->state_log[to_idx] == NULL
+ && err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ while (ent++->more);
+ return REG_NOERROR;
+}
+
+/* Build transition table for the state.
+ Return true if successful. */
+
+static bool
+internal_function
+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;
+ bool dests_node_malloced = false;
+ bool dest_states_malloced = false;
+ Idx ndests; /* Number of the destination states from 'state'. */
+ re_dfastate_t **trtable;
+ re_dfastate_t **dest_states = NULL, **dest_states_word, **dest_states_nl;
+ re_node_set follows, *dests_node;
+ bitset_t *dests_ch;
+ bitset_t acceptable;
+
+ struct dests_alloc
+ {
+ re_node_set dests_node[SBC_MAX];
+ bitset_t dests_ch[SBC_MAX];
+ } *dests_alloc;
+
+ /* 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. */
+ if (__libc_use_alloca (sizeof (struct dests_alloc)))
+ dests_alloc = (struct dests_alloc *) alloca (sizeof (struct dests_alloc));
+ else
+ {
+ dests_alloc = re_malloc (struct dests_alloc, 1);
+ if (BE (dests_alloc == NULL, 0))
+ return false;
+ dests_node_malloced = true;
+ }
+ dests_node = dests_alloc->dests_node;
+ dests_ch = dests_alloc->dests_ch;
+
+ /* 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 (BE (ndests <= 0, 0))
+ {
+ if (dests_node_malloced)
+ free (dests_alloc);
+ /* 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 (BE (state->trtable == NULL, 0))
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ err = re_node_set_alloc (&follows, ndests + 1);
+ if (BE (err != REG_NOERROR, 0))
+ goto out_free;
+
+ /* Avoid arithmetic overflow in size calculation. */
+ if (BE ((((SIZE_MAX - (sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX)
+ / (3 * sizeof (re_dfastate_t *)))
+ < ndests),
+ 0))
+ goto out_free;
+
+ if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX
+ + ndests * 3 * sizeof (re_dfastate_t *)))
+ dest_states = (re_dfastate_t **)
+ alloca (ndests * 3 * sizeof (re_dfastate_t *));
+ else
+ {
+ dest_states = (re_dfastate_t **)
+ malloc (ndests * 3 * sizeof (re_dfastate_t *));
+ if (BE (dest_states == NULL, 0))
+ {
+out_free:
+ if (dest_states_malloced)
+ free (dest_states);
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+ if (dests_node_malloced)
+ free (dests_alloc);
+ return false;
+ }
+ dest_states_malloced = true;
+ }
+ dest_states_word = dest_states + ndests;
+ dest_states_nl = dest_states_word + ndests;
+ 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 (BE (err != REG_NOERROR, 0))
+ goto out_free;
+ }
+ }
+ dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0);
+ if (BE (dest_states[i] == NULL && err != REG_NOERROR, 0))
+ 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 (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0))
+ 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 (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0))
+ 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 (!BE (need_word_trtable, 0))
+ {
+ /* 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 (BE (trtable == NULL, 0))
+ 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 (BE (elem & 1, 0))
+ {
+ /* 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 (BE (trtable == NULL, 0))
+ 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 (BE (elem & 1, 0))
+ {
+ /* 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;
+ }
+ }
+
+ if (dest_states_malloced)
+ free (dest_states);
+
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+
+ if (dests_node_malloced)
+ free (dests_alloc);
+
+ 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]. This function return the number of destinations. */
+
+static Idx
+internal_function
+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)
+ {
+#ifdef RE_ENABLE_I18N
+ if (dfa->mb_cur_max > 1)
+ bitset_merge (accepts, dfa->sb_char);
+ else
+#endif
+ 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');
+ }
+#ifdef RE_ENABLE_I18N
+ 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');
+ }
+#endif
+ 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;
+ }
+#ifdef RE_ENABLE_I18N
+ 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
+#endif
+ 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;
+ }
+#ifdef RE_ENABLE_I18N
+ 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
+#endif
+ 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 (BE (err != REG_NOERROR, 0))
+ goto error_return;
+ ++ndests;
+ }
+
+ /* Put the position in the current group. */
+ ok = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]);
+ if (BE (! ok, 0))
+ 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 (BE (err != REG_NOERROR, 0))
+ goto error_return;
+ ++ndests;
+ bitset_empty (accepts);
+ }
+ }
+ return ndests;
+ error_return:
+ for (j = 0; j < ndests; ++j)
+ re_node_set_free (dests_node + j);
+ return -1;
+}
+
+#ifdef RE_ENABLE_I18N
+/* 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
+internal_function
+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 (BE (node->type == OP_UTF8_PERIOD, 0))
+ {
+ unsigned char c = re_string_byte_at (input, str_idx), d;
+ if (BE (c < 0xc2, 1))
+ 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 /* _LIBC */
+ 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);
+ if (idx > 0)
+ for (i = 0; i < cset->nequiv_classes; ++i)
+ {
+ int32_t equiv_class_idx = cset->equiv_classes[i];
+ size_t weight_len = weights[idx & 0xffffff];
+ if (weight_len == weights[equiv_class_idx & 0xffffff]
+ && (idx >> 24) == (equiv_class_idx >> 24))
+ {
+ Idx cnt = 0;
+
+ idx &= 0xffffff;
+ equiv_class_idx &= 0xffffff;
+
+ while (cnt <= weight_len
+ && (weights[equiv_class_idx + 1 + cnt]
+ == weights[idx + 1 + cnt]))
+ ++cnt;
+ if (cnt > weight_len)
+ {
+ 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
+internal_function
+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 */
+#endif /* RE_ENABLE_I18N */
+
+/* Check whether the node accepts the byte which is IDX-th
+ byte of the INPUT. */
+
+static bool
+internal_function
+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;
+
+#ifdef RE_ENABLE_I18N
+ case OP_UTF8_PERIOD:
+ if (ch >= ASCII_CHARS)
+ return false;
+ /* FALLTHROUGH */
+#endif
+ 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
+internal_function __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 (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2
+ <= pstr->bufs_len, 0))
+ 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 (BE (ret != REG_NOERROR, 0))
+ 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 (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ mctx->state_log = new_array;
+ }
+
+ /* Then reconstruct the buffers. */
+ if (pstr->icase)
+ {
+#ifdef RE_ENABLE_I18N
+ if (pstr->mb_cur_max > 1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ else
+#endif /* RE_ENABLE_I18N */
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+#ifdef RE_ENABLE_I18N
+ if (pstr->mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+#endif /* RE_ENABLE_I18N */
+ {
+ if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ }
+ }
+ return REG_NOERROR;
+}
+
+
+/* Functions for matching context. */
+
+/* Initialize MCTX. */
+
+static reg_errcode_t
+internal_function __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 (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n, 0))
+ 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 (BE (mctx->bkref_ents == NULL || mctx->sub_tops == NULL, 0))
+ 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
+internal_function
+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);
+ }
+ free (top);
+ }
+
+ mctx->nsub_tops = 0;
+ mctx->nbkref_ents = 0;
+}
+
+/* Free all the memory associated with MCTX. */
+
+static void
+internal_function
+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
+internal_function __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 (BE (new_entry == NULL, 0))
+ {
+ 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
+internal_function
+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
+internal_function __attribute_warn_unused_result__
+match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
+{
+#ifdef DEBUG
+ assert (mctx->sub_tops != NULL);
+ assert (mctx->asub_tops > 0);
+#endif
+ if (BE (mctx->nsub_tops == mctx->asub_tops, 0))
+ {
+ 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 (BE (new_array == NULL, 0))
+ 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 (BE (mctx->sub_tops[mctx->nsub_tops] == NULL, 0))
+ 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. */
+
+static re_sub_match_last_t *
+internal_function
+match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx)
+{
+ re_sub_match_last_t *new_entry;
+ if (BE (subtop->nlasts == subtop->alasts, 0))
+ {
+ 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 (BE (new_array == NULL, 0))
+ return NULL;
+ subtop->lasts = new_array;
+ subtop->alasts = new_alasts;
+ }
+ new_entry = calloc (1, sizeof (re_sub_match_last_t));
+ if (BE (new_entry != NULL, 1))
+ {
+ subtop->lasts[subtop->nlasts] = new_entry;
+ new_entry->node = node;
+ new_entry->str_idx = str_idx;
+ ++subtop->nlasts;
+ }
+ return new_entry;
+}
+
+static void
+internal_function
+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/lib/secure_getenv.c b/lib/secure_getenv.c
new file mode 100644
index 0000000..88a60dc
--- /dev/null
+++ b/lib/secure_getenv.c
@@ -0,0 +1,54 @@
+/* Look up an environment variable, returning NULL in insecure situations.
+
+ Copyright 2013-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#if !HAVE___SECURE_GETENV
+# if HAVE_ISSETUGID || (HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID)
+# include <unistd.h>
+# endif
+#endif
+
+char *
+secure_getenv (char const *name)
+{
+#if HAVE___SECURE_GETENV /* glibc */
+ return __secure_getenv (name);
+#elif HAVE_ISSETUGID /* OS X, FreeBSD, NetBSD, OpenBSD */
+ if (issetugid ())
+ return NULL;
+ return getenv (name);
+#elif HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID /* other Unix */
+ if (geteuid () != getuid () || getegid () != getgid ())
+ return NULL;
+ return getenv (name);
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* native Windows */
+ /* On native Windows, there is no such concept as setuid or setgid binaries.
+ - Programs launched as system services have high privileges, but they don't
+ inherit environment variables from a user.
+ - Programs launched by a user with "Run as Administrator" have high
+ privileges and use the environment variables, but the user has been asked
+ whether he agrees.
+ - Programs launched by a user without "Run as Administrator" cannot gain
+ high privileges, therefore there is no risk. */
+ return getenv (name);
+#else
+ return NULL;
+#endif
+}
diff --git a/lib/setenv.c b/lib/setenv.c
new file mode 100644
index 0000000..85c32cb
--- /dev/null
+++ b/lib/setenv.c
@@ -0,0 +1,390 @@
+/* Copyright (C) 1992, 1995-2003, 2005-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if !_LIBC
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+# define _GL_ARG_NONNULL(params)
+
+# define _GL_USE_STDLIB_ALLOC 1
+# include <config.h>
+#endif
+
+#include <alloca.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#if _LIBC || HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if !_LIBC
+# include "malloca.h"
+#endif
+
+#if _LIBC || !HAVE_SETENV
+
+#if !_LIBC
+# define __environ environ
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define setenv __setenv
+# define clearenv __clearenv
+# define tfind __tfind
+# define tsearch __tsearch
+#endif
+
+/* In the GNU C library implementation we try to be more clever and
+ allow arbitrarily many changes of the environment given that the used
+ values are from a small set. Outside glibc this will eat up all
+ memory after a while. */
+#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
+ && defined __GNUC__)
+# define USE_TSEARCH 1
+# include <search.h>
+typedef int (*compar_fn_t) (const void *, const void *);
+
+/* This is a pointer to the root of the search tree with the known
+ values. */
+static void *known_values;
+
+# define KNOWN_VALUE(Str) \
+ ({ \
+ void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \
+ value != NULL ? *(char **) value : NULL; \
+ })
+# define STORE_VALUE(Str) \
+ tsearch (Str, &known_values, (compar_fn_t) strcmp)
+
+#else
+# undef USE_TSEARCH
+
+# define KNOWN_VALUE(Str) NULL
+# define STORE_VALUE(Str) do { } while (0)
+
+#endif
+
+
+/* If this variable is not a null pointer we allocated the current
+ environment. */
+static char **last_environ;
+
+
+/* This function is used by 'setenv' and 'putenv'. The difference between
+ the two functions is that for the former must create a new string which
+ is then placed in the environment, while the argument of 'putenv'
+ must be used directly. This is all complicated by the fact that we try
+ to reuse values once generated for a 'setenv' call since we can never
+ free the strings. */
+int
+__add_to_environ (const char *name, const char *value, const char *combined,
+ int replace)
+{
+ char **ep;
+ size_t size;
+ const size_t namelen = strlen (name);
+ const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
+
+ LOCK;
+
+ /* We have to get the pointer now that we have the lock and not earlier
+ since another thread might have created a new environment. */
+ ep = __environ;
+
+ size = 0;
+ if (ep != NULL)
+ {
+ for (; *ep != NULL; ++ep)
+ if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
+ break;
+ else
+ ++size;
+ }
+
+ if (ep == NULL || *ep == NULL)
+ {
+ char **new_environ;
+#ifdef USE_TSEARCH
+ char *new_value;
+#endif
+
+ /* We allocated this space; we can extend it. */
+ new_environ =
+ (char **) (last_environ == NULL
+ ? malloc ((size + 2) * sizeof (char *))
+ : realloc (last_environ, (size + 2) * sizeof (char *)));
+ if (new_environ == NULL)
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' and 'realloc-posix' gnulib modules. */
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+ /* If the whole entry is given add it. */
+ if (combined != NULL)
+ /* We must not add the string to the search tree since it belongs
+ to the user. */
+ new_environ[size] = (char *) combined;
+ else
+ {
+ /* See whether the value is already known. */
+#ifdef USE_TSEARCH
+# ifdef _LIBC
+ new_value = (char *) alloca (namelen + 1 + vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
+# else
+ new_value = (char *) malloca (namelen + 1 + vallen);
+ if (new_value == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
+# endif
+
+ new_environ[size] = KNOWN_VALUE (new_value);
+ if (new_environ[size] == NULL)
+#endif
+ {
+ new_environ[size] = (char *) malloc (namelen + 1 + vallen);
+ if (new_environ[size] == NULL)
+ {
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+#ifdef USE_TSEARCH
+ memcpy (new_environ[size], new_value, namelen + 1 + vallen);
+#else
+ memcpy (new_environ[size], name, namelen);
+ new_environ[size][namelen] = '=';
+ memcpy (&new_environ[size][namelen + 1], value, vallen);
+#endif
+ /* And save the value now. We cannot do this when we remove
+ the string since then we cannot decide whether it is a
+ user string or not. */
+ STORE_VALUE (new_environ[size]);
+ }
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ }
+
+ if (__environ != last_environ)
+ memcpy ((char *) new_environ, (char *) __environ,
+ size * sizeof (char *));
+
+ new_environ[size + 1] = NULL;
+
+ last_environ = __environ = new_environ;
+ }
+ else if (replace)
+ {
+ char *np;
+
+ /* Use the user string if given. */
+ if (combined != NULL)
+ np = (char *) combined;
+ else
+ {
+#ifdef USE_TSEARCH
+ char *new_value;
+# ifdef _LIBC
+ new_value = alloca (namelen + 1 + vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
+# else
+ new_value = malloca (namelen + 1 + vallen);
+ if (new_value == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
+# endif
+
+ np = KNOWN_VALUE (new_value);
+ if (np == NULL)
+#endif
+ {
+ np = (char *) malloc (namelen + 1 + vallen);
+ if (np == NULL)
+ {
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+#ifdef USE_TSEARCH
+ memcpy (np, new_value, namelen + 1 + vallen);
+#else
+ memcpy (np, name, namelen);
+ np[namelen] = '=';
+ memcpy (&np[namelen + 1], value, vallen);
+#endif
+ /* And remember the value. */
+ STORE_VALUE (np);
+ }
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ }
+
+ *ep = np;
+ }
+
+ UNLOCK;
+
+ return 0;
+}
+
+int
+setenv (const char *name, const char *value, int replace)
+{
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __add_to_environ (name, value, NULL, replace);
+}
+
+/* The 'clearenv' was planned to be added to POSIX.1 but probably
+ never made it. Nevertheless the POSIX.9 standard (POSIX bindings
+ for Fortran 77) requires this function. */
+int
+clearenv (void)
+{
+ LOCK;
+
+ if (__environ == last_environ && __environ != NULL)
+ {
+ /* We allocated this environment so we can free it. */
+ free (__environ);
+ last_environ = NULL;
+ }
+
+ /* Clear the environment pointer removes the whole environment. */
+ __environ = NULL;
+
+ UNLOCK;
+
+ return 0;
+}
+
+#ifdef _LIBC
+static void
+free_mem (void)
+{
+ /* Remove all traces. */
+ clearenv ();
+
+ /* Now remove the search tree. */
+ __tdestroy (known_values, free);
+ known_values = NULL;
+}
+text_set_element (__libc_subfreeres, free_mem);
+
+
+# undef setenv
+# undef clearenv
+weak_alias (__setenv, setenv)
+weak_alias (__clearenv, clearenv)
+#endif
+
+#endif /* _LIBC || !HAVE_SETENV */
+
+/* The rest of this file is called into use when replacing an existing
+ but buggy setenv. Known bugs include failure to diagnose invalid
+ name, and consuming a leading '=' from value. */
+#if HAVE_SETENV
+
+# undef setenv
+# if !HAVE_DECL_SETENV
+extern int setenv (const char *, const char *, int);
+# endif
+# define STREQ(a, b) (strcmp (a, b) == 0)
+
+int
+rpl_setenv (const char *name, const char *value, int replace)
+{
+ int result;
+ if (!name || !*name || strchr (name, '='))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ /* Call the real setenv even if replace is 0, in case implementation
+ has underlying data to update, such as when environ changes. */
+ result = setenv (name, value, replace);
+ if (result == 0 && replace && *value == '=')
+ {
+ char *tmp = getenv (name);
+ if (!STREQ (tmp, value))
+ {
+ int saved_errno;
+ size_t len = strlen (value);
+ tmp = malloca (len + 2);
+ /* Since leading '=' is eaten, double it up. */
+ *tmp = '=';
+ memcpy (tmp + 1, value, len + 1);
+ result = setenv (name, tmp, replace);
+ saved_errno = errno;
+ freea (tmp);
+ errno = saved_errno;
+ }
+ }
+ return result;
+}
+
+#endif /* HAVE_SETENV */
diff --git a/lib/sh-quote.c b/lib/sh-quote.c
new file mode 100644
index 0000000..2db6d0d
--- /dev/null
+++ b/lib/sh-quote.c
@@ -0,0 +1,107 @@
+/* Shell quoting.
+ Copyright (C) 2001-2004, 2006, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "sh-quote.h"
+
+#include <string.h>
+
+#include "quotearg.h"
+#include "xalloc.h"
+
+/* Describes quoting for sh compatible shells. */
+static struct quoting_options *sh_quoting_options;
+
+/* Initializes the sh_quoting_options variable. */
+static void
+init_sh_quoting_options (void)
+{
+ sh_quoting_options = clone_quoting_options (NULL);
+ set_quoting_style (sh_quoting_options, shell_quoting_style);
+}
+
+/* Returns the number of bytes needed for the quoted string. */
+size_t
+shell_quote_length (const char *string)
+{
+ if (sh_quoting_options == NULL)
+ init_sh_quoting_options ();
+ return quotearg_buffer (NULL, 0, string, strlen (string),
+ sh_quoting_options);
+}
+
+/* Copies the quoted string to p and returns the incremented p.
+ There must be room for shell_quote_length (string) + 1 bytes at p. */
+char *
+shell_quote_copy (char *p, const char *string)
+{
+ if (sh_quoting_options == NULL)
+ init_sh_quoting_options ();
+ return p + quotearg_buffer (p, (size_t)(-1), string, strlen (string),
+ sh_quoting_options);
+}
+
+/* Returns the freshly allocated quoted string. */
+char *
+shell_quote (const char *string)
+{
+ if (sh_quoting_options == NULL)
+ init_sh_quoting_options ();
+ return quotearg_alloc (string, strlen (string), sh_quoting_options);
+}
+
+/* Returns a freshly allocated string containing all argument strings, quoted,
+ separated through spaces. */
+char *
+shell_quote_argv (char * const *argv)
+{
+ if (*argv != NULL)
+ {
+ char * const *argp;
+ size_t length;
+ char *command;
+ char *p;
+
+ length = 0;
+ for (argp = argv; ; )
+ {
+ length += shell_quote_length (*argp) + 1;
+ argp++;
+ if (*argp == NULL)
+ break;
+ }
+
+ command = XNMALLOC (length, char);
+
+ p = command;
+ for (argp = argv; ; )
+ {
+ p = shell_quote_copy (p, *argp);
+ argp++;
+ if (*argp == NULL)
+ break;
+ *p++ = ' ';
+ }
+ *p = '\0';
+
+ return command;
+ }
+ else
+ return xstrdup ("");
+}
diff --git a/lib/sh-quote.h b/lib/sh-quote.h
new file mode 100644
index 0000000..1708d95
--- /dev/null
+++ b/lib/sh-quote.h
@@ -0,0 +1,49 @@
+/* Shell quoting.
+ Copyright (C) 2001-2002, 2004, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _SH_QUOTE_H
+#define _SH_QUOTE_H
+
+/* When passing a command to a shell, we must quote the program name and
+ arguments, since Unix shells interpret characters like " ", "'", "<", ">",
+ "$", '*', '?' etc. in a special way. */
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Returns the number of bytes needed for the quoted string. */
+extern size_t shell_quote_length (const char *string);
+
+/* Copies the quoted string to p and returns the incremented p.
+ There must be room for shell_quote_length (string) + 1 bytes at p. */
+extern char * shell_quote_copy (char *p, const char *string);
+
+/* Returns the freshly allocated quoted string. */
+extern char * shell_quote (const char *string);
+
+/* Returns a freshly allocated string containing all argument strings, quoted,
+ separated through spaces. */
+extern char * shell_quote_argv (char * const *argv);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SH_QUOTE_H */
diff --git a/lib/sig-handler.c b/lib/sig-handler.c
new file mode 100644
index 0000000..52c3621
--- /dev/null
+++ b/lib/sig-handler.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define SIG_HANDLER_INLINE _GL_EXTERN_INLINE
+#include "sig-handler.h"
diff --git a/lib/sig-handler.h b/lib/sig-handler.h
new file mode 100644
index 0000000..ad8c1dd
--- /dev/null
+++ b/lib/sig-handler.h
@@ -0,0 +1,54 @@
+/* Convenience declarations when working with <signal.h>.
+
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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)
+{
+#ifdef SA_SIGINFO
+ /* 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. So
+ use (and cast) sa_sigaction in that case. */
+ if (a->sa_flags & SA_SIGINFO)
+ return (sa_handler_t) a->sa_sigaction;
+#endif
+ return a->sa_handler;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_SIG_HANDLER_H */
diff --git a/lib/sigaction.c b/lib/sigaction.c
new file mode 100644
index 0000000..529b612
--- /dev/null
+++ b/lib/sigaction.c
@@ -0,0 +1,204 @@
+/* POSIX compatible signal blocking.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Eric Blake <ebb9@byu.net>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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 __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/lib/signal.in.h b/lib/signal.in.h
new file mode 100644
index 0000000..ab0a049
--- /dev/null
+++ b/lib/signal.in.h
@@ -0,0 +1,463 @@
+/* A GNU-like <signal.h>.
+
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if __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
+ 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 __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 *new_mask, sigset_t *old_mask));
+_GL_CXXALIAS_RPL (pthread_sigmask, int,
+ (int how, const sigset_t *new_mask, sigset_t *old_mask));
+# else
+# if !@HAVE_PTHREAD_SIGMASK@
+_GL_FUNCDECL_SYS (pthread_sigmask, int,
+ (int how, const sigset_t *new_mask, sigset_t *old_mask));
+# endif
+_GL_CXXALIAS_SYS (pthread_sigmask, int,
+ (int how, const sigset_t *new_mask, sigset_t *old_mask));
+# endif
+_GL_CXXALIASWARN (pthread_sigmask);
+#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
+_GL_CXXALIASWARN (raise);
+#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.,
+ <http://lists.gnu.org/archive/html/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 *set, sigset_t *old_set));
+# endif
+_GL_CXXALIAS_SYS (sigprocmask, int,
+ (int operation, const sigset_t *set, sigset_t *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
+_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
+ (int sig, _gl_function_taking_int_returning_void_t func));
+# endif
+_GL_CXXALIASWARN (signal);
+
+# 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/lib/sigprocmask.c b/lib/sigprocmask.c
new file mode 100644
index 0000000..fcbf032
--- /dev/null
+++ b/lib/sigprocmask.c
@@ -0,0 +1,349 @@
+/* POSIX compatible signal blocking.
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <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 __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/lib/size_max.h b/lib/size_max.h
new file mode 100644
index 0000000..2f2792c
--- /dev/null
+++ b/lib/size_max.h
@@ -0,0 +1,30 @@
+/* size_max.h -- declare SIZE_MAX through system headers
+ Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef 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/lib/stat-macros.h b/lib/stat-macros.h
new file mode 100644
index 0000000..690216c
--- /dev/null
+++ b/lib/stat-macros.h
@@ -0,0 +1,3 @@
+/* All the mode bits that can be affected by chmod. */
+#define CHMOD_MODE_BITS \
+ (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
diff --git a/lib/stat-time.c b/lib/stat-time.c
new file mode 100644
index 0000000..81b83dd
--- /dev/null
+++ b/lib/stat-time.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE
+#include "stat-time.h"
diff --git a/lib/stat-time.h b/lib/stat-time.h
new file mode 100644
index 0000000..f5c4cd2
--- /dev/null
+++ b/lib/stat-time.h
@@ -0,0 +1,199 @@
+/* stat-related time functions.
+
+ Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef STAT_TIME_H
+#define STAT_TIME_H 1
+
+#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
+
+/* 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 defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+# ifdef 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 (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
+ /* Avoid a "parameter unused" warning. */
+ (void) st;
+ 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 (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 __WIN32__) && ! defined __CYGWIN__
+ /* Native Windows platforms (but not Cygwin) put the "file creation
+ time" in st_ctime (!). See
+ <http://msdn2.microsoft.com/de-de/library/14h5k7ff(VS.80).aspx>. */
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = 0;
+#else
+ /* Birth time is not supported. */
+ t.tv_sec = -1;
+ t.tv_nsec = -1;
+ /* Avoid a "parameter unused" warning. */
+ (void) st;
+#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 time stamps. 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;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/lib/stat.c b/lib/stat.c
new file mode 100644
index 0000000..62e9e0b
--- /dev/null
+++ b/lib/stat.c
@@ -0,0 +1,138 @@
+/* Work around platform bugs in stat.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Eric Blake */
+
+/* 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 __WIN32__) && ! defined __CYGWIN__
+# if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
+# define stat _stati64
+# define REPLACE_FUNC_STAT_DIR 1
+# undef REPLACE_FUNC_STAT_FILE
+# elif REPLACE_FUNC_STAT_FILE
+/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a.
+ Bypass it. */
+# define stat _stat
+# define REPLACE_FUNC_STAT_DIR 1
+# undef REPLACE_FUNC_STAT_FILE
+# endif
+#endif
+
+static int
+orig_stat (const char *filename, struct stat *buf)
+{
+ return stat (filename, buf);
+}
+
+/* Specification. */
+/* 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"
+
+#include <errno.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <string.h>
+#include "dosname.h"
+#include "verify.h"
+
+#if REPLACE_FUNC_STAT_DIR
+# include "pathmax.h"
+ /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
+ have a constant PATH_MAX. */
+# ifndef PATH_MAX
+# error "Please port this replacement to your platform"
+# endif
+#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 *st)
+{
+ int result = orig_stat (name, st);
+#if REPLACE_FUNC_STAT_FILE
+ /* Solaris 9 mistakenly succeeds when given a non-directory with a
+ trailing slash. */
+ if (result == 0 && !S_ISDIR (st->st_mode))
+ {
+ size_t len = strlen (name);
+ if (ISSLASH (name[len - 1]))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+#endif /* REPLACE_FUNC_STAT_FILE */
+#if REPLACE_FUNC_STAT_DIR
+
+ if (result == -1 && errno == ENOENT)
+ {
+ /* Due to mingw's oddities, there are some directories (like
+ c:\) where stat() only succeeds with a trailing slash, and
+ other directories (like c:\windows) where stat() only
+ succeeds without a trailing slash. But we want the two to be
+ synonymous, since chdir() manages either style. Likewise, Mingw also
+ reports ENOENT for names longer than PATH_MAX, when we want
+ ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR.
+ Fortunately, mingw PATH_MAX is small enough for stack
+ allocation. */
+ char fixed_name[PATH_MAX + 1] = {0};
+ size_t len = strlen (name);
+ bool check_dir = false;
+ verify (PATH_MAX <= 4096);
+ if (PATH_MAX <= len)
+ errno = ENAMETOOLONG;
+ else if (len)
+ {
+ strcpy (fixed_name, name);
+ if (ISSLASH (fixed_name[len - 1]))
+ {
+ check_dir = true;
+ while (len && ISSLASH (fixed_name[len - 1]))
+ fixed_name[--len] = '\0';
+ if (!len)
+ fixed_name[0] = '/';
+ }
+ else
+ fixed_name[len++] = '/';
+ result = orig_stat (fixed_name, st);
+ if (result == 0 && check_dir && !S_ISDIR (st->st_mode))
+ {
+ result = -1;
+ errno = ENOTDIR;
+ }
+ }
+ }
+#endif /* REPLACE_FUNC_STAT_DIR */
+ return result;
+}
diff --git a/lib/stdarg.in.h b/lib/stdarg.in.h
new file mode 100644
index 0000000..63371e2
--- /dev/null
+++ b/lib/stdarg.in.h
@@ -0,0 +1,35 @@
+/* Substitute for and wrapper around <stdarg.h>.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_STDARG_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDARG_H@
+
+#ifndef _@GUARD_PREFIX@_STDARG_H
+#define _@GUARD_PREFIX@_STDARG_H
+
+#ifndef va_copy
+# define va_copy(a,b) ((a) = (b))
+#endif
+
+#endif /* _@GUARD_PREFIX@_STDARG_H */
+#endif /* _@GUARD_PREFIX@_STDARG_H */
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
new file mode 100644
index 0000000..7ecf203
--- /dev/null
+++ b/lib/stdbool.in.h
@@ -0,0 +1,132 @@
+/* Copyright (C) 2001-2003, 2006-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ http://lists.gnu.org/archive/html/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/lib/stddef.in.h b/lib/stddef.in.h
new file mode 100644
index 0000000..f4c4a10
--- /dev/null
+++ b/lib/stddef.in.h
@@ -0,0 +1,110 @@
+/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
+
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+/*
+ * POSIX 2008 <stddef.h> for platforms that have issues.
+ * <http://www.opengroup.org/susv3xbd/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@
+# endif
+
+#else
+/* Normal invocation convention. */
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+
+/* 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. */
+#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_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. */
+# ifdef __GNUC__
+# 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);
+} max_align_t;
+#endif
+
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
+#endif /* __need_XXX */
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
new file mode 100644
index 0000000..cf65ec6
--- /dev/null
+++ b/lib/stdint.in.h
@@ -0,0 +1,635 @@
+/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
+ This file is part of gnulib.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT 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/>. */
+
+/*
+ * ISO C 99 <stdint.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/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
+
+/* <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
+
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+ LONG_MIN, LONG_MAX, ULONG_MAX. */
+#include <limits.h>
+
+#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. */
+
+#define _STDINT_MIN(signed, bits, zero) \
+ ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (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
+# elif @HAVE_LONG_LONG_INT@
+# 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
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+# 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. */
+#ifndef _INTPTR_T_DECLARED
+#undef intptr_t
+#undef uintptr_t
+typedef long int gl_intptr_t;
+typedef unsigned long int gl_uintptr_t;
+#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 @HAVE_LONG_LONG_INT@ && 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 @HAVE_UNSIGNED_LONG_LONG_INT@ && 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
+#define INTPTR_MIN LONG_MIN
+#define INTPTR_MAX LONG_MAX
+#define UINTPTR_MAX ULONG_MAX
+
+/* 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_MIN (1, 64, 0l)
+# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
+# else
+# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
+# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
+# endif
+#else
+# define PTRDIFF_MIN \
+ _STDINT_MIN (1, @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
+#define SIG_ATOMIC_MIN \
+ _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
+ 0@SIG_ATOMIC_T_SUFFIX@)
+#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)
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# include <wchar.h>
+# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+#endif
+#undef WCHAR_MIN
+#undef WCHAR_MAX
+#define WCHAR_MIN \
+ _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+#define WCHAR_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+
+/* wint_t limits */
+#undef WINT_MIN
+#undef WINT_MAX
+#define WINT_MIN \
+ _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#define WINT_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+
+/* 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
+#elif @HAVE_LONG_LONG_INT@
+# 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
+#elif @HAVE_UNSIGNED_LONG_LONG_INT@
+# define UINT64_C(x) x##ULL
+#endif
+
+/* 7.18.4.2. Macros for greatest-width integer constants */
+
+#ifndef INTMAX_C
+# if @HAVE_LONG_LONG_INT@ && 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 @HAVE_UNSIGNED_LONG_LONG_INT@ && 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 /* _@GUARD_PREFIX@_STDINT_H */
+#endif /* !(defined __ANDROID__ && ...) */
+#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
diff --git a/lib/stdio--.h b/lib/stdio--.h
new file mode 100644
index 0000000..8e23817
--- /dev/null
+++ b/lib/stdio--.h
@@ -0,0 +1,41 @@
+/* Like stdio.h, but redefine some names to avoid glitches.
+
+ Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <stdio.h>
+#include "stdio-safer.h"
+
+#if GNULIB_FOPEN_SAFER
+# undef fopen
+# define fopen fopen_safer
+#endif
+
+#if GNULIB_FREOPEN_SAFER
+# undef freopen
+# define freopen freopen_safer
+#endif
+
+#if GNULIB_TMPFILE_SAFER
+# undef tmpfile
+# define tmpfile tmpfile_safer
+#endif
+
+#if GNULIB_POPEN_SAFER
+# undef popen
+# define popen popen_safer
+#endif
diff --git a/lib/stdio-safer.h b/lib/stdio-safer.h
new file mode 100644
index 0000000..4231609
--- /dev/null
+++ b/lib/stdio-safer.h
@@ -0,0 +1,36 @@
+/* Invoke stdio functions, but avoid some glitches.
+
+ Copyright (C) 2001, 2003, 2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <stdio.h>
+
+#if GNULIB_FOPEN_SAFER
+FILE *fopen_safer (char const *, char const *);
+#endif
+
+#if GNULIB_FREOPEN_SAFER
+FILE *freopen_safer (char const *, char const *, FILE *);
+#endif
+
+#if GNULIB_POPEN_SAFER
+FILE *popen_safer (char const *, char const *);
+#endif
+
+#if GNULIB_TMPFILE_SAFER
+FILE *tmpfile_safer (void);
+#endif
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
new file mode 100644
index 0000000..9b31365
--- /dev/null
+++ b/lib/stdio.in.h
@@ -0,0 +1,1357 @@
+/* A GNU-like <stdio.h>.
+
+ Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#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>
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The __-protected variants of the attributes 'format' and 'printf' are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF
+ 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_PRINTF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
+ 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. */
+#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
+#else
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+#endif
+
+/* _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))
+
+/* Solaris 10 declares 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 __GLIBC__
+# 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. */
+
+/* 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.,
+ <http://lists.gnu.org/archive/html/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 *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
+# else
+# if !@HAVE_DPRINTF@
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *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
+_GL_CXXALIASWARN (fclose);
+#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_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_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+#elif 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");
+#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
+_GL_CXXALIASWARN (fflush);
+#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
+_GL_CXXALIASWARN (fgetc);
+#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 *s, int n, FILE *stream)
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgets);
+#endif
+
+#if @GNULIB_FOPEN@
+# if @REPLACE_FOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fopen
+# define fopen rpl_fopen
+# endif
+_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
+# endif
+_GL_CXXALIASWARN (fopen);
+#elif 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
+
+#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 *fp, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fprintf);
+#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
+_GL_CXXALIASWARN (fputc);
+#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 *string, FILE *stream)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fputs);
+#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 *ptr, size_t s, size_t n, FILE *stream)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fread);
+#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 *filename, const char *mode, FILE *stream)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (freopen, FILE *,
+ (const char *filename, const char *mode, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (freopen, FILE *,
+ (const char *filename, const char *mode, FILE *stream));
+# endif
+_GL_CXXALIASWARN (freopen);
+#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 *stream, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fscanf);
+#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
+_GL_CXXALIASWARN (fseek);
+#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
+_GL_CXXALIASWARN (ftell);
+#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 *ptr, size_t s, size_t n, FILE *stream)
+ _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (fwrite, size_t,
+ (const void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fwrite, size_t,
+ (const void *ptr, size_t s, size_t n, FILE *stream));
+
+/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
+ <http://sources.redhat.com/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
+_GL_CXXALIASWARN (fwrite);
+#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
+_GL_CXXALIASWARN (getc);
+#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
+_GL_CXXALIASWARN (getchar);
+#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 **lineptr, size_t *linesize, int delimiter,
+ FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+_GL_CXXALIAS_RPL (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *stream));
+# else
+# if !@HAVE_DECL_GETDELIM@
+_GL_FUNCDECL_SYS (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+_GL_CXXALIAS_SYS (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *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 **lineptr, size_t *linesize, FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *stream));
+# else
+# if !@HAVE_DECL_GETLINE@
+_GL_FUNCDECL_SYS (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *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_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 (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 (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 (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 (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
+_GL_CXXALIASWARN (perror);
+#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_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
+# else
+# if !@HAVE_POPEN@
+_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
+# endif
+_GL_CXXALIASWARN (popen);
+#elif 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
+
+#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__
+# 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 *format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *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 *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
+# endif
+# define GNULIB_overrides_printf 1
+# else
+_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
+# endif
+_GL_CXXALIASWARN (printf);
+#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
+_GL_CXXALIASWARN (putc);
+#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
+_GL_CXXALIASWARN (putchar);
+#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
+_GL_CXXALIASWARN (puts);
+#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
+_GL_CXXALIASWARN (remove);
+#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
+_GL_CXXALIASWARN (rename);
+#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__
+# 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 *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 *format, ...));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+# define scanf rpl_scanf
+# endif
+_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
+# endif
+# else
+_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
+# endif
+_GL_CXXALIASWARN (scanf);
+#endif
+
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define snprintf rpl_snprintf
+# endif
+_GL_FUNCDECL_RPL (snprintf, int,
+ (char *str, size_t size, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (snprintf, int,
+ (char *str, size_t size, const char *format, ...));
+# else
+# if !@HAVE_DECL_SNPRINTF@
+_GL_FUNCDECL_SYS (snprintf, int,
+ (char *str, size_t size, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (snprintf, int,
+ (char *str, size_t size, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (snprintf);
+#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
+_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (sprintf);
+#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_TMPFILE@
+# if @REPLACE_TMPFILE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define tmpfile rpl_tmpfile
+# endif
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
+_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
+# else
+_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
+# endif
+_GL_CXXALIASWARN (tmpfile);
+#elif 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
+
+#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
+_GL_FUNCDECL_RPL (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (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 (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
+_GL_FUNCDECL_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (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 (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 *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
+# else
+# if !@HAVE_VDPRINTF@
+_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (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 *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vdprintf);
+#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 *fp, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *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 *fp, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfprintf);
+#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 *stream, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vfscanf, int,
+ (FILE *stream, const char *format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vfscanf, int,
+ (FILE *stream, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfscanf);
+#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 *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_RPL (vprintf, int, (const char *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 *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vprintf);
+#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 *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vscanf);
+#endif
+
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsnprintf rpl_vsnprintf
+# endif
+_GL_FUNCDECL_RPL (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args));
+# else
+# if !@HAVE_DECL_VSNPRINTF@
+_GL_FUNCDECL_SYS (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vsnprintf);
+#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
+_GL_FUNCDECL_RPL (vsprintf, int,
+ (char *str, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vsprintf, int,
+ (char *str, const char *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 *str, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vsprintf);
+#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/lib/stdlib.in.h b/lib/stdlib.in.h
new file mode 100644
index 0000000..70dc88d
--- /dev/null
+++ b/lib/stdlib.in.h
@@ -0,0 +1,977 @@
+/* A GNU-like <stdlib.h>.
+
+ Copyright (C) 1995, 2001-2004, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if __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@
+# include <sys/loadavg.h>
+#endif
+
+/* Native Windows platforms declare mktemp() in <io.h>. */
+#if 0 && ((defined _WIN32 || 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_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || 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 Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
+/* But avoid namespace pollution on glibc systems and native Windows. */
+# include <unistd.h>
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The 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_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 @REPLACE_CALLOC@
+# 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_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
+# else
+_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
+# endif
+_GL_CXXALIASWARN (calloc);
+#elif 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
+
+#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_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
+# else
+# if !@HAVE_CANONICALIZE_FILE_NAME@
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
+# endif
+_GL_CXXALIASWARN (canonicalize_file_name);
+#elif 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
+
+#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:2001 specification.
+ http://www.opengroup.org/susv3xsh/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 @REPLACE_MALLOC@
+# 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_CXXALIAS_RPL (malloc, void *, (size_t size));
+# else
+_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
+# endif
+_GL_CXXALIASWARN (malloc);
+#elif 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
+
+/* 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 *pwc, const char *s, size_t n));
+_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+# else
+_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+# endif
+_GL_CXXALIASWARN (mbtowc);
+#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_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
+_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));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
+#endif
+
+#if @GNULIB_QSORT_R@
+# 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,
+ int (*compare) (void const *, void const *,
+ void *),
+ void *arg) _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ int (*compare) (void const *, void const *,
+ void *),
+ void *arg));
+# else
+_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ int (*compare) (void const *, void const *,
+ void *),
+ void *arg));
+# endif
+_GL_CXXALIASWARN (qsort_r);
+#endif
+
+
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+# ifndef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (random, long, (void));
+# endif
+_GL_CXXALIAS_SYS (random, long, (void));
+_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 !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+# endif
+_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
+_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 !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size));
+_GL_CXXALIASWARN (initstate);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate, "initstate is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
+_GL_CXXALIASWARN (setstate);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate
+# if HAVE_RAW_DECL_SETSTATE_R
+_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
+_GL_CXXALIAS_SYS (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
+_GL_CXXALIAS_SYS (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 @REPLACE_REALLOC@
+# 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_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
+# else
+_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
+# endif
+_GL_CXXALIASWARN (realloc);
+#elif 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
+
+#if @GNULIB_REALPATH@
+# if @REPLACE_REALPATH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define realpath rpl_realpath
+# endif
+_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
+# else
+# if !@HAVE_REALPATH@
+_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *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
+_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
+# else
+# if !@HAVE_STRTOD@
+_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
+# endif
+_GL_CXXALIASWARN (strtod);
+#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_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 !@HAVE_STRTOLL@
+_GL_FUNCDECL_SYS (strtoll, long long,
+ (const char *string, char **endptr, int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoll, long long,
+ (const char *string, char **endptr, int base));
+_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_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 !@HAVE_STRTOULL@
+_GL_FUNCDECL_SYS (strtoull, unsigned long long,
+ (const char *string, char **endptr, int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoull, unsigned long long,
+ (const char *string, char **endptr, int base));
+_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
+_GL_CXXALIASWARN (wctomb);
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif
diff --git a/lib/str-kmp.h b/lib/str-kmp.h
new file mode 100644
index 0000000..fcb2813
--- /dev/null
+++ b/lib/str-kmp.h
@@ -0,0 +1,153 @@
+/* Substring search in a NUL terminated string of UNIT elements,
+ using the Knuth-Morris-Pratt algorithm.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2005.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT 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/>. */
+
+/* Before including this file, you need to define:
+ UNIT The element type of the needle and haystack.
+ CANON_ELEMENT(c) A macro that canonicalizes an element right after
+ it has been fetched from needle or haystack.
+ The argument is of type UNIT; the result must be
+ of type UNIT as well. */
+
+/* Knuth-Morris-Pratt algorithm.
+ See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
+ HAYSTACK is the NUL terminated string in which to search for.
+ NEEDLE is the string to search for in HAYSTACK, consisting of NEEDLE_LEN
+ units.
+ Return a boolean indicating success:
+ Return true and set *RESULTP if the search was completed.
+ Return false if it was aborted because not enough memory was available. */
+static bool
+knuth_morris_pratt (const UNIT *haystack,
+ const UNIT *needle, size_t needle_len,
+ const UNIT **resultp)
+{
+ size_t m = needle_len;
+
+ /* Allocate the table. */
+ size_t *table = (size_t *) nmalloca (m, sizeof (size_t));
+ if (table == NULL)
+ return false;
+ /* Fill the table.
+ For 0 < i < m:
+ 0 < table[i] <= i is defined such that
+ forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x],
+ and table[i] is as large as possible with this property.
+ This implies:
+ 1) For 0 < i < m:
+ If table[i] < i,
+ needle[table[i]..i-1] = needle[0..i-1-table[i]].
+ 2) For 0 < i < m:
+ rhaystack[0..i-1] == needle[0..i-1]
+ and exists h, i <= h < m: rhaystack[h] != needle[h]
+ implies
+ forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1].
+ table[0] remains uninitialized. */
+ {
+ size_t i, j;
+
+ /* i = 1: Nothing to verify for x = 0. */
+ table[1] = 1;
+ j = 0;
+
+ for (i = 2; i < m; i++)
+ {
+ /* Here: j = i-1 - table[i-1].
+ The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold
+ for x < table[i-1], by induction.
+ Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */
+ UNIT b = CANON_ELEMENT (needle[i - 1]);
+
+ for (;;)
+ {
+ /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x]
+ is known to hold for x < i-1-j.
+ Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */
+ if (b == CANON_ELEMENT (needle[j]))
+ {
+ /* Set table[i] := i-1-j. */
+ table[i] = i - ++j;
+ break;
+ }
+ /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+ for x = i-1-j, because
+ needle[i-1] != needle[j] = needle[i-1-x]. */
+ if (j == 0)
+ {
+ /* The inequality holds for all possible x. */
+ table[i] = i;
+ break;
+ }
+ /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+ for i-1-j < x < i-1-j+table[j], because for these x:
+ needle[x..i-2]
+ = needle[x-(i-1-j)..j-1]
+ != needle[0..j-1-(x-(i-1-j))] (by definition of table[j])
+ = needle[0..i-2-x],
+ hence needle[x..i-1] != needle[0..i-1-x].
+ Furthermore
+ needle[i-1-j+table[j]..i-2]
+ = needle[table[j]..j-1]
+ = needle[0..j-1-table[j]] (by definition of table[j]). */
+ j = j - table[j];
+ }
+ /* Here: j = i - table[i]. */
+ }
+ }
+
+ /* Search, using the table to accelerate the processing. */
+ {
+ size_t j;
+ const UNIT *rhaystack;
+ const UNIT *phaystack;
+
+ *resultp = NULL;
+ j = 0;
+ rhaystack = haystack;
+ phaystack = haystack;
+ /* Invariant: phaystack = rhaystack + j. */
+ while (*phaystack != 0)
+ if (CANON_ELEMENT (needle[j]) == CANON_ELEMENT (*phaystack))
+ {
+ j++;
+ phaystack++;
+ if (j == m)
+ {
+ /* The entire needle has been found. */
+ *resultp = rhaystack;
+ break;
+ }
+ }
+ else if (j > 0)
+ {
+ /* Found a match of needle[0..j-1], mismatch at needle[j]. */
+ rhaystack += table[j];
+ j -= table[j];
+ }
+ else
+ {
+ /* Found a mismatch at needle[0] already. */
+ rhaystack++;
+ phaystack++;
+ }
+ }
+
+ freea (table);
+ return true;
+}
+
+#undef CANON_ELEMENT
diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c
new file mode 100644
index 0000000..ac9f84f
--- /dev/null
+++ b/lib/strcasecmp.c
@@ -0,0 +1,62 @@
+/* Case-insensitive string comparison function.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#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 (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+}
diff --git a/lib/streq.h b/lib/streq.h
new file mode 100644
index 0000000..234f075
--- /dev/null
+++ b/lib/streq.h
@@ -0,0 +1,176 @@
+/* Optimized string comparison.
+ Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#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 (__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/lib/strerror-override.c b/lib/strerror-override.c
new file mode 100644
index 0000000..9bc9b18
--- /dev/null
+++ b/lib/strerror-override.c
@@ -0,0 +1,302 @@
+/* strerror-override.c --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 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 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;
+ }
+}
diff --git a/lib/strerror-override.h b/lib/strerror-override.h
new file mode 100644
index 0000000..5264fd5
--- /dev/null
+++ b/lib/strerror-override.h
@@ -0,0 +1,56 @@
+/* strerror-override.h --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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
+# endif
+
+#endif /* _GL_STRERROR_OVERRIDE_H */
diff --git a/lib/strerror.c b/lib/strerror.c
new file mode 100644
index 0000000..45c7633
--- /dev/null
+++ b/lib/strerror.c
@@ -0,0 +1,70 @@
+/* strerror.c --- POSIX compatible system error routine
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#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 ();
+
+ return memcpy (buf, msg, len + 1);
+}
diff --git a/lib/strftime.c b/lib/strftime.c
new file mode 100644
index 0000000..4e65190
--- /dev/null
+++ b/lib/strftime.c
@@ -0,0 +1,1465 @@
+/* Copyright (C) 1991-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# define HAVE_STRUCT_ERA_ENTRY 1
+# define HAVE_TM_GMTOFF 1
+# define HAVE_TM_ZONE 1
+# define HAVE_TZNAME 1
+# define HAVE_TZSET 1
+# include "../locale/localeinfo.h"
+#else
+# include <config.h>
+# if FPRINTFTIME
+# include "fprintftime.h"
+# else
+# include "strftime.h"
+# endif
+# include "time-internal.h"
+#endif
+
+#include <ctype.h>
+#include <time.h>
+
+#if HAVE_TZNAME && !HAVE_DECL_TZNAME
+extern char *tzname[];
+#endif
+
+/* Do multibyte processing if multibyte encodings are supported, unless
+ multibyte sequences are safe in formats. Multibyte sequences are
+ safe if they cannot contain byte sequences that look like format
+ conversion specifications. The multibyte encodings used by the
+ C library on the various platforms (UTF-8, GB2312, GBK, CP936,
+ GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949,
+ SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%'
+ cannot occur in a multibyte character except in the first byte.
+
+ The DEC-HANYU encoding used on OSF/1 is not safe for formats, but
+ this encoding has never been seen in real-life use, so we ignore
+ it. */
+#if !(defined __osf__ && 0)
+# define MULTIBYTE_IS_FORMAT_SAFE 1
+#endif
+#define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE)
+
+#if DO_MULTIBYTE
+# include <wchar.h>
+ static const mbstate_t mbstate_zero;
+#endif
+
+#include <limits.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef COMPILE_WIDE
+# include <endian.h>
+# define CHAR_T wchar_t
+# define UCHAR_T unsigned int
+# define L_(Str) L##Str
+# define NLW(Sym) _NL_W##Sym
+
+# define MEMCPY(d, s, n) __wmemcpy (d, s, n)
+# define STRLEN(s) __wcslen (s)
+
+#else
+# define CHAR_T char
+# define UCHAR_T unsigned char
+# define L_(Str) Str
+# define NLW(Sym) Sym
+
+# define MEMCPY(d, s, n) memcpy (d, s, n)
+# define STRLEN(s) strlen (s)
+
+#endif
+
+/* Shift A right by B bits portably, by dividing A by 2**B and
+ truncating towards minus infinity. A and B should be free of side
+ effects, and B should be in the range 0 <= B <= INT_BITS - 2, where
+ INT_BITS is the number of useful bits in an int. GNU code can
+ assume that INT_BITS is at least 32.
+
+ ISO C99 says that A >> B is implementation-defined if A < 0. Some
+ implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift
+ right in the usual way when A < 0, so SHR falls back on division if
+ ordinary A >> B doesn't seem to be the usual signed shift. */
+#define SHR(a, b) \
+ (-1 >> 1 == -1 \
+ ? (a) >> (b) \
+ : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0))
+
+/* Bound on length of the string representing an integer type or expression T.
+ Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485;
+ add 1 for integer division truncation; add 1 more for a minus sign
+ if needed. */
+#define INT_STRLEN_BOUND(t) \
+ ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2)
+
+#define TM_YEAR_BASE 1900
+
+#ifndef __isleap
+/* Nonzero if YEAR is a leap year (every 4 years,
+ except every 100th isn't, and every 400th is). */
+# define __isleap(year) \
+ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+#endif
+
+
+#ifdef _LIBC
+# define mktime_z(tz, tm) mktime (tm)
+# define tzname __tzname
+# define tzset __tzset
+#endif
+
+#ifndef FPRINTFTIME
+# define FPRINTFTIME 0
+#endif
+
+#if FPRINTFTIME
+# define STREAM_OR_CHAR_T FILE
+# define STRFTIME_ARG(x) /* empty */
+#else
+# define STREAM_OR_CHAR_T CHAR_T
+# define STRFTIME_ARG(x) x,
+#endif
+
+#if FPRINTFTIME
+# define memset_byte(P, Len, Byte) \
+ do { size_t _i; for (_i = 0; _i < Len; _i++) fputc (Byte, P); } while (0)
+# define memset_space(P, Len) memset_byte (P, Len, ' ')
+# define memset_zero(P, Len) memset_byte (P, Len, '0')
+#elif defined COMPILE_WIDE
+# define memset_space(P, Len) (wmemset (P, L' ', Len), (P) += (Len))
+# define memset_zero(P, Len) (wmemset (P, L'0', Len), (P) += (Len))
+#else
+# define memset_space(P, Len) (memset (P, ' ', Len), (P) += (Len))
+# define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len))
+#endif
+
+#if FPRINTFTIME
+# define advance(P, N)
+#else
+# define advance(P, N) ((P) += (N))
+#endif
+
+#define add(n, f) \
+ do \
+ { \
+ size_t _n = (n); \
+ size_t _w = (width < 0 ? 0 : width); \
+ size_t _incr = _n < _w ? _w : _n; \
+ if (_incr >= maxsize - i) \
+ return 0; \
+ if (p) \
+ { \
+ if (digits == 0 && _n < _w) \
+ { \
+ size_t _delta = width - _n; \
+ if (pad == L_('0')) \
+ memset_zero (p, _delta); \
+ else \
+ memset_space (p, _delta); \
+ } \
+ f; \
+ advance (p, _n); \
+ } \
+ i += _incr; \
+ } while (0)
+
+#if FPRINTFTIME
+# define add1(C) add (1, fputc (C, p))
+#else
+# define add1(C) add (1, *p = C)
+#endif
+
+#if FPRINTFTIME
+# define cpy(n, s) \
+ add ((n), \
+ do \
+ { \
+ if (to_lowcase) \
+ fwrite_lowcase (p, (s), _n); \
+ else if (to_uppcase) \
+ fwrite_uppcase (p, (s), _n); \
+ else \
+ { \
+ /* Ignore the value of fwrite. The caller can determine whether \
+ an error occurred by inspecting ferror (P). All known fwrite \
+ implementations set the stream's error indicator when they \
+ fail due to ENOMEM etc., even though C11 and POSIX.1-2008 do \
+ not require this. */ \
+ fwrite (s, _n, 1, p); \
+ } \
+ } \
+ while (0) \
+ )
+#else
+# define cpy(n, s) \
+ add ((n), \
+ if (to_lowcase) \
+ memcpy_lowcase (p, (s), _n LOCALE_ARG); \
+ else if (to_uppcase) \
+ memcpy_uppcase (p, (s), _n LOCALE_ARG); \
+ else \
+ MEMCPY ((void *) p, (void const *) (s), _n))
+#endif
+
+#ifdef COMPILE_WIDE
+# ifndef USE_IN_EXTENDED_LOCALE_MODEL
+# undef __mbsrtowcs_l
+# define __mbsrtowcs_l(d, s, l, st, loc) __mbsrtowcs (d, s, l, st)
+# endif
+# define widen(os, ws, l) \
+ { \
+ mbstate_t __st; \
+ const char *__s = os; \
+ memset (&__st, '\0', sizeof (__st)); \
+ l = __mbsrtowcs_l (NULL, &__s, 0, &__st, loc); \
+ ws = (wchar_t *) alloca ((l + 1) * sizeof (wchar_t)); \
+ (void) __mbsrtowcs_l (ws, &__s, l, &__st, loc); \
+ }
+#endif
+
+
+#if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL
+/* We use this code also for the extended locale handling where the
+ function gets as an additional argument the locale which has to be
+ used. To access the values we have to redefine the _NL_CURRENT
+ macro. */
+# define strftime __strftime_l
+# define wcsftime __wcsftime_l
+# undef _NL_CURRENT
+# define _NL_CURRENT(category, item) \
+ (current->values[_NL_ITEM_INDEX (item)].string)
+# define LOCALE_ARG , loc
+# define LOCALE_PARAM_PROTO , __locale_t loc
+# define HELPER_LOCALE_ARG , current
+#else
+# define LOCALE_PARAM_PROTO
+# define LOCALE_ARG
+# ifdef _LIBC
+# define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME)
+# else
+# define HELPER_LOCALE_ARG
+# endif
+#endif
+
+#ifdef COMPILE_WIDE
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define TOUPPER(Ch, L) __towupper_l (Ch, L)
+# define TOLOWER(Ch, L) __towlower_l (Ch, L)
+# else
+# define TOUPPER(Ch, L) towupper (Ch)
+# define TOLOWER(Ch, L) towlower (Ch)
+# endif
+#else
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define TOUPPER(Ch, L) __toupper_l (Ch, L)
+# define TOLOWER(Ch, L) __tolower_l (Ch, L)
+# else
+# define TOUPPER(Ch, L) toupper (Ch)
+# define TOLOWER(Ch, L) tolower (Ch)
+# endif
+#endif
+/* We don't use 'isdigit' here since the locale dependent
+ interpretation is not what we want here. We only need to accept
+ the arabic digits in the ASCII range. One day there is perhaps a
+ more reliable way to accept other sets of digits. */
+#define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9)
+
+#if FPRINTFTIME
+static void
+fwrite_lowcase (FILE *fp, const CHAR_T *src, size_t len)
+{
+ while (len-- > 0)
+ {
+ fputc (TOLOWER ((UCHAR_T) *src, loc), fp);
+ ++src;
+ }
+}
+
+static void
+fwrite_uppcase (FILE *fp, const CHAR_T *src, size_t len)
+{
+ while (len-- > 0)
+ {
+ fputc (TOUPPER ((UCHAR_T) *src, loc), fp);
+ ++src;
+ }
+}
+#else
+static CHAR_T *
+memcpy_lowcase (CHAR_T *dest, const CHAR_T *src,
+ size_t len LOCALE_PARAM_PROTO)
+{
+ while (len-- > 0)
+ dest[len] = TOLOWER ((UCHAR_T) src[len], loc);
+ return dest;
+}
+
+static CHAR_T *
+memcpy_uppcase (CHAR_T *dest, const CHAR_T *src,
+ size_t len LOCALE_PARAM_PROTO)
+{
+ while (len-- > 0)
+ dest[len] = TOUPPER ((UCHAR_T) src[len], loc);
+ return dest;
+}
+#endif
+
+
+#if ! HAVE_TM_GMTOFF
+/* Yield the difference between *A and *B,
+ measured in seconds, ignoring leap seconds. */
+# define tm_diff ftime_tm_diff
+static int
+tm_diff (const struct tm *a, const struct tm *b)
+{
+ /* Compute intervening leap days correctly even if year is negative.
+ Take care to avoid int overflow in leap day calculations,
+ but it's OK to assume that A and B are close to each other. */
+ int a4 = SHR (a->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (a->tm_year & 3);
+ int b4 = SHR (b->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (b->tm_year & 3);
+ int a100 = a4 / 25 - (a4 % 25 < 0);
+ int b100 = b4 / 25 - (b4 % 25 < 0);
+ int a400 = SHR (a100, 2);
+ int b400 = SHR (b100, 2);
+ int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
+ int years = a->tm_year - b->tm_year;
+ int days = (365 * years + intervening_leap_days
+ + (a->tm_yday - b->tm_yday));
+ return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
+ + (a->tm_min - b->tm_min))
+ + (a->tm_sec - b->tm_sec));
+}
+#endif /* ! HAVE_TM_GMTOFF */
+
+
+
+/* The number of days from the first day of the first ISO week of this
+ year to the year day YDAY with week day WDAY. ISO weeks start on
+ Monday; the first ISO week has the year's first Thursday. YDAY may
+ be as small as YDAY_MINIMUM. */
+#define ISO_WEEK_START_WDAY 1 /* Monday */
+#define ISO_WEEK1_WDAY 4 /* Thursday */
+#define YDAY_MINIMUM (-366)
+#ifdef __GNUC__
+__inline__
+#endif
+static int
+iso_week_days (int yday, int wday)
+{
+ /* Add enough to the first operand of % to make it nonnegative. */
+ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
+ return (yday
+ - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
+ + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
+}
+
+
+/* When compiling this file, GNU applications can #define my_strftime
+ to a symbol (typically nstrftime) to get an extended strftime with
+ extra arguments TZ and NS. */
+
+#if FPRINTFTIME
+# undef my_strftime
+# define my_strftime fprintftime
+#endif
+
+#ifdef my_strftime
+# undef HAVE_TZSET
+# define extra_args , tz, ns
+# define extra_args_spec , timezone_t tz, int ns
+#else
+# if defined COMPILE_WIDE
+# define my_strftime wcsftime
+# define nl_get_alt_digit _nl_get_walt_digit
+# else
+# define my_strftime strftime
+# define nl_get_alt_digit _nl_get_alt_digit
+# endif
+# define extra_args
+# define extra_args_spec
+/* We don't have this information in general. */
+# define tz 1
+# define ns 0
+#endif
+
+
+/* Just like my_strftime, below, but with one more parameter, UPCASE,
+ to indicate that the result should be converted to upper case. */
+static size_t
+strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
+ STRFTIME_ARG (size_t maxsize)
+ const CHAR_T *format,
+ const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO)
+{
+#if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL
+ struct locale_data *const current = loc->__locales[LC_TIME];
+#endif
+#if FPRINTFTIME
+ size_t maxsize = (size_t) -1;
+#endif
+
+ int hour12 = tp->tm_hour;
+#ifdef _NL_CURRENT
+ /* We cannot make the following values variables since we must delay
+ the evaluation of these values until really needed since some
+ expressions might not be valid in every situation. The 'struct tm'
+ might be generated by a strptime() call that initialized
+ only a few elements. Dereference the pointers only if the format
+ requires this. Then it is ok to fail if the pointers are invalid. */
+# define a_wkday \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday))
+# define f_wkday \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday))
+# define a_month \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon))
+# define f_month \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))
+# define ampm \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \
+ ? NLW(PM_STR) : NLW(AM_STR)))
+
+# define aw_len STRLEN (a_wkday)
+# define am_len STRLEN (a_month)
+# define ap_len STRLEN (ampm)
+#endif
+#if HAVE_TZNAME
+ char **tzname_vec = tzname;
+#endif
+ const char *zone;
+ size_t i = 0;
+ STREAM_OR_CHAR_T *p = s;
+ const CHAR_T *f;
+#if DO_MULTIBYTE && !defined COMPILE_WIDE
+ const char *format_end = NULL;
+#endif
+
+#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST
+ /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned
+ by localtime. On such systems, we must either use the tzset and
+ localtime wrappers to work around the bug (which sets
+ HAVE_RUN_TZSET_TEST) or make a copy of the structure. */
+ struct tm copy = *tp;
+ tp = &copy;
+#endif
+
+ zone = NULL;
+#if HAVE_TM_ZONE
+ /* The POSIX test suite assumes that setting
+ the environment variable TZ to a new value before calling strftime()
+ will influence the result (the %Z format) even if the information in
+ TP is computed with a totally different time zone.
+ This is bogus: though POSIX allows bad behavior like this,
+ POSIX does not require it. Do the right thing instead. */
+ zone = (const char *) tp->tm_zone;
+#endif
+#if HAVE_TZNAME
+ if (!tz)
+ {
+ if (! (zone && *zone))
+ zone = "GMT";
+ }
+ else
+ {
+# if !HAVE_TM_ZONE
+ /* Infer the zone name from *TZ instead of from TZNAME. */
+ tzname_vec = tz->tzname_copy;
+# endif
+ /* POSIX.1 requires that local time zone information be used as
+ though strftime called tzset. */
+# if HAVE_TZSET
+ tzset ();
+# endif
+ }
+ /* The tzset() call might have changed the value. */
+ if (!(zone && *zone) && tp->tm_isdst >= 0)
+ zone = tzname_vec[tp->tm_isdst != 0];
+#endif
+ if (! zone)
+ zone = "";
+
+ if (hour12 > 12)
+ hour12 -= 12;
+ else
+ if (hour12 == 0)
+ hour12 = 12;
+
+ for (f = format; *f != '\0'; ++f)
+ {
+ int pad = 0; /* Padding for number ('-', '_', or 0). */
+ int modifier; /* Field modifier ('E', 'O', or 0). */
+ int digits = 0; /* Max digits for numeric format. */
+ int number_value; /* Numeric value to be printed. */
+ unsigned int u_number_value; /* (unsigned int) number_value. */
+ bool negative_number; /* The number is negative. */
+ bool always_output_a_sign; /* +/- should always be output. */
+ int tz_colon_mask; /* Bitmask of where ':' should appear. */
+ const CHAR_T *subfmt;
+ CHAR_T sign_char;
+ CHAR_T *bufp;
+ CHAR_T buf[1
+ + 2 /* for the two colons in a %::z or %:::z time zone */
+ + (sizeof (int) < sizeof (time_t)
+ ? INT_STRLEN_BOUND (time_t)
+ : INT_STRLEN_BOUND (int))];
+ int width = -1;
+ bool to_lowcase = false;
+ bool to_uppcase = upcase;
+ size_t colons;
+ bool change_case = false;
+ int format_char;
+
+#if DO_MULTIBYTE && !defined COMPILE_WIDE
+ switch (*f)
+ {
+ case L_('%'):
+ break;
+
+ case L_('\b'): case L_('\t'): case L_('\n'):
+ case L_('\v'): case L_('\f'): case L_('\r'):
+ 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_('~'):
+ /* The C Standard requires these 98 characters (plus '%') to
+ be in the basic execution character set. None of these
+ characters can start a multibyte sequence, so they need
+ not be analyzed further. */
+ add1 (*f);
+ continue;
+
+ default:
+ /* Copy this multibyte sequence until we reach its end, find
+ an error, or come back to the initial shift state. */
+ {
+ mbstate_t mbstate = mbstate_zero;
+ size_t len = 0;
+ size_t fsize;
+
+ if (! format_end)
+ format_end = f + strlen (f) + 1;
+ fsize = format_end - f;
+
+ do
+ {
+ size_t bytes = mbrlen (f + len, fsize - len, &mbstate);
+
+ if (bytes == 0)
+ break;
+
+ if (bytes == (size_t) -2)
+ {
+ len += strlen (f + len);
+ break;
+ }
+
+ if (bytes == (size_t) -1)
+ {
+ len++;
+ break;
+ }
+
+ len += bytes;
+ }
+ while (! mbsinit (&mbstate));
+
+ cpy (len, f);
+ f += len - 1;
+ continue;
+ }
+ }
+
+#else /* ! DO_MULTIBYTE */
+
+ /* Either multibyte encodings are not supported, they are
+ safe for formats, so any non-'%' byte can be copied through,
+ or this is the wide character version. */
+ if (*f != L_('%'))
+ {
+ add1 (*f);
+ continue;
+ }
+
+#endif /* ! DO_MULTIBYTE */
+
+ /* Check for flags that can modify a format. */
+ while (1)
+ {
+ switch (*++f)
+ {
+ /* This influences the number formats. */
+ case L_('_'):
+ case L_('-'):
+ case L_('0'):
+ pad = *f;
+ continue;
+
+ /* This changes textual output. */
+ case L_('^'):
+ to_uppcase = true;
+ continue;
+ case L_('#'):
+ change_case = true;
+ continue;
+
+ default:
+ break;
+ }
+ break;
+ }
+
+ /* As a GNU extension we allow the field width to be specified. */
+ if (ISDIGIT (*f))
+ {
+ width = 0;
+ do
+ {
+ if (width > INT_MAX / 10
+ || (width == INT_MAX / 10 && *f - L_('0') > INT_MAX % 10))
+ /* Avoid overflow. */
+ width = INT_MAX;
+ else
+ {
+ width *= 10;
+ width += *f - L_('0');
+ }
+ ++f;
+ }
+ while (ISDIGIT (*f));
+ }
+
+ /* Check for modifiers. */
+ switch (*f)
+ {
+ case L_('E'):
+ case L_('O'):
+ modifier = *f++;
+ break;
+
+ default:
+ modifier = 0;
+ break;
+ }
+
+ /* Now do the specified format. */
+ format_char = *f;
+ switch (format_char)
+ {
+#define DO_NUMBER(d, v) \
+ do \
+ { \
+ digits = d; \
+ number_value = v; \
+ goto do_number; \
+ } \
+ while (0)
+#define DO_SIGNED_NUMBER(d, negative, v) \
+ do \
+ { \
+ digits = d; \
+ negative_number = negative; \
+ u_number_value = v; \
+ goto do_signed_number; \
+ } \
+ while (0)
+
+ /* The mask is not what you might think.
+ When the ordinal i'th bit is set, insert a colon
+ before the i'th digit of the time zone representation. */
+#define DO_TZ_OFFSET(d, negative, mask, v) \
+ do \
+ { \
+ digits = d; \
+ negative_number = negative; \
+ tz_colon_mask = mask; \
+ u_number_value = v; \
+ goto do_tz_offset; \
+ } \
+ while (0)
+#define DO_NUMBER_SPACEPAD(d, v) \
+ do \
+ { \
+ digits = d; \
+ number_value = v; \
+ goto do_number_spacepad; \
+ } \
+ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
+ goto bad_format;
+ add1 (*f);
+ break;
+
+ case L_('a'):
+ if (modifier != 0)
+ goto bad_format;
+ if (change_case)
+ {
+ to_uppcase = true;
+ to_lowcase = false;
+ }
+#ifdef _NL_CURRENT
+ cpy (aw_len, a_wkday);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case 'A':
+ if (modifier != 0)
+ goto bad_format;
+ if (change_case)
+ {
+ to_uppcase = true;
+ to_lowcase = false;
+ }
+#ifdef _NL_CURRENT
+ cpy (STRLEN (f_wkday), f_wkday);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case L_('b'):
+ case L_('h'):
+ if (change_case)
+ {
+ to_uppcase = true;
+ to_lowcase = false;
+ }
+ if (modifier != 0)
+ goto bad_format;
+#ifdef _NL_CURRENT
+ cpy (am_len, a_month);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case L_('B'):
+ if (modifier != 0)
+ goto bad_format;
+ if (change_case)
+ {
+ to_uppcase = true;
+ to_lowcase = false;
+ }
+#ifdef _NL_CURRENT
+ cpy (STRLEN (f_month), f_month);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case L_('c'):
+ if (modifier == L_('O'))
+ goto bad_format;
+#ifdef _NL_CURRENT
+ if (! (modifier == 'E'
+ && (*(subfmt =
+ (const CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(ERA_D_T_FMT)))
+ != '\0')))
+ subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
+#else
+ goto underlying_strftime;
+#endif
+
+ subformat:
+ {
+ size_t len = strftime_case_ (to_uppcase,
+ NULL, STRFTIME_ARG ((size_t) -1)
+ subfmt,
+ tp extra_args LOCALE_ARG);
+ add (len, strftime_case_ (to_uppcase, p,
+ STRFTIME_ARG (maxsize - i)
+ subfmt,
+ tp extra_args LOCALE_ARG));
+ }
+ break;
+
+#if !(defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+ underlying_strftime:
+ {
+ /* The relevant information is available only via the
+ underlying strftime implementation, so use that. */
+ char ufmt[5];
+ char *u = ufmt;
+ char ubuf[1024]; /* enough for any single format in practice */
+ size_t len;
+ /* Make sure we're calling the actual underlying strftime.
+ In some cases, config.h contains something like
+ "#define strftime rpl_strftime". */
+# ifdef strftime
+# undef strftime
+ size_t strftime ();
+# endif
+
+ /* The space helps distinguish strftime failure from empty
+ output. */
+ *u++ = ' ';
+ *u++ = '%';
+ if (modifier != 0)
+ *u++ = modifier;
+ *u++ = format_char;
+ *u = '\0';
+ len = strftime (ubuf, sizeof ubuf, ufmt, tp);
+ if (len != 0)
+ cpy (len - 1, ubuf + 1);
+ }
+ break;
+#endif
+
+ case L_('C'):
+ if (modifier == L_('O'))
+ goto bad_format;
+ if (modifier == L_('E'))
+ {
+#if HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ if (era)
+ {
+# ifdef COMPILE_WIDE
+ size_t len = __wcslen (era->era_wname);
+ cpy (len, era->era_wname);
+# else
+ size_t len = strlen (era->era_name);
+ cpy (len, era->era_name);
+# endif
+ break;
+ }
+#else
+ goto underlying_strftime;
+#endif
+ }
+
+ {
+ int century = tp->tm_year / 100 + TM_YEAR_BASE / 100;
+ century -= tp->tm_year % 100 < 0 && 0 < century;
+ DO_SIGNED_NUMBER (2, tp->tm_year < - TM_YEAR_BASE, century);
+ }
+
+ case L_('x'):
+ if (modifier == L_('O'))
+ goto bad_format;
+#ifdef _NL_CURRENT
+ if (! (modifier == L_('E')
+ && (*(subfmt =
+ (const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT)))
+ != L_('\0'))))
+ subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
+ goto subformat;
+#else
+ goto underlying_strftime;
+#endif
+ case L_('D'):
+ if (modifier != 0)
+ goto bad_format;
+ subfmt = L_("%m/%d/%y");
+ goto subformat;
+
+ case L_('d'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_mday);
+
+ case L_('e'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER_SPACEPAD (2, tp->tm_mday);
+
+ /* All numeric formats set DIGITS and NUMBER_VALUE (or U_NUMBER_VALUE)
+ and then jump to one of these labels. */
+
+ do_tz_offset:
+ always_output_a_sign = true;
+ goto do_number_body;
+
+ do_number_spacepad:
+ /* Force '_' flag unless overridden by '0' or '-' flag. */
+ if (pad != L_('0') && pad != L_('-'))
+ pad = L_('_');
+
+ do_number:
+ /* Format NUMBER_VALUE according to the MODIFIER flag. */
+ negative_number = number_value < 0;
+ u_number_value = number_value;
+
+ do_signed_number:
+ always_output_a_sign = false;
+ tz_colon_mask = 0;
+
+ do_number_body:
+ /* Format U_NUMBER_VALUE according to the MODIFIER flag.
+ NEGATIVE_NUMBER is nonzero if the original number was
+ negative; in this case it was converted directly to
+ unsigned int (i.e., modulo (UINT_MAX + 1)) without
+ negating it. */
+ if (modifier == L_('O') && !negative_number)
+ {
+#ifdef _NL_CURRENT
+ /* Get the locale specific alternate representation of
+ the number. If none exist NULL is returned. */
+ const CHAR_T *cp = nl_get_alt_digit (u_number_value
+ HELPER_LOCALE_ARG);
+
+ if (cp != NULL)
+ {
+ size_t digitlen = STRLEN (cp);
+ if (digitlen != 0)
+ {
+ cpy (digitlen, cp);
+ break;
+ }
+ }
+#else
+ goto underlying_strftime;
+#endif
+ }
+
+ bufp = buf + sizeof (buf) / sizeof (buf[0]);
+
+ if (negative_number)
+ u_number_value = - u_number_value;
+
+ do
+ {
+ if (tz_colon_mask & 1)
+ *--bufp = ':';
+ tz_colon_mask >>= 1;
+ *--bufp = u_number_value % 10 + L_('0');
+ u_number_value /= 10;
+ }
+ while (u_number_value != 0 || tz_colon_mask != 0);
+
+ do_number_sign_and_padding:
+ if (digits < width)
+ digits = width;
+
+ sign_char = (negative_number ? L_('-')
+ : always_output_a_sign ? L_('+')
+ : 0);
+
+ if (pad == L_('-'))
+ {
+ if (sign_char)
+ add1 (sign_char);
+ }
+ else
+ {
+ int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0]))
+ - bufp) - !!sign_char;
+
+ if (padding > 0)
+ {
+ if (pad == L_('_'))
+ {
+ if ((size_t) padding >= maxsize - i)
+ return 0;
+
+ if (p)
+ memset_space (p, padding);
+ i += padding;
+ width = width > padding ? width - padding : 0;
+ if (sign_char)
+ add1 (sign_char);
+ }
+ else
+ {
+ if ((size_t) digits >= maxsize - i)
+ return 0;
+
+ if (sign_char)
+ add1 (sign_char);
+
+ if (p)
+ memset_zero (p, padding);
+ i += padding;
+ width = 0;
+ }
+ }
+ else
+ {
+ if (sign_char)
+ add1 (sign_char);
+ }
+ }
+
+ cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp);
+ break;
+
+ case L_('F'):
+ if (modifier != 0)
+ goto bad_format;
+ subfmt = L_("%Y-%m-%d");
+ goto subformat;
+
+ case L_('H'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_hour);
+
+ case L_('I'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, hour12);
+
+ case L_('k'): /* GNU extension. */
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER_SPACEPAD (2, tp->tm_hour);
+
+ case L_('l'): /* GNU extension. */
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER_SPACEPAD (2, hour12);
+
+ case L_('j'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_SIGNED_NUMBER (3, tp->tm_yday < -1, tp->tm_yday + 1U);
+
+ case L_('M'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_min);
+
+ case L_('m'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_SIGNED_NUMBER (2, tp->tm_mon < -1, tp->tm_mon + 1U);
+
+#ifndef _LIBC
+ case L_('N'): /* GNU extension. */
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ number_value = ns;
+ if (width == -1)
+ width = 9;
+ else
+ {
+ /* Take an explicit width less than 9 as a precision. */
+ int j;
+ for (j = width; j < 9; j++)
+ number_value /= 10;
+ }
+
+ DO_NUMBER (width, number_value);
+#endif
+
+ case L_('n'):
+ add1 (L_('\n'));
+ break;
+
+ case L_('P'):
+ to_lowcase = true;
+#ifndef _NL_CURRENT
+ format_char = L_('p');
+#endif
+ /* FALLTHROUGH */
+
+ case L_('p'):
+ if (change_case)
+ {
+ to_uppcase = false;
+ to_lowcase = true;
+ }
+#ifdef _NL_CURRENT
+ cpy (ap_len, ampm);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case L_('R'):
+ subfmt = L_("%H:%M");
+ goto subformat;
+
+ case L_('r'):
+#ifdef _NL_CURRENT
+ if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(T_FMT_AMPM)))
+ == L_('\0'))
+ subfmt = L_("%I:%M:%S %p");
+ goto subformat;
+#else
+ goto underlying_strftime;
+#endif
+
+ case L_('S'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_sec);
+
+ case L_('s'): /* GNU extension. */
+ {
+ struct tm ltm;
+ time_t t;
+
+ ltm = *tp;
+ t = mktime_z (tz, &ltm);
+
+ /* Generate string value for T using time_t arithmetic;
+ this works even if sizeof (long) < sizeof (time_t). */
+
+ bufp = buf + sizeof (buf) / sizeof (buf[0]);
+ negative_number = t < 0;
+
+ do
+ {
+ int d = t % 10;
+ t /= 10;
+ *--bufp = (negative_number ? -d : d) + L_('0');
+ }
+ while (t != 0);
+
+ digits = 1;
+ always_output_a_sign = false;
+ goto do_number_sign_and_padding;
+ }
+
+ case L_('X'):
+ if (modifier == L_('O'))
+ goto bad_format;
+#ifdef _NL_CURRENT
+ if (! (modifier == L_('E')
+ && (*(subfmt =
+ (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT)))
+ != L_('\0'))))
+ subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
+ goto subformat;
+#else
+ goto underlying_strftime;
+#endif
+ case L_('T'):
+ subfmt = L_("%H:%M:%S");
+ goto subformat;
+
+ case L_('t'):
+ add1 (L_('\t'));
+ break;
+
+ case L_('u'):
+ DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
+
+ case L_('U'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
+
+ case L_('V'):
+ case L_('g'):
+ case L_('G'):
+ if (modifier == L_('E'))
+ goto bad_format;
+ {
+ /* YEAR is a leap year if and only if (tp->tm_year + TM_YEAR_BASE)
+ is a leap year, except that YEAR and YEAR - 1 both work
+ correctly even when (tp->tm_year + TM_YEAR_BASE) would
+ overflow. */
+ int year = (tp->tm_year
+ + (tp->tm_year < 0
+ ? TM_YEAR_BASE % 400
+ : TM_YEAR_BASE % 400 - 400));
+ int year_adjust = 0;
+ int days = iso_week_days (tp->tm_yday, tp->tm_wday);
+
+ if (days < 0)
+ {
+ /* This ISO week belongs to the previous year. */
+ year_adjust = -1;
+ days = iso_week_days (tp->tm_yday + (365 + __isleap (year - 1)),
+ tp->tm_wday);
+ }
+ else
+ {
+ int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)),
+ tp->tm_wday);
+ if (0 <= d)
+ {
+ /* This ISO week belongs to the next year. */
+ year_adjust = 1;
+ days = d;
+ }
+ }
+
+ switch (*f)
+ {
+ case L_('g'):
+ {
+ int yy = (tp->tm_year % 100 + year_adjust) % 100;
+ DO_NUMBER (2, (0 <= yy
+ ? yy
+ : tp->tm_year < -TM_YEAR_BASE - year_adjust
+ ? -yy
+ : yy + 100));
+ }
+
+ case L_('G'):
+ DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE - year_adjust,
+ (tp->tm_year + (unsigned int) TM_YEAR_BASE
+ + year_adjust));
+
+ default:
+ DO_NUMBER (2, days / 7 + 1);
+ }
+ }
+
+ case L_('W'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
+
+ case L_('w'):
+ if (modifier == L_('E'))
+ goto bad_format;
+
+ DO_NUMBER (1, tp->tm_wday);
+
+ case L_('Y'):
+ if (modifier == 'E')
+ {
+#if HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ if (era)
+ {
+# ifdef COMPILE_WIDE
+ subfmt = era->era_wformat;
+# else
+ subfmt = era->era_format;
+# endif
+ goto subformat;
+ }
+#else
+ goto underlying_strftime;
+#endif
+ }
+ if (modifier == L_('O'))
+ goto bad_format;
+
+ DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE,
+ tp->tm_year + (unsigned int) TM_YEAR_BASE);
+
+ case L_('y'):
+ if (modifier == L_('E'))
+ {
+#if HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ if (era)
+ {
+ int delta = tp->tm_year - era->start_date[0];
+ DO_NUMBER (1, (era->offset
+ + delta * era->absolute_direction));
+ }
+#else
+ goto underlying_strftime;
+#endif
+ }
+
+ {
+ int yy = tp->tm_year % 100;
+ if (yy < 0)
+ yy = tp->tm_year < - TM_YEAR_BASE ? -yy : yy + 100;
+ DO_NUMBER (2, yy);
+ }
+
+ case L_('Z'):
+ if (change_case)
+ {
+ to_uppcase = false;
+ to_lowcase = true;
+ }
+
+#ifdef COMPILE_WIDE
+ {
+ /* The zone string is always given in multibyte form. We have
+ to transform it first. */
+ wchar_t *wczone;
+ size_t len;
+ widen (zone, wczone, len);
+ cpy (len, wczone);
+ }
+#else
+ cpy (strlen (zone), zone);
+#endif
+ break;
+
+ case L_(':'):
+ /* :, ::, and ::: are valid only just before 'z'.
+ :::: etc. are rejected later. */
+ for (colons = 1; f[colons] == L_(':'); colons++)
+ continue;
+ if (f[colons] != L_('z'))
+ goto bad_format;
+ f += colons;
+ goto do_z_conversion;
+
+ case L_('z'):
+ colons = 0;
+
+ do_z_conversion:
+ if (tp->tm_isdst < 0)
+ break;
+
+ {
+ int diff;
+ int hour_diff;
+ int min_diff;
+ int sec_diff;
+#if HAVE_TM_GMTOFF
+ diff = tp->tm_gmtoff;
+#else
+ if (!tz)
+ diff = 0;
+ else
+ {
+ struct tm gtm;
+ struct tm ltm;
+ time_t lt;
+
+ ltm = *tp;
+ lt = mktime_z (tz, &ltm);
+
+ if (lt == (time_t) -1)
+ {
+ /* mktime returns -1 for errors, but -1 is also a
+ valid time_t value. Check whether an error really
+ occurred. */
+ struct tm tm;
+
+ if (! localtime_rz (tz, &lt, &tm)
+ || ((ltm.tm_sec ^ tm.tm_sec)
+ | (ltm.tm_min ^ tm.tm_min)
+ | (ltm.tm_hour ^ tm.tm_hour)
+ | (ltm.tm_mday ^ tm.tm_mday)
+ | (ltm.tm_mon ^ tm.tm_mon)
+ | (ltm.tm_year ^ tm.tm_year)))
+ break;
+ }
+
+ if (! localtime_rz (0, &lt, &gtm))
+ break;
+
+ diff = tm_diff (&ltm, &gtm);
+ }
+#endif
+
+ hour_diff = diff / 60 / 60;
+ min_diff = diff / 60 % 60;
+ sec_diff = diff % 60;
+
+ switch (colons)
+ {
+ case 0: /* +hhmm */
+ DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff);
+
+ case 1: tz_hh_mm: /* +hh:mm */
+ DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff);
+
+ case 2: tz_hh_mm_ss: /* +hh:mm:ss */
+ DO_TZ_OFFSET (9, diff < 0, 024,
+ hour_diff * 10000 + min_diff * 100 + sec_diff);
+
+ case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */
+ if (sec_diff != 0)
+ goto tz_hh_mm_ss;
+ if (min_diff != 0)
+ goto tz_hh_mm;
+ DO_TZ_OFFSET (3, diff < 0, 0, hour_diff);
+
+ default:
+ goto bad_format;
+ }
+ }
+
+ case L_('\0'): /* GNU extension: % at end of format. */
+ --f;
+ /* Fall through. */
+ default:
+ /* Unknown format; output the format, including the '%',
+ since this is most likely the right thing to do if a
+ multibyte string has been misparsed. */
+ bad_format:
+ {
+ int flen;
+ for (flen = 1; f[1 - flen] != L_('%'); flen++)
+ continue;
+ cpy (flen, &f[1 - flen]);
+ }
+ break;
+ }
+ }
+
+#if ! FPRINTFTIME
+ if (p && maxsize != 0)
+ *p = L_('\0');
+#endif
+
+ return i;
+}
+
+/* Write information from TP into S according to the format
+ string FORMAT, writing no more that MAXSIZE characters
+ (including the terminating '\0') and returning number of
+ characters written. If S is NULL, nothing will be written
+ anywhere, so to determine how many characters would be
+ written, use NULL for S and (size_t) -1 for MAXSIZE. */
+size_t
+my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
+ const CHAR_T *format,
+ const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO)
+{
+ return strftime_case_ (false, s, STRFTIME_ARG (maxsize)
+ format, tp extra_args LOCALE_ARG);
+}
+
+#if defined _LIBC && ! FPRINTFTIME
+libc_hidden_def (my_strftime)
+#endif
diff --git a/lib/strftime.h b/lib/strftime.h
new file mode 100644
index 0000000..17445e1
--- /dev/null
+++ b/lib/strftime.h
@@ -0,0 +1,33 @@
+/* declarations for strftime.c
+
+ Copyright (C) 2002, 2004, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Just like strftime, but with two more arguments:
+ POSIX requires that strftime use the local timezone information.
+ Use the timezone __TZ instead. Use __NS as the number of
+ nanoseconds in the %N directive. */
+size_t nstrftime (char *, size_t, char const *, struct tm const *,
+ timezone_t __tz, int __ns);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/lib/striconv.c b/lib/striconv.c
new file mode 100644
index 0000000..0d9ccdc
--- /dev/null
+++ b/lib/striconv.c
@@ -0,0 +1,463 @@
+/* Charset conversion.
+ Copyright (C) 2001-2007, 2010-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible and Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "striconv.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+/* Get MB_LEN_MAX, CHAR_BIT. */
+# include <limits.h>
+#endif
+
+#include "c-strcase.h"
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+
+
+#if HAVE_ICONV
+
+int
+mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+ char **resultp, size_t *lengthp)
+{
+# define tmpbufsize 4096
+ size_t length;
+ char *result;
+
+ /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
+# if defined _LIBICONV_VERSION \
+ || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ || defined __sun)
+ /* Set to the initial state. */
+ iconv (cd, NULL, NULL, NULL, NULL);
+# endif
+
+ /* Determine the length we need. */
+ {
+ size_t count = 0;
+ /* The alignment is needed when converting e.g. to glibc's WCHAR_T or
+ libiconv's UCS-4-INTERNAL encoding. */
+ union { unsigned int align; char buf[tmpbufsize]; } tmp;
+# define tmpbuf tmp.buf
+ const char *inptr = src;
+ size_t insize = srclen;
+
+ while (insize > 0)
+ {
+ char *outptr = tmpbuf;
+ size_t outsize = tmpbufsize;
+ size_t res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &insize,
+ &outptr, &outsize);
+
+ if (res == (size_t)(-1))
+ {
+ if (errno == E2BIG)
+ ;
+ else if (errno == EINVAL)
+ break;
+ else
+ return -1;
+ }
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+ /* Irix iconv() inserts a NUL byte if it cannot convert.
+ NetBSD iconv() inserts a question mark if it cannot convert.
+ Only GNU libiconv and GNU libc are known to prefer to fail rather
+ than doing a lossy conversion. */
+ else if (res > 0)
+ {
+ errno = EILSEQ;
+ return -1;
+ }
+# endif
+ count += outptr - tmpbuf;
+ }
+ /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
+# if defined _LIBICONV_VERSION \
+ || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ || defined __sun)
+ {
+ char *outptr = tmpbuf;
+ size_t outsize = tmpbufsize;
+ size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
+
+ if (res == (size_t)(-1))
+ return -1;
+ count += outptr - tmpbuf;
+ }
+# endif
+ length = count;
+# undef tmpbuf
+ }
+
+ if (length == 0)
+ {
+ *lengthp = 0;
+ return 0;
+ }
+ if (*resultp != NULL && *lengthp >= length)
+ result = *resultp;
+ else
+ {
+ result = (char *) malloc (length);
+ if (result == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ }
+
+ /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
+# if defined _LIBICONV_VERSION \
+ || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ || defined __sun)
+ /* Return to the initial state. */
+ iconv (cd, NULL, NULL, NULL, NULL);
+# endif
+
+ /* Do the conversion for real. */
+ {
+ const char *inptr = src;
+ size_t insize = srclen;
+ char *outptr = result;
+ size_t outsize = length;
+
+ while (insize > 0)
+ {
+ size_t res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &insize,
+ &outptr, &outsize);
+
+ if (res == (size_t)(-1))
+ {
+ if (errno == EINVAL)
+ break;
+ else
+ goto fail;
+ }
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+ /* Irix iconv() inserts a NUL byte if it cannot convert.
+ NetBSD iconv() inserts a question mark if it cannot convert.
+ Only GNU libiconv and GNU libc are known to prefer to fail rather
+ than doing a lossy conversion. */
+ else if (res > 0)
+ {
+ errno = EILSEQ;
+ goto fail;
+ }
+# endif
+ }
+ /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
+# if defined _LIBICONV_VERSION \
+ || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ || defined __sun)
+ {
+ size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
+
+ if (res == (size_t)(-1))
+ goto fail;
+ }
+# endif
+ if (outsize != 0)
+ abort ();
+ }
+
+ *resultp = result;
+ *lengthp = length;
+
+ return 0;
+
+ fail:
+ {
+ if (result != *resultp)
+ {
+ int saved_errno = errno;
+ free (result);
+ errno = saved_errno;
+ }
+ return -1;
+ }
+# undef tmpbufsize
+}
+
+char *
+str_cd_iconv (const char *src, iconv_t cd)
+{
+ /* For most encodings, a trailing NUL byte in the input will be converted
+ to a trailing NUL byte in the output. But not for UTF-7. So that this
+ function is usable for UTF-7, we have to exclude the NUL byte from the
+ conversion and add it by hand afterwards. */
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+ /* Irix iconv() inserts a NUL byte if it cannot convert.
+ NetBSD iconv() inserts a question mark if it cannot convert.
+ Only GNU libiconv and GNU libc are known to prefer to fail rather
+ than doing a lossy conversion. For other iconv() implementations,
+ we have to look at the number of irreversible conversions returned;
+ but this information is lost when iconv() returns for an E2BIG reason.
+ Therefore we cannot use the second, faster algorithm. */
+
+ char *result = NULL;
+ size_t length = 0;
+ int retval = mem_cd_iconv (src, strlen (src), cd, &result, &length);
+ char *final_result;
+
+ if (retval < 0)
+ {
+ if (result != NULL)
+ abort ();
+ return NULL;
+ }
+
+ /* Add the terminating NUL byte. */
+ final_result =
+ (result != NULL ? realloc (result, length + 1) : malloc (length + 1));
+ if (final_result == NULL)
+ {
+ free (result);
+ errno = ENOMEM;
+ return NULL;
+ }
+ final_result[length] = '\0';
+
+ return final_result;
+
+# else
+ /* This algorithm is likely faster than the one above. But it may produce
+ iconv() returns for an E2BIG reason, when the output size guess is too
+ small. Therefore it can only be used when we don't need the number of
+ irreversible conversions performed. */
+ char *result;
+ size_t result_size;
+ size_t length;
+ const char *inptr = src;
+ size_t inbytes_remaining = strlen (src);
+
+ /* Make a guess for the worst-case output size, in order to avoid a
+ realloc. It's OK if the guess is wrong as long as it is not zero and
+ doesn't lead to an integer overflow. */
+ result_size = inbytes_remaining;
+ {
+ size_t approx_sqrt_SIZE_MAX = SIZE_MAX >> (sizeof (size_t) * CHAR_BIT / 2);
+ if (result_size <= approx_sqrt_SIZE_MAX / MB_LEN_MAX)
+ result_size *= MB_LEN_MAX;
+ }
+ result_size += 1; /* for the terminating NUL */
+
+ result = (char *) malloc (result_size);
+ if (result == NULL)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
+# if defined _LIBICONV_VERSION \
+ || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ || defined __sun)
+ /* Set to the initial state. */
+ iconv (cd, NULL, NULL, NULL, NULL);
+# endif
+
+ /* Do the conversion. */
+ {
+ char *outptr = result;
+ size_t outbytes_remaining = result_size - 1;
+
+ for (;;)
+ {
+ /* Here inptr + inbytes_remaining = src + strlen (src),
+ outptr + outbytes_remaining = result + result_size - 1. */
+ size_t res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &inbytes_remaining,
+ &outptr, &outbytes_remaining);
+
+ if (res == (size_t)(-1))
+ {
+ if (errno == EINVAL)
+ break;
+ else if (errno == E2BIG)
+ {
+ size_t used = outptr - result;
+ size_t newsize = result_size * 2;
+ char *newresult;
+
+ if (!(newsize > result_size))
+ {
+ errno = ENOMEM;
+ goto failed;
+ }
+ newresult = (char *) realloc (result, newsize);
+ if (newresult == NULL)
+ {
+ errno = ENOMEM;
+ goto failed;
+ }
+ result = newresult;
+ result_size = newsize;
+ outptr = result + used;
+ outbytes_remaining = result_size - 1 - used;
+ }
+ else
+ goto failed;
+ }
+ else
+ break;
+ }
+ /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
+# if defined _LIBICONV_VERSION \
+ || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ || defined __sun)
+ for (;;)
+ {
+ /* Here outptr + outbytes_remaining = result + result_size - 1. */
+ size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining);
+
+ if (res == (size_t)(-1))
+ {
+ if (errno == E2BIG)
+ {
+ size_t used = outptr - result;
+ size_t newsize = result_size * 2;
+ char *newresult;
+
+ if (!(newsize > result_size))
+ {
+ errno = ENOMEM;
+ goto failed;
+ }
+ newresult = (char *) realloc (result, newsize);
+ if (newresult == NULL)
+ {
+ errno = ENOMEM;
+ goto failed;
+ }
+ result = newresult;
+ result_size = newsize;
+ outptr = result + used;
+ outbytes_remaining = result_size - 1 - used;
+ }
+ else
+ goto failed;
+ }
+ else
+ break;
+ }
+# endif
+
+ /* Add the terminating NUL byte. */
+ *outptr++ = '\0';
+
+ length = outptr - result;
+ }
+
+ /* Give away unused memory. */
+ if (length < result_size)
+ {
+ char *smaller_result = (char *) realloc (result, length);
+
+ if (smaller_result != NULL)
+ result = smaller_result;
+ }
+
+ return result;
+
+ failed:
+ {
+ int saved_errno = errno;
+ free (result);
+ errno = saved_errno;
+ return NULL;
+ }
+
+# endif
+}
+
+#endif
+
+char *
+str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
+{
+ if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0)
+ {
+ char *result = strdup (src);
+
+ if (result == NULL)
+ errno = ENOMEM;
+ return result;
+ }
+ else
+ {
+#if HAVE_ICONV
+ iconv_t cd;
+ char *result;
+
+ /* Avoid glibc-2.1 bug with EUC-KR. */
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+ && !defined _LIBICONV_VERSION
+ if (c_strcasecmp (from_codeset, "EUC-KR") == 0
+ || c_strcasecmp (to_codeset, "EUC-KR") == 0)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+# endif
+ cd = iconv_open (to_codeset, from_codeset);
+ if (cd == (iconv_t) -1)
+ return NULL;
+
+ result = str_cd_iconv (src, cd);
+
+ if (result == NULL)
+ {
+ /* Close cd, but preserve the errno from str_cd_iconv. */
+ int saved_errno = errno;
+ iconv_close (cd);
+ errno = saved_errno;
+ }
+ else
+ {
+ if (iconv_close (cd) < 0)
+ {
+ /* Return NULL, but free the allocated memory, and while doing
+ that, preserve the errno from iconv_close. */
+ int saved_errno = errno;
+ free (result);
+ errno = saved_errno;
+ return NULL;
+ }
+ }
+ return result;
+#else
+ /* This is a different error code than if iconv_open existed but didn't
+ support from_codeset and to_codeset, so that the caller can emit
+ an error message such as
+ "iconv() is not supported. Installing GNU libiconv and
+ then reinstalling this package would fix this." */
+ errno = ENOSYS;
+ return NULL;
+#endif
+ }
+}
diff --git a/lib/striconv.h b/lib/striconv.h
new file mode 100644
index 0000000..e5217d7
--- /dev/null
+++ b/lib/striconv.h
@@ -0,0 +1,75 @@
+/* Charset conversion.
+ Copyright (C) 2001-2004, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible and Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _STRICONV_H
+#define _STRICONV_H
+
+#include <stddef.h>
+#if HAVE_ICONV
+#include <iconv.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if HAVE_ICONV
+
+/* Convert an entire string from one encoding to another, using iconv.
+ The original string is at [SRC,...,SRC+SRCLEN-1].
+ The conversion descriptor is passed as CD.
+ *RESULTP and *LENGTH should initially be a scratch buffer and its size,
+ or *RESULTP can initially be NULL.
+ May erase the contents of the memory at *RESULTP.
+ Return value: 0 if successful, otherwise -1 and errno set.
+ If successful: The resulting string is stored in *RESULTP and its length
+ in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is
+ unchanged if no dynamic memory allocation was necessary. */
+extern int mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+ char **resultp, size_t *lengthp);
+
+/* Convert an entire string from one encoding to another, using iconv.
+ The original string is the NUL-terminated string starting at SRC.
+ The conversion descriptor is passed as CD. Both the "from" and the "to"
+ encoding must use a single NUL byte at the end of the string (i.e. not
+ UCS-2, UCS-4, UTF-16, UTF-32).
+ Allocate a malloced memory block for the result.
+ Return value: the freshly allocated resulting NUL-terminated string if
+ successful, otherwise NULL and errno set. */
+extern char * str_cd_iconv (const char *src, iconv_t cd);
+
+#endif
+
+/* Convert an entire string from one encoding to another, using iconv.
+ The original string is the NUL-terminated string starting at SRC.
+ Both the "from" and the "to" encoding must use a single NUL byte at the
+ end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32).
+ Allocate a malloced memory block for the result.
+ Return value: the freshly allocated resulting NUL-terminated string if
+ successful, otherwise NULL and errno set. */
+extern char * str_iconv (const char *src,
+ const char *from_codeset, const char *to_codeset);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _STRICONV_H */
diff --git a/lib/string.in.h b/lib/string.in.h
new file mode 100644
index 0000000..7fb00c1
--- /dev/null
+++ b/lib/string.in.h
@@ -0,0 +1,1046 @@
+/* A GNU-like <string.h>.
+
+ Copyright (C) 1995-1996, 2001-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#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
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* 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
+
+/* 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. */
+
+
+/* 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 !@HAVE_FFSLL@
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+_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
+
+
+/* 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)
+# 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
+# if ! @HAVE_MEMCHR@
+_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* 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))
+_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
+_GL_CXXALIASWARN1 (memchr, void const *,
+ (void const *__s, int __c, size_t __n));
+# else
+_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))
+_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
+_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
+# 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))
+_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
+_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
+# 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 (strchr, "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))
+_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
+_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
+# 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_CXXALIAS_RPL (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@ || defined strdup)
+_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+#elif 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
+#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 *dest, const char *src, size_t n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
+# else
+_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
+# endif
+_GL_CXXALIASWARN (strncat);
+#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 *__string, size_t __n)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
+# else
+# if ! @HAVE_DECL_STRNDUP@
+_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
+# endif
+_GL_CXXALIASWARN (strndup);
+#elif 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
+
+/* 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 *__string, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+# else
+# if ! @HAVE_DECL_STRNLEN@
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, 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))
+_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
+_GL_CXXALIASWARN1 (strpbrk, char const *,
+ (char const *__s, char const *__accept));
+# else
+_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 (strpbrk, "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 (strpbrk, "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 (strrchr, "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))
+_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strstr, const char *,
+ (const char *haystack, const char *needle));
+# else
+_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))
+_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strcasestr, const char *,
+ (const char *haystack, const char *needle));
+# 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:
+ http://www.opengroup.org/susv3xsh/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 *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
+_GL_CXXALIASWARN (strerror);
+#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
+
+#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/lib/strings.in.h b/lib/strings.in.h
new file mode 100644
index 0000000..d5cabc5
--- /dev/null
+++ b/lib/strings.in.h
@@ -0,0 +1,122 @@
+/* A substitute <strings.h>.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_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/lib/stripslash.c b/lib/stripslash.c
new file mode 100644
index 0000000..0453e36
--- /dev/null
+++ b/lib/stripslash.c
@@ -0,0 +1,45 @@
+/* stripslash.c -- remove redundant trailing slashes from a file name
+
+ Copyright (C) 1990, 2001, 2003-2006, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+/* Remove trailing slashes from FILE. Return true if a trailing slash
+ was removed. This is useful when using file name completion from a
+ shell that adds a "/" after directory names (such as tcsh and
+ bash), because on symlinks to directories, several system calls
+ have different semantics according to whether a trailing slash is
+ present. */
+
+bool
+strip_trailing_slashes (char *file)
+{
+ char *base = last_component (file);
+ char *base_lim;
+ bool had_slash;
+
+ /* last_component returns "" for file system roots, but we need to turn
+ "///" into "/". */
+ if (! *base)
+ base = file;
+ base_lim = base + base_len (base);
+ had_slash = (*base_lim != '\0');
+ *base_lim = '\0';
+ return had_slash;
+}
diff --git a/lib/strncasecmp.c b/lib/strncasecmp.c
new file mode 100644
index 0000000..07a55ea
--- /dev/null
+++ b/lib/strncasecmp.c
@@ -0,0 +1,62 @@
+/* strncasecmp.c -- case insensitive string comparator
+ Copyright (C) 1998-1999, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#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 (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+}
diff --git a/lib/strndup.c b/lib/strndup.c
new file mode 100644
index 0000000..6250fcd
--- /dev/null
+++ b/lib/strndup.c
@@ -0,0 +1,36 @@
+/* A replacement function, for systems that lack strndup.
+
+ Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 3, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#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/lib/strnlen.c b/lib/strnlen.c
new file mode 100644
index 0000000..1bd7936
--- /dev/null
+++ b/lib/strnlen.c
@@ -0,0 +1,30 @@
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+/* 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/lib/strnlen1.c b/lib/strnlen1.c
new file mode 100644
index 0000000..f5e0ffc
--- /dev/null
+++ b/lib/strnlen1.c
@@ -0,0 +1,35 @@
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+ Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "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/lib/strnlen1.h b/lib/strnlen1.h
new file mode 100644
index 0000000..d3cd7c1
--- /dev/null
+++ b/lib/strnlen1.h
@@ -0,0 +1,40 @@
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+ Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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/lib/strptime.c b/lib/strptime.c
new file mode 100644
index 0000000..a6a306c
--- /dev/null
+++ b/lib/strptime.c
@@ -0,0 +1,1143 @@
+/* Copyright (C) 2002, 2004-2005, 2007, 2009-2016 Free Software Foundation,
+ Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <time.h>
+
+#include <assert.h>
+#include <ctype.h>
+#ifdef _LIBC
+# include <langinfo.h>
+#endif
+#include <limits.h>
+#include <string.h>
+#include <stdbool.h>
+
+#ifdef _LIBC
+# include "../locale/localeinfo.h"
+#endif
+
+#ifndef _LIBC
+enum ptime_locale_status { not, loc, raw };
+#endif
+
+
+
+#define match_char(ch1, ch2) if (ch1 != ch2) return NULL
+#if defined _LIBC && defined __GNUC__ && __GNUC__ >= 2
+# define match_string(cs1, s2) \
+ ({ size_t len = strlen (cs1); \
+ int result = __strncasecmp_l ((cs1), (s2), len, locale) == 0; \
+ if (result) (s2) += len; \
+ result; })
+#else
+/* Oh come on. Get a reasonable compiler. */
+# define match_string(cs1, s2) \
+ (strncasecmp ((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1))
+#endif
+/* We intentionally do not use isdigit() for testing because this will
+ lead to problems with the wide character version. */
+#define get_number(from, to, n) \
+ do { \
+ int __n = n; \
+ val = 0; \
+ while (*rp == ' ') \
+ ++rp; \
+ if (*rp < '0' || *rp > '9') \
+ return NULL; \
+ do { \
+ val *= 10; \
+ val += *rp++ - '0'; \
+ } while (--__n > 0 && val * 10 <= to && *rp >= '0' && *rp <= '9'); \
+ if (val < from || val > to) \
+ return NULL; \
+ } while (0)
+#ifdef _NL_CURRENT
+# define get_alt_number(from, to, n) \
+ ({ \
+ __label__ do_normal; \
+ \
+ if (*decided != raw) \
+ { \
+ val = _nl_parse_alt_digit (&rp HELPER_LOCALE_ARG); \
+ if (val == -1 && *decided != loc) \
+ { \
+ *decided = loc; \
+ goto do_normal; \
+ } \
+ if (val < from || val > to) \
+ return NULL; \
+ } \
+ else \
+ { \
+ do_normal: \
+ get_number (from, to, n); \
+ } \
+ 0; \
+ })
+#else
+# define get_alt_number(from, to, n) \
+ /* We don't have the alternate representation. */ \
+ get_number(from, to, n)
+#endif
+#define recursive(new_fmt) \
+ (*(new_fmt) != '\0' \
+ && (rp = __strptime_internal (rp, (new_fmt), tm, \
+ decided, era_cnt LOCALE_ARG)) != NULL)
+
+
+#ifdef _LIBC
+/* This is defined in locale/C-time.c in the GNU libc. */
+extern const struct locale_data _nl_C_LC_TIME attribute_hidden;
+
+# define weekday_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (DAY_1)].string)
+# define ab_weekday_name \
+ (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABDAY_1)].string)
+# define month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (MON_1)].string)
+# define ab_month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABMON_1)].string)
+# define HERE_D_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_T_FMT)].string)
+# define HERE_D_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_FMT)].string)
+# define HERE_AM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (AM_STR)].string)
+# define HERE_PM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (PM_STR)].string)
+# define HERE_T_FMT_AMPM \
+ (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT_AMPM)].string)
+# define HERE_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT)].string)
+
+# define strncasecmp(s1, s2, n) __strncasecmp (s1, s2, n)
+#else
+static char const weekday_name[][10] =
+ {
+ "Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"
+ };
+static char const ab_weekday_name[][4] =
+ {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+static char const month_name[][10] =
+ {
+ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December"
+ };
+static char const ab_month_name[][4] =
+ {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+# define HERE_D_T_FMT "%a %b %e %H:%M:%S %Y"
+# define HERE_D_FMT "%m/%d/%y"
+# define HERE_AM_STR "AM"
+# define HERE_PM_STR "PM"
+# define HERE_T_FMT_AMPM "%I:%M:%S %p"
+# define HERE_T_FMT "%H:%M:%S"
+
+static const unsigned short int __mon_yday[2][13] =
+ {
+ /* Normal years. */
+ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
+ /* Leap years. */
+ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
+ };
+#endif
+
+#if defined _LIBC
+/* We use this code also for the extended locale handling where the
+ function gets as an additional argument the locale which has to be
+ used. To access the values we have to redefine the _NL_CURRENT
+ macro. */
+# define strptime __strptime_l
+# undef _NL_CURRENT
+# define _NL_CURRENT(category, item) \
+ (current->values[_NL_ITEM_INDEX (item)].string)
+# undef _NL_CURRENT_WORD
+# define _NL_CURRENT_WORD(category, item) \
+ (current->values[_NL_ITEM_INDEX (item)].word)
+# define LOCALE_PARAM , locale
+# define LOCALE_ARG , locale
+# define LOCALE_PARAM_PROTO , __locale_t locale
+# define LOCALE_PARAM_DECL __locale_t locale;
+# define HELPER_LOCALE_ARG , current
+# define ISSPACE(Ch) __isspace_l (Ch, locale)
+#else
+# define LOCALE_PARAM
+# define LOCALE_ARG
+# define LOCALE_PARAM_DECL
+# define LOCALE_PARAM_PROTO
+# define HELPER_LOCALE_ARG
+# define ISSPACE(Ch) isspace (Ch)
+#endif
+
+
+
+
+#ifndef __isleap
+/* Nonzero if YEAR is a leap year (every 4 years,
+ except every 100th isn't, and every 400th is). */
+# define __isleap(year) \
+ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+#endif
+
+/* Compute the day of the week. */
+static void
+day_of_the_week (struct tm *tm)
+{
+ /* We know that January 1st 1970 was a Thursday (= 4). Compute the
+ difference between this data in the one on TM and so determine
+ the weekday. */
+ int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2);
+ int wday = (-473
+ + (365 * (tm->tm_year - 70))
+ + (corr_year / 4)
+ - ((corr_year / 4) / 25) + ((corr_year / 4) % 25 < 0)
+ + (((corr_year / 4) / 25) / 4)
+ + __mon_yday[0][tm->tm_mon]
+ + tm->tm_mday - 1);
+ tm->tm_wday = ((wday % 7) + 7) % 7;
+}
+
+/* Compute the day of the year. */
+static void
+day_of_the_year (struct tm *tm)
+{
+ tm->tm_yday = (__mon_yday[__isleap (1900 + tm->tm_year)][tm->tm_mon]
+ + (tm->tm_mday - 1));
+}
+
+
+#ifdef _LIBC
+char *
+internal_function
+#else
+static char *
+#endif
+__strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
+ const char *rp;
+ const char *fmt;
+ struct tm *tm;
+ enum ptime_locale_status *decided;
+ int era_cnt;
+ LOCALE_PARAM_DECL
+{
+#ifdef _LIBC
+ struct locale_data *const current = locale->__locales[LC_TIME];
+#endif
+
+ int cnt;
+ size_t val;
+ int have_I, is_pm;
+ int century, want_century;
+ int want_era;
+ int have_wday, want_xday;
+ int have_yday;
+ int have_mon, have_mday;
+ int have_uweek, have_wweek;
+ int week_no;
+#ifdef _NL_CURRENT
+ size_t num_eras;
+ struct era_entry *era = NULL;
+ const char *rp_backup;
+#endif
+
+ have_I = is_pm = 0;
+ century = -1;
+ want_century = 0;
+ want_era = 0;
+ week_no = 0;
+
+ have_wday = want_xday = have_yday = have_mon = have_mday = have_uweek = 0;
+ have_wweek = 0;
+
+ while (*fmt != '\0')
+ {
+ /* A white space in the format string matches 0 more or white
+ space in the input string. */
+ if (ISSPACE (*fmt))
+ {
+ while (ISSPACE (*rp))
+ ++rp;
+ ++fmt;
+ continue;
+ }
+
+ /* Any character but '%' must be matched by the same character
+ in the iput string. */
+ if (*fmt != '%')
+ {
+ match_char (*fmt++, *rp++);
+ continue;
+ }
+
+ ++fmt;
+#ifndef _NL_CURRENT
+ /* We need this for handling the 'E' modifier. */
+ start_over:
+#else
+ /* Make back up of current processing pointer. */
+ rp_backup = rp;
+#endif
+
+ switch (*fmt++)
+ {
+ case '%':
+ /* Match the '%' character itself. */
+ match_char ('%', *rp++);
+ break;
+ case 'a':
+ case 'A':
+ /* Match day of week. */
+ for (cnt = 0; cnt < 7; ++cnt)
+ {
+#ifdef _NL_CURRENT
+ if (*decided !=raw)
+ {
+ if (match_string (_NL_CURRENT (LC_TIME, DAY_1 + cnt), rp))
+ {
+ if (*decided == not
+ && strcmp (_NL_CURRENT (LC_TIME, DAY_1 + cnt),
+ weekday_name[cnt]))
+ *decided = loc;
+ break;
+ }
+ if (match_string (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt), rp))
+ {
+ if (*decided == not
+ && strcmp (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt),
+ ab_weekday_name[cnt]))
+ *decided = loc;
+ break;
+ }
+ }
+#endif
+ if (*decided != loc
+ && (match_string (weekday_name[cnt], rp)
+ || match_string (ab_weekday_name[cnt], rp)))
+ {
+ *decided = raw;
+ break;
+ }
+ }
+ if (cnt == 7)
+ /* Does not match a weekday name. */
+ return NULL;
+ tm->tm_wday = cnt;
+ have_wday = 1;
+ break;
+ case 'b':
+ case 'B':
+ case 'h':
+ /* Match month name. */
+ for (cnt = 0; cnt < 12; ++cnt)
+ {
+#ifdef _NL_CURRENT
+ if (*decided !=raw)
+ {
+ if (match_string (_NL_CURRENT (LC_TIME, MON_1 + cnt), rp))
+ {
+ if (*decided == not
+ && strcmp (_NL_CURRENT (LC_TIME, MON_1 + cnt),
+ month_name[cnt]))
+ *decided = loc;
+ break;
+ }
+ if (match_string (_NL_CURRENT (LC_TIME, ABMON_1 + cnt), rp))
+ {
+ if (*decided == not
+ && strcmp (_NL_CURRENT (LC_TIME, ABMON_1 + cnt),
+ ab_month_name[cnt]))
+ *decided = loc;
+ break;
+ }
+ }
+#endif
+ if (match_string (month_name[cnt], rp)
+ || match_string (ab_month_name[cnt], rp))
+ {
+ *decided = raw;
+ break;
+ }
+ }
+ if (cnt == 12)
+ /* Does not match a month name. */
+ return NULL;
+ tm->tm_mon = cnt;
+ want_xday = 1;
+ break;
+ case 'c':
+ /* Match locale's date and time format. */
+#ifdef _NL_CURRENT
+ if (*decided != raw)
+ {
+ if (!recursive (_NL_CURRENT (LC_TIME, D_T_FMT)))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (*decided == not &&
+ strcmp (_NL_CURRENT (LC_TIME, D_T_FMT), HERE_D_T_FMT))
+ *decided = loc;
+ want_xday = 1;
+ break;
+ }
+ *decided = raw;
+ }
+#endif
+ if (!recursive (HERE_D_T_FMT))
+ return NULL;
+ want_xday = 1;
+ break;
+ case 'C':
+ /* Match century number. */
+#ifdef _NL_CURRENT
+ match_century:
+#endif
+ get_number (0, 99, 2);
+ century = val;
+ want_xday = 1;
+ break;
+ case 'd':
+ case 'e':
+ /* Match day of month. */
+ get_number (1, 31, 2);
+ tm->tm_mday = val;
+ have_mday = 1;
+ want_xday = 1;
+ break;
+ case 'F':
+ if (!recursive ("%Y-%m-%d"))
+ return NULL;
+ want_xday = 1;
+ break;
+ case 'x':
+#ifdef _NL_CURRENT
+ if (*decided != raw)
+ {
+ if (!recursive (_NL_CURRENT (LC_TIME, D_FMT)))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (*decided == not
+ && strcmp (_NL_CURRENT (LC_TIME, D_FMT), HERE_D_FMT))
+ *decided = loc;
+ want_xday = 1;
+ break;
+ }
+ *decided = raw;
+ }
+#endif
+ /* Fall through. */
+ case 'D':
+ /* Match standard day format. */
+ if (!recursive (HERE_D_FMT))
+ return NULL;
+ want_xday = 1;
+ break;
+ case 'k':
+ case 'H':
+ /* Match hour in 24-hour clock. */
+ get_number (0, 23, 2);
+ tm->tm_hour = val;
+ have_I = 0;
+ break;
+ case 'l':
+ /* Match hour in 12-hour clock. GNU extension. */
+ case 'I':
+ /* Match hour in 12-hour clock. */
+ get_number (1, 12, 2);
+ tm->tm_hour = val % 12;
+ have_I = 1;
+ break;
+ case 'j':
+ /* Match day number of year. */
+ get_number (1, 366, 3);
+ tm->tm_yday = val - 1;
+ have_yday = 1;
+ break;
+ case 'm':
+ /* Match number of month. */
+ get_number (1, 12, 2);
+ tm->tm_mon = val - 1;
+ have_mon = 1;
+ want_xday = 1;
+ break;
+ case 'M':
+ /* Match minute. */
+ get_number (0, 59, 2);
+ tm->tm_min = val;
+ break;
+ case 'n':
+ case 't':
+ /* Match any white space. */
+ while (ISSPACE (*rp))
+ ++rp;
+ break;
+ case 'p':
+ /* Match locale's equivalent of AM/PM. */
+#ifdef _NL_CURRENT
+ if (*decided != raw)
+ {
+ if (match_string (_NL_CURRENT (LC_TIME, AM_STR), rp))
+ {
+ if (strcmp (_NL_CURRENT (LC_TIME, AM_STR), HERE_AM_STR))
+ *decided = loc;
+ break;
+ }
+ if (match_string (_NL_CURRENT (LC_TIME, PM_STR), rp))
+ {
+ if (strcmp (_NL_CURRENT (LC_TIME, PM_STR), HERE_PM_STR))
+ *decided = loc;
+ is_pm = 1;
+ break;
+ }
+ *decided = raw;
+ }
+#endif
+ if (!match_string (HERE_AM_STR, rp))
+ {
+ if (match_string (HERE_PM_STR, rp))
+ is_pm = 1;
+ else
+ return NULL;
+ }
+ break;
+ case 'r':
+#ifdef _NL_CURRENT
+ if (*decided != raw)
+ {
+ if (!recursive (_NL_CURRENT (LC_TIME, T_FMT_AMPM)))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (*decided == not &&
+ strcmp (_NL_CURRENT (LC_TIME, T_FMT_AMPM),
+ HERE_T_FMT_AMPM))
+ *decided = loc;
+ break;
+ }
+ *decided = raw;
+ }
+#endif
+ if (!recursive (HERE_T_FMT_AMPM))
+ return NULL;
+ break;
+ case 'R':
+ if (!recursive ("%H:%M"))
+ return NULL;
+ break;
+ case 's':
+ {
+ /* The number of seconds may be very high so we cannot use
+ the 'get_number' macro. Instead read the number
+ character for character and construct the result while
+ doing this. */
+ time_t secs = 0;
+ if (*rp < '0' || *rp > '9')
+ /* We need at least one digit. */
+ return NULL;
+
+ do
+ {
+ secs *= 10;
+ secs += *rp++ - '0';
+ }
+ while (*rp >= '0' && *rp <= '9');
+
+ if (localtime_r (&secs, tm) == NULL)
+ /* Error in function. */
+ return NULL;
+ }
+ break;
+ case 'S':
+ get_number (0, 61, 2);
+ tm->tm_sec = val;
+ break;
+ case 'X':
+#ifdef _NL_CURRENT
+ if (*decided != raw)
+ {
+ if (!recursive (_NL_CURRENT (LC_TIME, T_FMT)))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (strcmp (_NL_CURRENT (LC_TIME, T_FMT), HERE_T_FMT))
+ *decided = loc;
+ break;
+ }
+ *decided = raw;
+ }
+#endif
+ /* Fall through. */
+ case 'T':
+ if (!recursive (HERE_T_FMT))
+ return NULL;
+ break;
+ case 'u':
+ get_number (1, 7, 1);
+ tm->tm_wday = val % 7;
+ have_wday = 1;
+ break;
+ case 'g':
+ get_number (0, 99, 2);
+ /* XXX This cannot determine any field in TM. */
+ break;
+ case 'G':
+ if (*rp < '0' || *rp > '9')
+ return NULL;
+ /* XXX Ignore the number since we would need some more
+ information to compute a real date. */
+ do
+ ++rp;
+ while (*rp >= '0' && *rp <= '9');
+ break;
+ case 'U':
+ get_number (0, 53, 2);
+ week_no = val;
+ have_uweek = 1;
+ break;
+ case 'W':
+ get_number (0, 53, 2);
+ week_no = val;
+ have_wweek = 1;
+ break;
+ case 'V':
+ get_number (0, 53, 2);
+ /* XXX This cannot determine any field in TM without some
+ information. */
+ break;
+ case 'w':
+ /* Match number of weekday. */
+ get_number (0, 6, 1);
+ tm->tm_wday = val;
+ have_wday = 1;
+ break;
+ case 'y':
+#ifdef _NL_CURRENT
+ match_year_in_century:
+#endif
+ /* Match year within century. */
+ get_number (0, 99, 2);
+ /* The "Year 2000: The Millennium Rollover" paper suggests that
+ values in the range 69-99 refer to the twentieth century. */
+ tm->tm_year = val >= 69 ? val : val + 100;
+ /* Indicate that we want to use the century, if specified. */
+ want_century = 1;
+ want_xday = 1;
+ break;
+ case 'Y':
+ /* Match year including century number. */
+ get_number (0, 9999, 4);
+ tm->tm_year = val - 1900;
+ want_century = 0;
+ want_xday = 1;
+ break;
+ case 'Z':
+ /* XXX How to handle this? */
+ break;
+ case 'z':
+ /* We recognize two formats: if two digits are given, these
+ specify hours. If fours digits are used, minutes are
+ also specified. */
+ {
+ bool neg _GL_UNUSED;
+ int n;
+
+ val = 0;
+ while (*rp == ' ')
+ ++rp;
+ if (*rp != '+' && *rp != '-')
+ return NULL;
+ neg = *rp++ == '-';
+ n = 0;
+ while (n < 4 && *rp >= '0' && *rp <= '9')
+ {
+ val = val * 10 + *rp++ - '0';
+ ++n;
+ }
+ if (n == 2)
+ val *= 100;
+ else if (n != 4)
+ /* Only two or four digits recognized. */
+ return NULL;
+ else
+ {
+ /* We have to convert the minutes into decimal. */
+ if (val % 100 >= 60)
+ return NULL;
+ val = (val / 100) * 100 + ((val % 100) * 50) / 30;
+ }
+ if (val > 1200)
+ return NULL;
+#if defined _LIBC || HAVE_TM_GMTOFF
+ tm->tm_gmtoff = (val * 3600) / 100;
+ if (neg)
+ tm->tm_gmtoff = -tm->tm_gmtoff;
+#endif
+ }
+ break;
+ case 'E':
+#ifdef _NL_CURRENT
+ switch (*fmt++)
+ {
+ case 'c':
+ /* Match locale's alternate date and time format. */
+ if (*decided != raw)
+ {
+ const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT);
+
+ if (*fmt == '\0')
+ fmt = _NL_CURRENT (LC_TIME, D_T_FMT);
+
+ if (!recursive (fmt))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (strcmp (fmt, HERE_D_T_FMT))
+ *decided = loc;
+ want_xday = 1;
+ break;
+ }
+ *decided = raw;
+ }
+ /* The C locale has no era information, so use the
+ normal representation. */
+ if (!recursive (HERE_D_T_FMT))
+ return NULL;
+ want_xday = 1;
+ break;
+ case 'C':
+ if (*decided != raw)
+ {
+ if (era_cnt >= 0)
+ {
+ era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG);
+ if (era != NULL && match_string (era->era_name, rp))
+ {
+ *decided = loc;
+ break;
+ }
+ else
+ return NULL;
+ }
+
+ num_eras = _NL_CURRENT_WORD (LC_TIME,
+ _NL_TIME_ERA_NUM_ENTRIES);
+ for (era_cnt = 0; era_cnt < (int) num_eras;
+ ++era_cnt, rp = rp_backup)
+ {
+ era = _nl_select_era_entry (era_cnt
+ HELPER_LOCALE_ARG);
+ if (era != NULL && match_string (era->era_name, rp))
+ {
+ *decided = loc;
+ break;
+ }
+ }
+ if (era_cnt != (int) num_eras)
+ break;
+
+ era_cnt = -1;
+ if (*decided == loc)
+ return NULL;
+
+ *decided = raw;
+ }
+ /* The C locale has no era information, so use the
+ normal representation. */
+ goto match_century;
+ case 'y':
+ if (*decided != raw)
+ {
+ get_number(0, 9999, 4);
+ tm->tm_year = val;
+ want_era = 1;
+ want_xday = 1;
+ want_century = 1;
+
+ if (era_cnt >= 0)
+ {
+ assert (*decided == loc);
+
+ era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG);
+ bool match = false;
+ if (era != NULL)
+ {
+ int delta = ((tm->tm_year - era->offset)
+ * era->absolute_direction);
+ match = (delta >= 0
+ && delta < (((int64_t) era->stop_date[0]
+ - (int64_t) era->start_date[0])
+ * era->absolute_direction));
+ }
+ if (! match)
+ return NULL;
+
+ break;
+ }
+
+ num_eras = _NL_CURRENT_WORD (LC_TIME,
+ _NL_TIME_ERA_NUM_ENTRIES);
+ for (era_cnt = 0; era_cnt < (int) num_eras; ++era_cnt)
+ {
+ era = _nl_select_era_entry (era_cnt
+ HELPER_LOCALE_ARG);
+ if (era != NULL)
+ {
+ int delta = ((tm->tm_year - era->offset)
+ * era->absolute_direction);
+ if (delta >= 0
+ && delta < (((int64_t) era->stop_date[0]
+ - (int64_t) era->start_date[0])
+ * era->absolute_direction))
+ {
+ *decided = loc;
+ break;
+ }
+ }
+ }
+ if (era_cnt != (int) num_eras)
+ break;
+
+ era_cnt = -1;
+ if (*decided == loc)
+ return NULL;
+
+ *decided = raw;
+ }
+
+ goto match_year_in_century;
+ case 'Y':
+ if (*decided != raw)
+ {
+ num_eras = _NL_CURRENT_WORD (LC_TIME,
+ _NL_TIME_ERA_NUM_ENTRIES);
+ for (era_cnt = 0; era_cnt < (int) num_eras;
+ ++era_cnt, rp = rp_backup)
+ {
+ era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG);
+ if (era != NULL && recursive (era->era_format))
+ break;
+ }
+ if (era_cnt == (int) num_eras)
+ {
+ era_cnt = -1;
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ *decided = loc;
+ era_cnt = -1;
+ break;
+ }
+
+ *decided = raw;
+ }
+ get_number (0, 9999, 4);
+ tm->tm_year = val - 1900;
+ want_century = 0;
+ want_xday = 1;
+ break;
+ case 'x':
+ if (*decided != raw)
+ {
+ const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_FMT);
+
+ if (*fmt == '\0')
+ fmt = _NL_CURRENT (LC_TIME, D_FMT);
+
+ if (!recursive (fmt))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (strcmp (fmt, HERE_D_FMT))
+ *decided = loc;
+ break;
+ }
+ *decided = raw;
+ }
+ if (!recursive (HERE_D_FMT))
+ return NULL;
+ break;
+ case 'X':
+ if (*decided != raw)
+ {
+ const char *fmt = _NL_CURRENT (LC_TIME, ERA_T_FMT);
+
+ if (*fmt == '\0')
+ fmt = _NL_CURRENT (LC_TIME, T_FMT);
+
+ if (!recursive (fmt))
+ {
+ if (*decided == loc)
+ return NULL;
+ else
+ rp = rp_backup;
+ }
+ else
+ {
+ if (strcmp (fmt, HERE_T_FMT))
+ *decided = loc;
+ break;
+ }
+ *decided = raw;
+ }
+ if (!recursive (HERE_T_FMT))
+ return NULL;
+ break;
+ default:
+ return NULL;
+ }
+ break;
+#else
+ /* We have no information about the era format. Just use
+ the normal format. */
+ if (*fmt != 'c' && *fmt != 'C' && *fmt != 'y' && *fmt != 'Y'
+ && *fmt != 'x' && *fmt != 'X')
+ /* This is an illegal format. */
+ return NULL;
+
+ goto start_over;
+#endif
+ case 'O':
+ switch (*fmt++)
+ {
+ case 'd':
+ case 'e':
+ /* Match day of month using alternate numeric symbols. */
+ get_alt_number (1, 31, 2);
+ tm->tm_mday = val;
+ have_mday = 1;
+ want_xday = 1;
+ break;
+ case 'H':
+ /* Match hour in 24-hour clock using alternate numeric
+ symbols. */
+ get_alt_number (0, 23, 2);
+ tm->tm_hour = val;
+ have_I = 0;
+ break;
+ case 'I':
+ /* Match hour in 12-hour clock using alternate numeric
+ symbols. */
+ get_alt_number (1, 12, 2);
+ tm->tm_hour = val % 12;
+ have_I = 1;
+ break;
+ case 'm':
+ /* Match month using alternate numeric symbols. */
+ get_alt_number (1, 12, 2);
+ tm->tm_mon = val - 1;
+ have_mon = 1;
+ want_xday = 1;
+ break;
+ case 'M':
+ /* Match minutes using alternate numeric symbols. */
+ get_alt_number (0, 59, 2);
+ tm->tm_min = val;
+ break;
+ case 'S':
+ /* Match seconds using alternate numeric symbols. */
+ get_alt_number (0, 61, 2);
+ tm->tm_sec = val;
+ break;
+ case 'U':
+ get_alt_number (0, 53, 2);
+ week_no = val;
+ have_uweek = 1;
+ break;
+ case 'W':
+ get_alt_number (0, 53, 2);
+ week_no = val;
+ have_wweek = 1;
+ break;
+ case 'V':
+ get_alt_number (0, 53, 2);
+ /* XXX This cannot determine any field in TM without
+ further information. */
+ break;
+ case 'w':
+ /* Match number of weekday using alternate numeric symbols. */
+ get_alt_number (0, 6, 1);
+ tm->tm_wday = val;
+ have_wday = 1;
+ break;
+ case 'y':
+ /* Match year within century using alternate numeric symbols. */
+ get_alt_number (0, 99, 2);
+ tm->tm_year = val >= 69 ? val : val + 100;
+ want_xday = 1;
+ break;
+ default:
+ return NULL;
+ }
+ break;
+ default:
+ return NULL;
+ }
+ }
+
+ if (have_I && is_pm)
+ tm->tm_hour += 12;
+
+ if (century != -1)
+ {
+ if (want_century)
+ tm->tm_year = tm->tm_year % 100 + (century - 19) * 100;
+ else
+ /* Only the century, but not the year. Strange, but so be it. */
+ tm->tm_year = (century - 19) * 100;
+ }
+
+ if (era_cnt != -1)
+ {
+#ifdef _NL_CURRENT
+ era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG);
+ if (era == NULL)
+ return NULL;
+ if (want_era)
+ tm->tm_year = (era->start_date[0]
+ + ((tm->tm_year - era->offset)
+ * era->absolute_direction));
+ else
+ /* Era start year assumed. */
+ tm->tm_year = era->start_date[0];
+#endif
+ }
+ else
+ if (want_era)
+ {
+ /* No era found but we have seen an E modifier. Rectify some
+ values. */
+ if (want_century && century == -1 && tm->tm_year < 69)
+ tm->tm_year += 100;
+ }
+
+ if (want_xday && !have_wday)
+ {
+ if ( !(have_mon && have_mday) && have_yday)
+ {
+ /* We don't have tm_mon and/or tm_mday, compute them. */
+ int t_mon = 0;
+ while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon] <= tm->tm_yday)
+ t_mon++;
+ if (!have_mon)
+ tm->tm_mon = t_mon - 1;
+ if (!have_mday)
+ tm->tm_mday =
+ (tm->tm_yday
+ - __mon_yday[__isleap(1900 + tm->tm_year)][t_mon - 1] + 1);
+ }
+ day_of_the_week (tm);
+ }
+
+ if (want_xday && !have_yday)
+ day_of_the_year (tm);
+
+ if ((have_uweek || have_wweek) && have_wday)
+ {
+ int save_wday = tm->tm_wday;
+ int save_mday = tm->tm_mday;
+ int save_mon = tm->tm_mon;
+ int w_offset = have_uweek ? 0 : 1;
+
+ tm->tm_mday = 1;
+ tm->tm_mon = 0;
+ day_of_the_week (tm);
+ if (have_mday)
+ tm->tm_mday = save_mday;
+ if (have_mon)
+ tm->tm_mon = save_mon;
+
+ if (!have_yday)
+ tm->tm_yday = ((7 - (tm->tm_wday - w_offset)) % 7
+ + (week_no - 1) *7
+ + save_wday - w_offset);
+
+ if (!have_mday || !have_mon)
+ {
+ int t_mon = 0;
+ while (__mon_yday[__isleap(1900 + tm->tm_year)][t_mon]
+ <= tm->tm_yday)
+ t_mon++;
+ if (!have_mon)
+ tm->tm_mon = t_mon - 1;
+ if (!have_mday)
+ tm->tm_mday =
+ (tm->tm_yday
+ - __mon_yday[__isleap(1900 + tm->tm_year)][t_mon - 1] + 1);
+ }
+
+ tm->tm_wday = save_wday;
+ }
+
+ return (char *) rp;
+}
+
+
+char *
+strptime (buf, format, tm LOCALE_PARAM)
+ const char *restrict buf;
+ const char *restrict format;
+ struct tm *restrict tm;
+ LOCALE_PARAM_DECL
+{
+ enum ptime_locale_status decided;
+
+#ifdef _NL_CURRENT
+ decided = not;
+#else
+ decided = raw;
+#endif
+ return __strptime_internal (buf, format, tm, &decided, -1 LOCALE_ARG);
+}
+
+#ifdef _LIBC
+weak_alias (__strptime_l, strptime_l)
+#endif
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
new file mode 100644
index 0000000..223412b
--- /dev/null
+++ b/lib/strtoimax.c
@@ -0,0 +1,82 @@
+/* Convert string representation of a number into an intmax_t value.
+
+ Copyright (C) 1999, 2001-2004, 2006, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+/* Verify interface. */
+#include <inttypes.h>
+
+#include <stdlib.h>
+
+#include "verify.h"
+
+#ifdef UNSIGNED
+# if HAVE_UNSIGNED_LONG_LONG_INT
+# ifndef HAVE_DECL_STRTOULL
+"this configure-time declaration test was not run"
+# endif
+# if !HAVE_DECL_STRTOULL
+unsigned long long int strtoull (char const *, char **, int);
+# endif
+# endif
+
+#else
+
+# if HAVE_LONG_LONG_INT
+# ifndef HAVE_DECL_STRTOLL
+"this configure-time declaration test was not run"
+# endif
+# if !HAVE_DECL_STRTOLL
+long long int strtoll (char const *, char **, int);
+# endif
+# endif
+#endif
+
+#ifdef UNSIGNED
+# define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT
+# define Int uintmax_t
+# define Strtoimax strtoumax
+# define Strtol strtoul
+# define Strtoll strtoull
+# define Unsigned unsigned
+#else
+# define Have_long_long HAVE_LONG_LONG_INT
+# define Int intmax_t
+# define Strtoimax strtoimax
+# define Strtol strtol
+# define Strtoll strtoll
+# define Unsigned
+#endif
+
+Int
+Strtoimax (char const *ptr, char **endptr, int base)
+{
+#if Have_long_long
+ verify (sizeof (Int) == sizeof (Unsigned long int)
+ || sizeof (Int) == sizeof (Unsigned long long int));
+
+ if (sizeof (Int) != sizeof (Unsigned long int))
+ return Strtoll (ptr, endptr, base);
+#else
+ verify (sizeof (Int) == sizeof (Unsigned long int));
+#endif
+
+ return Strtol (ptr, endptr, base);
+}
diff --git a/lib/strtol.c b/lib/strtol.c
new file mode 100644
index 0000000..6ef8a96
--- /dev/null
+++ b/lib/strtol.c
@@ -0,0 +1,422 @@
+/* Convert string representation of a number into an integer value.
+
+ Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2016 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@gnu.org.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 3 of the License, or any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# define USE_NUMBER_GROUPING
+#else
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef USE_NUMBER_GROUPING
+# include "../locale/localeinfo.h"
+#endif
+
+/* Nonzero if we are defining 'strtoul' or 'strtoull', operating on
+ unsigned integers. */
+#ifndef UNSIGNED
+# define UNSIGNED 0
+# define INT LONG int
+#else
+# define INT unsigned LONG int
+#endif
+
+/* Determine the name. */
+#ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# if UNSIGNED
+# ifdef USE_WIDE_CHAR
+# ifdef QUAD
+# define strtol __wcstoull_l
+# else
+# define strtol __wcstoul_l
+# endif
+# else
+# ifdef QUAD
+# define strtol __strtoull_l
+# else
+# define strtol __strtoul_l
+# endif
+# endif
+# else
+# ifdef USE_WIDE_CHAR
+# ifdef QUAD
+# define strtol __wcstoll_l
+# else
+# define strtol __wcstol_l
+# endif
+# else
+# ifdef QUAD
+# define strtol __strtoll_l
+# else
+# define strtol __strtol_l
+# endif
+# endif
+# endif
+#else
+# if UNSIGNED
+# ifdef USE_WIDE_CHAR
+# ifdef QUAD
+# define strtol wcstoull
+# else
+# define strtol wcstoul
+# endif
+# else
+# ifdef QUAD
+# define strtol strtoull
+# else
+# define strtol strtoul
+# endif
+# endif
+# else
+# ifdef USE_WIDE_CHAR
+# ifdef QUAD
+# define strtol wcstoll
+# else
+# define strtol wcstol
+# endif
+# else
+# ifdef QUAD
+# define strtol strtoll
+# endif
+# endif
+# endif
+#endif
+
+/* If QUAD is defined, we are defining 'strtoll' or 'strtoull',
+ operating on 'long long int's. */
+#ifdef QUAD
+# define LONG long long
+# define STRTOL_LONG_MIN LLONG_MIN
+# define STRTOL_LONG_MAX LLONG_MAX
+# define STRTOL_ULONG_MAX ULLONG_MAX
+
+/* 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 signed. */
+# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* Minimum and maximum values for integer types.
+ These macros have undefined behavior for signed types that either
+ have padding bits or do not use two's complement. If this is a
+ problem for you, please let us know how to fix it for your host. */
+
+/* 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 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+# ifndef ULLONG_MAX
+# define ULLONG_MAX TYPE_MAXIMUM (unsigned long long)
+# endif
+# ifndef LLONG_MAX
+# define LLONG_MAX TYPE_MAXIMUM (long long int)
+# endif
+# ifndef LLONG_MIN
+# define LLONG_MIN TYPE_MINIMUM (long long int)
+# endif
+
+# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
+ /* Work around gcc bug with using this constant. */
+ static const unsigned long long int maxquad = ULLONG_MAX;
+# undef STRTOL_ULONG_MAX
+# define STRTOL_ULONG_MAX maxquad
+# endif
+#else
+# define LONG long
+# define STRTOL_LONG_MIN LONG_MIN
+# define STRTOL_LONG_MAX LONG_MAX
+# define STRTOL_ULONG_MAX ULONG_MAX
+#endif
+
+
+/* We use this code also for the extended locale handling where the
+ function gets as an additional argument the locale which has to be
+ used. To access the values we have to redefine the _NL_CURRENT
+ macro. */
+#ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# undef _NL_CURRENT
+# define _NL_CURRENT(category, item) \
+ (current->values[_NL_ITEM_INDEX (item)].string)
+# define LOCALE_PARAM , loc
+# define LOCALE_PARAM_PROTO , __locale_t loc
+#else
+# define LOCALE_PARAM
+# define LOCALE_PARAM_PROTO
+#endif
+
+#ifdef USE_WIDE_CHAR
+# include <wchar.h>
+# include <wctype.h>
+# define L_(Ch) L##Ch
+# define UCHAR_TYPE wint_t
+# define STRING_TYPE wchar_t
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define ISSPACE(Ch) __iswspace_l ((Ch), loc)
+# define ISALPHA(Ch) __iswalpha_l ((Ch), loc)
+# define TOUPPER(Ch) __towupper_l ((Ch), loc)
+# else
+# define ISSPACE(Ch) iswspace (Ch)
+# define ISALPHA(Ch) iswalpha (Ch)
+# define TOUPPER(Ch) towupper (Ch)
+# endif
+#else
+# define L_(Ch) Ch
+# define UCHAR_TYPE unsigned char
+# define STRING_TYPE char
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define ISSPACE(Ch) __isspace_l ((Ch), loc)
+# define ISALPHA(Ch) __isalpha_l ((Ch), loc)
+# define TOUPPER(Ch) __toupper_l ((Ch), loc)
+# else
+# define ISSPACE(Ch) isspace (Ch)
+# define ISALPHA(Ch) isalpha (Ch)
+# define TOUPPER(Ch) toupper (Ch)
+# endif
+#endif
+
+#define INTERNAL(X) INTERNAL1(X)
+#define INTERNAL1(X) __##X##_internal
+#define WEAKNAME(X) WEAKNAME1(X)
+
+#ifdef USE_NUMBER_GROUPING
+/* This file defines a function to check for correct grouping. */
+# include "grouping.h"
+#endif
+
+
+
+/* Convert NPTR to an 'unsigned long int' or 'long int' in base BASE.
+ If BASE is 0 the base is determined by the presence of a leading
+ zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal.
+ If BASE is < 2 or > 36, it is reset to 10.
+ If ENDPTR is not NULL, a pointer to the character after the last
+ one converted is stored in *ENDPTR. */
+
+INT
+INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
+ int base, int group LOCALE_PARAM_PROTO)
+{
+ int negative;
+ register unsigned LONG int cutoff;
+ register unsigned int cutlim;
+ register unsigned LONG int i;
+ register const STRING_TYPE *s;
+ register UCHAR_TYPE c;
+ const STRING_TYPE *save, *end;
+ int overflow;
+
+#ifdef USE_NUMBER_GROUPING
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+ struct locale_data *current = loc->__locales[LC_NUMERIC];
+# endif
+ /* The thousands character of the current locale. */
+ wchar_t thousands = L'\0';
+ /* The numeric grouping specification of the current locale,
+ in the format described in <locale.h>. */
+ const char *grouping;
+
+ if (group)
+ {
+ grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
+ if (*grouping <= 0 || *grouping == CHAR_MAX)
+ grouping = NULL;
+ else
+ {
+ /* Figure out the thousands separator character. */
+# if defined _LIBC || defined _HAVE_BTOWC
+ thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP));
+ if (thousands == WEOF)
+ thousands = L'\0';
+# endif
+ if (thousands == L'\0')
+ grouping = NULL;
+ }
+ }
+ else
+ grouping = NULL;
+#endif
+
+ if (base < 0 || base == 1 || base > 36)
+ {
+ __set_errno (EINVAL);
+ return 0;
+ }
+
+ save = s = nptr;
+
+ /* Skip white space. */
+ while (ISSPACE (*s))
+ ++s;
+ if (*s == L_('\0'))
+ goto noconv;
+
+ /* Check for a sign. */
+ if (*s == L_('-'))
+ {
+ negative = 1;
+ ++s;
+ }
+ else if (*s == L_('+'))
+ {
+ negative = 0;
+ ++s;
+ }
+ else
+ negative = 0;
+
+ /* Recognize number prefix and if BASE is zero, figure it out ourselves. */
+ if (*s == L_('0'))
+ {
+ if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X'))
+ {
+ s += 2;
+ base = 16;
+ }
+ else if (base == 0)
+ base = 8;
+ }
+ else if (base == 0)
+ base = 10;
+
+ /* Save the pointer so we can check later if anything happened. */
+ save = s;
+
+#ifdef USE_NUMBER_GROUPING
+ if (group)
+ {
+ /* Find the end of the digit string and check its grouping. */
+ end = s;
+ for (c = *end; c != L_('\0'); c = *++end)
+ if ((wchar_t) c != thousands
+ && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9'))
+ && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base))
+ break;
+ if (*s == thousands)
+ end = s;
+ else
+ end = correctly_grouped_prefix (s, end, thousands, grouping);
+ }
+ else
+#endif
+ end = NULL;
+
+ cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base;
+ cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base;
+
+ overflow = 0;
+ i = 0;
+ for (c = *s; c != L_('\0'); c = *++s)
+ {
+ if (s == end)
+ break;
+ if (c >= L_('0') && c <= L_('9'))
+ c -= L_('0');
+ else if (ISALPHA (c))
+ c = TOUPPER (c) - L_('A') + 10;
+ else
+ break;
+ if ((int) c >= base)
+ break;
+ /* Check for overflow. */
+ if (i > cutoff || (i == cutoff && c > cutlim))
+ overflow = 1;
+ else
+ {
+ i *= (unsigned LONG int) base;
+ i += c;
+ }
+ }
+
+ /* Check if anything actually happened. */
+ if (s == save)
+ goto noconv;
+
+ /* Store in ENDPTR the address of one character
+ past the last character we converted. */
+ if (endptr != NULL)
+ *endptr = (STRING_TYPE *) s;
+
+#if !UNSIGNED
+ /* Check for a value that is within the range of
+ 'unsigned LONG int', but outside the range of 'LONG int'. */
+ if (overflow == 0
+ && i > (negative
+ ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1
+ : (unsigned LONG int) STRTOL_LONG_MAX))
+ overflow = 1;
+#endif
+
+ if (overflow)
+ {
+ __set_errno (ERANGE);
+#if UNSIGNED
+ return STRTOL_ULONG_MAX;
+#else
+ return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX;
+#endif
+ }
+
+ /* Return the result of the appropriate sign. */
+ return negative ? -i : i;
+
+noconv:
+ /* We must handle a special case here: the base is 0 or 16 and the
+ first two characters are '0' and 'x', but the rest are no
+ hexadecimal digits. This is no error case. We return 0 and
+ ENDPTR points to the 'x'. */
+ if (endptr != NULL)
+ {
+ if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
+ && save[-2] == L_('0'))
+ *endptr = (STRING_TYPE *) &save[-1];
+ else
+ /* There was no number to convert. */
+ *endptr = (STRING_TYPE *) nptr;
+ }
+
+ return 0L;
+}
+
+/* External user entry point. */
+
+
+INT
+#ifdef weak_function
+weak_function
+#endif
+strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr,
+ int base LOCALE_PARAM_PROTO)
+{
+ return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM);
+}
diff --git a/lib/strtoul.c b/lib/strtoul.c
new file mode 100644
index 0000000..6a5d4dd
--- /dev/null
+++ b/lib/strtoul.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 1991, 1997, 2009-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define UNSIGNED 1
+
+#include "strtol.c"
diff --git a/lib/strtoull.c b/lib/strtoull.c
new file mode 100644
index 0000000..16da823
--- /dev/null
+++ b/lib/strtoull.c
@@ -0,0 +1,26 @@
+/* Function to parse an 'unsigned long long int' from text.
+ Copyright (C) 1995-1997, 1999, 2009-2016 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@gnu.org.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 3 of the License, or any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define QUAD 1
+
+#include "strtoul.c"
+
+#ifdef _LIBC
+strong_alias (__strtoull_internal, __strtouq_internal)
+weak_alias (strtoull, strtouq)
+#endif
diff --git a/lib/strtoumax.c b/lib/strtoumax.c
new file mode 100644
index 0000000..dc395d6
--- /dev/null
+++ b/lib/strtoumax.c
@@ -0,0 +1,2 @@
+#define UNSIGNED 1
+#include "strtoimax.c"
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
new file mode 100644
index 0000000..72d9537
--- /dev/null
+++ b/lib/sys_stat.in.h
@@ -0,0 +1,732 @@
+/* Provide a more complete sys/stat header file.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* 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 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 <unistd.h>. */
+#if (defined _WIN32 || 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 __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+/* Large File Support on native Windows. */
+#if @WINDOWS_64_BIT_ST_SIZE@
+# define stat _stati64
+#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
+
+/* S_IXUGO is a common extension to POSIX. */
+#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_FCHMODAT@
+# 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));
+_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
+_GL_CXXALIASWARN (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 *name, struct stat *st, int flags)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (fstatat, int,
+ (int fd, char const *name, struct stat *st, int flags));
+# else
+# if !@HAVE_FSTATAT@
+_GL_FUNCDECL_SYS (fstatat, int,
+ (int fd, char const *name, struct stat *st, int flags)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (fstatat, int,
+ (int fd, char const *name, struct stat *st, int flags));
+# endif
+_GL_CXXALIASWARN (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_LCHMOD@
+/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
+ denotes a symbolic link. */
+# if !@HAVE_LCHMOD@
+/* The lchmod replacement follows symbolic links. Callers should take
+ this into account; lchmod should be applied only to arguments that
+ are known to not be symbolic links. On hosts that lack lchmod,
+ this can lead to race conditions between the check and the
+ invocation of lchmod, but we know of no workarounds that are
+ reliable in general. You might try requesting support for lchmod
+ from your operating system supplier. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lchmod chmod
+# endif
+/* Need to cast, because on mingw, the second parameter of chmod is
+ int mode. */
+_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
+ (const char *filename, mode_t mode));
+# else
+# if 0 /* assume already declared */
+_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));
+# endif
+# if @HAVE_LCHMOD@
+_GL_CXXALIASWARN (lchmod);
+# endif
+#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 *name, struct stat *buf));
+# elif @REPLACE_LSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lstat
+# define lstat rpl_lstat
+# endif
+_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
+# else
+_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
+# endif
+#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 @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));
+#else
+/* 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 (defined _WIN32 || 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)
+# 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
+#endif
+_GL_CXXALIASWARN (mkdir);
+
+
+#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 !@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));
+_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 !@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));
+_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@
+/* 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 */
+_GL_EXTERN_C int stat (const char *name, struct stat *buf)
+ _GL_ARG_NONNULL ((1, 2));
+# endif
+#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_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/lib/sys_time.in.h b/lib/sys_time.in.h
new file mode 100644
index 0000000..1623a1d
--- /dev/null
+++ b/lib/sys_time.in.h
@@ -0,0 +1,213 @@
+/* Provide a more complete sys/time.h.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* 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);
+#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
+# else
+ _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/lib/sys_types.in.h b/lib/sys_types.in.h
new file mode 100644
index 0000000..8ab0545
--- /dev/null
+++ b/lib/sys_types.in.h
@@ -0,0 +1,53 @@
+/* Provide a more complete sys/types.h.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#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
+
+/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <stddef.h>
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h
new file mode 100644
index 0000000..3982b2b
--- /dev/null
+++ b/lib/sys_wait.in.h
@@ -0,0 +1,129 @@
+/* A POSIX-like <sys/wait.h>.
+ Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+#define _@GUARD_PREFIX@_SYS_WAIT_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. */
+
+
+#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+/* Unix API. */
+
+/* The following macros apply to an argument x, that is a status of a process,
+ as returned by waitpid().
+ On nearly all systems, including Linux/x86, WEXITSTATUS are bits 15..8 and
+ WTERMSIG are bits 7..0, while BeOS uses the opposite. Therefore programs
+ have to use the abstract macros. */
+
+/* For valid x, exactly one of WIFSIGNALED(x), WIFEXITED(x), WIFSTOPPED(x)
+ is true. */
+# ifndef WIFSIGNALED
+# define WIFSIGNALED(x) (WTERMSIG (x) != 0 && WTERMSIG(x) != 0x7f)
+# endif
+# ifndef WIFEXITED
+# define WIFEXITED(x) (WTERMSIG (x) == 0)
+# endif
+# ifndef WIFSTOPPED
+# define WIFSTOPPED(x) (WTERMSIG (x) == 0x7f)
+# endif
+
+/* The termination signal. Only to be accessed if WIFSIGNALED(x) is true. */
+# ifndef WTERMSIG
+# define WTERMSIG(x) ((x) & 0x7f)
+# endif
+
+/* The exit status. Only to be accessed if WIFEXITED(x) is true. */
+# ifndef WEXITSTATUS
+# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
+# endif
+
+/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true. */
+# ifndef WSTOPSIG
+# define WSTOPSIG(x) (((x) >> 8) & 0x7f)
+# endif
+
+/* True if the process dumped core. Not standardized by POSIX. */
+# ifndef WCOREDUMP
+# define WCOREDUMP(x) ((x) & 0x80)
+# endif
+
+#else
+/* Native Windows API. */
+
+# include <signal.h> /* for SIGTERM */
+
+/* The following macros apply to an argument x, that is a status of a process,
+ as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
+ This value is simply an 'int', not composed of bit fields. */
+
+/* When an unhandled fatal signal terminates a process, the exit code is 3. */
+# define WIFSIGNALED(x) ((x) == 3)
+# define WIFEXITED(x) ((x) != 3)
+# define WIFSTOPPED(x) 0
+
+/* The signal that terminated a process is not known posthum. */
+# define WTERMSIG(x) SIGTERM
+
+# define WEXITSTATUS(x) (x)
+
+/* There are no stopping signals. */
+# define WSTOPSIG(x) 0
+
+/* There are no core dumps. */
+# define WCOREDUMP(x) 0
+
+#endif
+
+
+/* Declarations of functions. */
+
+#if @GNULIB_WAITPID@
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+# endif
+_GL_CXXALIAS_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+_GL_CXXALIASWARN (waitpid);
+#elif defined GNULIB_POSIXCHECK
+# undef waitpid
+# if HAVE_RAW_DECL_WAITPID
+_GL_WARN_ON_USE (waitpid, "waitpid is unportable - "
+ "use gnulib module sys_wait for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
diff --git a/lib/system-quote.c b/lib/system-quote.c
new file mode 100644
index 0000000..5cb6fde
--- /dev/null
+++ b/lib/system-quote.c
@@ -0,0 +1,311 @@
+/* Quoting for a system command.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2012.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "system-quote.h"
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "sh-quote.h"
+#include "xalloc.h"
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* The native Windows CreateProcess() function interprets characters like
+ ' ', '\t', '\\', '"' (but not '<' and '>') in a special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ - '*', '?' characters may get expanded through wildcard expansion in the
+ callee: By default, in the callee, the initialization code before main()
+ takes the result of GetCommandLine(), wildcard-expands it, and passes it
+ to main(). The exceptions to this rule are:
+ - programs that inspect GetCommandLine() and ignore argv,
+ - mingw programs that have a global variable 'int _CRT_glob = 0;',
+ - Cygwin programs, when invoked from a Cygwin program.
+ */
+# define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037*?"
+# define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+
+/* Copies the quoted string to p and returns the number of bytes needed.
+ If p is non-NULL, there must be room for system_quote_length (string)
+ bytes at p. */
+static size_t
+windows_createprocess_quote (char *p, const char *string)
+{
+ size_t len = strlen (string);
+ bool quote_around =
+ (len == 0 || strpbrk (string, SHELL_SPECIAL_CHARS) != NULL);
+ size_t backslashes = 0;
+ size_t i = 0;
+# define STORE(c) \
+ do \
+ { \
+ if (p != NULL) \
+ p[i] = (c); \
+ i++; \
+ } \
+ while (0)
+
+ if (quote_around)
+ STORE ('"');
+ for (; len > 0; string++, len--)
+ {
+ char c = *string;
+
+ if (c == '"')
+ {
+ size_t j;
+
+ for (j = backslashes + 1; j > 0; j--)
+ STORE ('\\');
+ }
+ STORE (c);
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ size_t j;
+
+ for (j = backslashes; j > 0; j--)
+ STORE ('\\');
+ STORE ('"');
+ }
+# undef STORE
+ return i;
+}
+
+/* The native Windows cmd.exe command interpreter also interprets:
+ - '\n', '\r' as a command terminator - no way to escape it,
+ - '<', '>' as redirections,
+ - '|' as pipe operator,
+ - '%var%' as a reference to the environment variable VAR (uppercase),
+ even inside quoted strings,
+ - '&' '[' ']' '{' '}' '^' '=' ';' '!' '\'' '+' ',' '`' '~' for other
+ purposes, according to
+ <http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true>
+ We quote a string like '%var%' by putting the '%' characters outside of
+ double-quotes and the rest of the string inside double-quotes: %"var"%.
+ This is guaranteed to not be a reference to an environment variable.
+ */
+# define CMD_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037!%&'*+,;<=>?[]^`{|}~"
+# define CMD_FORBIDDEN_CHARS "\n\r"
+
+/* Copies the quoted string to p and returns the number of bytes needed.
+ If p is non-NULL, there must be room for system_quote_length (string)
+ bytes at p. */
+static size_t
+windows_cmd_quote (char *p, const char *string)
+{
+ size_t len = strlen (string);
+ bool quote_around =
+ (len == 0 || strpbrk (string, CMD_SPECIAL_CHARS) != NULL);
+ size_t backslashes = 0;
+ size_t i = 0;
+# define STORE(c) \
+ do \
+ { \
+ if (p != NULL) \
+ p[i] = (c); \
+ i++; \
+ } \
+ while (0)
+
+ if (quote_around)
+ STORE ('"');
+ for (; len > 0; string++, len--)
+ {
+ char c = *string;
+
+ if (c == '"')
+ {
+ size_t j;
+
+ for (j = backslashes + 1; j > 0; j--)
+ STORE ('\\');
+ }
+ if (c == '%')
+ {
+ size_t j;
+
+ for (j = backslashes; j > 0; j--)
+ STORE ('\\');
+ STORE ('"');
+ }
+ STORE (c);
+ if (c == '%')
+ STORE ('"');
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ size_t j;
+
+ for (j = backslashes; j > 0; j--)
+ STORE ('\\');
+ STORE ('"');
+ }
+ return i;
+}
+
+#endif
+
+size_t
+system_quote_length (enum system_command_interpreter interpreter,
+ const char *string)
+{
+ switch (interpreter)
+ {
+#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+ case SCI_SYSTEM:
+#endif
+ case SCI_POSIX_SH:
+ return shell_quote_length (string);
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ case SCI_WINDOWS_CREATEPROCESS:
+ return windows_createprocess_quote (NULL, string);
+
+ case SCI_SYSTEM:
+ case SCI_WINDOWS_CMD:
+ return windows_cmd_quote (NULL, string);
+#endif
+
+ default:
+ /* Invalid interpreter. */
+ abort ();
+ }
+}
+
+char *
+system_quote_copy (char *p,
+ enum system_command_interpreter interpreter,
+ const char *string)
+{
+ switch (interpreter)
+ {
+#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+ case SCI_SYSTEM:
+#endif
+ case SCI_POSIX_SH:
+ return shell_quote_copy (p, string);
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ case SCI_WINDOWS_CREATEPROCESS:
+ p += windows_createprocess_quote (p, string);
+ *p = '\0';
+ return p;
+
+ case SCI_SYSTEM:
+ case SCI_WINDOWS_CMD:
+ p += windows_cmd_quote (p, string);
+ *p = '\0';
+ return p;
+#endif
+
+ default:
+ /* Invalid interpreter. */
+ abort ();
+ }
+}
+
+char *
+system_quote (enum system_command_interpreter interpreter,
+ const char *string)
+{
+ switch (interpreter)
+ {
+#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+ case SCI_SYSTEM:
+#endif
+ case SCI_POSIX_SH:
+ return shell_quote (string);
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ case SCI_WINDOWS_CREATEPROCESS:
+ case SCI_SYSTEM:
+ case SCI_WINDOWS_CMD:
+ {
+ size_t length = system_quote_length (interpreter, string);
+ char *quoted = XNMALLOC (length, char);
+ system_quote_copy (quoted, interpreter, string);
+ return quoted;
+ }
+#endif
+
+ default:
+ /* Invalid interpreter. */
+ abort ();
+ }
+}
+
+char *
+system_quote_argv (enum system_command_interpreter interpreter,
+ char * const *argv)
+{
+ if (*argv != NULL)
+ {
+ char * const *argp;
+ size_t length;
+ char *command;
+ char *p;
+
+ length = 0;
+ for (argp = argv; ; )
+ {
+ length += system_quote_length (interpreter, *argp) + 1;
+ argp++;
+ if (*argp == NULL)
+ break;
+ }
+
+ command = XNMALLOC (length, char);
+
+ p = command;
+ for (argp = argv; ; )
+ {
+ p = system_quote_copy (p, interpreter, *argp);
+ argp++;
+ if (*argp == NULL)
+ break;
+ *p++ = ' ';
+ }
+ *p = '\0';
+
+ return command;
+ }
+ else
+ return xstrdup ("");
+}
diff --git a/lib/system-quote.h b/lib/system-quote.h
new file mode 100644
index 0000000..b56f467
--- /dev/null
+++ b/lib/system-quote.h
@@ -0,0 +1,99 @@
+/* Quoting for a system command.
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2012.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYSTEM_QUOTE_H
+#define _SYSTEM_QUOTE_H
+
+/* When passing a command the system's command interpreter, we must quote the
+ program name and arguments, since
+ - Unix shells interpret characters like " ", "'", "<", ">", "$", '*', '?'
+ etc. in a special way,
+ - Windows CreateProcess() interprets characters like ' ', '\t', '\\', '"'
+ etc. (but not '<' and '>') in a special way,
+ - Windows cmd.exe also interprets characters like '<', '>', '&', '%', etc.
+ in a special way. Note that it is impossible to pass arguments that
+ contain newlines or carriage return characters to programs through
+ cmd.exe.
+ - Windows programs usually perform wildcard expansion when they receive
+ arguments that contain unquoted '*', '?' characters.
+
+ With this module, you can build a command that will invoke a program with
+ specific strings as arguments.
+
+ Note: If you want wildcard expansion to happen, you have to first do wildcard
+ expansion through the 'glob' module, then quote the resulting strings through
+ this module, and then invoke the system's command interpreter.
+
+ Limitations:
+ - When invoking native Windows programs on Windows Vista or newer,
+ wildcard expansion will occur in the invoked program nevertheless.
+ - On native Windows, for SCI_SYSTEM and SCI_WINDOWS_CMD, newlines and
+ carriage return characters are not supported. Their undesired effect
+ is to truncate the entire command line.
+ */
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Identifier for the kind of interpreter of the command. */
+enum system_command_interpreter
+{
+ /* The interpreter used by the system() and popen() functions.
+ This is equivalent to SCI_POSIX_SH on Unix platforms and
+ SCI_WINDOWS_CMD on native Windows platforms. */
+ SCI_SYSTEM = 0
+ /* The POSIX /bin/sh. */
+ , SCI_POSIX_SH = 1
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* The native Windows CreateProcess() function. */
+ , SCI_WINDOWS_CREATEPROCESS = 2
+ /* The native Windows cmd.exe interpreter. */
+ , SCI_WINDOWS_CMD = 3
+#endif
+};
+
+/* Returns the number of bytes needed for the quoted string. */
+extern size_t
+ system_quote_length (enum system_command_interpreter interpreter,
+ const char *string);
+
+/* Copies the quoted string to p and returns the incremented p.
+ There must be room for system_quote_length (string) + 1 bytes at p. */
+extern char *
+ system_quote_copy (char *p,
+ enum system_command_interpreter interpreter,
+ const char *string);
+
+/* Returns the freshly allocated quoted string. */
+extern char *
+ system_quote (enum system_command_interpreter interpreter,
+ const char *string);
+
+/* Returns a freshly allocated string containing all argument strings, quoted,
+ separated through spaces. */
+extern char *
+ system_quote_argv (enum system_command_interpreter interpreter,
+ char * const *argv);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYSTEM_QUOTE_H */
diff --git a/lib/tempname.c b/lib/tempname.c
new file mode 100644
index 0000000..b1e9880
--- /dev/null
+++ b/lib/tempname.c
@@ -0,0 +1,324 @@
+/* tempname.c - generate the name of a temporary file.
+
+ Copyright (C) 1991-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */
+
+#if !_LIBC
+# include <config.h>
+# include "tempname.h"
+#endif
+
+#include <sys/types.h>
+#include <assert.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+
+#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 <sys/time.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <sys/stat.h>
+
+#if _LIBC
+# define struct_stat64 struct stat64
+#else
+# define struct_stat64 struct stat
+# define __try_tempname try_tempname
+# define __gen_tempname gen_tempname
+# define __getpid getpid
+# define __gettimeofday gettimeofday
+# define __mkdir mkdir
+# define __open open
+# define __lxstat64(version, file, buf) lstat (file, buf)
+# define __secure_getenv secure_getenv
+#endif
+
+#ifdef _LIBC
+# include <hp-timing.h>
+# if HP_TIMING_AVAIL
+# define RANDOM_BITS(Var) \
+ if (__builtin_expect (value == UINT64_C (0), 0)) \
+ { \
+ /* If this is the first time this function is used initialize \
+ the variable we accumulate the value in to some somewhat \
+ random value. If we'd not do this programs at startup time \
+ might have a reduced set of possible names, at least on slow \
+ machines. */ \
+ struct timeval tv; \
+ __gettimeofday (&tv, NULL); \
+ value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \
+ } \
+ HP_TIMING_NOW (Var)
+# endif
+#endif
+
+/* Use the widest available unsigned type if uint64_t is not
+ available. The algorithm below extracts a number less than 62**6
+ (approximately 2**35.725) from uint64_t, so ancient hosts where
+ uintmax_t is only 32 bits lose about 3.725 bits of randomness,
+ which is better than not having mkstemp at all. */
+#if !defined UINT64_MAX && !defined uint64_t
+# define uint64_t uintmax_t
+#endif
+
+#if _LIBC
+/* Return nonzero if DIR is an existent directory. */
+static int
+direxists (const char *dir)
+{
+ struct_stat64 buf;
+ return __xstat64 (_STAT_VER, 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 */
+
+/* These are the characters used in temporary file names. */
+static const char letters[] =
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+int
+__try_tempname (char *tmpl, int suffixlen, void *args,
+ int (*tryfunc) (char *, void *))
+{
+ int len;
+ char *XXXXXX;
+ static uint64_t value;
+ uint64_t random_time_bits;
+ 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. */
+#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
+
+ len = strlen (tmpl);
+ if (len < 6 + suffixlen || memcmp (&tmpl[len - 6 - suffixlen], "XXXXXX", 6))
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ /* This is where the Xs start. */
+ XXXXXX = &tmpl[len - 6 - suffixlen];
+
+ /* Get some more or less random data. */
+#ifdef RANDOM_BITS
+ RANDOM_BITS (random_time_bits);
+#else
+ {
+ struct timeval tv;
+ __gettimeofday (&tv, NULL);
+ random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
+ }
+#endif
+ value += random_time_bits ^ __getpid ();
+
+ for (count = 0; count < attempts; value += 7777, ++count)
+ {
+ uint64_t v = value;
+
+ /* Fill in the random bits. */
+ XXXXXX[0] = letters[v % 62];
+ v /= 62;
+ XXXXXX[1] = letters[v % 62];
+ v /= 62;
+ XXXXXX[2] = letters[v % 62];
+ v /= 62;
+ XXXXXX[3] = letters[v % 62];
+ v /= 62;
+ XXXXXX[4] = letters[v % 62];
+ v /= 62;
+ XXXXXX[5] = letters[v % 62];
+
+ 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;
+}
+
+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, void *flags _GL_UNUSED)
+{
+ return __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+}
+
+static int
+try_nocreate (char *tmpl, void *flags _GL_UNUSED)
+{
+ struct_stat64 st;
+
+ if (__lxstat64 (_STAT_VER, tmpl, &st) == 0)
+ __set_errno (EEXIST);
+ return errno == ENOENT ? 0 : -1;
+}
+
+/* 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 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. */
+int
+__gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+{
+ int (*tryfunc) (char *, void *);
+
+ switch (kind)
+ {
+ case __GT_FILE:
+ tryfunc = try_file;
+ break;
+
+ case __GT_DIR:
+ tryfunc = try_dir;
+ break;
+
+ case __GT_NOCREATE:
+ tryfunc = try_nocreate;
+ break;
+
+ default:
+ assert (! "invalid KIND in __gen_tempname");
+ abort ();
+ }
+ return __try_tempname (tmpl, suffixlen, &flags, tryfunc);
+}
diff --git a/lib/tempname.h b/lib/tempname.h
new file mode 100644
index 0000000..be01c51
--- /dev/null
+++ b/lib/tempname.h
@@ -0,0 +1,65 @@
+/* Create a temporary file or directory.
+
+ Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* 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 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 *));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GL_TEMPNAME_H */
diff --git a/lib/time-internal.h b/lib/time-internal.h
new file mode 100644
index 0000000..0635f28
--- /dev/null
+++ b/lib/time-internal.h
@@ -0,0 +1,49 @@
+/* Time internal interface
+
+ Copyright 2015-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* A time zone rule. */
+struct tm_zone
+{
+ /* More abbreviations, should they be needed. Their TZ_IS_SET
+ members are zero. */
+ struct tm_zone *next;
+
+#if HAVE_TZNAME && !HAVE_TM_ZONE
+ /* Copies of recent strings taken from tzname[0] and tzname[1].
+ The copies are in ABBRS, so that they survive tzset. Null if unknown. */
+ char *tzname_copy[2];
+#endif
+
+ /* If nonzero, the rule represents the TZ environment variable set
+ to the first "abbreviation" (this may be the empty string).
+ Otherwise, it represents an unset TZ. */
+ char tz_is_set;
+
+ /* A sequence of null-terminated strings packed next to each other.
+ The strings are followed by an extra null byte. If TZ_IS_SET,
+ there must be at least one string and the first string (which is
+ actually a TZ environment value value) may be empty. Otherwise
+ all strings must be nonempty.
+
+ Abbreviations are stored here because otherwise the values of
+ tm_zone and/or tzname would be dead after changing TZ and calling
+ tzset. Abbreviations never move once allocated, and are live
+ until tzfree is called. */
+ char abbrs[FLEXIBLE_ARRAY_MEMBER];
+};
diff --git a/lib/time.in.h b/lib/time.in.h
new file mode 100644
index 0000000..865c114
--- /dev/null
+++ b/lib/time.in.h
@@ -0,0 +1,297 @@
+/* A more-standard <time.h>.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#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
+
+# @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, Ultrix 4.3).
+ 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
+/* Per http://austingroupbugs.net/view.php?id=327, POSIX 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
+
+/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
+ return -1 and store the remaining time into RMTP. See
+ <http://www.opengroup.org/susv3xsh/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
+
+/* 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
+_GL_CXXALIASWARN (mktime);
+# endif
+
+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
+ <http://www.opengroup.org/susv3xsh/localtime_r.html> and
+ <http://www.opengroup.org/susv3xsh/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
+ <http://www.opengroup.org/susv3xsh/localtime.html> and
+ <http://www.opengroup.org/susv3xsh/gmtime.html>. */
+# if @GNULIB_GETTIMEOFDAY@
+# 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
+_GL_CXXALIASWARN (localtime);
+# endif
+
+# if @GNULIB_GETTIMEOFDAY@
+# 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 time stamp, assuming FORMAT specifies its layout, and store
+ the resulting broken-down time into TM. See
+ <http://www.opengroup.org/susv3xsh/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
+
+# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
+typedef struct tm_zone *timezone_t;
+_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
+_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
+_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
+_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
+_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));
+_GL_FUNCDECL_SYS (mktime_z, time_t,
+ (timezone_t __tz, struct tm *restrict __result)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (mktime_z, time_t,
+ (timezone_t __tz, struct tm *restrict __result));
+# 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, "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 (asctime, "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 (asctime, "ctime_r can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+
+#endif
diff --git a/lib/time_r.c b/lib/time_r.c
new file mode 100644
index 0000000..dc1e161
--- /dev/null
+++ b/lib/time_r.c
@@ -0,0 +1,44 @@
+/* Reentrant time functions like localtime_r.
+
+ Copyright (C) 2003, 2006-2007, 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+#include <time.h>
+
+static struct tm *
+copy_tm_result (struct tm *dest, struct tm const *src)
+{
+ if (! src)
+ return 0;
+ *dest = *src;
+ return dest;
+}
+
+
+struct tm *
+gmtime_r (time_t const * restrict t, struct tm * restrict tp)
+{
+ return copy_tm_result (tp, gmtime (t));
+}
+
+struct tm *
+localtime_r (time_t const * restrict t, struct tm * restrict tp)
+{
+ return copy_tm_result (tp, localtime (t));
+}
diff --git a/lib/time_rz.c b/lib/time_rz.c
new file mode 100644
index 0000000..55b764e
--- /dev/null
+++ b/lib/time_rz.c
@@ -0,0 +1,321 @@
+/* Time zone functions such as tzalloc and localtime_rz
+
+ Copyright 2015-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* Although this module is not thread-safe, any races should be fairly
+ rare and reasonably benign. For complete thread-safety, use a C
+ library with a working timezone_t type, so that this module is not
+ needed. */
+
+#include <config.h>
+
+#include <time.h>
+
+#include <errno.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "time-internal.h"
+
+#if !HAVE_TZSET
+static void tzset (void) { }
+#endif
+
+/* The approximate size to use for small allocation requests. This is
+ the largest "small" request for the GNU C library malloc. */
+enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
+
+/* Minimum size of the ABBRS member of struct abbr. ABBRS is larger
+ only in the unlikely case where an abbreviation longer than this is
+ used. */
+enum { ABBR_SIZE_MIN = DEFAULT_MXFAST - offsetof (struct tm_zone, abbrs) };
+
+/* Magic cookie timezone_t value, for local time. It differs from
+ NULL and from all other timezone_t values. Only the address
+ matters; the pointer is never dereferenced. */
+static timezone_t const local_tz = (timezone_t) 1;
+
+#if HAVE_TM_ZONE || HAVE_TZNAME
+
+/* Return true if the values A and B differ according to the rules for
+ tm_isdst: A and B differ if one is zero and the other positive. */
+static bool
+isdst_differ (int a, int b)
+{
+ return !a != !b && 0 <= a && 0 <= b;
+}
+
+/* Return true if A and B are equal. */
+static int
+equal_tm (const struct tm *a, const struct tm *b)
+{
+ return ! ((a->tm_sec ^ b->tm_sec)
+ | (a->tm_min ^ b->tm_min)
+ | (a->tm_hour ^ b->tm_hour)
+ | (a->tm_mday ^ b->tm_mday)
+ | (a->tm_mon ^ b->tm_mon)
+ | (a->tm_year ^ b->tm_year)
+ | isdst_differ (a->tm_isdst, b->tm_isdst));
+}
+
+#endif
+
+/* Copy to ABBRS the abbreviation at ABBR with size ABBR_SIZE (this
+ includes its trailing null byte). Append an extra null byte to
+ mark the end of ABBRS. */
+static void
+extend_abbrs (char *abbrs, char const *abbr, size_t abbr_size)
+{
+ memcpy (abbrs, abbr, abbr_size);
+ abbrs[abbr_size] = '\0';
+}
+
+/* Return a newly allocated time zone for NAME, or NULL on failure.
+ A null NAME stands for wall clock time (which is like unset TZ). */
+timezone_t
+tzalloc (char const *name)
+{
+ size_t name_size = name ? strlen (name) + 1 : 0;
+ size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1;
+ timezone_t tz = malloc (offsetof (struct tm_zone, abbrs) + abbr_size);
+ if (tz)
+ {
+ tz->next = NULL;
+#if HAVE_TZNAME && !HAVE_TM_ZONE
+ tz->tzname_copy[0] = tz->tzname_copy[1] = NULL;
+#endif
+ tz->tz_is_set = !!name;
+ tz->abbrs[0] = '\0';
+ if (name)
+ extend_abbrs (tz->abbrs, name, name_size);
+ }
+ return tz;
+}
+
+/* Save into TZ any nontrivial time zone abbreviation used by TM, and
+ update *TM (if HAVE_TM_ZONE) or *TZ (if !HAVE_TM_ZONE &&
+ HAVE_TZNAME) if they use the abbreviation. Return true if
+ successful, false (setting errno) otherwise. */
+static bool
+save_abbr (timezone_t tz, struct tm *tm)
+{
+#if HAVE_TM_ZONE || HAVE_TZNAME
+ char const *zone = NULL;
+ char *zone_copy = (char *) "";
+
+# if HAVE_TZNAME
+ int tzname_index = -1;
+# endif
+
+# if HAVE_TM_ZONE
+ zone = tm->tm_zone;
+# endif
+
+# if HAVE_TZNAME
+ if (! (zone && *zone) && 0 <= tm->tm_isdst)
+ {
+ tzname_index = tm->tm_isdst != 0;
+ zone = tzname[tzname_index];
+ }
+# endif
+
+ /* No need to replace null zones, or zones within the struct tm. */
+ if (!zone || ((char *) tm <= zone && zone < (char *) (tm + 1)))
+ return true;
+
+ if (*zone)
+ {
+ zone_copy = tz->abbrs;
+
+ while (strcmp (zone_copy, zone) != 0)
+ {
+ if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set)))
+ {
+ size_t zone_size = strlen (zone) + 1;
+ if (zone_size < tz->abbrs + ABBR_SIZE_MIN - zone_copy)
+ extend_abbrs (zone_copy, zone, zone_size);
+ else
+ {
+ tz = tz->next = tzalloc (zone);
+ if (!tz)
+ return false;
+ tz->tz_is_set = 0;
+ zone_copy = tz->abbrs;
+ }
+ break;
+ }
+
+ zone_copy += strlen (zone_copy) + 1;
+ if (!*zone_copy && tz->next)
+ {
+ tz = tz->next;
+ zone_copy = tz->abbrs;
+ }
+ }
+ }
+
+ /* Replace the zone name so that its lifetime matches that of TZ. */
+# if HAVE_TM_ZONE
+ tm->tm_zone = zone_copy;
+# else
+ if (0 <= tzname_index)
+ tz->tzname_copy[tzname_index] = zone_copy;
+# endif
+#endif
+
+ return true;
+}
+
+/* Free a time zone. */
+void
+tzfree (timezone_t tz)
+{
+ if (tz != local_tz)
+ while (tz)
+ {
+ timezone_t next = tz->next;
+ free (tz);
+ tz = next;
+ }
+}
+
+/* Get and set the TZ environment variable. These functions can be
+ overridden by programs like Emacs that manage their own environment. */
+
+#ifndef getenv_TZ
+static char *
+getenv_TZ (void)
+{
+ return getenv ("TZ");
+}
+#endif
+
+#ifndef setenv_TZ
+static int
+setenv_TZ (char const *tz)
+{
+ return tz ? setenv ("TZ", tz, 1) : unsetenv ("TZ");
+}
+#endif
+
+/* Change the environment to match the specified timezone_t value.
+ Return true if successful, false (setting errno) otherwise. */
+static bool
+change_env (timezone_t tz)
+{
+ if (setenv_TZ (tz->tz_is_set ? tz->abbrs : NULL) != 0)
+ return false;
+ tzset ();
+ return true;
+}
+
+/* Temporarily set the time zone to TZ, which must not be null.
+ Return LOCAL_TZ if the time zone setting is already correct.
+ Otherwise return a newly allocated time zone representing the old
+ setting, or NULL (setting errno) on failure. */
+static timezone_t
+set_tz (timezone_t tz)
+{
+ char *env_tz = getenv_TZ ();
+ if (env_tz
+ ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0
+ : !tz->tz_is_set)
+ return local_tz;
+ else
+ {
+ timezone_t old_tz = tzalloc (env_tz);
+ if (!old_tz)
+ return old_tz;
+ if (! change_env (tz))
+ {
+ int saved_errno = errno;
+ tzfree (old_tz);
+ errno = saved_errno;
+ return NULL;
+ }
+ return old_tz;
+ }
+}
+
+/* Restore an old setting returned by set_tz. It must not be null.
+ Return true (preserving errno) if successful, false (setting errno)
+ otherwise. */
+static bool
+revert_tz (timezone_t tz)
+{
+ if (tz == local_tz)
+ return true;
+ else
+ {
+ int saved_errno = errno;
+ bool ok = change_env (tz);
+ if (!ok)
+ saved_errno = errno;
+ tzfree (tz);
+ errno = saved_errno;
+ return ok;
+ }
+}
+
+/* Use time zone TZ to compute localtime_r (T, TM). */
+struct tm *
+localtime_rz (timezone_t tz, time_t const *t, struct tm *tm)
+{
+ if (!tz)
+ return gmtime_r (t, tm);
+ else
+ {
+ timezone_t old_tz = set_tz (tz);
+ if (old_tz)
+ {
+ bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm);
+ if (revert_tz (old_tz) && abbr_saved)
+ return tm;
+ }
+ return NULL;
+ }
+}
+
+/* Use time zone TZ to compute mktime (TM). */
+time_t
+mktime_z (timezone_t tz, struct tm *tm)
+{
+ if (!tz)
+ return timegm (tm);
+ else
+ {
+ timezone_t old_tz = set_tz (tz);
+ if (old_tz)
+ {
+ time_t t = mktime (tm);
+#if HAVE_TM_ZONE || HAVE_TZNAME
+ time_t badtime = -1;
+ struct tm tm_1;
+ if ((t != badtime
+ || (localtime_r (&t, &tm_1) && equal_tm (tm, &tm_1)))
+ && !save_abbr (tz, tm))
+ t = badtime;
+#endif
+ if (revert_tz (old_tz))
+ return t;
+ }
+ return -1;
+ }
+}
diff --git a/lib/timegm.c b/lib/timegm.c
new file mode 100644
index 0000000..bf61244
--- /dev/null
+++ b/lib/timegm.c
@@ -0,0 +1,40 @@
+/* Convert UTC calendar time to simple time. Like mktime but assumes UTC.
+
+ Copyright (C) 1994, 1997, 2003-2004, 2006-2007, 2009-2016 Free Software
+ Foundation, Inc. This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <time.h>
+
+#ifdef _LIBC
+typedef time_t mktime_offset_t;
+#else
+# undef __gmtime_r
+# define __gmtime_r gmtime_r
+# define __mktime_internal mktime_internal
+# include "mktime-internal.h"
+#endif
+
+time_t
+timegm (struct tm *tmp)
+{
+ static mktime_offset_t gmtime_offset;
+ tmp->tm_isdst = 0;
+ return __mktime_internal (tmp, __gmtime_r, &gmtime_offset);
+}
diff --git a/lib/timespec.c b/lib/timespec.c
new file mode 100644
index 0000000..2b6098e
--- /dev/null
+++ b/lib/timespec.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_TIMESPEC_INLINE _GL_EXTERN_INLINE
+#include "timespec.h"
diff --git a/lib/timespec.h b/lib/timespec.h
new file mode 100644
index 0000000..601394b
--- /dev/null
+++ b/lib/timespec.h
@@ -0,0 +1,112 @@
+/* timespec -- System time interface
+
+ Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#if ! defined 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
+
+/* Resolution of timespec time stamps (in units per second), and log
+ base 10 of the resolution. */
+
+enum { TIMESPEC_RESOLUTION = 1000000000 };
+enum { LOG10_TIMESPEC_RESOLUTION = 9 };
+
+/* 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.
+
+ For each time stamp T, this code assumes that either:
+
+ * T.tv_nsec is in the range 0..999999999; or
+ * T.tv_sec corresponds to a valid leap second on a host that supports
+ leap seconds, and T.tv_nsec is in the range 1000000000..1999999999; or
+ * T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or
+ T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000.
+ This allows for special struct timespec values that are less or
+ greater than all possible valid time stamps.
+
+ In all these cases, it is safe to subtract two tv_nsec values and
+ convert the result to integer without worrying about overflow on
+ any platform of interest to the GNU project, since all such
+ platforms have 32-bit int or wider.
+
+ Replacing "(int) (a.tv_nsec - b.tv_nsec)" with something like
+ "a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause
+ this function to work in some cases where the above assumption is
+ violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2,
+ b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the
+ extra instructions. Using a subtraction has the advantage of
+ detecting some invalid cases on platforms that detect integer
+ overflow.
+
+ The (int) cast avoids a gcc -Wconversion warning. */
+
+_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
+timespec_cmp (struct timespec a, struct timespec b)
+{
+ return (a.tv_sec < b.tv_sec ? -1
+ : a.tv_sec > b.tv_sec ? 1
+ : (int) (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 a.tv_sec < 0 ? -1 : 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;
+}
+
+void gettime (struct timespec *);
+int settime (struct timespec const *);
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/lib/trim.c b/lib/trim.c
new file mode 100644
index 0000000..b2e43c5
--- /dev/null
+++ b/lib/trim.c
@@ -0,0 +1,129 @@
+/* Removes leading and/or trailing whitespaces
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Davide Angelocola <davide.angelocola@gmail.com> */
+
+#include <config.h>
+
+/* Specification. */
+#include "trim.h"
+
+#include <ctype.h>
+#include <string.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "mbchar.h"
+#include "mbiter.h"
+#include "xalloc.h"
+
+/* Use this to suppress gcc's "...may be used before initialized" warnings. */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+char *
+trim2 (const char *s, int how)
+{
+ char *d;
+
+ d = strdup (s);
+
+ if (!d)
+ xalloc_die ();
+
+ if (MB_CUR_MAX > 1)
+ {
+ mbi_iterator_t i;
+
+ /* Trim leading whitespaces. */
+ if (how != TRIM_TRAILING)
+ {
+ mbi_init (i, d, strlen (d));
+
+ for (; mbi_avail (i) && mb_isspace (mbi_cur (i)); mbi_advance (i))
+ ;
+
+ memmove (d, mbi_cur_ptr (i), strlen (mbi_cur_ptr (i)) + 1);
+ }
+
+ /* Trim trailing whitespaces. */
+ if (how != TRIM_LEADING)
+ {
+ unsigned int state = 0;
+ char *r IF_LINT (= NULL); /* used only while state = 2 */
+
+ mbi_init (i, d, strlen (d));
+
+ for (; mbi_avail (i); mbi_advance (i))
+ {
+ if (state == 0 && mb_isspace (mbi_cur (i)))
+ continue;
+
+ if (state == 0 && !mb_isspace (mbi_cur (i)))
+ {
+ state = 1;
+ continue;
+ }
+
+ if (state == 1 && !mb_isspace (mbi_cur (i)))
+ continue;
+
+ if (state == 1 && mb_isspace (mbi_cur (i)))
+ {
+ state = 2;
+ r = (char *) mbi_cur_ptr (i);
+ }
+ else if (state == 2 && mb_isspace (mbi_cur (i)))
+ {
+ /* empty */
+ }
+ else
+ {
+ state = 1;
+ }
+ }
+
+ if (state == 2)
+ *r = '\0';
+ }
+ }
+ else
+ {
+ char *p;
+
+ /* Trim leading whitespaces. */
+ if (how != TRIM_TRAILING)
+ {
+ for (p = d; *p && isspace ((unsigned char) *p); p++)
+ ;
+
+ memmove (d, p, strlen (p) + 1);
+ }
+
+ /* Trim trailing whitespaces. */
+ if (how != TRIM_LEADING)
+ {
+ for (p = d + strlen (d) - 1;
+ p >= d && isspace ((unsigned char) *p); p--)
+ *p = '\0';
+ }
+ }
+
+ return d;
+}
diff --git a/lib/trim.h b/lib/trim.h
new file mode 100644
index 0000000..01c22f2
--- /dev/null
+++ b/lib/trim.h
@@ -0,0 +1,33 @@
+/* Removes leading and/or trailing whitespaces
+ Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Davide Angelocola <davide.angelocola@gmail.com> */
+
+/* Trim mode. */
+#define TRIM_TRAILING 0
+#define TRIM_LEADING 1
+#define TRIM_BOTH 2
+
+/* Removes trailing and leading whitespaces. */
+#define trim(s) trim2(s, TRIM_BOTH)
+
+/* Removes trailing whitespaces. */
+#define trim_trailing(s) trim2(s, TRIM_TRAILING)
+
+/* Removes leading whitespaces. */
+#define trim_leading(s) trim2(s, TRIM_LEADING)
+
+char *trim2 (const char *, int);
diff --git a/lib/uinttostr.c b/lib/uinttostr.c
new file mode 100644
index 0000000..48fd98f
--- /dev/null
+++ b/lib/uinttostr.c
@@ -0,0 +1,3 @@
+#define anytostr uinttostr
+#define inttype unsigned int
+#include "anytostr.c"
diff --git a/lib/umaxtostr.c b/lib/umaxtostr.c
new file mode 100644
index 0000000..f95bfc3
--- /dev/null
+++ b/lib/umaxtostr.c
@@ -0,0 +1,3 @@
+#define anytostr umaxtostr
+#define inttype uintmax_t
+#include "anytostr.c"
diff --git a/lib/unistd.c b/lib/unistd.c
new file mode 100644
index 0000000..72bad1c
--- /dev/null
+++ b/lib/unistd.c
@@ -0,0 +1,4 @@
+#include <config.h>
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
+typedef int dummy;
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
new file mode 100644
index 0000000..c3af07a
--- /dev/null
+++ b/lib/unistd.in.h
@@ -0,0 +1,1586 @@
+/* Substitute for and wrapper around <unistd.h>.
+ Copyright (C) 2003-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_UNISTD_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#ifdef _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. */
+#include <stddef.h>
+
+/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
+/* 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_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
+ && defined __CYGWIN__)) \
+ && ! defined __GLIBC__
+# include <stdio.h>
+#endif
+
+/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
+ && ! 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 ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
+ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# include <io.h> /* mingw32, mingw64 */
+# include <direct.h> /* mingw64, MSVC 9 */
+#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
+ || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
+ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.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
+
+/* MSVC defines off_t in <sys/types.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@
+/* Get off_t. */
+# include <sys/types.h>
+#endif
+
+#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
+ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
+ || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
+/* Get ssize_t. */
+# include <sys/types.h>
+#endif
+
+/* Get getopt(), optarg, optind, opterr, optopt.
+ But avoid namespace pollution on glibc systems. */
+#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
+# define __need_getopt
+# include <getopt.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
+
+/* 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. */
+
+
+/* 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 defined GNULIB_POSIXCHECK
+/* The access() function is a security risk. */
+_GL_WARN_ON_USE (access, "the access function is a security risk - "
+ "use the gnulib module faccessat instead");
+#endif
+
+
+#if @GNULIB_CHDIR@
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+_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
+#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
+ <http://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));
+# 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");
+#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));
+# 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
+#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
+ <http://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));
+# else
+# if !@HAVE_DUP2@
+_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_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
+#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
+ <http://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 !@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 ***
+rpl_environ (void)
+{
+ return &environ;
+}
+_GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
+ "use gnulib module environ for portability");
+# 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_FACCESSAT@
+# 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));
+_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
+ <http://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 openat 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
+ <http://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
+ <http://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
+ <http://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
+ <http://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));
+# 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
+#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
+_GL_CXXALIAS_SYS (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_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 <http://www.opengroup.org/susv3xsh/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_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 <http://www.opengroup.org/susv3xsh/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
+# 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_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
+_GL_FUNCDECL_RPL (isatty, int, (int fd));
+_GL_CXXALIAS_RPL (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
+#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
+ <http://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
+ <http://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
+ <http://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));
+# 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
+#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
+ <http://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
+ <http://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
+ <http://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
+ <http://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));
+# else
+/* Need to cast, because on mingw, the third parameter is
+ unsigned int count
+ and the return type is 'int'. */
+_GL_CXXALIAS_SYS_CAST (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
+ <http://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 *file, char *buf, size_t bufsize)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (readlink, ssize_t,
+ (const char *file, char *buf, size_t bufsize));
+# else
+# if !@HAVE_READLINK@
+_GL_FUNCDECL_SYS (readlink, ssize_t,
+ (const char *file, char *buf, size_t bufsize)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (readlink, ssize_t,
+ (const char *file, char *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 *file, char *buf, size_t len)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (readlinkat, ssize_t,
+ (int fd, char const *file, char *buf, size_t len));
+# else
+# if !@HAVE_READLINKAT@
+_GL_FUNCDECL_SYS (readlinkat, ssize_t,
+ (int fd, char const *file, char *buf, size_t len)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (readlinkat, ssize_t,
+ (int fd, char const *file, char *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));
+# 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
+#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
+ <http://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_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_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));
+# 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
+#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 openat 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
+ <http://www.opengroup.org/susv3xsh/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
+_GL_CXXALIAS_SYS (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
+ <http://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));
+# else
+/* Need to cast, because on mingw, the third parameter is
+ unsigned int count
+ and the return type is 'int'. */
+_GL_CXXALIAS_SYS_CAST (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/lib/unistr.in.h b/lib/unistr.in.h
new file mode 100644
index 0000000..70aa9cb
--- /dev/null
+++ b/lib/unistr.in.h
@@ -0,0 +1,750 @@
+/* Elementary Unicode string functions.
+ Copyright (C) 2001-2002, 2005-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _UNISTR_H
+#define _UNISTR_H
+
+#include "unitypes.h"
+
+/* Get common macros for C. */
+#include "unused-parameter.h"
+
+/* Get bool. */
+#include <stdbool.h>
+
+/* Get size_t. */
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Conventions:
+
+ All functions prefixed with u8_ operate on UTF-8 encoded strings.
+ Their unit is an uint8_t (1 byte).
+
+ All functions prefixed with u16_ operate on UTF-16 encoded strings.
+ Their unit is an uint16_t (a 2-byte word).
+
+ All functions prefixed with u32_ operate on UCS-4 encoded strings.
+ Their unit is an uint32_t (a 4-byte word).
+
+ All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly
+ n units.
+
+ All arguments starting with "str" and the arguments of functions starting
+ with u8_str/u16_str/u32_str denote a NUL terminated string, i.e. a string
+ which terminates at the first NUL unit. This termination unit is
+ considered part of the string for all memory allocation purposes, but
+ is not considered part of the string for all other logical purposes.
+
+ Functions returning a string result take a (resultbuf, lengthp) argument
+ pair. If resultbuf is not NULL and the result fits into *lengthp units,
+ it is put in resultbuf, and resultbuf is returned. Otherwise, a freshly
+ allocated string is returned. In both cases, *lengthp is set to the
+ length (number of units) of the returned string. In case of error,
+ NULL is returned and errno is set. */
+
+
+/* Elementary string checks. */
+
+/* Check whether an UTF-8 string is well-formed.
+ Return NULL if valid, or a pointer to the first invalid unit otherwise. */
+extern const uint8_t *
+ u8_check (const uint8_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+/* Check whether an UTF-16 string is well-formed.
+ Return NULL if valid, or a pointer to the first invalid unit otherwise. */
+extern const uint16_t *
+ u16_check (const uint16_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+/* Check whether an UCS-4 string is well-formed.
+ Return NULL if valid, or a pointer to the first invalid unit otherwise. */
+extern const uint32_t *
+ u32_check (const uint32_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+
+/* Elementary string conversions. */
+
+/* Convert an UTF-8 string to an UTF-16 string. */
+extern uint16_t *
+ u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf,
+ size_t *lengthp);
+
+/* Convert an UTF-8 string to an UCS-4 string. */
+extern uint32_t *
+ u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf,
+ size_t *lengthp);
+
+/* Convert an UTF-16 string to an UTF-8 string. */
+extern uint8_t *
+ u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf,
+ size_t *lengthp);
+
+/* Convert an UTF-16 string to an UCS-4 string. */
+extern uint32_t *
+ u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf,
+ size_t *lengthp);
+
+/* Convert an UCS-4 string to an UTF-8 string. */
+extern uint8_t *
+ u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf,
+ size_t *lengthp);
+
+/* Convert an UCS-4 string to an UTF-16 string. */
+extern uint16_t *
+ u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf,
+ size_t *lengthp);
+
+
+/* Elementary string functions. */
+
+/* Return the length (number of units) of the first character in S, which is
+ no longer than N. Return 0 if it is the NUL character. Return -1 upon
+ failure. */
+/* Similar to mblen(), except that s must not be NULL. */
+extern int
+ u8_mblen (const uint8_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_mblen (const uint16_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_mblen (const uint32_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+/* Return the length (number of units) of the first character in S, putting
+ its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd,
+ and an appropriate number of units is returned.
+ The number of available units, N, must be > 0. */
+/* Similar to mbtowc(), except that puc and s must not be NULL, n must be > 0,
+ and the NUL character is not treated specially. */
+/* The variants with _safe suffix are safe, even if the library is compiled
+ without --enable-safety. */
+
+#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
+# else
+extern int
+ u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n);
+static inline int
+u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+ uint8_t c = *s;
+
+ if (c < 0x80)
+ {
+ *puc = c;
+ return 1;
+ }
+ else
+ return u8_mbtouc_unsafe_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
+# else
+extern int
+ u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n);
+static inline int
+u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n)
+{
+ uint16_t c = *s;
+
+ if (c < 0xd800 || c >= 0xe000)
+ {
+ *puc = c;
+ return 1;
+ }
+ else
+ return u16_mbtouc_unsafe_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
+# else
+static inline int
+u32_mbtouc_unsafe (ucs4_t *puc,
+ const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
+{
+ uint32_t c = *s;
+
+# if CONFIG_UNICODE_SAFETY
+ if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
+# endif
+ *puc = c;
+# if CONFIG_UNICODE_SAFETY
+ else
+ /* invalid multibyte character */
+ *puc = 0xfffd;
+# endif
+ return 1;
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
+# else
+extern int
+ u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n);
+static inline int
+u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+ uint8_t c = *s;
+
+ if (c < 0x80)
+ {
+ *puc = c;
+ return 1;
+ }
+ else
+ return u8_mbtouc_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
+# else
+extern int
+ u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n);
+static inline int
+u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
+{
+ uint16_t c = *s;
+
+ if (c < 0xd800 || c >= 0xe000)
+ {
+ *puc = c;
+ return 1;
+ }
+ else
+ return u16_mbtouc_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
+# else
+static inline int
+u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
+{
+ uint32_t c = *s;
+
+ if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
+ *puc = c;
+ else
+ /* invalid multibyte character */
+ *puc = 0xfffd;
+ return 1;
+}
+# endif
+#endif
+
+/* Return the length (number of units) of the first character in S, putting
+ its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd,
+ and -1 is returned for an invalid sequence of units, -2 is returned for an
+ incomplete sequence of units.
+ The number of available units, N, must be > 0. */
+/* Similar to u*_mbtouc(), except that the return value gives more details
+ about the failure, similar to mbrtowc(). */
+
+#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING
+extern int
+ u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);
+#endif
+
+#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING
+extern int
+ u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n);
+#endif
+
+#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING
+extern int
+ u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n);
+#endif
+
+/* Put the multibyte character represented by UC in S, returning its
+ length. Return -1 upon failure, -2 if the number of available units, N,
+ is too small. The latter case cannot occur if N >= 6/2/1, respectively. */
+/* Similar to wctomb(), except that s must not be NULL, and the argument n
+ must be specified. */
+
+#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
+/* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */
+extern int
+ u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
+# if !HAVE_INLINE
+extern int
+ u8_uctomb (uint8_t *s, ucs4_t uc, int n);
+# else
+static inline int
+u8_uctomb (uint8_t *s, ucs4_t uc, int n)
+{
+ if (uc < 0x80 && n > 0)
+ {
+ s[0] = uc;
+ return 1;
+ }
+ else
+ return u8_uctomb_aux (s, uc, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
+/* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */
+extern int
+ u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
+# if !HAVE_INLINE
+extern int
+ u16_uctomb (uint16_t *s, ucs4_t uc, int n);
+# else
+static inline int
+u16_uctomb (uint16_t *s, ucs4_t uc, int n)
+{
+ if (uc < 0xd800 && n > 0)
+ {
+ s[0] = uc;
+ return 1;
+ }
+ else
+ return u16_uctomb_aux (s, uc, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+ u32_uctomb (uint32_t *s, ucs4_t uc, int n);
+# else
+static inline int
+u32_uctomb (uint32_t *s, ucs4_t uc, int n)
+{
+ if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000))
+ {
+ if (n > 0)
+ {
+ *s = uc;
+ return 1;
+ }
+ else
+ return -2;
+ }
+ else
+ return -1;
+}
+# endif
+#endif
+
+/* Copy N units from SRC to DEST. */
+/* Similar to memcpy(). */
+extern uint8_t *
+ u8_cpy (uint8_t *dest, const uint8_t *src, size_t n);
+extern uint16_t *
+ u16_cpy (uint16_t *dest, const uint16_t *src, size_t n);
+extern uint32_t *
+ u32_cpy (uint32_t *dest, const uint32_t *src, size_t n);
+
+/* Copy N units from SRC to DEST, guaranteeing correct behavior for
+ overlapping memory areas. */
+/* Similar to memmove(). */
+extern uint8_t *
+ u8_move (uint8_t *dest, const uint8_t *src, size_t n);
+extern uint16_t *
+ u16_move (uint16_t *dest, const uint16_t *src, size_t n);
+extern uint32_t *
+ u32_move (uint32_t *dest, const uint32_t *src, size_t n);
+
+/* Set the first N characters of S to UC. UC should be a character that
+ occupies only 1 unit. */
+/* Similar to memset(). */
+extern uint8_t *
+ u8_set (uint8_t *s, ucs4_t uc, size_t n);
+extern uint16_t *
+ u16_set (uint16_t *s, ucs4_t uc, size_t n);
+extern uint32_t *
+ u32_set (uint32_t *s, ucs4_t uc, size_t n);
+
+/* Compare S1 and S2, each of length N. */
+/* Similar to memcmp(). */
+extern int
+ u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+/* Compare S1 and S2. */
+/* Similar to the gnulib function memcmp2(). */
+extern int
+ u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2)
+ _UC_ATTRIBUTE_PURE;
+
+/* Search the string at S for UC. */
+/* Similar to memchr(). */
+extern uint8_t *
+ u8_chr (const uint8_t *s, size_t n, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+ u16_chr (const uint16_t *s, size_t n, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+ u32_chr (const uint32_t *s, size_t n, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+
+/* Count the number of Unicode characters in the N units from S. */
+/* Similar to mbsnlen(). */
+extern size_t
+ u8_mbsnlen (const uint8_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u16_mbsnlen (const uint16_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u32_mbsnlen (const uint32_t *s, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+/* Elementary string functions with memory allocation. */
+
+/* Make a freshly allocated copy of S, of length N. */
+extern uint8_t *
+ u8_cpy_alloc (const uint8_t *s, size_t n);
+extern uint16_t *
+ u16_cpy_alloc (const uint16_t *s, size_t n);
+extern uint32_t *
+ u32_cpy_alloc (const uint32_t *s, size_t n);
+
+/* Elementary string functions on NUL terminated strings. */
+
+/* Return the length (number of units) of the first character in S.
+ Return 0 if it is the NUL character. Return -1 upon failure. */
+extern int
+ u8_strmblen (const uint8_t *s)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_strmblen (const uint16_t *s)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_strmblen (const uint32_t *s)
+ _UC_ATTRIBUTE_PURE;
+
+/* Return the length (number of units) of the first character in S, putting
+ its 'ucs4_t' representation in *PUC. Return 0 if it is the NUL
+ character. Return -1 upon failure. */
+extern int
+ u8_strmbtouc (ucs4_t *puc, const uint8_t *s);
+extern int
+ u16_strmbtouc (ucs4_t *puc, const uint16_t *s);
+extern int
+ u32_strmbtouc (ucs4_t *puc, const uint32_t *s);
+
+/* Forward iteration step. Advances the pointer past the next character,
+ or returns NULL if the end of the string has been reached. Puts the
+ character's 'ucs4_t' representation in *PUC. */
+extern const uint8_t *
+ u8_next (ucs4_t *puc, const uint8_t *s);
+extern const uint16_t *
+ u16_next (ucs4_t *puc, const uint16_t *s);
+extern const uint32_t *
+ u32_next (ucs4_t *puc, const uint32_t *s);
+
+/* Backward iteration step. Advances the pointer to point to the previous
+ character, or returns NULL if the beginning of the string had been reached.
+ Puts the character's 'ucs4_t' representation in *PUC. */
+extern const uint8_t *
+ u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start);
+extern const uint16_t *
+ u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start);
+extern const uint32_t *
+ u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start);
+
+/* Return the number of units in S. */
+/* Similar to strlen(), wcslen(). */
+extern size_t
+ u8_strlen (const uint8_t *s)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u16_strlen (const uint16_t *s)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u32_strlen (const uint32_t *s)
+ _UC_ATTRIBUTE_PURE;
+
+/* Return the number of units in S, but at most MAXLEN. */
+/* Similar to strnlen(), wcsnlen(). */
+extern size_t
+ u8_strnlen (const uint8_t *s, size_t maxlen)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u16_strnlen (const uint16_t *s, size_t maxlen)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u32_strnlen (const uint32_t *s, size_t maxlen)
+ _UC_ATTRIBUTE_PURE;
+
+/* Copy SRC to DEST. */
+/* Similar to strcpy(), wcscpy(). */
+extern uint8_t *
+ u8_strcpy (uint8_t *dest, const uint8_t *src);
+extern uint16_t *
+ u16_strcpy (uint16_t *dest, const uint16_t *src);
+extern uint32_t *
+ u32_strcpy (uint32_t *dest, const uint32_t *src);
+
+/* Copy SRC to DEST, returning the address of the terminating NUL in DEST. */
+/* Similar to stpcpy(). */
+extern uint8_t *
+ u8_stpcpy (uint8_t *dest, const uint8_t *src);
+extern uint16_t *
+ u16_stpcpy (uint16_t *dest, const uint16_t *src);
+extern uint32_t *
+ u32_stpcpy (uint32_t *dest, const uint32_t *src);
+
+/* Copy no more than N units of SRC to DEST. */
+/* Similar to strncpy(), wcsncpy(). */
+extern uint8_t *
+ u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n);
+extern uint16_t *
+ u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n);
+extern uint32_t *
+ u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n);
+
+/* Copy no more than N units of SRC to DEST. Return a pointer past the last
+ non-NUL unit written into DEST. */
+/* Similar to stpncpy(). */
+extern uint8_t *
+ u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n);
+extern uint16_t *
+ u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n);
+extern uint32_t *
+ u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n);
+
+/* Append SRC onto DEST. */
+/* Similar to strcat(), wcscat(). */
+extern uint8_t *
+ u8_strcat (uint8_t *dest, const uint8_t *src);
+extern uint16_t *
+ u16_strcat (uint16_t *dest, const uint16_t *src);
+extern uint32_t *
+ u32_strcat (uint32_t *dest, const uint32_t *src);
+
+/* Append no more than N units of SRC onto DEST. */
+/* Similar to strncat(), wcsncat(). */
+extern uint8_t *
+ u8_strncat (uint8_t *dest, const uint8_t *src, size_t n);
+extern uint16_t *
+ u16_strncat (uint16_t *dest, const uint16_t *src, size_t n);
+extern uint32_t *
+ u32_strncat (uint32_t *dest, const uint32_t *src, size_t n);
+
+/* Compare S1 and S2. */
+/* Similar to strcmp(), wcscmp(). */
+#ifdef __sun
+/* Avoid a collision with the u8_strcmp() function in Solaris 11 libc. */
+extern int
+ u8_strcmp_gnu (const uint8_t *s1, const uint8_t *s2)
+ _UC_ATTRIBUTE_PURE;
+# define u8_strcmp u8_strcmp_gnu
+#else
+extern int
+ u8_strcmp (const uint8_t *s1, const uint8_t *s2)
+ _UC_ATTRIBUTE_PURE;
+#endif
+extern int
+ u16_strcmp (const uint16_t *s1, const uint16_t *s2)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_strcmp (const uint32_t *s1, const uint32_t *s2)
+ _UC_ATTRIBUTE_PURE;
+
+/* Compare S1 and S2 using the collation rules of the current locale.
+ Return -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2.
+ Upon failure, set errno and return any value. */
+/* Similar to strcoll(), wcscoll(). */
+extern int
+ u8_strcoll (const uint8_t *s1, const uint8_t *s2);
+extern int
+ u16_strcoll (const uint16_t *s1, const uint16_t *s2);
+extern int
+ u32_strcoll (const uint32_t *s1, const uint32_t *s2);
+
+/* Compare no more than N units of S1 and S2. */
+/* Similar to strncmp(), wcsncmp(). */
+extern int
+ u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n)
+ _UC_ATTRIBUTE_PURE;
+
+/* Duplicate S, returning an identical malloc'd string. */
+/* Similar to strdup(), wcsdup(). */
+extern uint8_t *
+ u8_strdup (const uint8_t *s);
+extern uint16_t *
+ u16_strdup (const uint16_t *s);
+extern uint32_t *
+ u32_strdup (const uint32_t *s);
+
+/* Find the first occurrence of UC in STR. */
+/* Similar to strchr(), wcschr(). */
+extern uint8_t *
+ u8_strchr (const uint8_t *str, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+ u16_strchr (const uint16_t *str, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+ u32_strchr (const uint32_t *str, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+
+/* Find the last occurrence of UC in STR. */
+/* Similar to strrchr(), wcsrchr(). */
+extern uint8_t *
+ u8_strrchr (const uint8_t *str, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+ u16_strrchr (const uint16_t *str, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+ u32_strrchr (const uint32_t *str, ucs4_t uc)
+ _UC_ATTRIBUTE_PURE;
+
+/* Return the length of the initial segment of STR which consists entirely
+ of Unicode characters not in REJECT. */
+/* Similar to strcspn(), wcscspn(). */
+extern size_t
+ u8_strcspn (const uint8_t *str, const uint8_t *reject)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u16_strcspn (const uint16_t *str, const uint16_t *reject)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u32_strcspn (const uint32_t *str, const uint32_t *reject)
+ _UC_ATTRIBUTE_PURE;
+
+/* Return the length of the initial segment of STR which consists entirely
+ of Unicode characters in ACCEPT. */
+/* Similar to strspn(), wcsspn(). */
+extern size_t
+ u8_strspn (const uint8_t *str, const uint8_t *accept)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u16_strspn (const uint16_t *str, const uint16_t *accept)
+ _UC_ATTRIBUTE_PURE;
+extern size_t
+ u32_strspn (const uint32_t *str, const uint32_t *accept)
+ _UC_ATTRIBUTE_PURE;
+
+/* Find the first occurrence in STR of any character in ACCEPT. */
+/* Similar to strpbrk(), wcspbrk(). */
+extern uint8_t *
+ u8_strpbrk (const uint8_t *str, const uint8_t *accept)
+ _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+ u16_strpbrk (const uint16_t *str, const uint16_t *accept)
+ _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+ u32_strpbrk (const uint32_t *str, const uint32_t *accept)
+ _UC_ATTRIBUTE_PURE;
+
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+/* Similar to strstr(), wcsstr(). */
+extern uint8_t *
+ u8_strstr (const uint8_t *haystack, const uint8_t *needle)
+ _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+ u16_strstr (const uint16_t *haystack, const uint16_t *needle)
+ _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+ u32_strstr (const uint32_t *haystack, const uint32_t *needle)
+ _UC_ATTRIBUTE_PURE;
+
+/* Test whether STR starts with PREFIX. */
+extern bool
+ u8_startswith (const uint8_t *str, const uint8_t *prefix)
+ _UC_ATTRIBUTE_PURE;
+extern bool
+ u16_startswith (const uint16_t *str, const uint16_t *prefix)
+ _UC_ATTRIBUTE_PURE;
+extern bool
+ u32_startswith (const uint32_t *str, const uint32_t *prefix)
+ _UC_ATTRIBUTE_PURE;
+
+/* Test whether STR ends with SUFFIX. */
+extern bool
+ u8_endswith (const uint8_t *str, const uint8_t *suffix)
+ _UC_ATTRIBUTE_PURE;
+extern bool
+ u16_endswith (const uint16_t *str, const uint16_t *suffix)
+ _UC_ATTRIBUTE_PURE;
+extern bool
+ u32_endswith (const uint32_t *str, const uint32_t *suffix)
+ _UC_ATTRIBUTE_PURE;
+
+/* Divide STR into tokens separated by characters in DELIM.
+ This interface is actually more similar to wcstok than to strtok. */
+/* Similar to strtok_r(), wcstok(). */
+extern uint8_t *
+ u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr);
+extern uint16_t *
+ u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr);
+extern uint32_t *
+ u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UNISTR_H */
diff --git a/lib/unistr/u8-mbtoucr.c b/lib/unistr/u8-mbtoucr.c
new file mode 100644
index 0000000..48f9ca3
--- /dev/null
+++ b/lib/unistr/u8-mbtoucr.c
@@ -0,0 +1,285 @@
+/* Look at first character in UTF-8 string, returning an error code.
+ Copyright (C) 1999-2002, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistr.h"
+
+int
+u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+ uint8_t c = *s;
+
+ if (c < 0x80)
+ {
+ *puc = c;
+ return 1;
+ }
+ else if (c >= 0xc2)
+ {
+ if (c < 0xe0)
+ {
+ if (n >= 2)
+ {
+ if ((s[1] ^ 0x80) < 0x40)
+ {
+ *puc = ((unsigned int) (c & 0x1f) << 6)
+ | (unsigned int) (s[1] ^ 0x80);
+ return 2;
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ else if (c < 0xf0)
+ {
+ if (n >= 2)
+ {
+ if ((s[1] ^ 0x80) < 0x40
+ && (c >= 0xe1 || s[1] >= 0xa0)
+ && (c != 0xed || s[1] < 0xa0))
+ {
+ if (n >= 3)
+ {
+ if ((s[2] ^ 0x80) < 0x40)
+ {
+ *puc = ((unsigned int) (c & 0x0f) << 12)
+ | ((unsigned int) (s[1] ^ 0x80) << 6)
+ | (unsigned int) (s[2] ^ 0x80);
+ return 3;
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ else if (c < 0xf8)
+ {
+ if (n >= 2)
+ {
+ if ((s[1] ^ 0x80) < 0x40
+ && (c >= 0xf1 || s[1] >= 0x90)
+#if 1
+ && (c < 0xf4 || (c == 0xf4 && s[1] < 0x90))
+#endif
+ )
+ {
+ if (n >= 3)
+ {
+ if ((s[2] ^ 0x80) < 0x40)
+ {
+ if (n >= 4)
+ {
+ if ((s[3] ^ 0x80) < 0x40)
+ {
+ *puc = ((unsigned int) (c & 0x07) << 18)
+ | ((unsigned int) (s[1] ^ 0x80) << 12)
+ | ((unsigned int) (s[2] ^ 0x80) << 6)
+ | (unsigned int) (s[3] ^ 0x80);
+ return 4;
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+#if 0
+ else if (c < 0xfc)
+ {
+ if (n >= 2)
+ {
+ if ((s[1] ^ 0x80) < 0x40
+ && (c >= 0xf9 || s[1] >= 0x88))
+ {
+ if (n >= 3)
+ {
+ if ((s[2] ^ 0x80) < 0x40)
+ {
+ if (n >= 4)
+ {
+ if ((s[3] ^ 0x80) < 0x40)
+ {
+ if (n >= 5)
+ {
+ if ((s[4] ^ 0x80) < 0x40)
+ {
+ *puc = ((unsigned int) (c & 0x03) << 24)
+ | ((unsigned int) (s[1] ^ 0x80) << 18)
+ | ((unsigned int) (s[2] ^ 0x80) << 12)
+ | ((unsigned int) (s[3] ^ 0x80) << 6)
+ | (unsigned int) (s[4] ^ 0x80);
+ return 5;
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ else if (c < 0xfe)
+ {
+ if (n >= 2)
+ {
+ if ((s[1] ^ 0x80) < 0x40
+ && (c >= 0xfd || s[1] >= 0x84))
+ {
+ if (n >= 3)
+ {
+ if ((s[2] ^ 0x80) < 0x40)
+ {
+ if (n >= 4)
+ {
+ if ((s[3] ^ 0x80) < 0x40)
+ {
+ if (n >= 5)
+ {
+ if ((s[4] ^ 0x80) < 0x40)
+ {
+ if (n >= 6)
+ {
+ if ((s[5] ^ 0x80) < 0x40)
+ {
+ *puc = ((unsigned int) (c & 0x01) << 30)
+ | ((unsigned int) (s[1] ^ 0x80) << 24)
+ | ((unsigned int) (s[2] ^ 0x80) << 18)
+ | ((unsigned int) (s[3] ^ 0x80) << 12)
+ | ((unsigned int) (s[4] ^ 0x80) << 6)
+ | (unsigned int) (s[5] ^ 0x80);
+ return 6;
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+ /* invalid multibyte character */
+ }
+ else
+ {
+ /* incomplete multibyte character */
+ *puc = 0xfffd;
+ return -2;
+ }
+ }
+#endif
+ }
+ /* invalid multibyte character */
+ *puc = 0xfffd;
+ return -1;
+}
diff --git a/lib/unistr/u8-uctomb-aux.c b/lib/unistr/u8-uctomb-aux.c
new file mode 100644
index 0000000..d5ff1d6
--- /dev/null
+++ b/lib/unistr/u8-uctomb-aux.c
@@ -0,0 +1,69 @@
+/* Conversion UCS-4 to UTF-8.
+ Copyright (C) 2002, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistr.h"
+
+int
+u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n)
+{
+ int count;
+
+ if (uc < 0x80)
+ /* The case n >= 1 is already handled by the caller. */
+ return -2;
+ else if (uc < 0x800)
+ count = 2;
+ else if (uc < 0x10000)
+ {
+ if (uc < 0xd800 || uc >= 0xe000)
+ count = 3;
+ else
+ return -1;
+ }
+#if 0
+ else if (uc < 0x200000)
+ count = 4;
+ else if (uc < 0x4000000)
+ count = 5;
+ else if (uc <= 0x7fffffff)
+ count = 6;
+#else
+ else if (uc < 0x110000)
+ count = 4;
+#endif
+ else
+ return -1;
+
+ if (n < count)
+ return -2;
+
+ switch (count) /* note: code falls through cases! */
+ {
+#if 0
+ case 6: s[5] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x4000000;
+ case 5: s[4] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x200000;
+#endif
+ case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000;
+ case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800;
+ case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0;
+ /*case 1:*/ s[0] = uc;
+ }
+ return count;
+}
diff --git a/lib/unistr/u8-uctomb.c b/lib/unistr/u8-uctomb.c
new file mode 100644
index 0000000..419a6b4
--- /dev/null
+++ b/lib/unistr/u8-uctomb.c
@@ -0,0 +1,88 @@
+/* Store a character in UTF-8 string.
+ Copyright (C) 2002, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#if defined IN_LIBUNISTRING
+/* Tell unistr.h to declare u8_uctomb as 'extern', not 'static inline'. */
+# include "unistring-notinline.h"
+#endif
+
+/* Specification. */
+#include "unistr.h"
+
+#if !HAVE_INLINE
+
+int
+u8_uctomb (uint8_t *s, ucs4_t uc, int n)
+{
+ if (uc < 0x80)
+ {
+ if (n > 0)
+ {
+ s[0] = uc;
+ return 1;
+ }
+ /* else return -2, below. */
+ }
+ else
+ {
+ int count;
+
+ if (uc < 0x800)
+ count = 2;
+ else if (uc < 0x10000)
+ {
+ if (uc < 0xd800 || uc >= 0xe000)
+ count = 3;
+ else
+ return -1;
+ }
+#if 0
+ else if (uc < 0x200000)
+ count = 4;
+ else if (uc < 0x4000000)
+ count = 5;
+ else if (uc <= 0x7fffffff)
+ count = 6;
+#else
+ else if (uc < 0x110000)
+ count = 4;
+#endif
+ else
+ return -1;
+
+ if (n >= count)
+ {
+ switch (count) /* note: code falls through cases! */
+ {
+#if 0
+ case 6: s[5] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x4000000;
+ case 5: s[4] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x200000;
+#endif
+ case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000;
+ case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800;
+ case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0;
+ /*case 1:*/ s[0] = uc;
+ }
+ return count;
+ }
+ }
+ return -2;
+}
+
+#endif
diff --git a/lib/unitypes.in.h b/lib/unitypes.in.h
new file mode 100644
index 0000000..c6ca0ba
--- /dev/null
+++ b/lib/unitypes.in.h
@@ -0,0 +1,46 @@
+/* Elementary types and macros for the GNU UniString library.
+ Copyright (C) 2002, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _UNITYPES_H
+#define _UNITYPES_H
+
+/* Get uint8_t, uint16_t, uint32_t. */
+#include <stdint.h>
+
+/* Type representing a Unicode character. */
+typedef uint32_t ucs4_t;
+
+/* Attribute of a function whose result depends only on the arguments
+ (not pointers!) and which has no side effects. */
+#ifndef _UC_ATTRIBUTE_CONST
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _UC_ATTRIBUTE_CONST __attribute__ ((__const__))
+# else
+# define _UC_ATTRIBUTE_CONST
+# endif
+#endif
+
+/* Attribute of a function whose result depends only on the arguments
+ (possibly pointers) and global memory, and which has no side effects. */
+#ifndef _UC_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _UC_ATTRIBUTE_PURE
+# endif
+#endif
+
+#endif /* _UNITYPES_H */
diff --git a/lib/uniwidth.in.h b/lib/uniwidth.in.h
new file mode 100644
index 0000000..0ab6d25
--- /dev/null
+++ b/lib/uniwidth.in.h
@@ -0,0 +1,72 @@
+/* Display width functions.
+ Copyright (C) 2001-2002, 2005, 2007, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _UNIWIDTH_H
+#define _UNIWIDTH_H
+
+#include "unitypes.h"
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get locale_charset() declaration. */
+#include "localcharset.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Display width. */
+
+/* These functions are locale dependent. The encoding argument identifies
+ the encoding (e.g. "ISO-8859-2" for Polish). */
+
+/* Determine number of column positions required for UC. */
+extern int
+ uc_width (ucs4_t uc, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+
+/* Determine number of column positions required for first N units
+ (or fewer if S ends before this) in S. */
+extern int
+ u8_width (const uint8_t *s, size_t n, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_width (const uint16_t *s, size_t n, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_width (const uint32_t *s, size_t n, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+
+/* Determine number of column positions required for S. */
+extern int
+ u8_strwidth (const uint8_t *s, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u16_strwidth (const uint16_t *s, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+extern int
+ u32_strwidth (const uint32_t *s, const char *encoding)
+ _UC_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UNIWIDTH_H */
diff --git a/lib/uniwidth/cjk.h b/lib/uniwidth/cjk.h
new file mode 100644
index 0000000..0eac6fe
--- /dev/null
+++ b/lib/uniwidth/cjk.h
@@ -0,0 +1,37 @@
+/* Test for CJK encoding.
+ Copyright (C) 2001-2002, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "streq.h"
+
+static int
+is_cjk_encoding (const char *encoding)
+{
+ if (0
+ /* Legacy Japanese encodings */
+ || STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)
+ /* Legacy Chinese encodings */
+ || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+ || STREQ_OPT (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0)
+ || STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)
+ || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)
+ /* Legacy Korean encodings */
+ || STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+ || STREQ_OPT (encoding, "CP949", 'C', 'P', '9', '4', '9', 0, 0, 0, 0)
+ || STREQ_OPT (encoding, "JOHAB", 'J', 'O', 'H', 'A', 'B', 0, 0, 0, 0))
+ return 1;
+ return 0;
+}
diff --git a/lib/uniwidth/width.c b/lib/uniwidth/width.c
new file mode 100644
index 0000000..bd3b3fc
--- /dev/null
+++ b/lib/uniwidth/width.c
@@ -0,0 +1,450 @@
+/* Determine display width of Unicode character.
+ Copyright (C) 2001-2002, 2006-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "uniwidth.h"
+
+#include "cjk.h"
+
+/*
+ * Non-spacing attribute table.
+ * Consists of:
+ * - Non-spacing characters; generated from PropList.txt or
+ * "grep '^[^;]*;[^;]*;[^;]*;[^;]*;NSM;' UnicodeData.txt"
+ * - Format control characters; generated from
+ * "grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt"
+ * - Zero width characters; generated from
+ * "grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt"
+ */
+static const unsigned char nonspacing_table_data[36*64] = {
+ /* 0x0000-0x01ff */
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0000-0x003f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x0040-0x007f */
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x00, 0x00, /* 0x0080-0x00bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00c0-0x00ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0100-0x013f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0140-0x017f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0180-0x01bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x01c0-0x01ff */
+ /* 0x0200-0x03ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0200-0x023f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0240-0x027f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0280-0x02bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x02c0-0x02ff */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x0300-0x033f */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, /* 0x0340-0x037f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0380-0x03bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x03c0-0x03ff */
+ /* 0x0400-0x05ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0400-0x043f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0440-0x047f */
+ 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0480-0x04bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04c0-0x04ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0500-0x053f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0540-0x057f */
+ 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */
+ 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */
+ /* 0x0600-0x07ff */
+ 0x3f, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
+ 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */
+ 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
+ 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
+ 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x07c0-0x07ff */
+ /* 0x0800-0x09ff */
+ 0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */
+ 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */
+ 0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */
+ 0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x09c0-0x09ff */
+ /* 0x0a00-0x0bff */
+ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a00-0x0a3f */
+ 0x86, 0x39, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, /* 0x0a40-0x0a7f */
+ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a80-0x0abf */
+ 0xbe, 0x21, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0ac0-0x0aff */
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, /* 0x0b00-0x0b3f */
+ 0x1e, 0x20, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0b40-0x0b7f */
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0b80-0x0bbf */
+ 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0bc0-0x0bff */
+ /* 0x0c00-0x0dff */
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, /* 0x0c00-0x0c3f */
+ 0xc1, 0x3d, 0x60, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0c40-0x0c7f */
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0c80-0x0cbf */
+ 0x00, 0x30, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0cc0-0x0cff */
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d00-0x0d3f */
+ 0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0d40-0x0d7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d80-0x0dbf */
+ 0x00, 0x04, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0dc0-0x0dff */
+ /* 0x0e00-0x0fff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x07, /* 0x0e00-0x0e3f */
+ 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0e40-0x0e7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x1b, /* 0x0e80-0x0ebf */
+ 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0ec0-0x0eff */
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xa0, 0x02, /* 0x0f00-0x0f3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, /* 0x0f40-0x0f7f */
+ 0xdf, 0xe0, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x1f, /* 0x0f80-0x0fbf */
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0fc0-0x0fff */
+ /* 0x1000-0x11ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfd, 0x66, /* 0x1000-0x103f */
+ 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x1e, 0x00, /* 0x1040-0x107f */
+ 0x64, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x1080-0x10bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10c0-0x10ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1100-0x113f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1140-0x117f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1180-0x11bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11c0-0x11ff */
+ /* 0x1200-0x13ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1200-0x123f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1240-0x127f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1280-0x12bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x12c0-0x12ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1300-0x133f */
+ 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, /* 0x1340-0x137f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1380-0x13bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x13c0-0x13ff */
+ /* 0x1600-0x17ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1600-0x163f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1640-0x167f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1680-0x16bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16c0-0x16ff */
+ 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, /* 0x1700-0x173f */
+ 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, /* 0x1740-0x177f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x3f, /* 0x1780-0x17bf */
+ 0x40, 0xfe, 0x0f, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x17c0-0x17ff */
+ /* 0x1800-0x19ff */
+ 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1800-0x183f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1840-0x187f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* 0x1880-0x18bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18c0-0x18ff */
+ 0x00, 0x00, 0x00, 0x00, 0x87, 0x01, 0x04, 0x0e, /* 0x1900-0x193f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1940-0x197f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1980-0x19bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x19c0-0x19ff */
+ /* 0x1a00-0x1bff */
+ 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, 0x00, 0x00, /* 0x1a00-0x1a3f */
+ 0x00, 0x00, 0x40, 0x7f, 0xe5, 0x1f, 0xf8, 0x9f, /* 0x1a40-0x1a7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, /* 0x1a80-0x1abf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1ac0-0x1aff */
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x17, /* 0x1b00-0x1b3f */
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x1b40-0x1b7f */
+ 0x03, 0x00, 0x00, 0x00, 0x3c, 0x3b, 0x00, 0x00, /* 0x1b80-0x1bbf */
+ 0x00, 0x00, 0x00, 0x00, 0x40, 0xa3, 0x03, 0x00, /* 0x1bc0-0x1bff */
+ /* 0x1c00-0x1dff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0x00, /* 0x1c00-0x1c3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c40-0x1c7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c80-0x1cbf */
+ 0x00, 0x00, 0xf7, 0xff, 0xfd, 0x21, 0x10, 0x03, /* 0x1cc0-0x1cff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d00-0x1d3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d40-0x1d7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d80-0x1dbf */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf0, /* 0x1dc0-0x1dff */
+ /* 0x2000-0x21ff */
+ 0x00, 0xf8, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, /* 0x2000-0x203f */
+ 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0x00, 0x00, /* 0x2040-0x207f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2080-0x20bf */
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, /* 0x20c0-0x20ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2100-0x213f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2140-0x217f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2180-0x21bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x21c0-0x21ff */
+ /* 0x2c00-0x2dff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c00-0x2c3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c40-0x2c7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c80-0x2cbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, /* 0x2cc0-0x2cff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d00-0x2d3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x2d40-0x2d7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d80-0x2dbf */
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, /* 0x2dc0-0x2dff */
+ /* 0x3000-0x31ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x3000-0x303f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3040-0x307f */
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, /* 0x3080-0x30bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30c0-0x30ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3100-0x313f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3140-0x317f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3180-0x31bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x31c0-0x31ff */
+ /* 0xa600-0xa7ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa600-0xa63f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x3f, /* 0xa640-0xa67f */
+ 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, /* 0xa680-0xa6bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, /* 0xa6c0-0xa6ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa700-0xa73f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa740-0xa77f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa780-0xa7bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa7c0-0xa7ff */
+ /* 0xa800-0xa9ff */
+ 0x44, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0xa800-0xa83f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa840-0xa87f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa880-0xa8bf */
+ 0x10, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, /* 0xa8c0-0xa8ff */
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, /* 0xa900-0xa93f */
+ 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa940-0xa97f */
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x13, /* 0xa980-0xa9bf */
+ 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, /* 0xa9c0-0xa9ff */
+ /* 0xaa00-0xabff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x00, /* 0xaa00-0xaa3f */
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0xaa40-0xaa7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0xc1, /* 0xaa80-0xaabf */
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40, 0x00, /* 0xaac0-0xaaff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab00-0xab3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab40-0xab7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab80-0xabbf */
+ 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x00, 0x00, /* 0xabc0-0xabff */
+ /* 0xfa00-0xfbff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa00-0xfa3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa40-0xfa7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa80-0xfabf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfac0-0xfaff */
+ 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, /* 0xfb00-0xfb3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb40-0xfb7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb80-0xfbbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfbc0-0xfbff */
+ /* 0xfe00-0xffff */
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, /* 0xfe00-0xfe3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe40-0xfe7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe80-0xfebf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xfec0-0xfeff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff00-0xff3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff40-0xff7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff80-0xffbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, /* 0xffc0-0xffff */
+ /* 0x10000-0x101ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10000-0x1003f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10040-0x1007f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10080-0x100bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x100c0-0x100ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10100-0x1013f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10140-0x1017f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10180-0x101bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, /* 0x101c0-0x101ff */
+ /* 0x10200-0x103ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10200-0x1023f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10240-0x1027f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10280-0x102bf */
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* 0x102c0-0x102ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10300-0x1033f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, /* 0x10340-0x1037f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10380-0x103bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x103c0-0x103ff */
+ /* 0x10a00-0x10bff */
+ 0x6e, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0x10a00-0x10a3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a40-0x10a7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a80-0x10abf */
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0x10ac0-0x10aff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b00-0x10b3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b40-0x10b7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b80-0x10bbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10bc0-0x10bff */
+ /* 0x11000-0x111ff */
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11000-0x1103f */
+ 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x11040-0x1107f */
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x26, /* 0x11080-0x110bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
+ 0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */
+ 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x111c0-0x111ff */
+ /* 0x11200-0x113ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd3, 0x00, /* 0x11200-0x1123f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11240-0x1127f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11280-0x112bf */
+ 0x00, 0x00, 0x00, 0x80, 0xf8, 0x07, 0x00, 0x00, /* 0x112c0-0x112ff */
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x11300-0x1133f */
+ 0x01, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x1f, 0x00, /* 0x11340-0x1137f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11380-0x113bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x113c0-0x113ff */
+ /* 0x11400-0x115ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11400-0x1143f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11440-0x1147f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x85, /* 0x11480-0x114bf */
+ 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x114c0-0x114ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11500-0x1153f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11540-0x1157f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xb0, /* 0x11580-0x115bf */
+ 0x01, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, /* 0x115c0-0x115ff */
+ /* 0x11600-0x117ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xa7, /* 0x11600-0x1163f */
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11640-0x1167f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbf, 0x00, /* 0x11680-0x116bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x116c0-0x116ff */
+ 0x00, 0x00, 0x00, 0xe0, 0xbc, 0x0f, 0x00, 0x00, /* 0x11700-0x1173f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11740-0x1177f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11780-0x117bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x117c0-0x117ff */
+ /* 0x16a00-0x16bff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a00-0x16a3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a40-0x16a7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a80-0x16abf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, /* 0x16ac0-0x16aff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, /* 0x16b00-0x16b3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16b40-0x16b7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16b80-0x16bbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16bc0-0x16bff */
+ /* 0x16e00-0x16fff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e00-0x16e3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e40-0x16e7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e80-0x16ebf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16ec0-0x16eff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f00-0x16f3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f40-0x16f7f */
+ 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f80-0x16fbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16fc0-0x16fff */
+ /* 0x1bc00-0x1bdff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc00-0x1bc3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc40-0x1bc7f */
+ 0x00, 0x00, 0x00, 0x60, 0x0f, 0x00, 0x00, 0x00, /* 0x1bc80-0x1bcbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bcc0-0x1bcff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd00-0x1bd3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd40-0x1bd7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd80-0x1bdbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bdc0-0x1bdff */
+ /* 0x1d000-0x1d1ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d000-0x1d03f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d040-0x1d07f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d080-0x1d0bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d0c0-0x1d0ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d100-0x1d13f */
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xf8, 0xff, /* 0x1d140-0x1d17f */
+ 0xe7, 0x0f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x1d180-0x1d1bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d1c0-0x1d1ff */
+ /* 0x1d200-0x1d3ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d200-0x1d23f */
+ 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d240-0x1d27f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d280-0x1d2bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d2c0-0x1d2ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d300-0x1d33f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d340-0x1d37f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d380-0x1d3bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d3c0-0x1d3ff */
+ /* 0x1da00-0x1dbff */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, /* 0x1da00-0x1da3f */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x20, 0x00, /* 0x1da40-0x1da7f */
+ 0x10, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x00, 0x00, /* 0x1da80-0x1dabf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dac0-0x1daff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db00-0x1db3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db40-0x1db7f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db80-0x1dbbf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dbc0-0x1dbff */
+ /* 0x1e800-0x1e9ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e800-0x1e83f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e840-0x1e87f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e880-0x1e8bf */
+ 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e8c0-0x1e8ff */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e900-0x1e93f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e940-0x1e97f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e980-0x1e9bf */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0x1e9c0-0x1e9ff */
+};
+static const signed char nonspacing_table_ind[248] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, /* 0x0000-0x0fff */
+ 8, 9, -1, 10, 11, 12, 13, -1, /* 0x1000-0x1fff */
+ 14, -1, -1, -1, -1, -1, 15, -1, /* 0x2000-0x2fff */
+ 16, -1, -1, -1, -1, -1, -1, -1, /* 0x3000-0x3fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x4000-0x4fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x5000-0x5fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x6000-0x6fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x7000-0x7fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x8000-0x8fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x9000-0x9fff */
+ -1, -1, -1, 17, 18, 19, -1, -1, /* 0xa000-0xafff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb000-0xbfff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc000-0xcfff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd000-0xdfff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe000-0xefff */
+ -1, -1, -1, -1, -1, 20, -1, 21, /* 0xf000-0xffff */
+ 22, 23, -1, -1, -1, 24, -1, -1, /* 0x10000-0x10fff */
+ 25, 26, 27, 28, -1, -1, -1, -1, /* 0x11000-0x11fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x12000-0x12fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x13000-0x13fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x14000-0x14fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x15000-0x15fff */
+ -1, -1, -1, -1, -1, 29, -1, 30, /* 0x16000-0x16fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x17000-0x17fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x18000-0x18fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x19000-0x19fff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1a000-0x1afff */
+ -1, -1, -1, -1, -1, -1, 31, -1, /* 0x1b000-0x1bfff */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1c000-0x1cfff */
+ 32, 33, -1, -1, -1, 34, -1, -1, /* 0x1d000-0x1dfff */
+ -1, -1, -1, -1, 35, -1, -1, -1 /* 0x1e000-0x1efff */
+};
+
+/* Determine number of column positions required for UC. */
+int
+uc_width (ucs4_t uc, const char *encoding)
+{
+ /* Test for non-spacing or control character. */
+ if ((uc >> 9) < 248)
+ {
+ int ind = nonspacing_table_ind[uc >> 9];
+ if (ind >= 0)
+ if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1)
+ {
+ if (uc > 0 && uc < 0xa0)
+ return -1;
+ else
+ return 0;
+ }
+ }
+ else if ((uc >> 9) == (0xe0000 >> 9))
+ {
+ if (uc >= 0xe0100)
+ {
+ if (uc <= 0xe01ef)
+ return 0;
+ }
+ else
+ {
+ if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001)
+ return 0;
+ }
+ }
+ /* Test for double-width character.
+ * Generated from "grep '^[^;]\{4,5\};[WF]' EastAsianWidth.txt"
+ * and "grep '^[^;]\{4,5\};[^WF]' EastAsianWidth.txt"
+ */
+ if (uc >= 0x1100
+ && ((uc < 0x1160) /* Hangul Jamo */
+ || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */
+ || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */
+ && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00))
+ || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */
+ || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */
+ || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */
+ || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */
+ || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */
+ || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */
+ || (uc >= 0x20000 && uc <= 0x2ffff) /* Supplementary Ideographic Plane */
+ || (uc >= 0x30000 && uc <= 0x3ffff) /* Tertiary Ideographic Plane */
+ ) )
+ return 2;
+ /* In ancient CJK encodings, Cyrillic and most other characters are
+ double-width as well. */
+ if (uc >= 0x00A1 && uc < 0xFF61 && uc != 0x20A9
+ && is_cjk_encoding (encoding))
+ return 2;
+ return 1;
+}
diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h
new file mode 100644
index 0000000..c0ece50
--- /dev/null
+++ b/lib/unlocked-io.h
@@ -0,0 +1,136 @@
+/* Prefer faster, non-thread-safe stdio functions if available.
+
+ Copyright (C) 2001-2004, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#ifndef UNLOCKED_IO_H
+# define UNLOCKED_IO_H 1
+
+/* These are wrappers for functions/macros from the GNU C library, and
+ from other C libraries supporting POSIX's optional thread-safe functions.
+
+ The standard I/O functions are thread-safe. These *_unlocked ones are
+ more efficient but not thread-safe. That they're not thread-safe is
+ fine since all of the applications in this package are single threaded.
+
+ Also, some code that is shared with the GNU C library may invoke
+ the *_unlocked functions directly. On hosts that lack those
+ functions, invoke the non-thread-safe versions instead. */
+
+# include <stdio.h>
+
+# if HAVE_DECL_CLEARERR_UNLOCKED
+# undef clearerr
+# define clearerr(x) clearerr_unlocked (x)
+# else
+# define clearerr_unlocked(x) clearerr (x)
+# endif
+
+# if HAVE_DECL_FEOF_UNLOCKED
+# undef feof
+# define feof(x) feof_unlocked (x)
+# else
+# define feof_unlocked(x) feof (x)
+# endif
+
+# if HAVE_DECL_FERROR_UNLOCKED
+# undef ferror
+# define ferror(x) ferror_unlocked (x)
+# else
+# define ferror_unlocked(x) ferror (x)
+# endif
+
+# if HAVE_DECL_FFLUSH_UNLOCKED
+# undef fflush
+# define fflush(x) fflush_unlocked (x)
+# else
+# define fflush_unlocked(x) fflush (x)
+# endif
+
+# if HAVE_DECL_FGETS_UNLOCKED
+# undef fgets
+# define fgets(x,y,z) fgets_unlocked (x,y,z)
+# else
+# define fgets_unlocked(x,y,z) fgets (x,y,z)
+# endif
+
+# if HAVE_DECL_FPUTC_UNLOCKED
+# undef fputc
+# define fputc(x,y) fputc_unlocked (x,y)
+# else
+# define fputc_unlocked(x,y) fputc (x,y)
+# endif
+
+# if HAVE_DECL_FPUTS_UNLOCKED
+# undef fputs
+# define fputs(x,y) fputs_unlocked (x,y)
+# else
+# define fputs_unlocked(x,y) fputs (x,y)
+# endif
+
+# if HAVE_DECL_FREAD_UNLOCKED
+# undef fread
+# define fread(w,x,y,z) fread_unlocked (w,x,y,z)
+# else
+# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
+# endif
+
+# if HAVE_DECL_FWRITE_UNLOCKED
+# undef fwrite
+# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
+# else
+# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
+# endif
+
+# if HAVE_DECL_GETC_UNLOCKED
+# undef getc
+# define getc(x) getc_unlocked (x)
+# else
+# define getc_unlocked(x) getc (x)
+# endif
+
+# if HAVE_DECL_GETCHAR_UNLOCKED
+# undef getchar
+# define getchar() getchar_unlocked ()
+# else
+# define getchar_unlocked() getchar ()
+# endif
+
+# if HAVE_DECL_PUTC_UNLOCKED
+# undef putc
+# define putc(x,y) putc_unlocked (x,y)
+# else
+# define putc_unlocked(x,y) putc (x,y)
+# endif
+
+# if HAVE_DECL_PUTCHAR_UNLOCKED
+# undef putchar
+# define putchar(x) putchar_unlocked (x)
+# else
+# define putchar_unlocked(x) putchar (x)
+# endif
+
+# undef flockfile
+# define flockfile(x) ((void) 0)
+
+# undef ftrylockfile
+# define ftrylockfile(x) 0
+
+# undef funlockfile
+# define funlockfile(x) ((void) 0)
+
+#endif /* UNLOCKED_IO_H */
diff --git a/lib/unsetenv.c b/lib/unsetenv.c
new file mode 100644
index 0000000..8368744
--- /dev/null
+++ b/lib/unsetenv.c
@@ -0,0 +1,127 @@
+/* Copyright (C) 1992, 1995-2002, 2005-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#if !_LIBC
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#if !_LIBC
+# define __environ environ
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define unsetenv __unsetenv
+#endif
+
+#if _LIBC || !HAVE_UNSETENV
+
+int
+unsetenv (const char *name)
+{
+ size_t len;
+ char **ep;
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ len = strlen (name);
+
+ LOCK;
+
+ ep = __environ;
+ while (*ep != NULL)
+ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+ {
+ /* Found it. Remove this pointer by moving later ones back. */
+ char **dp = ep;
+
+ do
+ dp[0] = dp[1];
+ while (*dp++);
+ /* Continue the loop in case NAME appears again. */
+ }
+ else
+ ++ep;
+
+ UNLOCK;
+
+ return 0;
+}
+
+#ifdef _LIBC
+# undef unsetenv
+weak_alias (__unsetenv, unsetenv)
+#endif
+
+#else /* HAVE_UNSETENV */
+
+# undef unsetenv
+# if !HAVE_DECL_UNSETENV
+# if VOID_UNSETENV
+extern void unsetenv (const char *);
+# else
+extern int unsetenv (const char *);
+# endif
+# endif
+
+/* Call the underlying unsetenv, in case there is hidden bookkeeping
+ that needs updating beyond just modifying environ. */
+int
+rpl_unsetenv (const char *name)
+{
+ int result = 0;
+ if (!name || !*name || strchr (name, '='))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ while (getenv (name))
+# if !VOID_UNSETENV
+ result =
+# endif
+ unsetenv (name);
+ return result;
+}
+
+#endif /* HAVE_UNSETENV */
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
new file mode 100644
index 0000000..de8965f
--- /dev/null
+++ b/lib/vasnprintf.c
@@ -0,0 +1,5598 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* 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. */
+
+/* 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
+#ifndef IN_LIBINTL
+# include <alloca.h>
+#endif
+
+/* 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 "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
+# 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
+# define SNPRINTF _snprintf
+# 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) && !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) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (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) && 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 (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)
+ 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:
+ if (tmp_roomptr != NULL)
+ 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);
+ char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes));
+ 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 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 HAVE_LONG_LONG_INT
+ 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
+# endif
+ 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 HAVE_LONG_LONG_INT
+ 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
+# endif
+ 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 HAVE_LONG_LONG_INT
+ 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
+# endif
+ 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;
+ 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;
+
+#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)
+ {
+ CLEANUP ();
+ errno = EINVAL;
+ return NULL;
+ }
+
+ {
+ 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;
+ }
+
+ if (resultbuf != NULL)
+ {
+ result = resultbuf;
+ allocated = *lengthp;
+ }
+ else
+ {
+ result = NULL;
+ allocated = 0;
+ }
+ length = 0;
+ /* Invariants:
+ result is either == resultbuf or == NULL or malloc-allocated.
+ 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(needed) \
+ 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)) \
+ goto out_of_memory; \
+ if (result == resultbuf || result == NULL) \
+ memory = (DCHAR_T *) malloc (memory_size); \
+ else \
+ memory = (DCHAR_T *) realloc (result, memory_size); \
+ if (memory == NULL) \
+ goto out_of_memory; \
+ if (result == resultbuf && length > 0) \
+ DCHAR_CPY (memory, result, length); \
+ result = 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;
+#if HAVE_LONG_LONG_INT
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+ break;
+#endif
+ 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)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION (xsum (length, converted_len));
+ 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)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION (xsum (length, converted_len));
+ 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)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION (xsum (length, converted_len));
+ 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 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && 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. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg_end, &state);
+# else
+ count = wctomb (cbuf, *arg_end);
+# endif
+ if (count < 0)
+ {
+ /* Cannot convert. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ if (precision < 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;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg_end, &state);
+# else
+ count = wctomb (cbuf, *arg_end);
+# endif
+ if (count < 0)
+ {
+ /* Cannot convert. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ 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 ();
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg, &state);
+# else
+ count = wctomb (cbuf, *arg);
+# endif
+ 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)
+ {
+ int saved_errno = errno;
+ free (tmpsrc);
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ 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 ();
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg, &state);
+# else
+ count = wctomb (cbuf, *arg);
+# endif
+ 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 ();
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg, &state);
+# else
+ count = wctomb (cbuf, *arg);
+# endif
+ if (count <= 0)
+ {
+ /* Cannot convert. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ }
+ }
+# else
+ ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+ 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 (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 __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 __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 __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 __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 __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 || !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 || 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 || !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 || 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)
+ {
+#if HAVE_LONG_LONG_INT
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ *fbp++ = 'I';
+ *fbp++ = '6';
+ *fbp++ = '4';
+ break;
+# else
+ *fbp++ = 'l';
+ /*FALLTHROUGH*/
+# endif
+#endif
+ 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 !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+# else
+ /* On glibc2 systems from glibc >= 2.3 - probably also older
+ ones - we know that snprintf's return value conforms to
+ ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
+ gl_SNPRINTF_TRUNCATION_C99 pass.
+ Therefore we can avoid using %n in this situation.
+ 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), so we should avoid it
+ in this situation. */
+ /* 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
+ <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+ <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
+ So we should avoid %n in this situation. */
+ fbp[1] = '\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;
+#if HAVE_LONG_LONG_INT
+ 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;
+#endif
+ 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 (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
+ /* 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. Save and use the errno
+ that it has set, if any. */
+ int saved_errno = errno;
+ if (saved_errno == 0)
+ {
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ saved_errno = EILSEQ;
+ else
+ saved_errno = EINVAL;
+ }
+
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+
+ errno = saved_errno;
+ return NULL;
+ }
+
+#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)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+ 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:
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EOVERFLOW;
+ return NULL;
+#endif
+
+ out_of_memory:
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ out_of_memory_1:
+ CLEANUP ();
+ errno = ENOMEM;
+ 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/lib/vasnprintf.h b/lib/vasnprintf.h
new file mode 100644
index 0000000..8e9d84f
--- /dev/null
+++ b/lib/vasnprintf.h
@@ -0,0 +1,79 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _VASNPRINTF_H
+#define _VASNPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The __-protected variants of the attributes 'format' and 'printf' are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+#endif
+
+#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 *resultbuf, size_t *lengthp, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
+extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VASNPRINTF_H */
diff --git a/lib/vasprintf.c b/lib/vasprintf.c
new file mode 100644
index 0000000..a5dc1be
--- /dev/null
+++ b/lib/vasprintf.c
@@ -0,0 +1,50 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#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/lib/verify.h b/lib/verify.h
new file mode 100644
index 0000000..5c8381d
--- /dev/null
+++ b/lib/verify.h
@@ -0,0 +1,279 @@
+/* Compile-time assert-like macros.
+
+ Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by 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 works as per C11.
+ This is supported by GCC 4.6.0 and later, in C mode, and its use
+ here generates easier-to-read diagnostics when verify (R) fails.
+
+ Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
+ This will likely be supported by future GCC versions, in C++ mode.
+
+ Use this only with GCC. 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? */
+#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+ && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
+ && !defined __cplusplus)
+# define _GL_HAVE__STATIC_ASSERT 1
+#endif
+/* The condition (99 < __GNUC__) is temporary, until we know about the
+ first G++ release that supports static_assert. */
+#if (99 < __GNUC__) && defined __cplusplus
+# define _GL_HAVE_STATIC_ASSERT 1
+#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, preferably
+ with a diagnostic that includes the string-literal DIAGNOSTIC.
+
+ Unfortunately, unlike C11, this implementation must appear as an
+ ordinary declaration, and cannot appear inside struct { ... }. */
+
+#ifdef _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY _Static_assert
+#else
+# define _GL_VERIFY(R, DIAGNOSTIC) \
+ extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
+ [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
+#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_ASSERT && !defined _Static_assert
+# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
+# endif
+# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
+# define static_assert _Static_assert /* C11 requires this #define. */
+# endif
+#endif
+
+/* @assert.h omit start@ */
+
+/* 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_true (R) 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, as an integer constant expression.
+ Return 1. This is equivalent to verify_expr (R, 1).
+
+ verify_true is obsolescent; please use verify_expr instead. */
+
+#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
+
+/* 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 ';'. */
+
+#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+
+/* Assume that R always holds. This lets the compiler optimize
+ accordingly. R should not have side-effects; it may or may not be
+ evaluated. Behavior is undefined if R is false. */
+
+#if (__has_builtin (__builtin_unreachable) \
+ || 4 < __GNUC__ + (5 <= __GNUC_MINOR__))
+# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
+#elif 1200 <= _MSC_VER
+# define assume(R) __assume (R)
+#elif ((defined GCC_LINT || defined lint) \
+ && (__has_builtin (__builtin_trap) \
+ || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
+ /* 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
+# define assume(R) ((void) (0 && (R)))
+#endif
+
+/* @assert.h omit end@ */
+
+#endif
diff --git a/lib/version-etc-fsf.c b/lib/version-etc-fsf.c
new file mode 100644
index 0000000..baaebb6
--- /dev/null
+++ b/lib/version-etc-fsf.c
@@ -0,0 +1,30 @@
+/* Variable with FSF copyright information, for version-etc.
+ Copyright (C) 1999-2006, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+/* Specification. */
+#include "version-etc.h"
+
+/* Default copyright goes to the FSF. */
+
+const char version_etc_copyright[] =
+ /* Do *not* mark this string for translation. %s is a copyright
+ symbol suitable for this locale, and %d is the copyright
+ year. */
+ "Copyright %s %d Free Software Foundation, Inc.";
diff --git a/lib/version-etc.c b/lib/version-etc.c
new file mode 100644
index 0000000..a9a0fdb
--- /dev/null
+++ b/lib/version-etc.c
@@ -0,0 +1,258 @@
+/* Print --version and bug-reporting information in a consistent format.
+ Copyright (C) 1999-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+/* Specification. */
+#include "version-etc.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+/* If you use AM_INIT_AUTOMAKE's no-define option,
+ PACKAGE is not defined. Use PACKAGE_TARNAME instead. */
+#if ! defined PACKAGE && defined PACKAGE_TARNAME
+# define PACKAGE PACKAGE_TARNAME
+#endif
+
+enum { COPYRIGHT_YEAR = 2016 };
+
+/* The three functions below display the --version information the
+ standard way.
+
+ If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
+ the program. The formats are therefore:
+
+ PACKAGE VERSION
+
+ or
+
+ COMMAND_NAME (PACKAGE) VERSION.
+
+ The functions differ in the way they are passed author names. */
+
+/* Display the --version information the standard way.
+
+ Author names are given in the array AUTHORS. N_AUTHORS is the
+ number of elements in the array. */
+void
+version_etc_arn (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version,
+ const char * const * authors, size_t n_authors)
+{
+ if (command_name)
+ fprintf (stream, "%s (%s) %s\n", command_name, package, version);
+ else
+ fprintf (stream, "%s %s\n", package, version);
+
+#ifdef PACKAGE_PACKAGER
+# ifdef PACKAGE_PACKAGER_VERSION
+ fprintf (stream, _("Packaged by %s (%s)\n"), PACKAGE_PACKAGER,
+ PACKAGE_PACKAGER_VERSION);
+# else
+ fprintf (stream, _("Packaged by %s\n"), PACKAGE_PACKAGER);
+# endif
+#endif
+
+ /* TRANSLATORS: Translate "(C)" to the copyright symbol
+ (C-in-a-circle), if this symbol is available in the user's
+ locale. Otherwise, do not translate "(C)"; leave it as-is. */
+ fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
+
+ fputs (_("\
+\n\
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
+This is free software: you are free to change and redistribute it.\n\
+There is NO WARRANTY, to the extent permitted by law.\n\
+\n\
+"),
+ stream);
+
+ switch (n_authors)
+ {
+ case 0:
+ /* The caller must provide at least one author name. */
+ abort ();
+ case 1:
+ /* TRANSLATORS: %s denotes an author name. */
+ fprintf (stream, _("Written by %s.\n"), authors[0]);
+ break;
+ case 2:
+ /* TRANSLATORS: Each %s denotes an author name. */
+ fprintf (stream, _("Written by %s and %s.\n"), authors[0], authors[1]);
+ break;
+ case 3:
+ /* TRANSLATORS: Each %s denotes an author name. */
+ fprintf (stream, _("Written by %s, %s, and %s.\n"),
+ authors[0], authors[1], authors[2]);
+ break;
+ case 4:
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"),
+ authors[0], authors[1], authors[2], authors[3]);
+ break;
+ case 5:
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"),
+ authors[0], authors[1], authors[2], authors[3], authors[4]);
+ break;
+ case 6:
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
+ authors[0], authors[1], authors[2], authors[3], authors[4],
+ authors[5]);
+ break;
+ case 7:
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
+ authors[0], authors[1], authors[2], authors[3], authors[4],
+ authors[5], authors[6]);
+ break;
+ case 8:
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("\
+Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
+ authors[0], authors[1], authors[2], authors[3], authors[4],
+ authors[5], authors[6], authors[7]);
+ break;
+ case 9:
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("\
+Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
+ authors[0], authors[1], authors[2], authors[3], authors[4],
+ authors[5], authors[6], authors[7], authors[8]);
+ break;
+ default:
+ /* 10 or more authors. Use an abbreviation, since the human reader
+ will probably not want to read the entire list anyway. */
+ /* TRANSLATORS: Each %s denotes an author name.
+ You can use line breaks, estimating that each author name occupies
+ ca. 16 screen columns and that a screen line has ca. 80 columns. */
+ fprintf (stream, _("\
+Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
+ authors[0], authors[1], authors[2], authors[3], authors[4],
+ authors[5], authors[6], authors[7], authors[8]);
+ break;
+ }
+}
+
+/* Display the --version information the standard way. See the initial
+ comment to this module, for more information.
+
+ Author names are given in the NULL-terminated array AUTHORS. */
+void
+version_etc_ar (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version, const char * const * authors)
+{
+ size_t n_authors;
+
+ for (n_authors = 0; authors[n_authors]; n_authors++)
+ ;
+ version_etc_arn (stream, command_name, package, version, authors, n_authors);
+}
+
+/* Display the --version information the standard way. See the initial
+ comment to this module, for more information.
+
+ Author names are given in the NULL-terminated va_list AUTHORS. */
+void
+version_etc_va (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version, va_list authors)
+{
+ size_t n_authors;
+ const char *authtab[10];
+
+ for (n_authors = 0;
+ n_authors < 10
+ && (authtab[n_authors] = va_arg (authors, const char *)) != NULL;
+ n_authors++)
+ ;
+ version_etc_arn (stream, command_name, package, version,
+ authtab, n_authors);
+}
+
+
+/* Display the --version information the standard way.
+
+ If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
+ the program. The formats are therefore:
+
+ PACKAGE VERSION
+
+ or
+
+ COMMAND_NAME (PACKAGE) VERSION.
+
+ The authors names are passed as separate arguments, with an additional
+ NULL argument at the end. */
+void
+version_etc (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version, /* const char *author1, ...*/ ...)
+{
+ va_list authors;
+
+ va_start (authors, version);
+ version_etc_va (stream, command_name, package, version, authors);
+ va_end (authors);
+}
+
+void
+emit_bug_reporting_address (void)
+{
+ /* TRANSLATORS: The placeholder indicates the bug-reporting address
+ for this package. Please add _another line_ saying
+ "Report translation bugs to <...>\n" with the address for translation
+ bugs (typically your translation team's web or email address). */
+ printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT);
+#ifdef PACKAGE_PACKAGER_BUG_REPORTS
+ printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
+ PACKAGE_PACKAGER_BUG_REPORTS);
+#endif
+#ifdef PACKAGE_URL
+ printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
+#else
+ printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"),
+ PACKAGE_NAME, PACKAGE);
+#endif
+ fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),
+ stdout);
+}
diff --git a/lib/version-etc.h b/lib/version-etc.h
new file mode 100644
index 0000000..1a5f603
--- /dev/null
+++ b/lib/version-etc.h
@@ -0,0 +1,78 @@
+/* Print --version and bug-reporting information in a consistent format.
+ Copyright (C) 1999, 2003, 2005, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#ifndef VERSION_ETC_H
+# define VERSION_ETC_H 1
+
+# include <stdarg.h>
+# include <stdio.h>
+
+/* The 'sentinel' attribute was added in gcc 4.0. */
+#ifndef _GL_ATTRIBUTE_SENTINEL
+# if 4 <= __GNUC__
+# define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
+# else
+# define _GL_ATTRIBUTE_SENTINEL /* empty */
+# endif
+#endif
+
+extern const char version_etc_copyright[];
+
+/* The three functions below display the --version information in the
+ standard way: command and package names, package version, followed
+ by a short GPLv3+ notice and a list of up to 10 author names.
+
+ If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
+ the program. The formats are therefore:
+
+ PACKAGE VERSION
+
+ or
+
+ COMMAND_NAME (PACKAGE) VERSION.
+
+ The functions differ in the way they are passed author names: */
+
+/* N_AUTHORS names are supplied in array AUTHORS. */
+extern void version_etc_arn (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version,
+ const char * const * authors, size_t n_authors);
+
+/* Names are passed in the NULL-terminated array AUTHORS. */
+extern void version_etc_ar (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version, const char * const * authors);
+
+/* Names are passed in the NULL-terminated va_list. */
+extern void version_etc_va (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version, va_list authors);
+
+/* Names are passed as separate arguments, with an additional
+ NULL argument at the end. */
+extern void version_etc (FILE *stream,
+ const char *command_name, const char *package,
+ const char *version,
+ /* const char *author1, ..., NULL */ ...)
+ _GL_ATTRIBUTE_SENTINEL;
+
+/* Display the usual "Report bugs to" stanza. */
+extern void emit_bug_reporting_address (void);
+
+#endif /* VERSION_ETC_H */
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
new file mode 100644
index 0000000..755600f
--- /dev/null
+++ b/lib/wchar.in.h
@@ -0,0 +1,1038 @@
+/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
+
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+/*
+ * ISO C 99 <wchar.h> for platforms that have issues.
+ * <http://www.opengroup.org/susv3xbd/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 __KLIBC__) \
+ || (defined __hpux \
+ && ((defined _INTTYPES_INCLUDED && !defined strtoimax) \
+ || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
+ || 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>.
+ - 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
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>.
+ 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
+#ifndef __GLIBC__
+# include <stdio.h>
+# include <time.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
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* 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
+/* MSVC defines wint_t as 'unsigned short' in <crtdefs.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 defined _MSC_VER
+# if !GNULIB_defined_wint_t
+# include <crtdefs.h>
+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. */
+#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
+typedef int rpl_mbstate_t;
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# define GNULIB_defined_mbstate_t 1
+# 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
+_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
+# endif
+_GL_CXXALIASWARN (btowc);
+#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
+_GL_CXXALIASWARN (wctob);
+#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
+_GL_CXXALIASWARN (mbsinit);
+#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 *pwc, const char *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbrtowc, size_t,
+ (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+# else
+# if !@HAVE_MBRTOWC@
+_GL_FUNCDECL_SYS (mbrtowc, size_t,
+ (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+# endif
+_GL_CXXALIAS_SYS (mbrtowc, size_t,
+ (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+# endif
+_GL_CXXALIASWARN (mbrtowc);
+#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 *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+# else
+# if !@HAVE_MBRLEN@
+_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+# endif
+_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+# endif
+_GL_CXXALIASWARN (mbrlen);
+#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 *dest, const char **srcp, size_t len, mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
+ (wchar_t *dest, const char **srcp, size_t len,
+ mbstate_t *ps));
+# else
+# if !@HAVE_MBSRTOWCS@
+_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
+ (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
+ (wchar_t *dest, const char **srcp, size_t len,
+ mbstate_t *ps));
+# endif
+_GL_CXXALIASWARN (mbsrtowcs);
+#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 *dest, const char **srcp, size_t srclen, size_t len,
+ mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
+ (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+ mbstate_t *ps));
+# else
+# if !@HAVE_MBSNRTOWCS@
+_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
+ (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+ mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
+ (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+ mbstate_t *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 *s, wchar_t wc, mbstate_t *ps));
+_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+# else
+# if !@HAVE_WCRTOMB@
+_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+# endif
+_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+# endif
+_GL_CXXALIASWARN (wcrtomb);
+#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 *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsrtombs, size_t,
+ (char *dest, const wchar_t **srcp, size_t len,
+ mbstate_t *ps));
+# else
+# if !@HAVE_WCSRTOMBS@
+_GL_FUNCDECL_SYS (wcsrtombs, size_t,
+ (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (wcsrtombs, size_t,
+ (char *dest, const wchar_t **srcp, size_t len,
+ mbstate_t *ps));
+# endif
+_GL_CXXALIASWARN (wcsrtombs);
+#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 *dest, const wchar_t **srcp, size_t srclen, size_t len,
+ mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
+ (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+ mbstate_t *ps));
+# else
+# if !@HAVE_WCSNRTOMBS@
+_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
+ (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+ mbstate_t *ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
+ (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+ mbstate_t *ps));
+# endif
+_GL_CXXALIASWARN (wcsnrtombs);
+#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);
+# elif defined __KLIBC__
+/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
+ static inline function. The implementation of wcwidth in wcwidth.c
+ causes a "conflicting types" error. */
+# undef wcwidth
+# endif
+_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
+# endif
+_GL_CXXALIASWARN (wcwidth);
+#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));
+# else
+_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));
+_GL_CXXALIASWARN (wmemcmp);
+#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 *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemcpy);
+#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));
+_GL_CXXALIASWARN (wmemmove);
+#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
+
+
+/* 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));
+_GL_CXXALIASWARN (wmemset);
+#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));
+_GL_CXXALIASWARN (wcslen);
+#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 *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscpy);
+#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 *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *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 *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncpy);
+#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 *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *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 *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscat);
+#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 *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncat);
+#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));
+_GL_CXXALIASWARN (wcscmp);
+#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));
+_GL_CXXALIASWARN (wcsncmp);
+#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));
+_GL_CXXALIASWARN (wcscoll);
+#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 *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsxfrm);
+#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 !@HAVE_WCSDUP@
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+_GL_CXXALIASWARN (wcsdup);
+#elif 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
+#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));
+# else
+_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));
+# else
+_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));
+_GL_CXXALIASWARN (wcscspn);
+#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));
+_GL_CXXALIASWARN (wcsspn);
+#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));
+# else
+_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 *haystack, const wchar_t *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 *, 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 (wcsstr, wchar_t *,
+ (wchar_t *haystack, const wchar_t *needle));
+_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
+ (const wchar_t *haystack, const wchar_t *needle));
+# else
+_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 !@HAVE_WCSTOK@
+_GL_FUNCDECL_SYS (wcstok, wchar_t *,
+ (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+# endif
+_GL_CXXALIAS_SYS (wcstok, wchar_t *,
+ (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+_GL_CXXALIASWARN (wcstok);
+#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
+_GL_CXXALIASWARN (wcswidth);
+#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
+
+
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif
diff --git a/lib/wcrtomb.c b/lib/wcrtomb.c
new file mode 100644
index 0000000..b931ee9
--- /dev/null
+++ b/lib/wcrtomb.c
@@ -0,0 +1,53 @@
+/* Convert wide character to multibyte character.
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <stdlib.h>
+
+
+size_t
+wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+{
+ /* This implementation of wcrtomb on top of wctomb() supports only
+ stateless encodings. ps must be in the initial state. */
+ if (ps != NULL && !mbsinit (ps))
+ {
+ errno = EINVAL;
+ return (size_t)(-1);
+ }
+
+ if (s == NULL)
+ /* We know the NUL wide character corresponds to the NUL character. */
+ return 1;
+ else
+ {
+ int ret = wctomb (s, wc);
+
+ if (ret >= 0)
+ return ret;
+ else
+ {
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+ }
+}
diff --git a/lib/wctype-h.c b/lib/wctype-h.c
new file mode 100644
index 0000000..bb5f847
--- /dev/null
+++ b/lib/wctype-h.c
@@ -0,0 +1,4 @@
+/* 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/lib/wctype.in.h b/lib/wctype.in.h
new file mode 100644
index 0000000..3431854
--- /dev/null
+++ b/lib/wctype.in.h
@@ -0,0 +1,514 @@
+/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
+
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible and Paul Eggert. */
+
+/*
+ * ISO C 99 <wctype.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/wctype.h.html>
+ *
+ * iswctype, towctrans, towlower, towupper, wctrans, wctype,
+ * wctrans_t, and wctype_t are not yet implemented.
+ */
+
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_WINT_T@
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
+ Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+
+/* mingw has declarations of towupper and towlower in <ctype.h> as
+ well <wctype.h>. Include <ctype.h> in advance to avoid rpl_ prefix
+ being added to the declarations. */
+#ifdef __MINGW32__
+# include <ctype.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
+/* MSVC defines wint_t as 'unsigned short' in <crtdefs.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 defined _MSC_VER
+# if !GNULIB_defined_wint_t
+# include <crtdefs.h>
+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.
+ Assume all 11 functions (all isw* except iswblank) are implemented the
+ same way, or not at all. */
+# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
+
+/* 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_ISWCNTRL@
+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_ISWCNTRL@
+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);
+}
+
+# elif @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 defined __MINGW32__
+
+/* 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__ */
+
+# define GNULIB_defined_wctype_functions 1
+#endif
+
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+#endif
+_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);
+
+#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
+_GL_CXXALIASWARN (iswblank);
+#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));
+_GL_CXXALIASWARN (wctype);
+#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 !@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));
+_GL_CXXALIASWARN (iswctype);
+#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
+_GL_CXXALIASWARN (towlower);
+_GL_CXXALIASWARN (towupper);
+
+#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));
+_GL_CXXALIASWARN (wctrans);
+#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));
+_GL_CXXALIASWARN (towctrans);
+#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 */
diff --git a/lib/wcwidth.c b/lib/wcwidth.c
new file mode 100644
index 0000000..b94fad0
--- /dev/null
+++ b/lib/wcwidth.c
@@ -0,0 +1,50 @@
+/* Determine the number of screen columns needed for a character.
+ Copyright (C) 2006-2007, 2010-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+/* Get iswprint. */
+#include <wctype.h>
+
+#include "localcharset.h"
+#include "streq.h"
+#include "uniwidth.h"
+
+int
+wcwidth (wchar_t wc)
+#undef wcwidth
+{
+ /* In UTF-8 locales, use a Unicode aware width function. */
+ const char *encoding = locale_charset ();
+ if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0 ,0))
+ {
+ /* We assume that in a UTF-8 locale, a wide character is the same as a
+ Unicode character. */
+ return uc_width (wc, encoding);
+ }
+ else
+ {
+ /* Otherwise, fall back to the system's wcwidth function. */
+#if HAVE_WCWIDTH
+ return wcwidth (wc);
+#else
+ return wc == 0 ? 0 : iswprint (wc) ? 1 : -1;
+#endif
+ }
+}
diff --git a/lib/xalloc-die.c b/lib/xalloc-die.c
new file mode 100644
index 0000000..4c7994b
--- /dev/null
+++ b/lib/xalloc-die.c
@@ -0,0 +1,41 @@
+/* Report a memory allocation failure and exit.
+
+ Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "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/lib/xalloc-oversized.h b/lib/xalloc-oversized.h
new file mode 100644
index 0000000..44f1644
--- /dev/null
+++ b/lib/xalloc-oversized.h
@@ -0,0 +1,71 @@
+/* xalloc-oversized.h -- memory allocation size checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef XALLOC_OVERSIZED_H_
+#define XALLOC_OVERSIZED_H_
+
+#include <stddef.h>
+
+/* Default for (non-Clang) compilers that lack __has_builtin. */
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+
+/* True if N * S would overflow in a size calculation.
+ This expands to a constant expression if N and S are both constants.
+ By gnulib convention, SIZE_MAX represents overflow in size
+ calculations, so the conservative dividend to use here is
+ SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
+ However, malloc (SIZE_MAX) fails on all known hosts where
+ sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
+ exactly-SIZE_MAX allocations on such hosts; this avoids a test and
+ branch when S is known to be 1. */
+#define __xalloc_oversized(n, s) \
+ ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
+
+
+/* Return 1 if an array of N objects, each of size S, cannot exist due
+ to size arithmetic overflow. S must be positive and N must be
+ nonnegative. This is a macro, not a function, so that it
+ works correctly even when SIZE_MAX < N. */
+
+/* GCC 7 __builtin_mul_overflow should easily compute this. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68120 */
+#if 7 <= __GNUC__
+# define xalloc_oversized(n, s) __builtin_mul_overflow (n, s, (size_t *) NULL)
+
+/* GCC 5 and Clang __builtin_mul_overflow needs a temporary, and
+ should be used only for non-constant operands, so that
+ xalloc_oversized is a constant expression if both arguments are.
+ Do not use this if pedantic, since pedantic GCC issues a diagnostic
+ for ({ ... }). */
+#elif ((5 <= __GNUC__ \
+ || (__has_builtin (__builtin_mul_overflow) \
+ && __has_builtin (__builtin_constant_p))) \
+ && !__STRICT_ANSI__)
+# define xalloc_oversized(n, s) \
+ (__builtin_constant_p (n) && __builtin_constant_p (s) \
+ ? __xalloc_oversized (n, s) \
+ : ({ size_t __xalloc_size; __builtin_mul_overflow (n, s, &__xalloc_size); }))
+
+/* 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/lib/xalloc.h b/lib/xalloc.h
new file mode 100644
index 0000000..a4fddbf
--- /dev/null
+++ b/lib/xalloc.h
@@ -0,0 +1,264 @@
+/* xalloc.h -- malloc with out-of-memory checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef XALLOC_H_
+#define XALLOC_H_
+
+#include <stddef.h>
+
+#include "xalloc-oversized.h"
+
+#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 __GNUC__ >= 3
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC
+#endif
+
+#if ! defined __clang__ && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+#else
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+#endif
+
+/* 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);
+
+void *xmalloc (size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+void *xzalloc (size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+void *xcalloc (size_t n, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2));
+void *xrealloc (void *p, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+void *x2realloc (void *p, size_t *pn);
+void *xmemdup (void const *p, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+char *xstrdup (char const *str)
+ _GL_ATTRIBUTE_MALLOC;
+
+/* 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. */
+
+XALLOC_INLINE void *xnmalloc (size_t n, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2));
+XALLOC_INLINE void *
+xnmalloc (size_t n, size_t s)
+{
+ if (xalloc_oversized (n, s))
+ xalloc_die ();
+ return xmalloc (n * s);
+}
+
+/* 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)
+{
+ if (xalloc_oversized (n, s))
+ xalloc_die ();
+ return xrealloc (p, n * s);
+}
+
+/* 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;
+ }
+
+ */
+
+XALLOC_INLINE 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 so that progress is made even if N == 0.
+ Check for overflow, so that N * S stays in size_t range.
+ The check may be slightly conservative, but an exact check isn't
+ worth the trouble. */
+ if ((size_t) -1 / 3 * 2 / s <= n)
+ xalloc_die ();
+ n += n / 2 + 1;
+ }
+
+ *pn = n;
+ return xrealloc (p, n * s);
+}
+
+/* Return a pointer to a new buffer of N bytes. This is like xmalloc,
+ except it returns char *. */
+
+XALLOC_INLINE char *xcharalloc (size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+XALLOC_INLINE char *
+xcharalloc (size_t n)
+{
+ return XNMALLOC (n, char);
+}
+
+#ifdef __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 *
+xnrealloc (T *p, size_t n, size_t s)
+{
+ return (T *) xnrealloc ((void *) 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
+
+_GL_INLINE_HEADER_END
+
+#endif /* !XALLOC_H_ */
diff --git a/lib/xasprintf.c b/lib/xasprintf.c
new file mode 100644
index 0000000..e9e83ef
--- /dev/null
+++ b/lib/xasprintf.c
@@ -0,0 +1,34 @@
+/* vasprintf and asprintf with out-of-memory checking.
+ Copyright (C) 1999, 2002-2004, 2006, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "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/lib/xfreopen.c b/lib/xfreopen.c
new file mode 100644
index 0000000..c02843a
--- /dev/null
+++ b/lib/xfreopen.c
@@ -0,0 +1,42 @@
+/* a wrapper for freopen
+ Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include "xfreopen.h"
+
+#include <errno.h>
+#include "error.h"
+#include "exitfail.h"
+#include "quote.h"
+#include "stdio--.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+void
+xfreopen (char const *filename, char const *mode, FILE *fp)
+{
+ if (!freopen (filename, mode, fp))
+ {
+ char const *f = (filename ? filename
+ : (fp == stdin ? _("stdin")
+ : (fp == stdout ? _("stdout")
+ : (fp == stderr ? _("stderr")
+ : _("unknown stream")))));
+ error (exit_failure, errno, _("failed to reopen %s with mode %s"),
+ quote_n (0, f), quote_n (1, mode));
+ }
+}
diff --git a/lib/xfreopen.h b/lib/xfreopen.h
new file mode 100644
index 0000000..2ce49b5
--- /dev/null
+++ b/lib/xfreopen.h
@@ -0,0 +1,2 @@
+#include <stdio.h>
+void xfreopen (char const *filename, char const *mode, FILE *fp);
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
new file mode 100644
index 0000000..429b50d
--- /dev/null
+++ b/lib/xmalloc.c
@@ -0,0 +1,122 @@
+/* xmalloc.c -- malloc with out of memory checking
+
+ Copyright (C) 1990-2000, 2002-2006, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define XALLOC_INLINE _GL_EXTERN_INLINE
+
+#include "xalloc.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/* 1 if calloc is known to be compatible with GNU calloc. This
+ matters if we are not also using the calloc module, which defines
+ HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms. */
+#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
+enum { HAVE_GNU_CALLOC = 1 };
+#else
+enum { HAVE_GNU_CALLOC = 0 };
+#endif
+
+/* Allocate N bytes of memory dynamically, with error checking. */
+
+void *
+xmalloc (size_t n)
+{
+ void *p = malloc (n);
+ if (!p && n != 0)
+ xalloc_die ();
+ return p;
+}
+
+/* Change the size of an allocated block of memory P to N bytes,
+ with error checking. */
+
+void *
+xrealloc (void *p, size_t n)
+{
+ if (!n && p)
+ {
+ /* The GNU and C99 realloc behaviors disagree here. Act like
+ GNU, even if the underlying realloc is C99. */
+ free (p);
+ return NULL;
+ }
+
+ p = realloc (p, n);
+ if (!p && n)
+ xalloc_die ();
+ return p;
+}
+
+/* If P is null, allocate a block of at least *PN bytes; otherwise,
+ reallocate P so that it contains more than *PN bytes. *PN must be
+ nonzero unless P is null. Set *PN to the new block's size, and
+ return the pointer to the new block. *PN is never set to zero, and
+ the returned pointer is never null. */
+
+void *
+x2realloc (void *p, size_t *pn)
+{
+ return x2nrealloc (p, pn, 1);
+}
+
+/* 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 memset (xmalloc (s), 0, s);
+}
+
+/* Allocate zeroed memory for N elements of S bytes, with error
+ checking. S must be nonzero. */
+
+void *
+xcalloc (size_t n, size_t s)
+{
+ void *p;
+ /* Test for overflow, since some calloc implementations don't have
+ proper overflow checks. But omit overflow and size-zero tests if
+ HAVE_GNU_CALLOC, since GNU calloc catches overflow and never
+ returns NULL if successful. */
+ if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s))
+ || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0)))
+ xalloc_die ();
+ return p;
+}
+
+/* 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);
+}
+
+/* Clone STRING. */
+
+char *
+xstrdup (char const *string)
+{
+ return xmemdup (string, strlen (string) + 1);
+}
diff --git a/lib/xreadlink.c b/lib/xreadlink.c
new file mode 100644
index 0000000..901f946
--- /dev/null
+++ b/lib/xreadlink.c
@@ -0,0 +1,44 @@
+/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage
+
+ Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering <jim@meyering.net>
+ and Bruno Haible <bruno@clisp.org>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "xreadlink.h"
+
+#include <errno.h>
+
+#include "areadlink.h"
+#include "xalloc.h"
+
+/* Call readlink to get the symbolic link value of FILENAME.
+ Return a pointer to that NUL-terminated string in malloc'd storage.
+ If readlink fails, return NULL and set errno.
+ If realloc fails, or if the link value is longer than SIZE_MAX :-),
+ give a diagnostic and exit. */
+
+char *
+xreadlink (char const *filename)
+{
+ char *result = areadlink (filename);
+ if (result == NULL && errno == ENOMEM)
+ xalloc_die ();
+ return result;
+}
diff --git a/lib/xreadlink.h b/lib/xreadlink.h
new file mode 100644
index 0000000..555c27d
--- /dev/null
+++ b/lib/xreadlink.h
@@ -0,0 +1,25 @@
+/* Reading symbolic links without size limitation.
+
+ Copyright (C) 2001, 2003-2004, 2007, 2009-2016 Free Software Foundation,
+ Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering <jim@meyering.net> */
+
+extern char *xreadlink (char const *filename);
+
+#if GNULIB_XREADLINKAT
+extern char *xreadlinkat (int fd, char const *filename);
+#endif
diff --git a/lib/xsize.c b/lib/xsize.c
new file mode 100644
index 0000000..4b4914c
--- /dev/null
+++ b/lib/xsize.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define XSIZE_INLINE _GL_EXTERN_INLINE
+#include "xsize.h"
diff --git a/lib/xsize.h b/lib/xsize.h
new file mode 100644
index 0000000..202a87e
--- /dev/null
+++ b/lib/xsize.h
@@ -0,0 +1,117 @@
+/* xsize.h -- Checked size_t computations.
+
+ Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _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
+
+#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
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+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
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+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
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+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
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+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/lib/xstriconv.c b/lib/xstriconv.c
new file mode 100644
index 0000000..2dbee18
--- /dev/null
+++ b/lib/xstriconv.c
@@ -0,0 +1,62 @@
+/* Charset conversion with out-of-memory checking.
+ Copyright (C) 2001-2004, 2006, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "xstriconv.h"
+
+#include <errno.h>
+
+#include "striconv.h"
+#include "xalloc.h"
+
+
+#if HAVE_ICONV
+
+int
+xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+ char **resultp, size_t *lengthp)
+{
+ int retval = mem_cd_iconv (src, srclen, cd, resultp, lengthp);
+
+ if (retval < 0 && errno == ENOMEM)
+ xalloc_die ();
+ return retval;
+}
+
+char *
+xstr_cd_iconv (const char *src, iconv_t cd)
+{
+ char *result = str_cd_iconv (src, cd);
+
+ if (result == NULL && errno == ENOMEM)
+ xalloc_die ();
+ return result;
+}
+
+#endif
+
+char *
+xstr_iconv (const char *src, const char *from_codeset, const char *to_codeset)
+{
+ char *result = str_iconv (src, from_codeset, to_codeset);
+
+ if (result == NULL && errno == ENOMEM)
+ xalloc_die ();
+ return result;
+}
diff --git a/lib/xstriconv.h b/lib/xstriconv.h
new file mode 100644
index 0000000..61e7c75
--- /dev/null
+++ b/lib/xstriconv.h
@@ -0,0 +1,78 @@
+/* Charset conversion with out-of-memory checking.
+ Copyright (C) 2001-2004, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+ Written by Bruno Haible and Simon Josefsson.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _XSTRICONV_H
+#define _XSTRICONV_H
+
+#include <stddef.h>
+#if HAVE_ICONV
+#include <iconv.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if HAVE_ICONV
+
+/* Convert an entire string from one encoding to another, using iconv.
+ The original string is at [SRC,...,SRC+SRCLEN-1].
+ The conversion descriptor is passed as CD.
+ *RESULTP and *LENGTH should initially be a scratch buffer and its size,
+ or *RESULTP can initially be NULL.
+ May erase the contents of the memory at *RESULTP.
+ Upon memory allocation failure, report the error and exit.
+ Return value: 0 if successful, otherwise -1 and errno set.
+ If successful: The resulting string is stored in *RESULTP and its length
+ in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is
+ unchanged if no dynamic memory allocation was necessary. */
+extern int xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+ char **resultp, size_t *lengthp);
+
+/* Convert an entire string from one encoding to another, using iconv.
+ The original string is the NUL-terminated string starting at SRC.
+ The conversion descriptor is passed as CD. Both the "from" and the "to"
+ encoding must use a single NUL byte at the end of the string (i.e. not
+ UCS-2, UCS-4, UTF-16, UTF-32).
+ Allocate a malloced memory block for the result.
+ Upon memory allocation failure, report the error and exit.
+ Return value: the freshly allocated resulting NUL-terminated string if
+ successful, otherwise NULL and errno set. */
+extern char * xstr_cd_iconv (const char *src, iconv_t cd);
+
+#endif
+
+/* Convert an entire string from one encoding to another, using iconv.
+ The original string is the NUL-terminated string starting at SRC.
+ Both the "from" and the "to" encoding must use a single NUL byte at the
+ end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32).
+ Allocate a malloced memory block for the result.
+ Upon memory allocation failure, report the error and exit.
+ Return value: the freshly allocated resulting NUL-terminated string if
+ successful, otherwise NULL and errno set. */
+extern char * xstr_iconv (const char *src,
+ const char *from_codeset, const char *to_codeset);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _XSTRICONV_H */
diff --git a/lib/xstrndup.c b/lib/xstrndup.c
new file mode 100644
index 0000000..3d605ef
--- /dev/null
+++ b/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-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "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/lib/xstrndup.h b/lib/xstrndup.h
new file mode 100644
index 0000000..0d3021c
--- /dev/null
+++ b/lib/xstrndup.h
@@ -0,0 +1,23 @@
+/* Duplicate a bounded initial segment of a string, with out-of-memory
+ checking.
+ Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stddef.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);
diff --git a/lib/xstrtol-error.c b/lib/xstrtol-error.c
new file mode 100644
index 0000000..30b51cb
--- /dev/null
+++ b/lib/xstrtol-error.c
@@ -0,0 +1,98 @@
+/* A more useful interface to strtol.
+
+ Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include "xstrtol.h"
+
+#include <stdlib.h>
+
+#include "error.h"
+#include "exitfail.h"
+#include "gettext.h"
+
+#define N_(msgid) msgid
+
+/* Report an error for an invalid integer in an option argument.
+
+ ERR is the error code returned by one of the xstrto* functions.
+
+ Use OPT_IDX to decide whether to print the short option string "C"
+ or "-C" or a long option string derived from LONG_OPTION. OPT_IDX
+ is -2 if the short option "C" was used, without any leading "-"; it
+ is -1 if the short option "-C" was used; otherwise it is an index
+ into LONG_OPTIONS, which should have a name preceded by two '-'
+ characters.
+
+ ARG is the option-argument containing the integer.
+
+ After reporting an error, exit with status EXIT_STATUS if it is
+ nonzero. */
+
+static void
+xstrtol_error (enum strtol_error err,
+ int opt_idx, char c, struct option const *long_options,
+ char const *arg,
+ int exit_status)
+{
+ char const *hyphens = "--";
+ char const *msgid;
+ char const *option;
+ char option_buffer[2];
+
+ switch (err)
+ {
+ default:
+ abort ();
+
+ case LONGINT_INVALID:
+ msgid = N_("invalid %s%s argument '%s'");
+ break;
+
+ case LONGINT_INVALID_SUFFIX_CHAR:
+ case LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW:
+ msgid = N_("invalid suffix in %s%s argument '%s'");
+ break;
+
+ case LONGINT_OVERFLOW:
+ msgid = N_("%s%s argument '%s' too large");
+ break;
+ }
+
+ if (opt_idx < 0)
+ {
+ hyphens -= opt_idx;
+ option_buffer[0] = c;
+ option_buffer[1] = '\0';
+ option = option_buffer;
+ }
+ else
+ option = long_options[opt_idx].name;
+
+ error (exit_status, 0, gettext (msgid), hyphens, option, arg);
+}
+
+/* Like xstrtol_error, except exit with a failure status. */
+
+void
+xstrtol_fatal (enum strtol_error err,
+ int opt_idx, char c, struct option const *long_options,
+ char const *arg)
+{
+ xstrtol_error (err, opt_idx, c, long_options, arg, exit_failure);
+ abort ();
+}
diff --git a/lib/xstrtol.c b/lib/xstrtol.c
new file mode 100644
index 0000000..c5b1692
--- /dev/null
+++ b/lib/xstrtol.c
@@ -0,0 +1,249 @@
+/* A more useful interface to strtol.
+
+ Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#ifndef __strtol
+# define __strtol strtol
+# define __strtol_t long int
+# define __xstrtol xstrtol
+# define STRTOL_T_MINIMUM LONG_MIN
+# define STRTOL_T_MAXIMUM LONG_MAX
+#endif
+
+#include <config.h>
+
+#include "xstrtol.h"
+
+/* Some pre-ANSI implementations (e.g. SunOS 4)
+ need stderr defined if assertion checking is enabled. */
+#include <stdio.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "assure.h"
+#include "intprops.h"
+
+/* xstrtoll.c and xstrtoull.c, which include this file, require that
+ ULLONG_MAX, LLONG_MAX, LLONG_MIN are defined, but <limits.h> does not
+ define them on all platforms. */
+#ifndef ULLONG_MAX
+# define ULLONG_MAX TYPE_MAXIMUM (unsigned long long)
+#endif
+#ifndef LLONG_MAX
+# define LLONG_MAX TYPE_MAXIMUM (long long int)
+#endif
+#ifndef LLONG_MIN
+# define LLONG_MIN TYPE_MINIMUM (long long int)
+#endif
+
+static strtol_error
+bkm_scale (__strtol_t *x, int scale_factor)
+{
+ if (TYPE_SIGNED (__strtol_t) && *x < STRTOL_T_MINIMUM / scale_factor)
+ {
+ *x = STRTOL_T_MINIMUM;
+ return LONGINT_OVERFLOW;
+ }
+ if (STRTOL_T_MAXIMUM / scale_factor < *x)
+ {
+ *x = STRTOL_T_MAXIMUM;
+ return LONGINT_OVERFLOW;
+ }
+ *x *= scale_factor;
+ return LONGINT_OK;
+}
+
+static strtol_error
+bkm_scale_by_power (__strtol_t *x, int base, int power)
+{
+ strtol_error err = LONGINT_OK;
+ while (power--)
+ err |= bkm_scale (x, base);
+ return err;
+}
+
+/* FIXME: comment. */
+
+strtol_error
+__xstrtol (const char *s, char **ptr, int strtol_base,
+ __strtol_t *val, const char *valid_suffixes)
+{
+ char *t_ptr;
+ char **p;
+ __strtol_t tmp;
+ strtol_error err = LONGINT_OK;
+
+ assure (0 <= strtol_base && strtol_base <= 36);
+
+ p = (ptr ? ptr : &t_ptr);
+
+ errno = 0;
+
+ if (! TYPE_SIGNED (__strtol_t))
+ {
+ const char *q = s;
+ unsigned char ch = *q;
+ while (isspace (ch))
+ ch = *++q;
+ if (ch == '-')
+ return LONGINT_INVALID;
+ }
+
+ tmp = __strtol (s, p, strtol_base);
+
+ if (*p == s)
+ {
+ /* If there is no number but there is a valid suffix, assume the
+ number is 1. The string is invalid otherwise. */
+ if (valid_suffixes && **p && strchr (valid_suffixes, **p))
+ tmp = 1;
+ else
+ return LONGINT_INVALID;
+ }
+ else if (errno != 0)
+ {
+ if (errno != ERANGE)
+ return LONGINT_INVALID;
+ err = LONGINT_OVERFLOW;
+ }
+
+ /* Let valid_suffixes == NULL mean "allow any suffix". */
+ /* FIXME: update all callers except the ones that allow suffixes
+ after the number, changing last parameter NULL to "". */
+ if (!valid_suffixes)
+ {
+ *val = tmp;
+ return err;
+ }
+
+ if (**p != '\0')
+ {
+ int base = 1024;
+ int suffixes = 1;
+ strtol_error overflow;
+
+ if (!strchr (valid_suffixes, **p))
+ {
+ *val = tmp;
+ return err | LONGINT_INVALID_SUFFIX_CHAR;
+ }
+
+ switch (**p)
+ {
+ case 'E': case 'G': case 'g': case 'k': case 'K': case 'M': case 'm':
+ case 'P': case 'T': case 't': case 'Y': case 'Z':
+
+ /* The "valid suffix" '0' is a special flag meaning that
+ an optional second suffix is allowed, which can change
+ the base. A suffix "B" (e.g. "100MB") stands for a power
+ of 1000, whereas a suffix "iB" (e.g. "100MiB") stands for
+ a power of 1024. If no suffix (e.g. "100M"), assume
+ power-of-1024. */
+
+ if (strchr (valid_suffixes, '0'))
+ switch (p[0][1])
+ {
+ case 'i':
+ if (p[0][2] == 'B')
+ suffixes += 2;
+ break;
+
+ case 'B':
+ case 'D': /* 'D' is obsolescent */
+ base = 1000;
+ suffixes++;
+ break;
+ }
+ }
+
+ switch (**p)
+ {
+ case 'b':
+ overflow = bkm_scale (&tmp, 512);
+ break;
+
+ case 'B':
+ /* This obsolescent first suffix is distinct from the 'B'
+ second suffix above. E.g., 'tar -L 1000B' means change
+ the tape after writing 1000 KiB of data. */
+ overflow = bkm_scale (&tmp, 1024);
+ break;
+
+ case 'c':
+ overflow = LONGINT_OK;
+ break;
+
+ case 'E': /* exa or exbi */
+ overflow = bkm_scale_by_power (&tmp, base, 6);
+ break;
+
+ case 'G': /* giga or gibi */
+ case 'g': /* 'g' is undocumented; for compatibility only */
+ overflow = bkm_scale_by_power (&tmp, base, 3);
+ break;
+
+ case 'k': /* kilo */
+ case 'K': /* kibi */
+ overflow = bkm_scale_by_power (&tmp, base, 1);
+ break;
+
+ case 'M': /* mega or mebi */
+ case 'm': /* 'm' is undocumented; for compatibility only */
+ overflow = bkm_scale_by_power (&tmp, base, 2);
+ break;
+
+ case 'P': /* peta or pebi */
+ overflow = bkm_scale_by_power (&tmp, base, 5);
+ break;
+
+ case 'T': /* tera or tebi */
+ case 't': /* 't' is undocumented; for compatibility only */
+ overflow = bkm_scale_by_power (&tmp, base, 4);
+ break;
+
+ case 'w':
+ overflow = bkm_scale (&tmp, 2);
+ break;
+
+ case 'Y': /* yotta or 2**80 */
+ overflow = bkm_scale_by_power (&tmp, base, 8);
+ break;
+
+ case 'Z': /* zetta or 2**70 */
+ overflow = bkm_scale_by_power (&tmp, base, 7);
+ break;
+
+ default:
+ *val = tmp;
+ return err | LONGINT_INVALID_SUFFIX_CHAR;
+ }
+
+ err |= overflow;
+ *p += suffixes;
+ if (**p)
+ err |= LONGINT_INVALID_SUFFIX_CHAR;
+ }
+
+ *val = tmp;
+ return err;
+}
diff --git a/lib/xstrtol.h b/lib/xstrtol.h
new file mode 100644
index 0000000..6f51d6e
--- /dev/null
+++ b/lib/xstrtol.h
@@ -0,0 +1,73 @@
+/* A more useful interface to strtol.
+
+ Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2016 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef XSTRTOL_H_
+# define XSTRTOL_H_ 1
+
+# include <getopt.h>
+# include <inttypes.h>
+
+# ifndef _STRTOL_ERROR
+enum strtol_error
+ {
+ LONGINT_OK = 0,
+
+ /* These two values can be ORed together, to indicate that both
+ errors occurred. */
+ LONGINT_OVERFLOW = 1,
+ LONGINT_INVALID_SUFFIX_CHAR = 2,
+
+ LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW = (LONGINT_INVALID_SUFFIX_CHAR
+ | LONGINT_OVERFLOW),
+ LONGINT_INVALID = 4
+ };
+typedef enum strtol_error strtol_error;
+# endif
+
+# define _DECLARE_XSTRTOL(name, type) \
+ strtol_error name (const char *, char **, int, type *, const char *);
+_DECLARE_XSTRTOL (xstrtol, long int)
+_DECLARE_XSTRTOL (xstrtoul, unsigned long int)
+_DECLARE_XSTRTOL (xstrtoimax, intmax_t)
+_DECLARE_XSTRTOL (xstrtoumax, uintmax_t)
+
+#if HAVE_LONG_LONG_INT
+_DECLARE_XSTRTOL (xstrtoll, long long int)
+_DECLARE_XSTRTOL (xstrtoull, unsigned long long int)
+#endif
+
+/* Report an error for an invalid integer in an option argument.
+
+ ERR is the error code returned by one of the xstrto* functions.
+
+ Use OPT_IDX to decide whether to print the short option string "C"
+ or "-C" or a long option string derived from LONG_OPTION. OPT_IDX
+ is -2 if the short option "C" was used, without any leading "-"; it
+ is -1 if the short option "-C" was used; otherwise it is an index
+ into LONG_OPTIONS, which should have a name preceded by two '-'
+ characters.
+
+ ARG is the option-argument containing the integer.
+
+ After reporting an error, exit with a failure status. */
+
+_Noreturn void xstrtol_fatal (enum strtol_error,
+ int, char, struct option const *,
+ char const *);
+
+#endif /* not XSTRTOL_H_ */
diff --git a/lib/xstrtoul.c b/lib/xstrtoul.c
new file mode 100644
index 0000000..285f7b9
--- /dev/null
+++ b/lib/xstrtoul.c
@@ -0,0 +1,6 @@
+#define __strtol strtoul
+#define __strtol_t unsigned long int
+#define __xstrtol xstrtoul
+#define STRTOL_T_MINIMUM 0
+#define STRTOL_T_MAXIMUM ULONG_MAX
+#include "xstrtol.c"
diff --git a/lib/xstrtoumax.c b/lib/xstrtoumax.c
new file mode 100644
index 0000000..9a2349f
--- /dev/null
+++ b/lib/xstrtoumax.c
@@ -0,0 +1,6 @@
+#define __strtol strtoumax
+#define __strtol_t uintmax_t
+#define __xstrtol xstrtoumax
+#define STRTOL_T_MINIMUM 0
+#define STRTOL_T_MAXIMUM UINTMAX_MAX
+#include "xstrtol.c"
diff --git a/lib/xvasprintf.c b/lib/xvasprintf.c
new file mode 100644
index 0000000..9deaad0
--- /dev/null
+++ b/lib/xvasprintf.c
@@ -0,0 +1,110 @@
+/* vasprintf and asprintf with out-of-memory checking.
+ Copyright (C) 1999, 2002-2004, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "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/lib/xvasprintf.h b/lib/xvasprintf.h
new file mode 100644
index 0000000..d62d7b7
--- /dev/null
+++ b/lib/xvasprintf.h
@@ -0,0 +1,55 @@
+/* vasprintf and asprintf with out-of-memory checking.
+ Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _XVASPRINTF_H
+#define _XVASPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The __-protected variants of the attributes 'format' and 'printf' are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+#endif
+
+#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_FORMAT ((__printf__, 1, 2));
+extern char *xvasprintf (const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 0));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _XVASPRINTF_H */
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
new file mode 100644
index 0000000..bb37e32
--- /dev/null
+++ b/m4/00gnulib.m4
@@ -0,0 +1,46 @@
+# 00gnulib.m4 serial 3
+dnl Copyright (C) 2009-2016 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 such time as we can
+dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
+dnl m4_divert semantics.
+
+# Until autoconf 2.63, handling of the diversion stack required m4_init
+# to be called first; but this does not happen with aclocal. Wrapping
+# the entire execution in another layer of the diversion stack fixes this.
+# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
+# for whether it was FIFO or LIFO; in order to properly balance with
+# m4_init, we need to undo our push just before anything wrapped within
+# the m4_init body. The way to ensure this is to wrap both sides of
+# m4_init with a one-shot macro that does the pop at the right time.
+m4_ifndef([_m4_divert_diversion],
+[m4_divert_push([KILL])
+m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
+m4_define([m4_init],
+ [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
+
+
+# AC_DEFUN_ONCE([NAME], VALUE)
+# ----------------------------
+# Define NAME to expand to VALUE on the first use (whether by direct
+# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
+# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This
+# definition is slower than the version in Autoconf 2.64, because it
+# can only use interfaces that existed since 2.59; but it achieves the
+# same effect. Quoting is necessary to avoid confusing Automake.
+m4_version_prereq([2.63.263], [],
+[m4_define([AC][_DEFUN_ONCE],
+ [AC][_DEFUN([$1],
+ [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
+ [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
+[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
+
+# 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/m4/absolute-header.m4 b/m4/absolute-header.m4
new file mode 100644
index 0000000..7ffc38d
--- /dev/null
+++ b/m4/absolute-header.m4
@@ -0,0 +1,102 @@
+# absolute-header.m4 serial 16
+dnl Copyright (C) 2006-2016 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
+dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
+dnl until we can assume autoconf 2.64 or newer.
+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])[>],
+ m4_defn([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/m4/alloca.m4 b/m4/alloca.m4
new file mode 100644
index 0000000..2382ff1
--- /dev/null
+++ b/m4/alloca.m4
@@ -0,0 +1,121 @@
+# alloca.m4 serial 14
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 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.])
+ ALLOCA_H=alloca.h
+ 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.
+ ALLOCA_H=
+ fi
+ else
+ ALLOCA_H=alloca.h
+ fi
+ AC_SUBST([ALLOCA_H])
+ AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
+])
+
+# Prerequisites of lib/alloca.c.
+# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
+AC_DEFUN([gl_PREREQ_ALLOCA], [:])
+
+# This works around a bug in autoconf <= 2.68.
+# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
+
+m4_version_prereq([2.69], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+
+# _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(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
+[AC_EGREP_CPP(webecray,
+[#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ AC_CHECK_FUNC($ac_func,
+ [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+ [Define to one of '_getb67', 'GETB67',
+ 'getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for
+ 'alloca.c' support on those systems.])
+ break])
+ done
+fi
+
+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/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
new file mode 100644
index 0000000..5387f28
--- /dev/null
+++ b/m4/arpa_inet_h.m4
@@ -0,0 +1,57 @@
+# arpa_inet_h.m4 serial 13
+dnl Copyright (C) 2006, 2008-2016 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 and Bruno Haible
+
+AC_DEFUN([gl_HEADER_ARPA_INET],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+ AC_CHECK_HEADERS_ONCE([arpa/inet.h])
+ if test $ac_cv_header_arpa_inet_h = yes; then
+ HAVE_ARPA_INET_H=1
+ else
+ HAVE_ARPA_INET_H=0
+ fi
+ AC_SUBST([HAVE_ARPA_INET_H])
+ dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([arpa/inet.h])
+
+ AC_REQUIRE([gl_FEATURES_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([[
+/* On some systems, this header is not self-consistent. */
+#if !(defined __GLIBC__ || defined __UCLIBC__)
+# include <sys/socket.h>
+#endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
+#include <arpa/inet.h>
+ ]], [inet_ntop inet_pton])
+])
+
+AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
+[
+ GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
+ GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
+ HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
+ REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP])
+ REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON])
+])
diff --git a/m4/btowc.m4 b/m4/btowc.m4
new file mode 100644
index 0000000..47e8fd8
--- /dev/null
+++ b/m4/btowc.m4
@@ -0,0 +1,116 @@
+# btowc.m4 serial 10
+dnl Copyright (C) 2008-2016 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 <http://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 <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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 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 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 <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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/m4/c-stack.m4 b/m4/c-stack.m4
new file mode 100644
index 0000000..aa9895e
--- /dev/null
+++ b/m4/c-stack.m4
@@ -0,0 +1,359 @@
+# Check prerequisites for compiling lib/c-stack.c.
+
+# Copyright (C) 2002-2004, 2008-2016 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 15
+
+AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
+ [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([setrlimit])
+ AC_CHECK_HEADERS_ONCE([ucontext.h])
+
+ dnl List of signals that are sent when an invalid virtual memory address
+ dnl is accessed, or when the stack overflows.
+ dnl Either { SIGSEGV } or { SIGSEGV, SIGBUS }.
+ case "$host_os" in
+ sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems
+ FAULT_YIELDS_SIGBUS=1 ;;
+ hpux*) # HP-UX
+ FAULT_YIELDS_SIGBUS=1 ;;
+ macos* | darwin*) # Mac OS X
+ FAULT_YIELDS_SIGBUS=1 ;;
+ gnu*) # Hurd
+ FAULT_YIELDS_SIGBUS=1 ;;
+ *)
+ FAULT_YIELDS_SIGBUS=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([FAULT_YIELDS_SIGBUS], [$FAULT_YIELDS_SIGBUS],
+ [Define to 1 if an invalid memory address access may yield a SIGBUS.])
+
+ AC_CACHE_CHECK([for working C stack overflow detection],
+ [ac_cv_sys_stack_overflow_works],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE(
+ [[
+ #include <unistd.h>
+ #include <signal.h>
+ #if HAVE_SETRLIMIT
+ # include <sys/types.h>
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
+ #ifndef SIGSTKSZ
+ # define SIGSTKSZ 16384
+ #endif
+
+ static union
+ {
+ char buffer[2 * SIGSTKSZ];
+ long double ld;
+ long u;
+ void *p;
+ } alternate_signal_stack;
+
+ static void
+ segv_handler (int signo)
+ {
+ _exit (0);
+ }
+
+ static int
+ c_stack_action ()
+ {
+ stack_t st;
+ struct sigaction act;
+ int r;
+
+ st.ss_flags = 0;
+ /* Use the midpoint to avoid Irix sigaltstack bug. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
+ st.ss_size = SIGSTKSZ;
+ r = sigaltstack (&st, 0);
+ if (r != 0)
+ return 1;
+
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
+ act.sa_handler = segv_handler;
+ #if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, 0) < 0)
+ return 2;
+ #endif
+ if (sigaction (SIGSEGV, &act, 0) < 0)
+ return 3;
+ return 0;
+ }
+ static volatile int *
+ recurse_1 (volatile int n, volatile int *p)
+ {
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+ }
+ static int
+ recurse (volatile int n)
+ {
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+ }
+ int
+ main ()
+ {
+ int result;
+ #if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly
+ to the user's machine. On some Linux 2.2.x systems, there
+ is no stack limit for user processes at all. We don't want
+ to kill such systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+ #endif
+
+ result = c_stack_action ();
+ if (result != 0)
+ return result;
+ return recurse (0);
+ }
+ ]])],
+ [ac_cv_sys_stack_overflow_works=yes],
+ [ac_cv_sys_stack_overflow_works=no],
+ [ac_cv_sys_stack_overflow_works=cross-compiling])])
+
+ if test $ac_cv_sys_stack_overflow_works = yes; then
+ AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1],
+ [Define to 1 if extending the stack slightly past the limit causes
+ a SIGSEGV which can be handled on an alternate stack established
+ with sigaltstack.])
+
+ dnl The ss_sp field of a stack_t is, according to POSIX, the lowest address
+ dnl of the memory block designated as an alternate stack. But IRIX 5.3
+ dnl interprets it as the highest address!
+ AC_CACHE_CHECK([for correct stack_t interpretation],
+ [gl_cv_sigaltstack_low_base], [
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+#ifndef SIGSTKSZ
+# define SIGSTKSZ 16384
+#endif
+volatile char *stack_lower_bound;
+volatile char *stack_upper_bound;
+static void check_stack_location (volatile char *addr)
+{
+ if (addr >= stack_lower_bound && addr <= stack_upper_bound)
+ exit (0);
+ else
+ exit (1);
+}
+static void stackoverflow_handler (int sig)
+{
+ char dummy;
+ check_stack_location (&dummy);
+}
+int main ()
+{
+ char mystack[2 * SIGSTKSZ];
+ stack_t altstack;
+ struct sigaction action;
+ /* Install the alternate stack. */
+ altstack.ss_sp = mystack + SIGSTKSZ;
+ altstack.ss_size = SIGSTKSZ;
+ stack_lower_bound = (char *) altstack.ss_sp;
+ stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1;
+ altstack.ss_flags = 0; /* no SS_DISABLE */
+ if (sigaltstack (&altstack, NULL) < 0)
+ exit (2);
+ /* Install the SIGSEGV handler. */
+ sigemptyset (&action.sa_mask);
+ action.sa_handler = &stackoverflow_handler;
+ action.sa_flags = SA_ONSTACK;
+ if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0)
+ exit(3);
+ /* Provoke a SIGSEGV. */
+ raise (SIGSEGV);
+ exit (4);
+}]])],
+ [gl_cv_sigaltstack_low_base=yes],
+ [gl_cv_sigaltstack_low_base=no],
+ [gl_cv_sigaltstack_low_base=cross-compiling])])
+ if test "$gl_cv_sigaltstack_low_base" = no; then
+ AC_DEFINE([SIGALTSTACK_SS_REVERSED], [1],
+ [Define if sigaltstack() interprets the stack_t.ss_sp field
+ incorrectly, as the highest address of the alternate stack range
+ rather than as the lowest address.])
+ fi
+
+ AC_CACHE_CHECK([for precise C stack overflow detection],
+ ac_cv_sys_xsi_stack_overflow_heuristic,
+ [AC_RUN_IFELSE([AC_LANG_SOURCE(
+ [[
+ #include <unistd.h>
+ #include <signal.h>
+ #if HAVE_UCONTEXT_H
+ # include <ucontext.h>
+ #endif
+ #if HAVE_SETRLIMIT
+ # include <sys/types.h>
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
+ #ifndef SIGSTKSZ
+ # define SIGSTKSZ 16384
+ #endif
+
+ static union
+ {
+ char buffer[2 * SIGSTKSZ];
+ long double ld;
+ long u;
+ void *p;
+ } alternate_signal_stack;
+
+ #if STACK_DIRECTION
+ # define find_stack_direction(ptr) STACK_DIRECTION
+ #else
+ static int
+ find_stack_direction (char const *addr)
+ {
+ char dummy;
+ return (! addr ? find_stack_direction (&dummy)
+ : addr < &dummy ? 1 : -1);
+ }
+ #endif
+
+ static void
+ segv_handler (int signo, siginfo_t *info, void *context)
+ {
+ if (0 < info->si_code)
+ {
+ /* For XSI heuristics to work, we need uc_stack to describe
+ the interrupted stack (as on Solaris), and not the
+ currently executing stack (as on Linux). */
+ ucontext_t const *user_context = context;
+ char const *stack_min = user_context->uc_stack.ss_sp;
+ size_t stack_size = user_context->uc_stack.ss_size;
+ char const *faulting_address = info->si_addr;
+ size_t s = faulting_address - stack_min;
+ size_t page_size = sysconf (_SC_PAGESIZE);
+ if (find_stack_direction (0) < 0)
+ s += page_size;
+ if (s < stack_size + page_size)
+ _exit (0);
+ _exit (4);
+ }
+ _exit (5);
+ }
+
+ static int
+ c_stack_action ()
+ {
+ stack_t st;
+ struct sigaction act;
+ int r;
+
+ st.ss_flags = 0;
+ /* Use the midpoint to avoid Irix sigaltstack bug. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
+ st.ss_size = SIGSTKSZ;
+ r = sigaltstack (&st, 0);
+ if (r != 0)
+ return 1;
+
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
+ act.sa_sigaction = segv_handler;
+ #if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, 0) < 0)
+ return 2;
+ #endif
+ if (sigaction (SIGSEGV, &act, 0) < 0)
+ return 3;
+ return 0;
+ }
+ static volatile int *
+ recurse_1 (volatile int n, volatile int *p)
+ {
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+ }
+ static int
+ recurse (volatile int n)
+ {
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+ }
+ int
+ main ()
+ {
+ int result;
+ #if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly
+ to the user's machine. On some Linux 2.2.x systems, there
+ is no stack limit for user processes at all. We don't want
+ to kill such systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+ #endif
+
+ result = c_stack_action ();
+ if (result != 0)
+ return result;
+ return recurse (0);
+ }
+ ]])],
+ [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
+ [ac_cv_sys_xsi_stack_overflow_heuristic=no],
+ [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
+
+ if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
+ AC_DEFINE([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [1],
+ [Define to 1 if extending the stack slightly past the limit causes
+ a SIGSEGV, and an alternate stack can be established with sigaltstack,
+ and the signal handler is passed a context that specifies the
+ run time stack. This behavior is defined by POSIX 1003.1-2001
+ with the X/Open System Interface (XSI) option
+ and is a standardized way to implement a SEGV-based stack
+ overflow detection heuristic.])
+ fi
+ fi])
+
+
+AC_DEFUN([gl_PREREQ_C_STACK],
+ [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
+ AC_REQUIRE([gl_LIBSIGSEGV])
+
+ # for STACK_DIRECTION
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+
+ AC_CHECK_FUNCS_ONCE([sigaltstack])
+ AC_CHECK_DECLS([sigaltstack], , , [[#include <signal.h>]])
+
+ AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h])
+
+ AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])
+
+ dnl c-stack does not need -lsigsegv if the system has XSI heuristics.
+ if test "$gl_cv_lib_sigsegv" = yes \
+ && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then
+ AC_SUBST([LIBCSTACK], [$LIBSIGSEGV])
+ AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])
+ fi
+])
+
+AC_DEFUN([gl_C_STACK],
+[
+ dnl Prerequisites of lib/c-stack.c.
+ gl_PREREQ_C_STACK
+])
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
new file mode 100644
index 0000000..bb20344
--- /dev/null
+++ b/m4/clock_time.m4
@@ -0,0 +1,31 @@
+# clock_time.m4 serial 10
+dnl Copyright (C) 2002-2006, 2009-2016 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_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_gettime clock_settime])
+ LIBS=$gl_saved_libs
+])
diff --git a/m4/close.m4 b/m4/close.m4
new file mode 100644
index 0000000..310f076
--- /dev/null
+++ b/m4/close.m4
@@ -0,0 +1,33 @@
+# close.m4 serial 8
+dnl Copyright (C) 2008-2016 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])
+ 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/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 0000000..bc98201
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,0 +1,24 @@
+# codeset.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016 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 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/m4/config-h.m4 b/m4/config-h.m4
new file mode 100644
index 0000000..d6664b7
--- /dev/null
+++ b/m4/config-h.m4
@@ -0,0 +1,13 @@
+# Say that -DHAVE_CONFIG_H is not needed.
+
+dnl Copyright (C) 2006, 2009-2016 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.
+
+# This package's source files all include config.h unconditionally,
+# so there's no need to pass -DHAVE_CONFIG_H to the compiler.
+AC_DEFUN([gl_CONFIG_H],
+ [AC_CONFIG_COMMANDS_PRE([test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS=])])
diff --git a/m4/configmake.m4 b/m4/configmake.m4
new file mode 100644
index 0000000..80b9254
--- /dev/null
+++ b/m4/configmake.m4
@@ -0,0 +1,55 @@
+# configmake.m4 serial 2
+dnl Copyright (C) 2010-2016 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_CONFIGMAKE_PREP
+# ------------------
+# Guarantee all of the standard directory variables, even when used with
+# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
+# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
+# and runstatedir in 1.14.1).
+AC_DEFUN([gl_CONFIGMAKE_PREP],
+[
+ dnl Technically, datadir should default to datarootdir. But if
+ dnl autoconf is too old to provide datarootdir, then reversing the
+ dnl definition is a reasonable compromise. Only AC_SUBST a variable
+ dnl if it was not already defined earlier by autoconf.
+ if test "x$datarootdir" = x; then
+ AC_SUBST([datarootdir], ['${datadir}'])
+ fi
+ dnl Copy the approach used in autoconf 2.60.
+ if test "x$docdir" = x; then
+ AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
+ ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
+ ['${datarootdir}/doc/${PACKAGE}'])])
+ fi
+ dnl The remaining variables missing from autoconf 2.59 are easier.
+ if test "x$htmldir" = x; then
+ AC_SUBST([htmldir], ['${docdir}'])
+ fi
+ if test "x$dvidir" = x; then
+ AC_SUBST([dvidir], ['${docdir}'])
+ fi
+ if test "x$pdfdir" = x; then
+ AC_SUBST([pdfdir], ['${docdir}'])
+ fi
+ if test "x$psdir" = x; then
+ AC_SUBST([psdir], ['${docdir}'])
+ fi
+ if test "x$lispdir" = x; then
+ AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
+ fi
+ if test "x$localedir" = x; then
+ AC_SUBST([localedir], ['${datarootdir}/locale'])
+ fi
+ dnl Added in autoconf 2.70
+ if test "x$runstatedir" = x; then
+ AC_SUBST([runstatedir], ['${localstatedir}/run'])
+ fi
+
+ dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
+ dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
+ AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
+])
diff --git a/m4/ctype.m4 b/m4/ctype.m4
new file mode 100644
index 0000000..a2165aa
--- /dev/null
+++ b/m4/ctype.m4
@@ -0,0 +1,32 @@
+# ctype_h.m4 serial 6
+dnl Copyright (C) 2009-2016 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_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])
+])
+
+AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_CTYPE_H_DEFAULTS],
+[
+ GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK])
+])
diff --git a/m4/dirname.m4 b/m4/dirname.m4
new file mode 100644
index 0000000..6f8bec3
--- /dev/null
+++ b/m4/dirname.m4
@@ -0,0 +1,19 @@
+#serial 10 -*- autoconf -*-
+dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_DIRNAME],
+[
+ AC_REQUIRE([gl_DIRNAME_LGPL])
+])
+
+AC_DEFUN([gl_DIRNAME_LGPL],
+[
+ dnl Prerequisites of lib/dirname.h.
+ AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
+
+ dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
+ dnl lib/stripslash.c.
+])
diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4
new file mode 100644
index 0000000..dfd3921
--- /dev/null
+++ b/m4/double-slash-root.m4
@@ -0,0 +1,38 @@
+# double-slash-root.m4 serial 4 -*- Autoconf -*-
+dnl Copyright (C) 2006, 2008-2016 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/m4/dup2.m4 b/m4/dup2.m4
new file mode 100644
index 0000000..5b68312
--- /dev/null
+++ b/m4/dup2.m4
@@ -0,0 +1,117 @@
+#serial 25
+dnl Copyright (C) 2002, 2005, 2007, 2009-2016 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])
+ m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
+ AC_CHECK_FUNCS_ONCE([dup2])
+ if test $ac_cv_func_dup2 = no; then
+ HAVE_DUP2=0
+ fi
+ ], [
+ AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
+ ])
+ if test $HAVE_DUP2 = 1; then
+ 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>
+ #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
+ fi
+ 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
+ if test $HAVE_DUP2 = 1; then
+ REPLACE_DUP2=1
+ fi
+ fi
+ ])
+])
+
+# Prerequisites of lib/dup2.c.
+AC_DEFUN([gl_PREREQ_DUP2], [])
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
new file mode 100644
index 0000000..63d74de
--- /dev/null
+++ b/m4/eealloc.m4
@@ -0,0 +1,31 @@
+# eealloc.m4 serial 3
+dnl Copyright (C) 2003, 2009-2016 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/m4/environ.m4 b/m4/environ.m4
new file mode 100644
index 0000000..9a0ea7e
--- /dev/null
+++ b/m4/environ.m4
@@ -0,0 +1,47 @@
+# environ.m4 serial 6
+dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_ENVIRON],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ dnl Persuade glibc <unistd.h> to declare environ.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ gt_CHECK_VAR_DECL(
+ [#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
+ ],
+ [environ])
+ if test $gt_cv_var_environ_declaration != yes; then
+ HAVE_DECL_ENVIRON=0
+ fi
+])
+
+# Check if a variable is properly declared.
+# gt_CHECK_VAR_DECL(includes,variable)
+AC_DEFUN([gt_CHECK_VAR_DECL],
+[
+ define([gt_cv_var], [gt_cv_var_]$2[_declaration])
+ AC_MSG_CHECKING([if $2 is properly declared])
+ AC_CACHE_VAL([gt_cv_var], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1
+ extern struct { int foo; } $2;]],
+ [[$2.foo = 1;]])],
+ [gt_cv_var=no],
+ [gt_cv_var=yes])])
+ AC_MSG_RESULT([$gt_cv_var])
+ if test $gt_cv_var = yes; then
+ AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
+ [Define if you have the declaration of $2.])
+ fi
+ undefine([gt_cv_var])
+])
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
new file mode 100644
index 0000000..b111fce
--- /dev/null
+++ b/m4/errno_h.m4
@@ -0,0 +1,137 @@
+# errno_h.m4 serial 12
+dnl Copyright (C) 2004, 2006, 2008-2016 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_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
+ ERRNO_H=''
+ else
+ gl_NEXT_HEADERS([errno.h])
+ ERRNO_H='errno.h'
+ fi
+ AC_SUBST([ERRNO_H])
+ AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
+ 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 test -n "$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
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/m4/error.m4 b/m4/error.m4
new file mode 100644
index 0000000..f772bcf
--- /dev/null
+++ b/m4/error.m4
@@ -0,0 +1,27 @@
+#serial 14
+
+# Copyright (C) 1996-1998, 2001-2004, 2009-2016 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_ERROR],
+[
+ dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+ dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
+ AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <error.h>]],
+ [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
+])
+
+# Prerequisites of lib/error.c.
+AC_DEFUN([gl_PREREQ_ERROR],
+[
+ AC_REQUIRE([AC_FUNC_STRERROR_R])
+ :
+])
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
new file mode 100644
index 0000000..7869a7d
--- /dev/null
+++ b/m4/exponentd.m4
@@ -0,0 +1,116 @@
+# exponentd.m4 serial 3
+dnl Copyright (C) 2007-2008, 2010-2016 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/m4/extensions.m4 b/m4/extensions.m4
new file mode 100644
index 0000000..6d378ec
--- /dev/null
+++ b/m4/extensions.m4
@@ -0,0 +1,143 @@
+# serial 13 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2016 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.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.70 or later 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.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+#
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for 'stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ AC_DEFINE([_NETBSD_SOURCE], [1],
+ [Define to 1 to make NetBSD features available. MINIX 3 needs this.])
+ fi
+
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+ AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on OS X. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ 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])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_DARWIN_C_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([__USE_MINGW_ANSI_STDIO])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ 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])])])
+ 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],
+[
+ dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
+ dnl gnulib does not need it. But if it gets required by third-party macros
+ dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
+ dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
+ dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
new file mode 100644
index 0000000..1e578f3
--- /dev/null
+++ b/m4/extern-inline.m4
@@ -0,0 +1,102 @@
+dnl 'extern inline' a la ISO C99.
+
+dnl Copyright 2012-2016 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],
+[
+ AH_VERBATIM([extern_inline],
+[/* 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
+ <http://lists.gnu.org/archive/html/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 Sun C 5.12 SunOS_i386 2011/11/16.
+
+ 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. This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ http://lists.gnu.org/archive/html/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 <http://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar. */
+#if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined __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 static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#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/m4/fcntl-o.m4 b/m4/fcntl-o.m4
new file mode 100644
index 0000000..24fcf88
--- /dev/null
+++ b/m4/fcntl-o.m4
@@ -0,0 +1,134 @@
+# fcntl-o.m4 serial 4
+dnl Copyright (C) 2006, 2009-2016 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.
+
+# 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.
+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+ dnl AC_GNU_SOURCE.
+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+ [AC_REQUIRE([AC_GNU_SOURCE])])
+
+ 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>
+ #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],
+ [gl_cv_header_working_fcntl_h=cross-compiling])])
+
+ 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/m4/fcntl.m4 b/m4/fcntl.m4
new file mode 100644
index 0000000..bb61470
--- /dev/null
+++ b/m4/fcntl.m4
@@ -0,0 +1,126 @@
+# fcntl.m4 serial 9
+dnl Copyright (C) 2009-2016 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>
+ #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
+ AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
+ [gl_cv_func_fcntl_f_dupfd_cloexec],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <fcntl.h>
+#ifndef F_DUPFD_CLOEXEC
+choke me
+#endif
+ ]])],
+ [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])])
+ if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
+ gl_REPLACE_FCNTL
+ dnl No witness macro needed for this bug.
+ fi
+ 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/m4/fcntl_h.m4 b/m4/fcntl_h.m4
new file mode 100644
index 0000000..ef0d78d
--- /dev/null
+++ b/m4/fcntl_h.m4
@@ -0,0 +1,50 @@
+# serial 15
+# Configure fcntl.h.
+dnl Copyright (C) 2006-2007, 2009-2016 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_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])
+])
+
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_FCNTL_H_DEFAULTS],
+[
+ GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
+ GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING])
+ GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
+ GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
+ 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_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+])
diff --git a/m4/fdopen.m4 b/m4/fdopen.m4
new file mode 100644
index 0000000..685a1bb
--- /dev/null
+++ b/m4/fdopen.m4
@@ -0,0 +1,47 @@
+# fdopen.m4 serial 3
+dnl Copyright (C) 2011-2016 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_FDOPEN],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_FDOPEN=1
+ else
+ dnl Test whether fdopen() sets errno when it fails due to a bad fd argument.
+ AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <errno.h>
+int
+main (void)
+{
+ FILE *fp;
+ errno = 0;
+ fp = fdopen (-1, "r");
+ if (fp == NULL && errno == 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_fdopen_works=yes],
+ [gl_cv_func_fdopen_works=no],
+ [case "$host_os" in
+ mingw*) gl_cv_func_fdopen_works="guessing no" ;;
+ *) gl_cv_func_fdopen_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fdopen_works" in
+ *no) REPLACE_FDOPEN=1 ;;
+ esac
+ fi
+])
+
+dnl Prerequisites of lib/fdopen.c.
+AC_DEFUN([gl_PREREQ_FDOPEN], [])
diff --git a/m4/filenamecat.m4 b/m4/filenamecat.m4
new file mode 100644
index 0000000..b794880
--- /dev/null
+++ b/m4/filenamecat.m4
@@ -0,0 +1,16 @@
+# filenamecat.m4 serial 11
+dnl Copyright (C) 2002-2006, 2009-2016 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/m4/flexmember.m4 b/m4/flexmember.m4
new file mode 100644
index 0000000..baa9ff8
--- /dev/null
+++ b/m4/flexmember.m4
@@ -0,0 +1,41 @@
+# serial 3
+# Check for flexible array member support.
+
+# Copyright (C) 2006, 2009-2016 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 s { int n; double d[]; };]],
+ [[int m = getchar ();
+ struct s *p = malloc (offsetof (struct s, d)
+ + m * sizeof (double));
+ 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; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
+ can be used with pre-C99 compilers.
+ When computing the size of such an object, don't use 'sizeof (struct s)'
+ as it overestimates the size. Use 'offsetof (struct s, d)' instead.
+ Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
+ MSVC and with C++ compilers.])
+ else
+ AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
+ fi
+])
diff --git a/m4/float_h.m4 b/m4/float_h.m4
new file mode 100644
index 0000000..e2887eb
--- /dev/null
+++ b/m4/float_h.m4
@@ -0,0 +1,98 @@
+# float_h.m4 serial 9
+dnl Copyright (C) 2007, 2009-2016 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])
+ FLOAT_H=
+ REPLACE_FLOAT_LDBL=0
+ case "$host_os" in
+ aix* | beos* | openbsd* | mirbsd* | irix*)
+ FLOAT_H=float.h
+ ;;
+ freebsd*)
+ case "$host_cpu" in
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ FLOAT_H=float.h
+ ;;
+ x86_64 )
+ # On x86_64 systems, the C compiler may still be generating
+ # 32-bit code.
+ AC_EGREP_CPP([yes],
+ [#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ yes
+ #endif],
+ [],
+ [FLOAT_H=float.h])
+ ;;
+ esac
+ ;;
+ linux*)
+ case "$host_cpu" in
+ powerpc*)
+ FLOAT_H=float.h
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_os" in
+ aix* | freebsd* | linux*)
+ if test -n "$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_EGREP_CPP([yes],
+ [#if defined __LP64__ || defined __arch64__
+ yes
+ #endif],
+ [gl_cv_func_itold_works="guessing no"],
+ [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.
+ FLOAT_H=float.h
+ ;;
+ esac
+
+ if test -n "$FLOAT_H"; then
+ gl_NEXT_HEADERS([float.h])
+ fi
+ AC_SUBST([FLOAT_H])
+ AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
+ AC_SUBST([REPLACE_ITOLD])
+])
diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4
new file mode 100644
index 0000000..b38f56c
--- /dev/null
+++ b/m4/fnmatch.m4
@@ -0,0 +1,156 @@
+# Check for fnmatch - serial 9. -*- coding: utf-8 -*-
+
+# Copyright (C) 2000-2007, 2009-2016 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])
+
+ 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])
+
+ FNMATCH_H=
+ gl_fnmatch_required_lowercase=`
+ echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]'
+ `
+ 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"],
+ [eval "$gl_fnmatch_cache_var=\"guessing no\""])
+ ])
+ eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
+ if test "$gl_fnmatch_result" = yes; then
+ dnl Not strictly necessary. Only to avoid spurious leftover files if people
+ dnl don't do "make distclean".
+ rm -f "$gl_source_base/fnmatch.h"
+ else
+ FNMATCH_H=fnmatch.h
+ fi
+ AC_SUBST([FNMATCH_H])
+ AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"])
+])
+
+# 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 We must choose a different name for our function, since on ELF systems
+ dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
+ dnl compiled into a shared library.
+ AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch],
+ [Define to a replacement function name for fnmatch().])
+ dnl Prerequisites of lib/fnmatch.c.
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
+ AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
+ AC_CHECK_HEADERS_ONCE([wctype.h])
+])
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
new file mode 100644
index 0000000..e11ac9f
--- /dev/null
+++ b/m4/fpieee.m4
@@ -0,0 +1,54 @@
+# fpieee.m4 serial 2 -*- coding: utf-8 -*-
+dnl Copyright (C) 2007, 2009-2016 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 IEEE 754 standardized three items:
+dnl - The formats of single-float and double-float - nowadays commonly
+dnl available as 'float' and 'double' in C and C++.
+dnl No autoconf test needed.
+dnl - The overflow and division by zero behaviour: The result are values
+dnl '±Inf' and 'NaN', rather than exceptions as it was before.
+dnl This file provides an autoconf macro for ensuring this behaviour of
+dnl floating-point operations.
+dnl - A set of conditions (overflow, underflow, inexact, etc.) which can
+dnl be configured to trigger an exception.
+dnl This cannot be done in a portable way: it depends on the compiler,
+dnl libc, kernel, and CPU. No autoconf macro is provided for this.
+
+dnl Ensure non-trapping behaviour of floating-point overflow and
+dnl floating-point division by zero.
+dnl (For integer overflow, see gcc's -ftrapv option; for integer division by
+dnl zero, see the autoconf macro in intdiv0.m4.)
+
+AC_DEFUN([gl_FP_IEEE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ # IEEE behaviour is the default on all CPUs except Alpha and SH
+ # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
+ # and the GCC 4.1.2 manual).
+ case "$host_cpu" in
+ alpha*)
+ # On Alpha systems, a compiler option provides the behaviour.
+ # See the ieee(3) manual page, also available at
+ # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
+ if test -n "$GCC"; then
+ # GCC has the option -mieee.
+ # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
+ CPPFLAGS="$CPPFLAGS -mieee"
+ else
+ # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+ # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
+ CPPFLAGS="$CPPFLAGS -ieee"
+ fi
+ ;;
+ sh*)
+ if test -n "$GCC"; then
+ # GCC has the option -mieee.
+ CPPFLAGS="$CPPFLAGS -mieee"
+ fi
+ ;;
+ esac
+])
diff --git a/m4/freopen.m4 b/m4/freopen.m4
new file mode 100644
index 0000000..8d8e124
--- /dev/null
+++ b/m4/freopen.m4
@@ -0,0 +1,19 @@
+# freopen.m4 serial 5
+dnl Copyright (C) 2007-2016 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_FREOPEN],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw* | pw* | os2*)
+ REPLACE_FREOPEN=1
+ ;;
+ esac
+])
+
+# Prerequisites of lib/freopen.c.
+AC_DEFUN([gl_PREREQ_FREOPEN], [:])
diff --git a/m4/fstat.m4 b/m4/fstat.m4
new file mode 100644
index 0000000..29f9b81
--- /dev/null
+++ b/m4/fstat.m4
@@ -0,0 +1,36 @@
+# fstat.m4 serial 4
+dnl Copyright (C) 2011-2016 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([gl_SYS_STAT_H_DEFAULTS])
+
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_FSTAT=1
+ fi
+
+ AC_REQUIRE([gl_HEADER_SYS_STAT_H])
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+ REPLACE_FSTAT=1
+ fi
+
+ 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.
+AC_DEFUN([gl_PREREQ_FSTAT], [:])
diff --git a/m4/ftruncate.m4 b/m4/ftruncate.m4
new file mode 100644
index 0000000..b62414c
--- /dev/null
+++ b/m4/ftruncate.m4
@@ -0,0 +1,40 @@
+# serial 20
+
+# See if we need to emulate a missing ftruncate function using chsize.
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2016 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_FTRUNCATE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([ftruncate])
+ if test $ac_cv_func_ftruncate = yes; then
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ dnl Native Windows, and Large File Support is requested.
+ dnl The MSVCRT _chsize() function only accepts a 32-bit file size,
+ dnl and the mingw64 ftruncate64() function is unreliable (it may
+ dnl delete the file, see
+ dnl <http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
+ dnl Use gnulib's ftruncate() implementation instead.
+ REPLACE_FTRUNCATE=1
+ ;;
+ esac
+ ], [
+ :
+ ])
+ else
+ HAVE_FTRUNCATE=0
+ fi
+])
+
+# Prerequisites of lib/ftruncate.c.
+AC_DEFUN([gl_PREREQ_FTRUNCATE],
+[
+ AC_CHECK_FUNCS([chsize])
+])
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
new file mode 100644
index 0000000..566c3c1
--- /dev/null
+++ b/m4/getcwd.m4
@@ -0,0 +1,162 @@
+# getcwd.m4 - check for working getcwd that is compatible with glibc
+
+# Copyright (C) 2001, 2003-2007, 2009-2016 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 13
+
+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
+# ifndef getcwd
+ char *getcwd ();
+# endif
+]], [[
+#if (defined _WIN32 || 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] != '/')
+ return 3;
+ if (f[1] != '\0')
+ 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*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_getcwd_null="guessing no";;
+ 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>]],
+ [[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/m4/getdtablesize.m4 b/m4/getdtablesize.m4
new file mode 100644
index 0000000..1bf4db0
--- /dev/null
+++ b/m4/getdtablesize.m4
@@ -0,0 +1,46 @@
+# getdtablesize.m4 serial 6
+dnl Copyright (C) 2008-2016 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
+ # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
+ # up to an unchangeable hard limit; all other platforms correctly
+ # require setrlimit before getdtablesize() can report a larger value.
+ AC_CACHE_CHECK([whether getdtablesize works],
+ [gl_cv_func_getdtablesize_works],
+ [AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([[#include <unistd.h>]],
+ [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])
+ ])
+ case "$gl_cv_func_getdtablesize_works" in
+ *yes) ;;
+ *) REPLACE_GETDTABLESIZE=1 ;;
+ esac
+ else
+ HAVE_GETDTABLESIZE=0
+ fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/m4/getopt.m4 b/m4/getopt.m4
new file mode 100644
index 0000000..ce6ec67
--- /dev/null
+++ b/m4/getopt.m4
@@ -0,0 +1,368 @@
+# getopt.m4 serial 44
+dnl Copyright (C) 2002-2006, 2008-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Request a POSIX compliant getopt function.
+AC_DEFUN([gl_FUNC_GETOPT_POSIX],
+[
+ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+ dnl Other modules can request the gnulib implementation of the getopt
+ dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+ dnl argp.m4 does this.
+ m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+ REPLACE_GETOPT=1
+ ], [
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+ ])
+ if test $REPLACE_GETOPT = 1; then
+ dnl Arrange for getopt.h to be created.
+ gl_GETOPT_SUBSTITUTE_HEADER
+ fi
+])
+
+# Request a POSIX compliant getopt function with GNU extensions (such as
+# options with optional arguments) and the functions getopt_long,
+# getopt_long_only.
+AC_DEFUN([gl_FUNC_GETOPT_GNU],
+[
+ m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
+
+ AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
+])
+
+# Determine whether to replace the entire getopt facility.
+AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
+
+ dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ gl_CHECK_NEXT_HEADERS([getopt.h])
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+ AC_SUBST([HAVE_GETOPT_H])
+
+ gl_replace_getopt=
+
+ dnl Test whether <getopt.h> is available.
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
+ fi
+
+ dnl Test whether the function getopt_long is available.
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
+ fi
+
+ dnl POSIX 2008 does not specify leading '+' behavior, but see
+ dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
+ dnl the next version of POSIX. For now, we only guarantee leading '+'
+ dnl behavior with getopt-gnu.
+ if test -z "$gl_replace_getopt"; then
+ AC_CACHE_CHECK([whether getopt is POSIX compatible],
+ [gl_cv_func_getopt_posix],
+ [
+ dnl Merging these three different test programs into a single one
+ dnl would require a reset mechanism. On BSD systems, it can be done
+ dnl through 'optreset'; on some others (glibc), it can be done by
+ dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+ dnl Solaris 9, musl libc), there is no such mechanism.
+ if test $cross_compiling = no; then
+ dnl Sanity check. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
+ int c;
+
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
+ if (!(c == -1))
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
+
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
+ if (!(strcmp (argv[6], "bar") == 0))
+ return 11;
+ if (!(optind == 1))
+ return 12;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
+ if (getopt (2, argv, "ab:") != 'a')
+ return 13;
+ if (getopt (2, argv, "ab:") != '?')
+ return 14;
+ if (optopt != 'b')
+ return 15;
+ if (optind != 2)
+ return 16;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=yes],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ else
+ case "$host_os" in
+ darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+ *) gl_cv_func_getopt_posix="guessing yes";;
+ esac
+ fi
+ ])
+ case "$gl_cv_func_getopt_posix" in
+ *no) gl_replace_getopt=yes ;;
+ esac
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
+ [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+ # optstring is necessary for programs like m4 that have POSIX-mandated
+ # semantics for supporting options interspersed with files.
+ # Also, since getopt_long is a GNU extension, we require optind=0.
+ # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+ # so take care to revert to the correct (non-)export state.
+dnl GNU Coding Standards currently allow awk but not env; besides, env
+dnl is ambiguous with environment values that contain newlines.
+ gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+ case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+ xx) gl_had_POSIXLY_CORRECT=exported ;;
+ x) gl_had_POSIXLY_CORRECT=yes ;;
+ *) gl_had_POSIXLY_CORRECT= ;;
+ esac
+ POSIXLY_CORRECT=1
+ export POSIXLY_CORRECT
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]GL_NOCRASH[
+ ]], [[
+ int result = 0;
+
+ nocrash_init();
+
+ /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+ and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+ OSF/1 5.1, Solaris 10. */
+ {
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
+ opterr = 0;
+ if (getopt (2, argv, "+a") != '?')
+ result |= 1;
+ }
+ /* This code succeeds on glibc 2.8, mingw,
+ and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+ IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
+ {
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
+
+ optind = 1;
+ if (getopt (4, argv, "p::") != 'p')
+ result |= 2;
+ else if (optarg != NULL)
+ result |= 4;
+ else if (getopt (4, argv, "p::") != -1)
+ result |= 6;
+ else if (optind != 2)
+ result |= 8;
+ }
+ /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
+ {
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
+ optind = 0;
+ if (getopt (3, argv, "-p") != 1)
+ result |= 16;
+ else if (getopt (3, argv, "-p") != 'p')
+ result |= 16;
+ }
+ /* This code fails on glibc 2.11. */
+ {
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
+ optind = opterr = 0;
+ if (getopt (3, argv, "+:a:b") != 'b')
+ result |= 32;
+ else if (getopt (3, argv, "+:a:b") != ':')
+ result |= 32;
+ }
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
+ result |= 64;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_getopt_gnu=yes],
+ [gl_cv_func_getopt_gnu=no],
+ [dnl Cross compiling. Assume the worst, even on glibc platforms.
+ gl_cv_func_getopt_gnu="guessing no"
+ ])
+ case $gl_had_POSIXLY_CORRECT in
+ exported) ;;
+ yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
+ *) AS_UNSET([POSIXLY_CORRECT]) ;;
+ esac
+ ])
+ if test "$gl_cv_func_getopt_gnu" != yes; then
+ gl_replace_getopt=yes
+ else
+ AC_CACHE_CHECK([for working GNU getopt_long function],
+ [gl_cv_func_getopt_long_gnu],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]],
+ [[static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_getopt_long_gnu=yes],
+ [gl_cv_func_getopt_long_gnu=no],
+ [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
+ fi
+ fi
+])
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+[
+ GETOPT_H=getopt.h
+ AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
+ [Define to rpl_ if the getopt replacement functions and variables
+ should be used.])
+ AC_SUBST([GETOPT_H])
+])
+
+# Prerequisites of lib/getopt*.
+AC_DEFUN([gl_PREREQ_GETOPT],
+[
+ AC_CHECK_DECLS_ONCE([getenv])
+])
diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4
new file mode 100644
index 0000000..8902b7b
--- /dev/null
+++ b/m4/getpagesize.m4
@@ -0,0 +1,32 @@
+# getpagesize.m4 serial 9
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2016 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])
+ AC_CHECK_FUNCS([getpagesize])
+ if test $ac_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])
+])
diff --git a/m4/gettext.m4 b/m4/gettext.m4
new file mode 100644
index 0000000..be247bf
--- /dev/null
+++ b/m4/gettext.m4
@@ -0,0 +1,401 @@
+# gettext.m4 serial 66 (gettext-0.18.2)
+dnl Copyright (C) 1995-2014 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/m4/gettime.m4 b/m4/gettime.m4
new file mode 100644
index 0000000..9843ed4
--- /dev/null
+++ b/m4/gettime.m4
@@ -0,0 +1,13 @@
+# gettime.m4 serial 8
+dnl Copyright (C) 2002, 2004-2006, 2009-2016 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([gettimeofday nanotime])
+])
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
new file mode 100644
index 0000000..4ae5d63
--- /dev/null
+++ b/m4/gettimeofday.m4
@@ -0,0 +1,138 @@
+# serial 21
+
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2016 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([AC_C_RESTRICT])
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([gettimeofday])
+
+ gl_gettimeofday_timezone=void
+ if test $ac_cv_func_gettimeofday != yes; then
+ HAVE_GETTIMEOFDAY=0
+ else
+ gl_FUNC_GETTIMEOFDAY_CLOBBER
+ 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
+ m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
+ gl_FUNC_TZSET_CLOBBER
+ case "$gl_cv_func_tzset_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+ AC_DEFINE([tzset], [rpl_tzset],
+ [Define to rpl_tzset if the wrapper function should be used.])
+ AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
+ [Define if tzset clobbers localtime's static buffer.])
+ ;;
+ 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.])
+])
+
+
+dnl See if gettimeofday clobbers the static buffer that localtime uses
+dnl for its return value. The gettimeofday function from Mac OS X 10.0.4
+dnl (i.e., Darwin 1.3.7) has this problem.
+dnl
+dnl If it does, then arrange to use gettimeofday and localtime only via
+dnl the wrapper functions that work around the problem.
+
+AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
+[
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
+ [gl_cv_func_gettimeofday_clobber],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdlib.h>
+ ]],
+ [[
+ time_t t = 0;
+ struct tm *lt;
+ struct tm saved_lt;
+ struct timeval tv;
+ lt = localtime (&t);
+ saved_lt = *lt;
+ gettimeofday (&tv, NULL);
+ return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
+ ]])],
+ [gl_cv_func_gettimeofday_clobber=no],
+ [gl_cv_func_gettimeofday_clobber=yes],
+ [# When cross-compiling:
+ case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+ ])])
+
+ case "$gl_cv_func_gettimeofday_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+ AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
+ [Define if gettimeofday clobbers the localtime buffer.])
+ ;;
+ esac
+])
+
+AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
+ REPLACE_GMTIME=1
+ REPLACE_LOCALTIME=1
+])
+
+# Prerequisites of lib/gettimeofday.c.
+AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
+ AC_CHECK_HEADERS([sys/timeb.h])
+ AC_CHECK_FUNCS([_ftime])
+])
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644
index 0000000..dafebf5
--- /dev/null
+++ b/m4/glibc21.m4
@@ -0,0 +1,34 @@
+# glibc21.m4 serial 5
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2016 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.1 or newer, or uClibc.
+# From Bruno Haible.
+
+AC_DEFUN([gl_GLIBC21],
+ [
+ AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
+ [ac_cv_gnu_library_2_1],
+ [AC_EGREP_CPP([Lucky],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
+ ],
+ [ac_cv_gnu_library_2_1=yes],
+ [ac_cv_gnu_library_2_1=no])
+ ]
+ )
+ AC_SUBST([GLIBC21])
+ GLIBC21="$ac_cv_gnu_library_2_1"
+ ]
+)
diff --git a/m4/gnu-make.m4 b/m4/gnu-make.m4
new file mode 100644
index 0000000..320c831
--- /dev/null
+++ b/m4/gnu-make.m4
@@ -0,0 +1,19 @@
+# Determine whether recent-enough GNU Make is being used.
+
+# Copyright (C) 2007, 2009-2016 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.
+
+# Set GNU_MAKE if we are using a recent-enough version of GNU make.
+
+# Use --version AND trailing junk, because SGI Make doesn't fail on --version.
+
+AC_DEFUN([gl_GNU_MAKE],
+[
+ AM_CONDITIONAL([GNU_MAKE],
+ [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1])
+])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
new file mode 100644
index 0000000..f8454c8
--- /dev/null
+++ b/m4/gnulib-common.m4
@@ -0,0 +1,462 @@
+# gnulib-common.m4 serial 36
+dnl Copyright (C) 2007-2016 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_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_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of C11. */
+#if ! (defined _Noreturn \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+# 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([unused_parameter],
+[/* Define as a marker that can be attached to declarations that might not
+ be used. This helps to reduce warnings, such as from
+ GCC -Wunused-parameter. */
+#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_UNUSED
+#endif
+/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+ is a misnomer outside of parameter lists. */
+#define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* gcc supports the "unused" attribute on possibly unused labels, and
+ g++ has since version 4.5. Note to support C++ as well as C,
+ _GL_UNUSED_LABEL should be used with a trailing ; */
+#if !defined __cplusplus || __GNUC__ > 4 \
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
+])
+ 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_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(
+ [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])
+])
+
+# m4_foreach_w
+# is a backport of autoconf-2.59c's m4_foreach_w.
+# Remove this macro when we can assume autoconf >= 2.60.
+m4_ifndef([m4_foreach_w],
+ [m4_define([m4_foreach_w],
+ [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
+
+# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
+# ----------------------------------------------------
+# Backport of autoconf-2.63b's macro.
+# Remove this macro when we can assume autoconf >= 2.64.
+m4_ifndef([AS_VAR_IF],
+[m4_define([AS_VAR_IF],
+[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+
+# gl_PROG_CC_C99
+# Modifies the value of the shell variable CC in an attempt to make $CC
+# understand ISO C99 source code.
+# This is like AC_PROG_CC_C99, except that
+# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
+# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
+# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
+# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
+# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
+# Remaining problems:
+# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
+# to CC twice
+# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
+# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
+AC_DEFUN([gl_PROG_CC_C99],
+[
+ dnl Change that version number to the minimum Autoconf version that supports
+ dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
+ m4_version_prereq([9.0],
+ [AC_REQUIRE([AC_PROG_CC_C99])],
+ [AC_REQUIRE([AC_PROG_CC_STDC])])
+])
+
+# 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])
+ AC_BEFORE([$0], [AM_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).
+ m4_ifdef([AM_PROG_AR], [AM_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_PROG_MKDIR_P
+# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
+# for interoperability with automake-1.9.6 from autoconf-2.62.
+# Remove this macro when we can assume autoconf >= 2.62 or
+# autoconf >= 2.60 && automake >= 1.10.
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
+m4_ifdef([AC_PROG_MKDIR_P], [
+ dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
+ m4_define([AC_PROG_MKDIR_P],
+ m4_defn([AC_PROG_MKDIR_P])[
+ AC_SUBST([MKDIR_P])])], [
+ dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
+ AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
+ [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+ MKDIR_P='$(mkdir_p)'
+ AC_SUBST([MKDIR_P])])])
+])
+
+# AC_C_RESTRICT
+# This definition is copied from post-2.69 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed
+# once autoconf >= 2.70 can be assumed. It's painful to check version
+# numbers, and in practice this macro is more up-to-date than Autoconf
+# is, so override Autoconf unconditionally.
+AC_DEFUN([AC_C_RESTRICT],
+[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
+ [ac_cv_c_restrict=no
+ # The order here caters to the fact that C++ does not require restrict.
+ 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 directly. */
+#undef restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !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
+])
+
+# 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],
+[
+ saved_as_echo_n="$as_echo_n"
+ as_echo_n=':'
+ AC_CACHE_VAL([$1], [$2])
+ as_echo_n="$saved_as_echo_n"
+])
+
+# AS_VAR_COPY was added in autoconf 2.63b
+m4_define_default([AS_VAR_COPY],
+[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
+
+# AC_PROG_SED was added in autoconf 2.59b
+m4_ifndef([AC_PROG_SED],
+[AC_DEFUN([AC_PROG_SED],
+[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
+ [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
+ dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ AS_UNSET([ac_script])
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ _AS_PATH_WALK([], [
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
+ case `"$ac_path_SED" --version 2>&1` in
+ *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
+ *)
+ ac_count=0
+ _AS_ECHO_N([0123456789]) >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >> conftest.nl
+ "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best so far, but keep looking for better
+ ac_cv_path_SED=$ac_path_SED
+ ac_path_SED_max=$ac_count
+ fi
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+ esac
+ $ac_path_SED_found && break 3
+ done
+ done])
+ if test -z "$ac_cv_path_SED"; then
+ AC_ERROR([no acceptable sed could be found in \$PATH])
+ fi
+ else
+ ac_cv_path_SED=$SED
+ fi
+ SED="$ac_cv_path_SED"
+ AC_SUBST([SED])dnl
+ rm -f conftest.sed
+])])])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
new file mode 100644
index 0000000..ee8ab85
--- /dev/null
+++ b/m4/gnulib-comp.m4
@@ -0,0 +1,1985 @@
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Copyright (C) 2002-2016 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 <http://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])
+
+ AC_REQUIRE([AM_PROG_CC_C_O])
+ # Code from module absolute-header:
+ # Code from module accept:
+ # Code from module accept-tests:
+ # Code from module alloca:
+ # Code from module alloca-opt:
+ # Code from module alloca-opt-tests:
+ # Code from module allocator:
+ # Code from module announce-gen:
+ # Code from module areadlink:
+ # Code from module areadlink-tests:
+ # Code from module argmatch:
+ # Code from module argmatch-tests:
+ # Code from module arpa_inet:
+ # Code from module arpa_inet-tests:
+ # Code from module assure:
+ # Code from module binary-io:
+ # Code from module binary-io-tests:
+ # Code from module bind:
+ # Code from module bind-tests:
+ # Code from module bitrotate:
+ # Code from module bitrotate-tests:
+ # Code from module btowc:
+ # Code from module btowc-tests:
+ # Code from module c-ctype:
+ # Code from module c-ctype-tests:
+ # Code from module c-stack:
+ # Code from module c-stack-tests:
+ # Code from module c-strcase:
+ # Code from module c-strcase-tests:
+ # Code from module c-strcaseeq:
+ # Code from module careadlinkat:
+ # Code from module clock-time:
+ # Code from module close:
+ # Code from module close-tests:
+ # Code from module config-h:
+ # Code from module configmake:
+ # Code from module connect:
+ # Code from module connect-tests:
+ # Code from module ctype:
+ # Code from module ctype-tests:
+ # Code from module diffseq:
+ # Code from module dirname:
+ # Code from module dirname-lgpl:
+ # Code from module dirname-tests:
+ # Code from module do-release-commit-and-tag:
+ # Code from module dosname:
+ # Code from module double-slash-root:
+ # Code from module dtotimespec:
+ # Code from module dup2:
+ # Code from module dup2-tests:
+ # Code from module environ:
+ # Code from module environ-tests:
+ # Code from module errno:
+ # Code from module errno-tests:
+ # Code from module error:
+ # Code from module exclude:
+ # Code from module exclude-tests:
+ # Code from module exitfail:
+ # Code from module extensions:
+ # Code from module extern-inline:
+ # Code from module fcntl:
+ # Code from module fcntl-h:
+ # Code from module fcntl-h-tests:
+ # Code from module fcntl-tests:
+ # Code from module fd-hook:
+ # Code from module fdl:
+ # Code from module fdopen:
+ # Code from module fdopen-tests:
+ # Code from module fgetc-tests:
+ # Code from module file-type:
+ # Code from module filename:
+ # Code from module filenamecat:
+ # Code from module filenamecat-lgpl:
+ # Code from module filenamecat-tests:
+ # Code from module flexmember:
+ # Code from module float:
+ # Code from module float-tests:
+ # Code from module fnmatch:
+ # Code from module fnmatch-gnu:
+ # Code from module fnmatch-tests:
+ # Code from module fpieee:
+ AC_REQUIRE([gl_FP_IEEE])
+ # Code from module fpucw:
+ # Code from module fputc-tests:
+ # Code from module fread-tests:
+ # Code from module freopen:
+ # Code from module freopen-safer:
+ # Code from module freopen-safer-tests:
+ # Code from module freopen-tests:
+ # Code from module fstat:
+ # Code from module fstat-tests:
+ # Code from module ftruncate:
+ # Code from module ftruncate-tests:
+ # Code from module fwrite-tests:
+ # Code from module gendocs:
+ # Code from module getcwd-lgpl:
+ # Code from module getcwd-lgpl-tests:
+ # Code from module getdtablesize:
+ # Code from module getdtablesize-tests:
+ # Code from module getopt:
+ # Code from module getopt-gnu:
+ # Code from module getopt-posix:
+ # Code from module getopt-posix-tests:
+ # Code from module getpagesize:
+ # Code from module gettext-h:
+ # Code from module gettime:
+ # Code from module gettimeofday:
+ # Code from module gettimeofday-tests:
+ # Code from module git-version-gen:
+ # Code from module gitlog-to-changelog:
+ # Code from module gnu-make:
+ # Code from module gnu-web-doc-update:
+ # Code from module gnumakefile:
+ # Code from module gnupload:
+ # Code from module gperf:
+ # Code from module hard-locale:
+ # Code from module hash:
+ # Code from module hash-pjw:
+ # Code from module hash-tests:
+ # Code from module havelib:
+ # Code from module iconv:
+ # Code from module iconv-h:
+ # Code from module iconv-h-tests:
+ # Code from module iconv-tests:
+ # Code from module iconv_open:
+ # Code from module ignore-value:
+ # Code from module ignore-value-tests:
+ # Code from module include_next:
+ # Code from module inet_pton:
+ # Code from module inet_pton-tests:
+ # Code from module inline:
+ # Code from module intprops:
+ # Code from module intprops-tests:
+ # Code from module inttostr:
+ # Code from module inttostr-tests:
+ # Code from module inttypes:
+ # Code from module inttypes-incomplete:
+ # Code from module inttypes-tests:
+ # Code from module ioctl:
+ # Code from module ioctl-tests:
+ # Code from module isblank:
+ # Code from module isblank-tests:
+ # Code from module iswblank:
+ # Code from module iswblank-tests:
+ # Code from module langinfo:
+ # Code from module langinfo-tests:
+ # Code from module largefile:
+ AC_REQUIRE([AC_SYS_LARGEFILE])
+ # Code from module libsigsegv:
+ # Code from module listen:
+ # Code from module listen-tests:
+ # Code from module localcharset:
+ # Code from module locale:
+ # Code from module locale-tests:
+ # Code from module localeconv:
+ # Code from module localeconv-tests:
+ # Code from module lstat:
+ # Code from module lstat-tests:
+ # Code from module maintainer-makefile:
+ # Code from module malloc-posix:
+ # Code from module malloca:
+ # Code from module malloca-tests:
+ # Code from module manywarnings:
+ # Code from module mbchar:
+ # Code from module mbiter:
+ # Code from module mbrtowc:
+ # Code from module mbrtowc-tests:
+ # Code from module mbscasecmp:
+ # Code from module mbscasecmp-tests:
+ # Code from module mbsinit:
+ # Code from module mbsinit-tests:
+ # Code from module mbslen:
+ # Code from module mbsrtowcs:
+ # Code from module mbsrtowcs-tests:
+ # Code from module mbsstr:
+ # Code from module mbsstr-tests:
+ # Code from module mbtowc:
+ # Code from module mbuiter:
+ # Code from module memchr:
+ # Code from module memchr-tests:
+ # Code from module mkstemp:
+ # Code from module mktime:
+ # Code from module mktime-internal:
+ # Code from module msvc-inval:
+ # Code from module msvc-nothrow:
+ # Code from module multiarch:
+ # Code from module nanosleep:
+ # Code from module nanosleep-tests:
+ # Code from module netinet_in:
+ # Code from module netinet_in-tests:
+ # Code from module nl_langinfo:
+ # Code from module nl_langinfo-tests:
+ # Code from module nocrash:
+ # Code from module open:
+ # Code from module open-tests:
+ # Code from module pathmax:
+ # Code from module pathmax-tests:
+ # Code from module perror:
+ # Code from module perror-tests:
+ # Code from module pipe-posix:
+ # Code from module pipe-posix-tests:
+ # Code from module progname:
+ # Code from module propername:
+ # Code from module putenv:
+ # Code from module quote:
+ # Code from module quotearg:
+ # Code from module quotearg-simple:
+ # Code from module quotearg-simple-tests:
+ # Code from module raise:
+ # Code from module raise-tests:
+ # Code from module rawmemchr:
+ # Code from module rawmemchr-tests:
+ # Code from module readlink:
+ # Code from module readlink-tests:
+ # Code from module readme-release:
+ # Code from module regex:
+ # Code from module regex-tests:
+ # Code from module same-inode:
+ # Code from module secure_getenv:
+ # Code from module select:
+ # Code from module select-tests:
+ # Code from module setenv:
+ # Code from module setenv-tests:
+ # Code from module setlocale:
+ # Code from module setlocale-tests:
+ # Code from module setsockopt:
+ # Code from module setsockopt-tests:
+ # Code from module sh-quote:
+ # Code from module sh-quote-tests:
+ # Code from module sigaction:
+ # Code from module sigaction-tests:
+ # Code from module signal:
+ # Code from module signal-h:
+ # Code from module signal-h-tests:
+ # Code from module sigprocmask:
+ # Code from module sigprocmask-tests:
+ # Code from module size_max:
+ # Code from module sleep:
+ # Code from module sleep-tests:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/unused-parameter:
+ # Code from module snippet/warn-on-use:
+ # Code from module snprintf:
+ # Code from module snprintf-tests:
+ # Code from module socket:
+ # Code from module socketlib:
+ # Code from module sockets:
+ # Code from module sockets-tests:
+ # Code from module socklen:
+ # Code from module ssize_t:
+ # Code from module stat:
+ # Code from module stat-macros:
+ # Code from module stat-tests:
+ # Code from module stat-time:
+ # Code from module stat-time-tests:
+ # Code from module stdalign:
+ # Code from module stdalign-tests:
+ # Code from module stdarg:
+ dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
+ dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
+ dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99
+ dnl shouldn't hurt, though installers are on their own to set c99 mode.
+ gl_PROG_CC_C99
+ # Code from module stdbool:
+ # Code from module stdbool-tests:
+ # Code from module stddef:
+ # Code from module stddef-tests:
+ # Code from module stdint:
+ # Code from module stdint-tests:
+ # Code from module stdio:
+ # Code from module stdio-tests:
+ # Code from module stdlib:
+ # Code from module stdlib-tests:
+ # Code from module strcase:
+ # Code from module streq:
+ # Code from module strerror:
+ # Code from module strerror-override:
+ # Code from module strerror-tests:
+ # Code from module strerror_r-posix:
+ # Code from module strerror_r-posix-tests:
+ # Code from module strftime:
+ # Code from module strftime-tests:
+ # Code from module striconv:
+ # Code from module striconv-tests:
+ # Code from module string:
+ # Code from module string-tests:
+ # Code from module strings:
+ # Code from module strings-tests:
+ # Code from module strndup:
+ # Code from module strnlen:
+ # Code from module strnlen-tests:
+ # Code from module strnlen1:
+ # Code from module strptime:
+ # Code from module strtoull:
+ # Code from module strtoull-tests:
+ # Code from module strtoumax:
+ # Code from module strtoumax-tests:
+ # Code from module symlink:
+ # Code from module symlink-tests:
+ # Code from module sys_ioctl:
+ # Code from module sys_ioctl-tests:
+ # Code from module sys_select:
+ # Code from module sys_select-tests:
+ # Code from module sys_socket:
+ # Code from module sys_socket-tests:
+ # Code from module sys_stat:
+ # Code from module sys_stat-tests:
+ # Code from module sys_time:
+ # Code from module sys_time-tests:
+ # Code from module sys_types:
+ # Code from module sys_types-tests:
+ # Code from module sys_uio:
+ # Code from module sys_uio-tests:
+ # Code from module sys_wait:
+ # Code from module sys_wait-tests:
+ # Code from module system-quote:
+ # Code from module tempname:
+ # Code from module test-framework-sh:
+ # Code from module test-framework-sh-tests:
+ # Code from module time:
+ # Code from module time-tests:
+ # Code from module time_r:
+ # Code from module time_rz:
+ # Code from module timegm:
+ # Code from module timespec:
+ # Code from module timespec-add:
+ # Code from module timespec-sub:
+ # Code from module timespec-tests:
+ # Code from module trim:
+ # Code from module unistd:
+ # Code from module unistd-tests:
+ # Code from module unistr/base:
+ # Code from module unistr/u8-mbtoucr:
+ # Code from module unistr/u8-mbtoucr-tests:
+ # Code from module unistr/u8-uctomb:
+ # Code from module unistr/u8-uctomb-tests:
+ # Code from module unitypes:
+ # Code from module uniwidth/base:
+ # Code from module uniwidth/width:
+ # Code from module uniwidth/width-tests:
+ # Code from module unlocked-io:
+ # Code from module unsetenv:
+ # Code from module unsetenv-tests:
+ # Code from module update-copyright:
+ # Code from module update-copyright-tests:
+ # Code from module useless-if-before-free:
+ # Code from module vararrays:
+ # Code from module vasnprintf:
+ # Code from module vasnprintf-tests:
+ # Code from module vasprintf:
+ # Code from module vasprintf-tests:
+ # Code from module vc-list-files:
+ # Code from module vc-list-files-tests:
+ # Code from module verify:
+ # Code from module verify-tests:
+ # Code from module version-etc:
+ # Code from module version-etc-fsf:
+ # Code from module version-etc-tests:
+ # Code from module warnings:
+ # Code from module wchar:
+ # Code from module wchar-tests:
+ # Code from module wcrtomb:
+ # Code from module wcrtomb-tests:
+ # Code from module wctob:
+ # Code from module wctomb:
+ # Code from module wctype-h:
+ # Code from module wctype-h-tests:
+ # Code from module wcwidth:
+ # Code from module wcwidth-tests:
+ # Code from module xalloc:
+ # Code from module xalloc-die:
+ # Code from module xalloc-die-tests:
+ # Code from module xalloc-oversized:
+ # Code from module xfreopen:
+ # Code from module xreadlink:
+ # Code from module xsize:
+ # Code from module xstriconv:
+ # Code from module xstrndup:
+ # Code from module xstrtol:
+ # Code from module xstrtol-tests:
+ # Code from module xstrtoumax:
+ # Code from module xstrtoumax-tests:
+ # Code from module xvasprintf:
+ # Code from module xvasprintf-tests:
+])
+
+# This macro should be invoked from ./configure.ac, in the section
+# "Check for header files, types and library functions".
+AC_DEFUN([gl_INIT],
+[
+ AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
+ gl_cond_libtool=false
+ gl_libdeps=
+ gl_ltlibdeps=
+ gl_m4_base='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], [])
+ gl_COMMON
+ gl_source_base='lib'
+ gl_FUNC_ALLOCA
+ gl_FUNC_BTOWC
+ if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
+ AC_LIBOBJ([btowc])
+ gl_PREREQ_BTOWC
+ fi
+ gl_WCHAR_MODULE_INDICATOR([btowc])
+ gl_C_STACK
+ AC_CHECK_FUNCS_ONCE([readlinkat])
+ gl_CLOCK_TIME
+ gl_FUNC_CLOSE
+ if test $REPLACE_CLOSE = 1; then
+ AC_LIBOBJ([close])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([close])
+ gl_CONFIG_H
+ gl_CONFIGMAKE_PREP
+ gl_CTYPE_H
+ gl_DIRNAME
+ gl_MODULE_INDICATOR([dirname])
+ gl_DIRNAME_LGPL
+ gl_DOUBLE_SLASH_ROOT
+ gl_FUNC_DUP2
+ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+ AC_LIBOBJ([dup2])
+ gl_PREREQ_DUP2
+ fi
+ gl_UNISTD_MODULE_INDICATOR([dup2])
+ gl_ENVIRON
+ gl_UNISTD_MODULE_INDICATOR([environ])
+ gl_HEADER_ERRNO_H
+ gl_ERROR
+ if test $ac_cv_lib_error_at_line = no; then
+ AC_LIBOBJ([error])
+ gl_PREREQ_ERROR
+ fi
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+ AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+ AC_REQUIRE([gl_EXTERN_INLINE])
+ gl_FUNC_FCNTL
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+ AC_LIBOBJ([fcntl])
+ fi
+ gl_FCNTL_MODULE_INDICATOR([fcntl])
+ gl_FCNTL_H
+ gl_FILE_NAME_CONCAT
+ gl_MODULE_INDICATOR([filenamecat])
+ gl_FILE_NAME_CONCAT_LGPL
+ AC_C_FLEXIBLE_ARRAY_MEMBER
+ gl_FLOAT_H
+ if test $REPLACE_FLOAT_LDBL = 1; then
+ AC_LIBOBJ([float])
+ fi
+ if test $REPLACE_ITOLD = 1; then
+ AC_LIBOBJ([itold])
+ fi
+ gl_FUNC_FNMATCH_POSIX
+ if test -n "$FNMATCH_H"; then
+ AC_LIBOBJ([fnmatch])
+ gl_PREREQ_FNMATCH
+ fi
+ gl_FUNC_FNMATCH_GNU
+ if test -n "$FNMATCH_H"; then
+ AC_LIBOBJ([fnmatch])
+ gl_PREREQ_FNMATCH
+ fi
+ gl_FUNC_FREOPEN
+ if test $REPLACE_FREOPEN = 1; then
+ AC_LIBOBJ([freopen])
+ gl_PREREQ_FREOPEN
+ fi
+ gl_STDIO_MODULE_INDICATOR([freopen])
+ gl_MODULE_INDICATOR([freopen-safer])
+ gl_FUNC_FSTAT
+ if test $REPLACE_FSTAT = 1; then
+ AC_LIBOBJ([fstat])
+ gl_PREREQ_FSTAT
+ fi
+ gl_SYS_STAT_MODULE_INDICATOR([fstat])
+ gl_FUNC_GETDTABLESIZE
+ if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
+ AC_LIBOBJ([getdtablesize])
+ gl_PREREQ_GETDTABLESIZE
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getdtablesize])
+ gl_FUNC_GETOPT_GNU
+ if test $REPLACE_GETOPT = 1; then
+ AC_LIBOBJ([getopt])
+ AC_LIBOBJ([getopt1])
+ gl_PREREQ_GETOPT
+ dnl Arrange for unistd.h to include getopt.h.
+ GNULIB_GL_UNISTD_H_GETOPT=1
+ fi
+ AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+ gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
+ gl_FUNC_GETOPT_POSIX
+ if test $REPLACE_GETOPT = 1; then
+ AC_LIBOBJ([getopt])
+ AC_LIBOBJ([getopt1])
+ gl_PREREQ_GETOPT
+ dnl Arrange for unistd.h to include getopt.h.
+ GNULIB_GL_UNISTD_H_GETOPT=1
+ fi
+ AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ gl_GETTIME
+ gl_FUNC_GETTIMEOFDAY
+ if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+ AC_LIBOBJ([gettimeofday])
+ gl_PREREQ_GETTIMEOFDAY
+ fi
+ gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
+ gl_GNU_MAKE
+ # Autoconf 2.61a.99 and earlier don't support linking a file only
+ # in VPATH builds. But since GNUmakefile is for maintainer use
+ # only, it does not matter if we skip the link with older autoconf.
+ # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+ # builds, so use a shell variable to bypass this.
+ GNUmakefile=GNUmakefile
+ m4_if(m4_version_compare([2.61a.100],
+ m4_defn([m4_PACKAGE_VERSION])), [1], [],
+ [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
+ [GNUmakefile=$GNUmakefile])])
+ gl_HARD_LOCALE
+ AM_ICONV
+ m4_ifdef([gl_ICONV_MODULE_INDICATOR],
+ [gl_ICONV_MODULE_INDICATOR([iconv])])
+ gl_ICONV_H
+ gl_FUNC_ICONV_OPEN
+ if test $REPLACE_ICONV_OPEN = 1; then
+ AC_LIBOBJ([iconv_open])
+ fi
+ if test $REPLACE_ICONV = 1; then
+ AC_LIBOBJ([iconv])
+ AC_LIBOBJ([iconv_close])
+ fi
+ gl_INLINE
+ gl_INTTOSTR
+ gl_INTTYPES_H
+ gl_INTTYPES_INCOMPLETE
+ gl_FUNC_ISBLANK
+ if test $HAVE_ISBLANK = 0; then
+ AC_LIBOBJ([isblank])
+ fi
+ gl_CTYPE_MODULE_INDICATOR([isblank])
+ gl_FUNC_ISWBLANK
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ :
+ else
+ if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+ AC_LIBOBJ([iswblank])
+ fi
+ fi
+ gl_WCTYPE_MODULE_INDICATOR([iswblank])
+ gl_LANGINFO_H
+ AC_REQUIRE([gl_LARGEFILE])
+ gl_LIBSIGSEGV
+ gl_LOCALCHARSET
+ LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+ AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+ gl_LOCALE_H
+ gl_FUNC_LOCALECONV
+ if test $REPLACE_LOCALECONV = 1; then
+ AC_LIBOBJ([localeconv])
+ gl_PREREQ_LOCALECONV
+ fi
+ gl_LOCALE_MODULE_INDICATOR([localeconv])
+ gl_FUNC_LSTAT
+ if test $REPLACE_LSTAT = 1; then
+ AC_LIBOBJ([lstat])
+ gl_PREREQ_LSTAT
+ fi
+ gl_SYS_STAT_MODULE_INDICATOR([lstat])
+ AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
+ [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
+ AC_REQUIRE([AC_PROG_SED])
+ gl_FUNC_MALLOC_POSIX
+ if test $REPLACE_MALLOC = 1; then
+ AC_LIBOBJ([malloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+ gl_MALLOCA
+ gl_MBCHAR
+ gl_MBITER
+ gl_FUNC_MBRTOWC
+ if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+ AC_LIBOBJ([mbrtowc])
+ gl_PREREQ_MBRTOWC
+ fi
+ gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+ gl_STRING_MODULE_INDICATOR([mbscasecmp])
+ gl_FUNC_MBSINIT
+ if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+ AC_LIBOBJ([mbsinit])
+ gl_PREREQ_MBSINIT
+ fi
+ gl_WCHAR_MODULE_INDICATOR([mbsinit])
+ gl_FUNC_MBSLEN
+ gl_STRING_MODULE_INDICATOR([mbslen])
+ gl_FUNC_MBSRTOWCS
+ if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+ AC_LIBOBJ([mbsrtowcs])
+ AC_LIBOBJ([mbsrtowcs-state])
+ gl_PREREQ_MBSRTOWCS
+ fi
+ gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
+ gl_STRING_MODULE_INDICATOR([mbsstr])
+ gl_FUNC_MBTOWC
+ if test $REPLACE_MBTOWC = 1; then
+ AC_LIBOBJ([mbtowc])
+ gl_PREREQ_MBTOWC
+ fi
+ gl_STDLIB_MODULE_INDICATOR([mbtowc])
+ gl_MBITER
+ gl_FUNC_MEMCHR
+ if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+ AC_LIBOBJ([memchr])
+ gl_PREREQ_MEMCHR
+ fi
+ gl_STRING_MODULE_INDICATOR([memchr])
+ gl_FUNC_MKSTEMP
+ if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
+ AC_LIBOBJ([mkstemp])
+ gl_PREREQ_MKSTEMP
+ fi
+ gl_STDLIB_MODULE_INDICATOR([mkstemp])
+ gl_FUNC_MKTIME
+ if test $REPLACE_MKTIME = 1; then
+ AC_LIBOBJ([mktime])
+ gl_PREREQ_MKTIME
+ fi
+ gl_TIME_MODULE_INDICATOR([mktime])
+ gl_FUNC_MKTIME_INTERNAL
+ if test $REPLACE_MKTIME = 1; then
+ AC_LIBOBJ([mktime])
+ gl_PREREQ_MKTIME
+ fi
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ AC_LIBOBJ([msvc-inval])
+ fi
+ AC_REQUIRE([gl_MSVC_NOTHROW])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ AC_LIBOBJ([msvc-nothrow])
+ fi
+ gl_MULTIARCH
+ gl_FUNC_NL_LANGINFO
+ if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
+ AC_LIBOBJ([nl_langinfo])
+ fi
+ gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
+ gl_FUNC_OPEN
+ if test $REPLACE_OPEN = 1; then
+ AC_LIBOBJ([open])
+ gl_PREREQ_OPEN
+ fi
+ gl_FCNTL_MODULE_INDICATOR([open])
+ gl_PATHMAX
+ AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
+ AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'])
+ AM_][XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])])
+ gl_QUOTE
+ gl_QUOTEARG
+ gl_FUNC_RAISE
+ if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
+ AC_LIBOBJ([raise])
+ gl_PREREQ_RAISE
+ fi
+ gl_SIGNAL_MODULE_INDICATOR([raise])
+ gl_FUNC_RAWMEMCHR
+ if test $HAVE_RAWMEMCHR = 0; then
+ AC_LIBOBJ([rawmemchr])
+ gl_PREREQ_RAWMEMCHR
+ fi
+ gl_STRING_MODULE_INDICATOR([rawmemchr])
+ gl_FUNC_READLINK
+ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+ AC_LIBOBJ([readlink])
+ gl_PREREQ_READLINK
+ fi
+ gl_UNISTD_MODULE_INDICATOR([readlink])
+ gl_REGEX
+ if test $ac_use_included_regex = yes; then
+ AC_LIBOBJ([regex])
+ gl_PREREQ_REGEX
+ fi
+ gl_FUNC_SECURE_GETENV
+ if test $HAVE_SECURE_GETENV = 0; then
+ AC_LIBOBJ([secure_getenv])
+ gl_PREREQ_SECURE_GETENV
+ fi
+ gl_STDLIB_MODULE_INDICATOR([secure_getenv])
+ gl_FUNC_SETENV
+ if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
+ AC_LIBOBJ([setenv])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([setenv])
+ gl_SIGACTION
+ if test $HAVE_SIGACTION = 0; then
+ AC_LIBOBJ([sigaction])
+ gl_PREREQ_SIGACTION
+ fi
+ gl_SIGNAL_MODULE_INDICATOR([sigaction])
+ gl_SIGNAL_H
+ gl_SIGNALBLOCKING
+ if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+ AC_LIBOBJ([sigprocmask])
+ gl_PREREQ_SIGPROCMASK
+ fi
+ gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
+ gl_SIZE_MAX
+ gt_TYPE_SSIZE_T
+ gl_FUNC_STAT
+ if test $REPLACE_STAT = 1; then
+ AC_LIBOBJ([stat])
+ gl_PREREQ_STAT
+ fi
+ gl_SYS_STAT_MODULE_INDICATOR([stat])
+ gl_STAT_TIME
+ gl_STAT_BIRTHTIME
+ gl_STDARG_H
+ AM_STDBOOL_H
+ gl_STDDEF_H
+ gl_STDINT_H
+ gl_STDIO_H
+ gl_STDLIB_H
+ gl_STRCASE
+ if test $HAVE_STRCASECMP = 0; then
+ AC_LIBOBJ([strcasecmp])
+ gl_PREREQ_STRCASECMP
+ fi
+ if test $HAVE_STRNCASECMP = 0; then
+ AC_LIBOBJ([strncasecmp])
+ gl_PREREQ_STRNCASECMP
+ fi
+ gl_FUNC_STRERROR
+ if test $REPLACE_STRERROR = 1; then
+ AC_LIBOBJ([strerror])
+ fi
+ gl_MODULE_INDICATOR([strerror])
+ gl_STRING_MODULE_INDICATOR([strerror])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+ AC_LIBOBJ([strerror-override])
+ gl_PREREQ_SYS_H_WINSOCK2
+ fi
+ gl_FUNC_GNU_STRFTIME
+ if test $gl_cond_libtool = false; then
+ gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
+ gl_libdeps="$gl_libdeps $LIBICONV"
+ fi
+ gl_HEADER_STRING_H
+ gl_HEADER_STRINGS_H
+ gl_FUNC_STRNDUP
+ if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+ AC_LIBOBJ([strndup])
+ fi
+ gl_STRING_MODULE_INDICATOR([strndup])
+ gl_FUNC_STRNLEN
+ if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+ AC_LIBOBJ([strnlen])
+ gl_PREREQ_STRNLEN
+ fi
+ gl_STRING_MODULE_INDICATOR([strnlen])
+ gl_FUNC_STRPTIME
+ if test $HAVE_STRPTIME = 0; then
+ AC_LIBOBJ([strptime])
+ gl_PREREQ_STRPTIME
+ fi
+ gl_TIME_MODULE_INDICATOR([strptime])
+ gl_FUNC_STRTOULL
+ if test $HAVE_STRTOULL = 0; then
+ AC_LIBOBJ([strtoull])
+ gl_PREREQ_STRTOULL
+ fi
+ gl_STDLIB_MODULE_INDICATOR([strtoull])
+ gl_FUNC_STRTOUMAX
+ if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then
+ AC_LIBOBJ([strtoumax])
+ gl_PREREQ_STRTOUMAX
+ fi
+ gl_INTTYPES_MODULE_INDICATOR([strtoumax])
+ gl_HEADER_SYS_STAT_H
+ AC_PROG_MKDIR_P
+ gl_HEADER_SYS_TIME_H
+ AC_PROG_MKDIR_P
+ gl_SYS_TYPES_H
+ AC_PROG_MKDIR_P
+ gl_SYS_WAIT_H
+ AC_PROG_MKDIR_P
+ gl_FUNC_GEN_TEMPNAME
+ gl_HEADER_TIME_H
+ gl_TIME_R
+ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
+ AC_LIBOBJ([time_r])
+ gl_PREREQ_TIME_R
+ fi
+ gl_TIME_MODULE_INDICATOR([time_r])
+ gl_TIME_RZ
+ if test "$HAVE_TIMEZONE_T" = 0; then
+ AC_LIBOBJ([time_rz])
+ fi
+ gl_TIME_MODULE_INDICATOR([time_rz])
+ gl_FUNC_TIMEGM
+ if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
+ AC_LIBOBJ([timegm])
+ gl_PREREQ_TIMEGM
+ fi
+ gl_TIME_MODULE_INDICATOR([timegm])
+ gl_TIMESPEC
+ gl_UNISTD_H
+ gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistr.h])
+ gl_MODULE_INDICATOR([unistr/u8-mbtoucr])
+ gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr])
+ gl_MODULE_INDICATOR([unistr/u8-uctomb])
+ gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb])
+ gl_LIBUNISTRING_LIBHEADER([0.9.4], [unitypes.h])
+ gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h])
+ gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width])
+ gl_FUNC_GLIBC_UNLOCKED_IO
+ gl_FUNC_UNSETENV
+ if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+ AC_LIBOBJ([unsetenv])
+ gl_PREREQ_UNSETENV
+ fi
+ gl_STDLIB_MODULE_INDICATOR([unsetenv])
+ AC_C_VARARRAYS
+ 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])])
+ gl_VERSION_ETC
+ gl_WCHAR_H
+ gl_FUNC_WCRTOMB
+ if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+ AC_LIBOBJ([wcrtomb])
+ gl_PREREQ_WCRTOMB
+ fi
+ gl_WCHAR_MODULE_INDICATOR([wcrtomb])
+ gl_WCTYPE_H
+ gl_FUNC_WCWIDTH
+ if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
+ AC_LIBOBJ([wcwidth])
+ fi
+ gl_WCHAR_MODULE_INDICATOR([wcwidth])
+ gl_XALLOC
+ gl_XSIZE
+ gl_XSTRNDUP
+ gl_XSTRTOL
+ 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_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=
+ if test -n "$gl_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ 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"
+ done
+ fi
+ AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
+ AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
+ ])
+ 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], [])
+ gl_COMMON
+ gl_source_base='gnulib-tests'
+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])
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([accept])
+ fi
+ gl_SYS_SOCKET_MODULE_INDICATOR([accept])
+ gl_HEADER_ARPA_INET
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([bind])
+ fi
+ gl_SYS_SOCKET_MODULE_INDICATOR([bind])
+ gt_LOCALE_FR
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_FR
+ gt_LOCALE_TR_UTF8
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([connect])
+ fi
+ gl_SYS_SOCKET_MODULE_INDICATOR([connect])
+ gl_FUNC_FDOPEN
+ if test $REPLACE_FDOPEN = 1; then
+ AC_LIBOBJ([fdopen])
+ gl_PREREQ_FDOPEN
+ fi
+ gl_STDIO_MODULE_INDICATOR([fdopen])
+ gl_FUNC_FTRUNCATE
+ if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then
+ AC_LIBOBJ([ftruncate])
+ gl_PREREQ_FTRUNCATE
+ fi
+ gl_UNISTD_MODULE_INDICATOR([ftruncate])
+ gl_FUNC_GETCWD_LGPL
+ if test $REPLACE_GETCWD = 1; then
+ AC_LIBOBJ([getcwd-lgpl])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getcwd])
+ gl_FUNC_GETPAGESIZE
+ if test $REPLACE_GETPAGESIZE = 1; then
+ AC_LIBOBJ([getpagesize])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getpagesize])
+ gl_FUNC_INET_PTON
+ if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then
+ AC_LIBOBJ([inet_pton])
+ gl_PREREQ_INET_PTON
+ fi
+ gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
+ AC_C_BIGENDIAN
+ gl_FUNC_IOCTL
+ if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
+ AC_LIBOBJ([ioctl])
+ fi
+ gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([listen])
+ fi
+ gl_SYS_SOCKET_MODULE_INDICATOR([listen])
+ AC_CHECK_FUNCS_ONCE([newlocale])
+ gt_LOCALE_FR
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_JA
+ gt_LOCALE_ZH_CN
+ gt_LOCALE_TR_UTF8
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_FR
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_JA
+ gt_LOCALE_ZH_CN
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_ZH_CN
+ dnl Check for prerequisites for memory fence checks.
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+ gl_FUNC_NANOSLEEP
+ if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then
+ AC_LIBOBJ([nanosleep])
+ gl_PREREQ_NANOSLEEP
+ fi
+ gl_TIME_MODULE_INDICATOR([nanosleep])
+ AC_CHECK_DECLS_ONCE([alarm])
+ gl_HEADER_NETINET_IN
+ AC_PROG_MKDIR_P
+ gt_LOCALE_FR
+ gt_LOCALE_FR_UTF8
+ gl_FUNC_PERROR
+ if test $REPLACE_PERROR = 1; then
+ AC_LIBOBJ([perror])
+ fi
+ gl_STRING_MODULE_INDICATOR([perror])
+ gl_FUNC_PIPE
+ if test $HAVE_PIPE = 0; then
+ AC_LIBOBJ([pipe])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([pipe])
+ gl_FUNC_PUTENV
+ if test $REPLACE_PUTENV = 1; then
+ AC_LIBOBJ([putenv])
+ gl_PREREQ_PUTENV
+ fi
+ gl_STDLIB_MODULE_INDICATOR([putenv])
+ dnl Check for prerequisites for memory fence checks.
+ dnl FIXME: zerosize-ptr.h requires these: make a module for it
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+ dnl Check for prerequisites for memory fence checks.
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+ gl_FUNC_SELECT
+ if test $REPLACE_SELECT = 1; then
+ AC_LIBOBJ([select])
+ fi
+ gl_SYS_SELECT_MODULE_INDICATOR([select])
+ AC_CHECK_HEADERS_ONCE([sys/wait.h])
+ gl_FUNC_SETLOCALE
+ if test $REPLACE_SETLOCALE = 1; then
+ AC_LIBOBJ([setlocale])
+ gl_PREREQ_SETLOCALE
+ fi
+ gl_LOCALE_MODULE_INDICATOR([setlocale])
+ gt_LOCALE_FR
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_JA
+ gt_LOCALE_ZH_CN
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([setsockopt])
+ fi
+ gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt])
+ gl_FUNC_SLEEP
+ if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
+ AC_LIBOBJ([sleep])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([sleep])
+ AC_CHECK_DECLS_ONCE([alarm])
+ gl_FUNC_SNPRINTF
+ gl_STDIO_MODULE_INDICATOR([snprintf])
+ gl_MODULE_INDICATOR([snprintf])
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([socket])
+ fi
+ # When this module is used, sockets may actually occur as file descriptors,
+ # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
+ 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_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+ fi
+ gl_SYS_SOCKET_MODULE_INDICATOR([socket])
+ AC_REQUIRE([gl_SOCKETLIB])
+ AC_REQUIRE([gl_SOCKETS])
+ gl_TYPE_SOCKLEN_T
+ gl_STDALIGN_H
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ gl_FUNC_STRERROR_R
+ if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
+ AC_LIBOBJ([strerror_r])
+ gl_PREREQ_STRERROR_R
+ fi
+ gl_STRING_MODULE_INDICATOR([strerror_r])
+ dnl Check for prerequisites for memory fence checks.
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+ gl_FUNC_SYMLINK
+ if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
+ AC_LIBOBJ([symlink])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([symlink])
+ gl_SYS_IOCTL_H
+ AC_PROG_MKDIR_P
+ gl_HEADER_SYS_SELECT
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ AC_PROG_MKDIR_P
+ AC_CHECK_FUNCS_ONCE([shutdown])
+ gl_HEADER_SYS_UIO
+ AC_PROG_MKDIR_P
+ abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+ AC_SUBST([abs_aux_dir])
+ abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+ AC_SUBST([abs_aux_dir])
+ gt_LOCALE_FR
+ gt_LOCALE_FR_UTF8
+ gt_LOCALE_JA
+ gt_LOCALE_ZH_CN
+ gl_FUNC_WCTOB
+ if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
+ AC_LIBOBJ([wctob])
+ gl_PREREQ_WCTOB
+ fi
+ gl_WCHAR_MODULE_INDICATOR([wctob])
+ gl_FUNC_WCTOMB
+ if test $REPLACE_WCTOMB = 1; then
+ AC_LIBOBJ([wctomb])
+ gl_PREREQ_WCTOMB
+ fi
+ gl_STDLIB_MODULE_INDICATOR([wctomb])
+ 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([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=
+ if test -n "$gltests_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ 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"
+ done
+ fi
+ AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
+ AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
+ ])
+ LIBDIFFUTILS_LIBDEPS="$gl_libdeps"
+ AC_SUBST([LIBDIFFUTILS_LIBDEPS])
+ LIBDIFFUTILS_LTLIBDEPS="$gl_ltlibdeps"
+ AC_SUBST([LIBDIFFUTILS_LTLIBDEPS])
+ LIBTESTS_LIBDEPS="$gltests_libdeps"
+ AC_SUBST([LIBTESTS_LIBDEPS])
+])
+
+# 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], [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], [gnulib-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/announce-gen
+ build-aux/config.rpath
+ build-aux/do-release-commit-and-tag
+ build-aux/gendocs.sh
+ build-aux/git-version-gen
+ build-aux/gitlog-to-changelog
+ build-aux/gnu-web-doc-update
+ build-aux/gnupload
+ build-aux/snippet/_Noreturn.h
+ build-aux/snippet/arg-nonnull.h
+ build-aux/snippet/c++defs.h
+ build-aux/snippet/unused-parameter.h
+ build-aux/snippet/warn-on-use.h
+ build-aux/update-copyright
+ build-aux/useless-if-before-free
+ build-aux/vc-list-files
+ doc/fdl.texi
+ doc/gendocs_template
+ doc/gendocs_template_min
+ lib/alloca.c
+ lib/alloca.in.h
+ lib/allocator.c
+ lib/allocator.h
+ lib/anytostr.c
+ lib/areadlink.c
+ lib/areadlink.h
+ lib/argmatch.c
+ lib/argmatch.h
+ lib/asnprintf.c
+ lib/asprintf.c
+ lib/assure.h
+ lib/basename-lgpl.c
+ lib/basename.c
+ lib/binary-io.c
+ lib/binary-io.h
+ lib/bitrotate.c
+ lib/bitrotate.h
+ lib/btowc.c
+ lib/c-ctype.c
+ lib/c-ctype.h
+ lib/c-stack.c
+ lib/c-stack.h
+ lib/c-strcase.h
+ lib/c-strcasecmp.c
+ lib/c-strcaseeq.h
+ lib/c-strncasecmp.c
+ lib/careadlinkat.c
+ lib/careadlinkat.h
+ lib/close.c
+ lib/config.charset
+ lib/ctype.in.h
+ lib/diffseq.h
+ lib/dirname-lgpl.c
+ lib/dirname.c
+ lib/dirname.h
+ lib/dosname.h
+ lib/dup2.c
+ lib/errno.in.h
+ lib/error.c
+ lib/error.h
+ lib/exclude.c
+ lib/exclude.h
+ lib/exitfail.c
+ lib/exitfail.h
+ lib/fcntl.c
+ lib/fcntl.in.h
+ lib/fd-hook.c
+ lib/fd-hook.h
+ lib/file-type.c
+ lib/file-type.h
+ lib/filename.h
+ lib/filenamecat-lgpl.c
+ lib/filenamecat.c
+ lib/filenamecat.h
+ lib/float+.h
+ lib/float.c
+ lib/float.in.h
+ lib/fnmatch.c
+ lib/fnmatch.in.h
+ lib/fnmatch_loop.c
+ lib/freopen-safer.c
+ lib/freopen.c
+ lib/fstat.c
+ lib/getdtablesize.c
+ lib/getopt.c
+ lib/getopt.in.h
+ lib/getopt1.c
+ lib/getopt_int.h
+ lib/gettext.h
+ lib/gettime.c
+ lib/gettimeofday.c
+ lib/hard-locale.c
+ lib/hard-locale.h
+ lib/hash.c
+ lib/hash.h
+ lib/iconv.c
+ lib/iconv.in.h
+ lib/iconv_close.c
+ lib/iconv_open-aix.gperf
+ lib/iconv_open-hpux.gperf
+ lib/iconv_open-irix.gperf
+ lib/iconv_open-osf.gperf
+ lib/iconv_open-solaris.gperf
+ lib/iconv_open.c
+ lib/ignore-value.h
+ lib/imaxtostr.c
+ lib/intprops.h
+ lib/inttostr.c
+ lib/inttostr.h
+ lib/inttypes.in.h
+ lib/isblank.c
+ lib/iswblank.c
+ lib/itold.c
+ lib/langinfo.in.h
+ lib/localcharset.c
+ lib/localcharset.h
+ lib/locale.in.h
+ lib/localeconv.c
+ lib/lstat.c
+ lib/malloc.c
+ lib/malloca.c
+ lib/malloca.h
+ lib/malloca.valgrind
+ lib/mbchar.c
+ lib/mbchar.h
+ lib/mbiter.c
+ lib/mbiter.h
+ lib/mbrtowc.c
+ lib/mbscasecmp.c
+ lib/mbsinit.c
+ lib/mbslen.c
+ lib/mbsrtowcs-impl.h
+ lib/mbsrtowcs-state.c
+ lib/mbsrtowcs.c
+ lib/mbsstr.c
+ lib/mbtowc-impl.h
+ lib/mbtowc.c
+ lib/mbuiter.c
+ lib/mbuiter.h
+ lib/memchr.c
+ lib/memchr.valgrind
+ lib/mkstemp.c
+ lib/mktime-internal.h
+ lib/mktime.c
+ lib/msvc-inval.c
+ lib/msvc-inval.h
+ lib/msvc-nothrow.c
+ lib/msvc-nothrow.h
+ lib/nl_langinfo.c
+ lib/offtostr.c
+ lib/open.c
+ lib/pathmax.h
+ lib/printf-args.c
+ lib/printf-args.h
+ lib/printf-parse.c
+ lib/printf-parse.h
+ lib/progname.c
+ lib/progname.h
+ lib/propername.c
+ lib/propername.h
+ lib/quote.h
+ lib/quotearg.c
+ lib/quotearg.h
+ lib/raise.c
+ lib/rawmemchr.c
+ lib/rawmemchr.valgrind
+ lib/readlink.c
+ lib/ref-add.sin
+ lib/ref-del.sin
+ lib/regcomp.c
+ lib/regex.c
+ lib/regex.h
+ lib/regex_internal.c
+ lib/regex_internal.h
+ lib/regexec.c
+ lib/secure_getenv.c
+ lib/setenv.c
+ lib/sh-quote.c
+ lib/sh-quote.h
+ lib/sig-handler.c
+ lib/sig-handler.h
+ lib/sigaction.c
+ lib/signal.in.h
+ lib/sigprocmask.c
+ lib/size_max.h
+ lib/stat-macros.h
+ lib/stat-time.c
+ lib/stat-time.h
+ lib/stat.c
+ lib/stdarg.in.h
+ lib/stdbool.in.h
+ lib/stddef.in.h
+ lib/stdint.in.h
+ lib/stdio--.h
+ lib/stdio-safer.h
+ lib/stdio.in.h
+ lib/stdlib.in.h
+ lib/str-kmp.h
+ lib/strcasecmp.c
+ lib/streq.h
+ lib/strerror-override.c
+ lib/strerror-override.h
+ lib/strerror.c
+ lib/strftime.c
+ lib/strftime.h
+ lib/striconv.c
+ lib/striconv.h
+ 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/strptime.c
+ lib/strtoimax.c
+ lib/strtol.c
+ lib/strtoul.c
+ lib/strtoull.c
+ lib/strtoumax.c
+ lib/sys_stat.in.h
+ lib/sys_time.in.h
+ lib/sys_types.in.h
+ lib/sys_wait.in.h
+ lib/system-quote.c
+ lib/system-quote.h
+ lib/tempname.c
+ lib/tempname.h
+ lib/time-internal.h
+ lib/time.in.h
+ lib/time_r.c
+ lib/time_rz.c
+ lib/timegm.c
+ lib/timespec.c
+ lib/timespec.h
+ lib/trim.c
+ lib/trim.h
+ lib/uinttostr.c
+ lib/umaxtostr.c
+ lib/unistd.c
+ lib/unistd.in.h
+ lib/unistr.in.h
+ lib/unistr/u8-mbtoucr.c
+ lib/unistr/u8-uctomb-aux.c
+ lib/unistr/u8-uctomb.c
+ lib/unitypes.in.h
+ lib/uniwidth.in.h
+ lib/uniwidth/cjk.h
+ lib/uniwidth/width.c
+ lib/unlocked-io.h
+ lib/unsetenv.c
+ lib/vasnprintf.c
+ lib/vasnprintf.h
+ lib/vasprintf.c
+ lib/verify.h
+ lib/version-etc-fsf.c
+ lib/version-etc.c
+ lib/version-etc.h
+ lib/wchar.in.h
+ lib/wcrtomb.c
+ lib/wctype-h.c
+ lib/wctype.in.h
+ lib/wcwidth.c
+ lib/xalloc-die.c
+ lib/xalloc-oversized.h
+ lib/xalloc.h
+ lib/xasprintf.c
+ lib/xfreopen.c
+ lib/xfreopen.h
+ lib/xmalloc.c
+ lib/xreadlink.c
+ lib/xreadlink.h
+ lib/xsize.c
+ lib/xsize.h
+ lib/xstriconv.c
+ lib/xstriconv.h
+ lib/xstrndup.c
+ lib/xstrndup.h
+ lib/xstrtol-error.c
+ lib/xstrtol.c
+ lib/xstrtol.h
+ lib/xstrtoul.c
+ lib/xstrtoumax.c
+ lib/xvasprintf.c
+ lib/xvasprintf.h
+ m4/00gnulib.m4
+ m4/absolute-header.m4
+ m4/alloca.m4
+ m4/arpa_inet_h.m4
+ m4/btowc.m4
+ m4/c-stack.m4
+ m4/clock_time.m4
+ m4/close.m4
+ m4/codeset.m4
+ m4/config-h.m4
+ m4/configmake.m4
+ m4/ctype.m4
+ m4/dirname.m4
+ m4/double-slash-root.m4
+ m4/dup2.m4
+ m4/eealloc.m4
+ m4/environ.m4
+ m4/errno_h.m4
+ m4/error.m4
+ m4/exponentd.m4
+ m4/extensions.m4
+ m4/extern-inline.m4
+ m4/fcntl-o.m4
+ m4/fcntl.m4
+ m4/fcntl_h.m4
+ m4/fdopen.m4
+ m4/filenamecat.m4
+ m4/flexmember.m4
+ m4/float_h.m4
+ m4/fnmatch.m4
+ m4/fpieee.m4
+ m4/freopen.m4
+ m4/fstat.m4
+ m4/ftruncate.m4
+ m4/getcwd.m4
+ m4/getdtablesize.m4
+ m4/getopt.m4
+ m4/getpagesize.m4
+ m4/gettime.m4
+ m4/gettimeofday.m4
+ m4/glibc21.m4
+ m4/gnu-make.m4
+ m4/gnulib-common.m4
+ m4/hard-locale.m4
+ m4/iconv.m4
+ m4/iconv_h.m4
+ m4/iconv_open.m4
+ m4/include_next.m4
+ m4/inet_pton.m4
+ m4/inline.m4
+ m4/intmax_t.m4
+ m4/inttostr.m4
+ m4/inttypes-pri.m4
+ m4/inttypes.m4
+ m4/inttypes_h.m4
+ m4/ioctl.m4
+ m4/isblank.m4
+ m4/iswblank.m4
+ m4/langinfo_h.m4
+ m4/largefile.m4
+ m4/lib-ld.m4
+ m4/lib-link.m4
+ m4/lib-prefix.m4
+ m4/libsigsegv.m4
+ m4/libunistring-base.m4
+ m4/localcharset.m4
+ m4/locale-fr.m4
+ m4/locale-ja.m4
+ m4/locale-tr.m4
+ m4/locale-zh.m4
+ m4/locale_h.m4
+ m4/localeconv.m4
+ m4/longlong.m4
+ m4/lstat.m4
+ m4/malloc.m4
+ m4/malloca.m4
+ m4/manywarnings.m4
+ m4/math_h.m4
+ m4/mbchar.m4
+ m4/mbiter.m4
+ m4/mbrtowc.m4
+ m4/mbsinit.m4
+ m4/mbslen.m4
+ m4/mbsrtowcs.m4
+ m4/mbstate_t.m4
+ m4/mbtowc.m4
+ m4/memchr.m4
+ m4/mkstemp.m4
+ m4/mktime.m4
+ m4/mmap-anon.m4
+ m4/mode_t.m4
+ m4/msvc-inval.m4
+ m4/msvc-nothrow.m4
+ m4/multiarch.m4
+ m4/nanosleep.m4
+ m4/netinet_in_h.m4
+ m4/nl_langinfo.m4
+ m4/nocrash.m4
+ m4/off_t.m4
+ m4/open.m4
+ m4/pathmax.m4
+ m4/perror.m4
+ m4/pipe.m4
+ m4/printf.m4
+ m4/putenv.m4
+ m4/quote.m4
+ m4/quotearg.m4
+ m4/raise.m4
+ m4/rawmemchr.m4
+ m4/readlink.m4
+ m4/regex.m4
+ m4/secure_getenv.m4
+ m4/select.m4
+ m4/setenv.m4
+ m4/setlocale.m4
+ m4/sigaction.m4
+ m4/signal_h.m4
+ m4/signalblocking.m4
+ m4/size_max.m4
+ m4/sleep.m4
+ m4/snprintf.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/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/strcase.m4
+ m4/strerror.m4
+ m4/strerror_r.m4
+ m4/strftime.m4
+ m4/string_h.m4
+ m4/strings_h.m4
+ m4/strndup.m4
+ m4/strnlen.m4
+ m4/strptime.m4
+ m4/strtoull.m4
+ m4/strtoumax.m4
+ m4/symlink.m4
+ m4/sys_ioctl_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/sys_wait_h.m4
+ m4/tempname.m4
+ m4/time_h.m4
+ m4/time_r.m4
+ m4/time_rz.m4
+ m4/timegm.m4
+ m4/timespec.m4
+ m4/tm_gmtoff.m4
+ m4/unistd_h.m4
+ m4/unlocked-io.m4
+ m4/vararrays.m4
+ m4/vasnprintf.m4
+ m4/vasprintf.m4
+ m4/version-etc.m4
+ m4/warn-on-use.m4
+ m4/warnings.m4
+ m4/wchar_h.m4
+ m4/wchar_t.m4
+ m4/wcrtomb.m4
+ m4/wctob.m4
+ m4/wctomb.m4
+ m4/wctype_h.m4
+ m4/wcwidth.m4
+ m4/wint_t.m4
+ m4/xalloc.m4
+ m4/xsize.m4
+ m4/xstrndup.m4
+ m4/xstrtol.m4
+ m4/xvasprintf.m4
+ tests/init.sh
+ tests/macros.h
+ tests/nap.h
+ tests/signature.h
+ tests/test-accept.c
+ tests/test-alloca-opt.c
+ tests/test-areadlink.c
+ tests/test-areadlink.h
+ tests/test-argmatch.c
+ tests/test-arpa_inet.c
+ tests/test-binary-io.c
+ tests/test-binary-io.sh
+ tests/test-bind.c
+ tests/test-bitrotate.c
+ tests/test-btowc.c
+ tests/test-btowc1.sh
+ tests/test-btowc2.sh
+ tests/test-c-ctype.c
+ tests/test-c-stack.c
+ tests/test-c-stack.sh
+ tests/test-c-stack2.sh
+ tests/test-c-strcase.sh
+ tests/test-c-strcasecmp.c
+ tests/test-c-strncasecmp.c
+ tests/test-close.c
+ tests/test-connect.c
+ tests/test-ctype.c
+ tests/test-dirname.c
+ tests/test-dup2.c
+ tests/test-environ.c
+ tests/test-errno.c
+ tests/test-exclude.c
+ tests/test-exclude1.sh
+ tests/test-exclude2.sh
+ tests/test-exclude3.sh
+ tests/test-exclude4.sh
+ tests/test-exclude5.sh
+ tests/test-exclude6.sh
+ tests/test-exclude7.sh
+ tests/test-exclude8.sh
+ tests/test-fcntl-h.c
+ tests/test-fcntl.c
+ tests/test-fdopen.c
+ tests/test-fgetc.c
+ tests/test-filenamecat.c
+ tests/test-float.c
+ tests/test-fnmatch.c
+ tests/test-fputc.c
+ tests/test-fread.c
+ tests/test-freopen-safer.c
+ tests/test-freopen.c
+ tests/test-fstat.c
+ tests/test-ftruncate.c
+ tests/test-ftruncate.sh
+ tests/test-fwrite.c
+ tests/test-getcwd-lgpl.c
+ tests/test-getdtablesize.c
+ tests/test-getopt.c
+ tests/test-getopt.h
+ tests/test-getopt_long.h
+ tests/test-gettimeofday.c
+ tests/test-hash.c
+ tests/test-iconv-h.c
+ tests/test-iconv.c
+ tests/test-ignore-value.c
+ tests/test-inet_pton.c
+ tests/test-init.sh
+ tests/test-intprops.c
+ tests/test-inttostr.c
+ tests/test-inttypes.c
+ tests/test-ioctl.c
+ tests/test-isblank.c
+ tests/test-iswblank.c
+ tests/test-langinfo.c
+ tests/test-listen.c
+ tests/test-locale.c
+ tests/test-localeconv.c
+ tests/test-lstat.c
+ tests/test-lstat.h
+ tests/test-malloca.c
+ tests/test-mbrtowc-w32-1.sh
+ tests/test-mbrtowc-w32-2.sh
+ tests/test-mbrtowc-w32-3.sh
+ tests/test-mbrtowc-w32-4.sh
+ tests/test-mbrtowc-w32-5.sh
+ tests/test-mbrtowc-w32.c
+ tests/test-mbrtowc.c
+ tests/test-mbrtowc1.sh
+ tests/test-mbrtowc2.sh
+ tests/test-mbrtowc3.sh
+ tests/test-mbrtowc4.sh
+ tests/test-mbrtowc5.sh
+ tests/test-mbscasecmp.c
+ tests/test-mbscasecmp.sh
+ tests/test-mbsinit.c
+ tests/test-mbsinit.sh
+ tests/test-mbsrtowcs.c
+ tests/test-mbsrtowcs1.sh
+ tests/test-mbsrtowcs2.sh
+ tests/test-mbsrtowcs3.sh
+ tests/test-mbsrtowcs4.sh
+ tests/test-mbsstr1.c
+ tests/test-mbsstr2.c
+ tests/test-mbsstr2.sh
+ tests/test-mbsstr3.c
+ tests/test-mbsstr3.sh
+ tests/test-memchr.c
+ tests/test-nanosleep.c
+ tests/test-netinet_in.c
+ tests/test-nl_langinfo.c
+ tests/test-nl_langinfo.sh
+ tests/test-open.c
+ tests/test-open.h
+ tests/test-pathmax.c
+ tests/test-perror.c
+ tests/test-perror.sh
+ tests/test-perror2.c
+ tests/test-pipe.c
+ tests/test-quotearg-simple.c
+ tests/test-quotearg.h
+ tests/test-raise.c
+ tests/test-rawmemchr.c
+ tests/test-readlink.c
+ tests/test-readlink.h
+ tests/test-regex.c
+ tests/test-select-fd.c
+ tests/test-select-in.sh
+ tests/test-select-out.sh
+ tests/test-select-stdin.c
+ tests/test-select.c
+ tests/test-select.h
+ tests/test-setenv.c
+ tests/test-setlocale1.c
+ tests/test-setlocale1.sh
+ tests/test-setlocale2.c
+ tests/test-setlocale2.sh
+ tests/test-setsockopt.c
+ tests/test-sh-quote.c
+ tests/test-sigaction.c
+ tests/test-signal-h.c
+ tests/test-sigprocmask.c
+ tests/test-sleep.c
+ tests/test-snprintf.c
+ tests/test-sockets.c
+ tests/test-stat-time.c
+ tests/test-stat.c
+ tests/test-stat.h
+ tests/test-stdalign.c
+ tests/test-stdbool.c
+ tests/test-stddef.c
+ tests/test-stdint.c
+ tests/test-stdio.c
+ tests/test-stdlib.c
+ tests/test-strerror.c
+ tests/test-strerror_r.c
+ tests/test-strftime.c
+ tests/test-striconv.c
+ tests/test-string.c
+ tests/test-strings.c
+ tests/test-strnlen.c
+ tests/test-strtoull.c
+ tests/test-strtoumax.c
+ tests/test-symlink.c
+ tests/test-symlink.h
+ tests/test-sys_ioctl.c
+ tests/test-sys_select.c
+ tests/test-sys_socket.c
+ tests/test-sys_stat.c
+ tests/test-sys_time.c
+ tests/test-sys_types.c
+ tests/test-sys_uio.c
+ tests/test-sys_wait.c
+ tests/test-sys_wait.h
+ tests/test-time.c
+ tests/test-timespec.c
+ tests/test-unistd.c
+ tests/test-unsetenv.c
+ tests/test-update-copyright.sh
+ tests/test-vasnprintf.c
+ tests/test-vasprintf.c
+ tests/test-vc-list-files-cvs.sh
+ tests/test-vc-list-files-git.sh
+ tests/test-verify.c
+ tests/test-verify.sh
+ tests/test-version-etc.c
+ tests/test-version-etc.sh
+ tests/test-wchar.c
+ tests/test-wcrtomb-w32-1.sh
+ tests/test-wcrtomb-w32-2.sh
+ tests/test-wcrtomb-w32-3.sh
+ tests/test-wcrtomb-w32-4.sh
+ tests/test-wcrtomb-w32-5.sh
+ tests/test-wcrtomb-w32.c
+ tests/test-wcrtomb.c
+ tests/test-wcrtomb.sh
+ tests/test-wctype-h.c
+ tests/test-wcwidth.c
+ tests/test-xalloc-die.c
+ tests/test-xalloc-die.sh
+ tests/test-xstrtol.c
+ tests/test-xstrtol.sh
+ tests/test-xstrtoul.c
+ tests/test-xstrtoumax.c
+ tests/test-xstrtoumax.sh
+ tests/test-xvasprintf.c
+ tests/unistr/test-u8-mbtoucr.c
+ tests/unistr/test-u8-uctomb.c
+ tests/uniwidth/test-uc_width.c
+ tests/uniwidth/test-uc_width2.c
+ tests/uniwidth/test-uc_width2.sh
+ tests/zerosize-ptr.h
+ tests=lib/accept.c
+ tests=lib/arpa_inet.in.h
+ tests=lib/bind.c
+ tests=lib/connect.c
+ tests=lib/dtotimespec.c
+ tests=lib/fdopen.c
+ tests=lib/fpucw.h
+ tests=lib/ftruncate.c
+ tests=lib/getcwd-lgpl.c
+ tests=lib/getpagesize.c
+ tests=lib/hash-pjw.c
+ tests=lib/hash-pjw.h
+ tests=lib/inet_pton.c
+ tests=lib/ioctl.c
+ tests=lib/listen.c
+ tests=lib/nanosleep.c
+ tests=lib/netinet_in.in.h
+ tests=lib/perror.c
+ tests=lib/pipe.c
+ tests=lib/putenv.c
+ tests=lib/same-inode.h
+ tests=lib/select.c
+ tests=lib/setlocale.c
+ tests=lib/setsockopt.c
+ tests=lib/sleep.c
+ tests=lib/snprintf.c
+ tests=lib/socket.c
+ tests=lib/sockets.c
+ tests=lib/sockets.h
+ tests=lib/stdalign.in.h
+ tests=lib/strerror_r.c
+ tests=lib/symlink.c
+ tests=lib/sys_ioctl.in.h
+ tests=lib/sys_select.in.h
+ tests=lib/sys_socket.c
+ tests=lib/sys_socket.in.h
+ tests=lib/sys_uio.in.h
+ tests=lib/timespec-add.c
+ tests=lib/timespec-sub.c
+ tests=lib/w32sock.h
+ tests=lib/wctob.c
+ tests=lib/wctomb-impl.h
+ tests=lib/wctomb.c
+ top/GNUmakefile
+ top/README-release
+ top/maint.mk
+])
diff --git a/m4/hard-locale.m4 b/m4/hard-locale.m4
new file mode 100644
index 0000000..4661bfc
--- /dev/null
+++ b/m4/hard-locale.m4
@@ -0,0 +1,11 @@
+# hard-locale.m4 serial 8
+dnl Copyright (C) 2002-2006, 2009-2016 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 No prerequisites of lib/hard-locale.c.
+AC_DEFUN([gl_HARD_LOCALE],
+[
+ :
+])
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644
index 0000000..aa159c5
--- /dev/null
+++ b/m4/iconv.m4
@@ -0,0 +1,271 @@
+# iconv.m4 serial 19 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-2014, 2016 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
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+ ]],
+ [[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 ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ ICONV_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,
+ &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 ICONV_CONST char input[] = "\263";
+ char buf[10];
+ ICONV_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,
+ &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 ICONV_CONST char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ &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 ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ ICONV_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,
+ &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], ,
+ [case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac])
+ test "$am_cv_func_iconv_works" = no || break
+ done
+ 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/m4/iconv_h.m4 b/m4/iconv_h.m4
new file mode 100644
index 0000000..c95ecc2
--- /dev/null
+++ b/m4/iconv_h.m4
@@ -0,0 +1,41 @@
+# iconv_h.m4 serial 8
+dnl Copyright (C) 2007-2016 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_ICONV_H],
+[
+ AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+
+ dnl Execute this unconditionally, because ICONV_H may be set by other
+ dnl modules, after this code is executed.
+ gl_CHECK_NEXT_HEADERS([iconv.h])
+])
+
+dnl Unconditionally enables the replacement of <iconv.h>.
+AC_DEFUN([gl_REPLACE_ICONV_H],
+[
+ AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ ICONV_H='iconv.h'
+ AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
+])
+
+AC_DEFUN([gl_ICONV_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_ICONV_H_DEFAULTS],
+[
+ GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ ICONV_CONST=; AC_SUBST([ICONV_CONST])
+ REPLACE_ICONV=0; AC_SUBST([REPLACE_ICONV])
+ REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
+ REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF])
+ ICONV_H=''; AC_SUBST([ICONV_H])
+ AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
+])
diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4
new file mode 100644
index 0000000..54e1dc8
--- /dev/null
+++ b/m4/iconv_open.m4
@@ -0,0 +1,56 @@
+# iconv_open.m4 serial 14
+dnl Copyright (C) 2007-2016 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_ICONV_OPEN],
+[
+ AC_REQUIRE([AM_ICONV])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test "$am_cv_func_iconv" = yes; then
+ dnl Provide the <iconv.h> override, for the sake of the C++ aliases.
+ gl_REPLACE_ICONV_H
+ dnl Test whether iconv_open accepts standardized encoding names.
+ dnl We know that GNU libiconv and GNU libc do.
+ AC_EGREP_CPP([gnu_iconv], [
+ #include <iconv.h>
+ #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+ gnu_iconv
+ #endif
+ ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
+ if test $gl_func_iconv_gnu = no; then
+ iconv_flavor=
+ case "$host_os" in
+ aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
+ irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
+ hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
+ osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
+ solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
+ esac
+ if test -n "$iconv_flavor"; then
+ AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
+ [Define to a symbolic name denoting the flavor of iconv_open()
+ implementation.])
+ gl_REPLACE_ICONV_OPEN
+ fi
+ fi
+ m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
+ gl_FUNC_ICONV_OPEN_UTF_SUPPORT
+ if test $gl_cv_func_iconv_supports_utf = no; then
+ REPLACE_ICONV_UTF=1
+ AC_DEFINE([REPLACE_ICONV_UTF], [1],
+ [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
+ REPLACE_ICONV=1
+ gl_REPLACE_ICONV_OPEN
+ fi
+ ])
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_ICONV_OPEN],
+[
+ gl_REPLACE_ICONV_H
+ REPLACE_ICONV_OPEN=1
+])
diff --git a/m4/include_next.m4 b/m4/include_next.m4
new file mode 100644
index 0000000..db0f2c0
--- /dev/null
+++ b/m4/include_next.m4
@@ -0,0 +1,223 @@
+# include_next.m4 serial 23
+dnl Copyright (C) 2006-2016 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 and PRAGMA_SYSTEM_HEADER.
+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])
+ AC_CACHE_CHECK([whether system header files limit the line length],
+ [gl_cv_pragma_columns],
+ [dnl HP NonStop systems, which define __TANDEM, have this misfeature.
+ AC_EGREP_CPP([choke me],
+ [
+#ifdef __TANDEM
+choke me
+#endif
+ ],
+ [gl_cv_pragma_columns=yes],
+ [gl_cv_pragma_columns=no])
+ ])
+ if test $gl_cv_pragma_columns = yes; 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])
+ ])
+
+dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
+dnl until we can assume autoconf 2.64 or newer.
+ 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])[>],
+ m4_defn([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/m4/inet_pton.m4 b/m4/inet_pton.m4
new file mode 100644
index 0000000..4f5db71
--- /dev/null
+++ b/m4/inet_pton.m4
@@ -0,0 +1,68 @@
+# inet_pton.m4 serial 17
+dnl Copyright (C) 2006, 2008-2016 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_INET_PTON],
+[
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+ dnl Persuade Solaris <arpa/inet.h> to declare inet_pton.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ dnl Most platforms that provide inet_pton define it in libc.
+ dnl Solaris 8..10 provide inet_pton in libnsl instead.
+ dnl Solaris 2.6..7 provide inet_pton in libresolv instead.
+ dnl Native Windows provides it in -lws2_32 instead, with a declaration in
+ dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
+ dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
+ HAVE_INET_PTON=1
+ INET_PTON_LIB=
+ gl_PREREQ_SYS_H_WINSOCK2
+ if test $HAVE_WINSOCK2_H = 1; then
+ AC_CHECK_DECLS([inet_pton],,, [[#include <ws2tcpip.h>]])
+ if test $ac_cv_have_decl_inet_pton = yes; then
+ dnl It needs to be overridden, because the stdcall calling convention
+ dnl is not compliant with POSIX.
+ REPLACE_INET_PTON=1
+ INET_PTON_LIB="-lws2_32"
+ else
+ HAVE_DECL_INET_PTON=0
+ HAVE_INET_PTON=0
+ fi
+ else
+ gl_save_LIBS=$LIBS
+ AC_SEARCH_LIBS([inet_pton], [nsl resolv], [],
+ [AC_CHECK_FUNCS([inet_pton])
+ if test $ac_cv_func_inet_pton = no; then
+ HAVE_INET_PTON=0
+ fi
+ ])
+ LIBS=$gl_save_LIBS
+
+ if test "$ac_cv_search_inet_pton" != "no" \
+ && test "$ac_cv_search_inet_pton" != "none required"; then
+ INET_PTON_LIB="$ac_cv_search_inet_pton"
+ fi
+
+ AC_CHECK_HEADERS_ONCE([netdb.h])
+ AC_CHECK_DECLS([inet_pton],,,
+ [[#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+ ]])
+ if test $ac_cv_have_decl_inet_pton = no; then
+ HAVE_DECL_INET_PTON=0
+ fi
+ fi
+ AC_SUBST([INET_PTON_LIB])
+])
+
+# Prerequisites of lib/inet_pton.c.
+AC_DEFUN([gl_PREREQ_INET_PTON], [
+ AC_REQUIRE([gl_SOCKET_FAMILIES])
+])
diff --git a/m4/inline.m4 b/m4/inline.m4
new file mode 100644
index 0000000..28fd2d0
--- /dev/null
+++ b/m4/inline.m4
@@ -0,0 +1,40 @@
+# inline.m4 serial 4
+dnl Copyright (C) 2006, 2009-2016 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 the 'inline' keyword or equivalent.
+dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
+dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an
+dnl equivalent is effectively supported, i.e. if the compiler is likely to
+dnl drop unused 'static inline' functions.
+AC_DEFUN([gl_INLINE],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ AC_CACHE_CHECK([whether the compiler generally respects inline],
+ [gl_cv_c_inline_effective],
+ [if test $ac_cv_c_inline = no; then
+ gl_cv_c_inline_effective=no
+ else
+ dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
+ dnl specified.
+ dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
+ dnl depends on optimization flags, which can be in CFLAGS.
+ dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]],
+ [[#ifdef __NO_INLINE__
+ #error "inline is not effective"
+ #endif]])],
+ [gl_cv_c_inline_effective=yes],
+ [gl_cv_c_inline_effective=no])
+ fi
+ ])
+ if test $gl_cv_c_inline_effective = yes; then
+ AC_DEFINE([HAVE_INLINE], [1],
+ [Define to 1 if the compiler supports one of the keywords
+ 'inline', '__inline__', '__inline' and effectively inlines
+ functions marked as such.])
+ fi
+])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
new file mode 100644
index 0000000..8a045f6
--- /dev/null
+++ b/m4/intlmacosx.m4
@@ -0,0 +1,56 @@
+# intlmacosx.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2004-2014 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/m4/intmax_t.m4 b/m4/intmax_t.m4
new file mode 100644
index 0000000..9559acc
--- /dev/null
+++ b/m4/intmax_t.m4
@@ -0,0 +1,67 @@
+# intmax_t.m4 serial 8
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 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_REQUIRE([AC_TYPE_LONG_LONG_INT])
+ test $ac_cv_type_long_long_int = yes \
+ && ac_type='long long' \
+ || ac_type='long'
+ AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+ [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_REQUIRE([AC_TYPE_LONG_LONG_INT])
+ test $ac_cv_type_long_long_int = yes \
+ && ac_type='long long' \
+ || ac_type='long'
+ AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+ [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
+ fi
+])
diff --git a/m4/inttostr.m4 b/m4/inttostr.m4
new file mode 100644
index 0000000..fd4ba76
--- /dev/null
+++ b/m4/inttostr.m4
@@ -0,0 +1,32 @@
+#serial 8
+dnl Copyright (C) 2004-2006, 2009-2016 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_INTTOSTR],
+[
+ gl_PREREQ_INTTOSTR
+ gl_PREREQ_IMAXTOSTR
+ gl_PREREQ_OFFTOSTR
+ gl_PREREQ_UMAXTOSTR
+ gl_PREREQ_UINTTOSTR
+])
+
+# Prerequisites of lib/inttostr.h.
+AC_DEFUN([gl_PREREQ_INTTOSTR], [
+ AC_REQUIRE([AC_TYPE_OFF_T])
+ :
+])
+
+# Prerequisites of lib/imaxtostr.c.
+AC_DEFUN([gl_PREREQ_IMAXTOSTR], [:])
+
+# Prerequisites of lib/offtostr.c.
+AC_DEFUN([gl_PREREQ_OFFTOSTR], [:])
+
+# Prerequisites of lib/umaxtostr.c.
+AC_DEFUN([gl_PREREQ_UMAXTOSTR], [:])
+
+# Prerequisites of lib/uinttostr.c.
+AC_DEFUN([gl_PREREQ_UINTTOSTR], [:])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 0000000..ae20183
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,42 @@
+# inttypes-pri.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1997-2002, 2006, 2008-2016 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/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 0000000..61cdb1a
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,158 @@
+# inttypes.m4 serial 26
+dnl Copyright (C) 2006-2016 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([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])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+ AC_REQUIRE([gt_INTTYPES_PRI])
+
+ PRIPTR_PREFIX=
+ if test -n "$STDINT_H"; then
+ dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
+ PRIPTR_PREFIX='"l"'
+ 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)
+ #elif HAVE_LONG_LONG_INT
+ #define CONDITION ($4)
+ #else
+ #define CONDITION 0
+ #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])
+])
+
+AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
+[
+ GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS])
+ GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV])
+ GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX])
+ GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX])
+ 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])
+ 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])
+ PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN])
+ 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/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644
index 0000000..7657119
--- /dev/null
+++ b/m4/inttypes_h.m4
@@ -0,0 +1,29 @@
+# inttypes_h.m4 serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2016 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/m4/ioctl.m4 b/m4/ioctl.m4
new file mode 100644
index 0000000..c688a64
--- /dev/null
+++ b/m4/ioctl.m4
@@ -0,0 +1,41 @@
+# ioctl.m4 serial 4
+dnl Copyright (C) 2008-2016 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_HEADER_SYS_SOCKET])
+ 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>]],
+ [[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/m4/isblank.m4 b/m4/isblank.m4
new file mode 100644
index 0000000..63d4a39
--- /dev/null
+++ b/m4/isblank.m4
@@ -0,0 +1,17 @@
+# isblank.m4 serial 3
+dnl Copyright (C) 2009-2016 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/m4/iswblank.m4 b/m4/iswblank.m4
new file mode 100644
index 0000000..0639073
--- /dev/null
+++ b/m4/iswblank.m4
@@ -0,0 +1,41 @@
+# iswblank.m4 serial 4
+dnl Copyright (C) 2011-2016 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_ISWBLANK],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ dnl Persuade glibc <wctype.h> to declare iswblank().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([iswblank])
+ AC_CHECK_DECLS([iswblank], , , [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
+]])
+ if test $ac_cv_func_iswblank = no; then
+ HAVE_ISWBLANK=0
+ if test $ac_cv_have_decl_iswblank = yes; then
+ REPLACE_ISWBLANK=1
+ fi
+ fi
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+ :
+ else
+ if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+ dnl Redefine only iswblank.
+ :
+ fi
+ fi
+
+])
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
new file mode 100644
index 0000000..edbbe76
--- /dev/null
+++ b/m4/langinfo_h.m4
@@ -0,0 +1,105 @@
+# langinfo_h.m4 serial 7
+dnl Copyright (C) 2009-2016 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_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_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. CODESET and ERA etc. are missing
+ dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+ 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 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_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])
+])
+
+AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
+[
+ GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO])
+ 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/m4/largefile.m4 b/m4/largefile.m4
new file mode 100644
index 0000000..8bbdfaa
--- /dev/null
+++ b/m4/largefile.m4
@@ -0,0 +1,146 @@
+# Enable large files on systems where this is not the default.
+
+# Copyright 1992-1996, 1998-2016 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 implementation works 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 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1]];[]dnl
+])
+
+
+# _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([@%:@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-systems.org/version2/whatsnew/lfs20mar.html
+AC_DEFUN([AC_SYS_LARGEFILE],
+[AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+if test "$enable_largefile" != no; then
+
+ 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])
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ _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])
+ fi
+
+ AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
+ [Enable large inode numbers on Mac OS X 10.5.])
+fi
+])# AC_SYS_LARGEFILE
+])# m4_version_prereq 2.70
+
+# 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 But all native Windows platforms (including mingw64) have a 32-bit
+ dnl st_size member in 'struct stat'.
+ WINDOWS_64_BIT_ST_SIZE=1
+ ;;
+ *)
+ 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/m4/lib-ld.m4 b/m4/lib-ld.m4
new file mode 100644
index 0000000..6209de6
--- /dev/null
+++ b/m4/lib-ld.m4
@@ -0,0 +1,119 @@
+# lib-ld.m4 serial 6
+dnl Copyright (C) 1996-2003, 2009-2016 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
+
+ac_prog=ld
+if test "$GCC" = yes; 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 "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL([acl_cv_path_LD],
+[if test -z "$LD"; then
+ 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"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_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])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
new file mode 100644
index 0000000..2f51855
--- /dev/null
+++ b/m4/lib-link.m4
@@ -0,0 +1,777 @@
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2016 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.54])
+
+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 Tell automake >= 1.10 to complain if config.rpath is missing.
+ m4_ifdef([AC_REQUIRE_AUX_FILE], [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 Autoconf >= 2.61 supports dots in --with options.
+ pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
+ 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(P_A_C_K[-prefix],
+[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]P_A_C_K[[-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\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ 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
+ dir="$additional_libdir"
+ 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"; 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"; 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"; 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"; 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
+ 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"; 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"; 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"; 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"; 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"; 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"
+ ;;
+ 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*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $additional_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$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; 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$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_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$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_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.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.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([P_A_C_K])
+ 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"; 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"; 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/m4/lib-prefix.m4 b/m4/lib-prefix.m4
new file mode 100644
index 0000000..6851031
--- /dev/null
+++ b/m4/lib-prefix.m4
@@ -0,0 +1,224 @@
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2016 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_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+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_LIB_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 variable acl_libdirstem, containing the basename of the libdir, either
+dnl "lib" or "lib64" or "lib/64",
+dnl - a variable acl_libdirstem2, as a secondary possible value for
+dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
+dnl "lib/amd64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64.
+ dnl On 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. We determine
+ dnl the compiler's default mode by looking at the compiler's library search
+ dnl path. If at least one of its elements ends in /lib64 or points to a
+ dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
+ dnl Otherwise we use the default, 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])
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
+ 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.
+ AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+ [AC_EGREP_CPP([sixtyfour bits], [
+#ifdef _LP64
+sixtyfour bits
+#endif
+ ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+ ])
+ if test $gl_cv_solaris_64bit = yes; then
+ acl_libdirstem=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+])
diff --git a/m4/libsigsegv.m4 b/m4/libsigsegv.m4
new file mode 100644
index 0000000..5bfa092
--- /dev/null
+++ b/m4/libsigsegv.m4
@@ -0,0 +1,16 @@
+# libsigsegv.m4 serial 4
+dnl Copyright (C) 2002-2003, 2008-2016 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, Sam Steingold.
+
+AC_DEFUN([gl_LIBSIGSEGV],
+[
+ AC_LIB_HAVE_LINKFLAGS([sigsegv], [],
+ [#include <sigsegv.h>], [sigsegv_deinstall_handler();],
+ [no, consider installing GNU libsigsegv])
+ dnl Some other autoconf macros and clisp's configure use this variable.
+ gl_cv_lib_sigsegv="$ac_cv_libsigsegv"
+])
diff --git a/m4/libunistring-base.m4 b/m4/libunistring-base.m4
new file mode 100644
index 0000000..f911216
--- /dev/null
+++ b/m4/libunistring-base.m4
@@ -0,0 +1,141 @@
+# libunistring-base.m4 serial 5
+dnl Copyright (C) 2010-2016 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 Paolo Bonzini and Bruno Haible.
+
+dnl gl_LIBUNISTRING_MODULE([VERSION], [Module])
+dnl Declares that the source files of Module should be compiled, unless we
+dnl are linking with libunistring and its version is >= the given VERSION.
+dnl Defines an automake conditional LIBUNISTRING_COMPILE_$MODULE that is
+dnl true if the source files of Module should be compiled.
+dnl This macro is to be used for public libunistring API, not for
+dnl undocumented API.
+dnl
+dnl You have to bump the VERSION argument to the next projected version
+dnl number each time you make a change that affects the behaviour of the
+dnl functions defined in Module (even if the sources of Module itself do not
+dnl change).
+
+AC_DEFUN([gl_LIBUNISTRING_MODULE],
+[
+ AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE])
+ dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from
+ dnl gl_LIBUNISTRING_CORE if that macro has been run.
+ AM_CONDITIONAL(AS_TR_CPP([LIBUNISTRING_COMPILE_$2]),
+ [gl_LIBUNISTRING_VERSION_CMP([$1])])
+])
+
+dnl gl_LIBUNISTRING_LIBHEADER([VERSION], [HeaderFile])
+dnl Declares that HeaderFile should be created, unless we are linking
+dnl with libunistring and its version is >= the given VERSION.
+dnl HeaderFile should be relative to the lib directory and end in '.h'.
+dnl Prepares for substituting LIBUNISTRING_HEADERFILE (to HeaderFile or empty).
+dnl
+dnl When we are linking with the already installed libunistring and its version
+dnl is < VERSION, we create HeaderFile here, because we may compile functions
+dnl (via gl_LIBUNISTRING_MODULE above) that are not contained in the installed
+dnl version.
+dnl When we are linking with the already installed libunistring and its version
+dnl is > VERSION, we don't create HeaderFile here: it could cause compilation
+dnl errors in other libunistring header files if some types are missing.
+dnl
+dnl You have to bump the VERSION argument to the next projected version
+dnl number each time you make a non-comment change to the HeaderFile.
+
+AC_DEFUN([gl_LIBUNISTRING_LIBHEADER],
+[
+ AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE])
+ dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from
+ dnl gl_LIBUNISTRING_CORE if that macro has been run.
+ if gl_LIBUNISTRING_VERSION_CMP([$1]); then
+ LIBUNISTRING_[]AS_TR_CPP([$2])='$2'
+ else
+ LIBUNISTRING_[]AS_TR_CPP([$2])=
+ fi
+ AC_SUBST([LIBUNISTRING_]AS_TR_CPP([$2]))
+])
+
+dnl Miscellaneous preparations/initializations.
+
+AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE],
+[
+ dnl Ensure that HAVE_LIBUNISTRING is fully determined at this point.
+ m4_ifdef([gl_LIBUNISTRING], [AC_REQUIRE([gl_LIBUNISTRING])])
+
+ AC_REQUIRE([AC_PROG_AWK])
+
+dnl Sed expressions to extract the parts of a version number.
+changequote(,)
+gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+changequote([,])
+
+ if test "$HAVE_LIBUNISTRING" = yes; then
+ LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"`
+ LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"`
+ LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+ fi
+])
+
+dnl gl_LIBUNISTRING_VERSION_CMP([VERSION])
+dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION
+dnl is less than the VERSION argument.
+AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
+[ { test "$HAVE_LIBUNISTRING" != yes \
+ || {
+ dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least.
+ AS_LITERAL_IF([$1],
+ [dnl This is the optimized variant, that assumes the argument is a literal:
+ m4_pushdef([requested_version_major],
+ [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])])
+ m4_pushdef([requested_version_minor],
+ [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
+ m4_pushdef([requested_version_subminor],
+ [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
+ test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor
+ }
+ }
+ }
+ m4_popdef([requested_version_subminor])
+ m4_popdef([requested_version_minor])
+ m4_popdef([requested_version_major])
+ ],
+ [dnl This is the unoptimized variant:
+ requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"`
+ requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"`
+ requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+ test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \
+ || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \
+ && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \
+ || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \
+ && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor
+ }
+ }
+ }
+ ])
+ }
+ }])
+
+dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the
+dnl same as ORIG, otherwise to 0.
+m4_define([gl_LIBUNISTRING_ARG_OR_ZERO], [m4_if([$1], [$2], [0], [$1])])
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
new file mode 100644
index 0000000..22c311b
--- /dev/null
+++ b/m4/localcharset.m4
@@ -0,0 +1,17 @@
+# localcharset.m4 serial 7
+dnl Copyright (C) 2002, 2004, 2006, 2009-2016 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])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ AC_CHECK_DECLS_ONCE([getc_unlocked])
+
+ dnl Prerequisites of the lib/Makefile.am snippet.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_GLIBC21])
+])
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
new file mode 100644
index 0000000..92896a0
--- /dev/null
+++ b/m4/locale-fr.m4
@@ -0,0 +1,250 @@
+# locale-fr.m4 serial 17
+dnl Copyright (C) 2003, 2005-2016 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([
+changequote(,)dnl
+#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 () {
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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;
+}
+changequote([,])dnl
+ ])])
+ 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([
+changequote(,)dnl
+#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 __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;
+}
+changequote([,])dnl
+ ])])
+ 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/m4/locale-ja.m4 b/m4/locale-ja.m4
new file mode 100644
index 0000000..f222a08
--- /dev/null
+++ b/m4/locale-ja.m4
@@ -0,0 +1,136 @@
+# locale-ja.m4 serial 12
+dnl Copyright (C) 2003, 2005-2016 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([
+changequote(,)dnl
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+changequote([,])dnl
+ ])])
+ 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/m4/locale-tr.m4 b/m4/locale-tr.m4
new file mode 100644
index 0000000..75aa295
--- /dev/null
+++ b/m4/locale-tr.m4
@@ -0,0 +1,127 @@
+# locale-tr.m4 serial 10
+dnl Copyright (C) 2003, 2005-2016 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 turkish locale with UTF-8 encoding.
+AC_DEFUN([gt_LOCALE_TR_UTF8],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a turkish Unicode locale], [gt_cv_locale_tr_utf8], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([
+changequote(,)dnl
+#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, 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. But BeOS does not
+ implement the Turkish upper-/lowercase mappings. Therefore, let this
+ program return 1 on BeOS. */
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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 tr_TR 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 eighth month, the second
+ character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
+ two bytes long, with UTF-8 encoding. */
+ t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 4
+ || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
+ return 1;
+ /* Check whether the upper-/lowercase mappings are as expected for
+ Turkish. */
+ if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
+ || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
+ return 1;
+ return 0;
+}
+changequote([,])dnl
+ ])])
+ 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=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=Turkish_Turkey.65001
+ else
+ # None found.
+ gt_cv_locale_tr_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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr_TR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr_TR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_tr_utf8=tr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_tr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ else
+ gt_cv_locale_tr_utf8=none
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
+ AC_SUBST([LOCALE_TR_UTF8])
+])
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
new file mode 100644
index 0000000..2271f77
--- /dev/null
+++ b/m4/locale-zh.m4
@@ -0,0 +1,130 @@
+# locale-zh.m4 serial 12
+dnl Copyright (C) 2003, 2005-2016 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([
+changequote(,)dnl
+#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 ()
+{
+ const char *p;
+ /* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || 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). */
+ 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;
+}
+changequote([,])dnl
+ ])])
+ 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/m4/locale_h.m4 b/m4/locale_h.m4
new file mode 100644
index 0000000..563f8f8
--- /dev/null
+++ b/m4/locale_h.m4
@@ -0,0 +1,122 @@
+# locale_h.m4 serial 19
+dnl Copyright (C) 2007, 2009-2016 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_LOCALE_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_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])
+
+ dnl Solaris 11 2011-11 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 for <xlocale.h>.
+ AC_CHECK_HEADERS_ONCE([xlocale.h])
+ if test $ac_cv_header_xlocale_h = yes; then
+ HAVE_XLOCALE_H=1
+ 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])
+ ])
+ 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
+ else
+ HAVE_XLOCALE_H=0
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ fi
+ AC_SUBST([HAVE_XLOCALE_H])
+
+ 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
+ REPLACE_STRUCT_LCONV=1
+ 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 duplocale])
+])
+
+AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_LOCALE_H_DEFAULTS],
+[
+ GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
+ GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE])
+ GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
+ REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
+ REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
+ REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+ REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
+])
diff --git a/m4/localeconv.m4 b/m4/localeconv.m4
new file mode 100644
index 0000000..6e1dbf1
--- /dev/null
+++ b/m4/localeconv.m4
@@ -0,0 +1,22 @@
+# localeconv.m4 serial 1
+dnl Copyright (C) 2012-2016 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/m4/longlong.m4 b/m4/longlong.m4
new file mode 100644
index 0000000..36d8b12
--- /dev/null
+++ b/m4/longlong.m4
@@ -0,0 +1,113 @@
+# longlong.m4 serial 17
+dnl Copyright (C) 1999-2007, 2009-2016 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_LONG_LONG_INT if 'long long int' works.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
+
+# Note: If the type 'long long int' exists but is only 32 bits large
+# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
+# defined. In this case you can treat 'long long int' like 'long int'.
+
+AC_DEFUN([AC_TYPE_LONG_LONG_INT],
+[
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
+ [ac_cv_type_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+ if test $ac_cv_type_long_long_int = yes; then
+ dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
+ dnl If cross compiling, assume the bug is not important, since
+ dnl nobody cross compiles for this platform as far as we know.
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[@%:@include <limits.h>
+ @%:@ifndef LLONG_MAX
+ @%:@ define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ @%:@ define LLONG_MAX (HALF - 1 + HALF)
+ @%:@endif]],
+ [[long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;]])],
+ [],
+ [ac_cv_type_long_long_int=no],
+ [:])
+ fi
+ fi])
+ if test $ac_cv_type_long_long_int = yes; then
+ AC_DEFINE([HAVE_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'long long int'.])
+ fi
+])
+
+# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
+
+# Note: If the type 'unsigned long long int' exists but is only 32 bits
+# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
+# will not be defined. In this case you can treat 'unsigned long long int'
+# like 'unsigned long int'.
+
+AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
+[
+ AC_CACHE_CHECK([for unsigned long long int],
+ [ac_cv_type_unsigned_long_long_int],
+ [ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ AC_LINK_IFELSE(
+ [_AC_TYPE_LONG_LONG_SNIPPET],
+ [],
+ [ac_cv_type_unsigned_long_long_int=no])
+ fi])
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+ AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'unsigned long long int'.])
+ fi
+])
+
+# Expands to a C program that can be used to test for simultaneous support
+# of 'long long' and 'unsigned long long'. We don't want to say that
+# 'long long' is available if 'unsigned long long' is not, or vice versa,
+# because too many programs rely on the symmetry between signed and unsigned
+# integer types (excluding 'bool').
+AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
+[
+ AC_LANG_PROGRAM(
+ [[/* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;]],
+ [[/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));]])
+])
diff --git a/m4/lstat.m4 b/m4/lstat.m4
new file mode 100644
index 0000000..e143d5c
--- /dev/null
+++ b/m4/lstat.m4
@@ -0,0 +1,71 @@
+# serial 27
+
+# Copyright (C) 1997-2001, 2003-2016 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([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 "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *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_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
+ *-gnu*)
+ # Guess yes on glibc systems.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ *)
+ # If we don't know, assume the worst.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+ 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/m4/malloc.m4 b/m4/malloc.m4
new file mode 100644
index 0000000..c393690
--- /dev/null
+++ b/m4/malloc.m4
@@ -0,0 +1,101 @@
+# malloc.m4 serial 15
+dnl Copyright (C) 2007, 2009-2016 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.
+
+m4_version_prereq([2.70], [] ,[
+
+# This is adapted with modifications from upstream Autoconf here:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
+AC_DEFUN([_AC_FUNC_MALLOC_IF],
+[
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CHECK_HEADERS([stdlib.h])
+ AC_CACHE_CHECK([for GNU libc compatible malloc],
+ [ac_cv_func_malloc_0_nonnull],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+ char *malloc ();
+ #endif
+ ]],
+ [[char *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* \
+ | hpux* | solaris* | cygwin* | mingw*)
+ ac_cv_func_malloc_0_nonnull=yes ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_malloc_0_nonnull=no ;;
+ esac
+ ])
+ ])
+ AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
+])# _AC_FUNC_MALLOC_IF
+
+])
+
+# gl_FUNC_MALLOC_GNU
+# ------------------
+# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
+# it is not.
+AC_DEFUN([gl_FUNC_MALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
+ _AC_FUNC_MALLOC_IF(
+ [AC_DEFINE([HAVE_MALLOC_GNU], [1],
+ [Define to 1 if your system has a GNU libc compatible 'malloc'
+ function, and to 0 otherwise.])],
+ [AC_DEFINE([HAVE_MALLOC_GNU], [0])
+ REPLACE_MALLOC=1
+ ])
+])
+
+# gl_FUNC_MALLOC_POSIX
+# --------------------
+# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails), and replace malloc if it is not.
+AC_DEFUN([gl_FUNC_MALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
+ if test $gl_cv_func_malloc_posix = yes; then
+ AC_DEFINE([HAVE_MALLOC_POSIX], [1],
+ [Define if the 'malloc' function is POSIX compliant.])
+ else
+ REPLACE_MALLOC=1
+ fi
+])
+
+# Test whether malloc, realloc, calloc are POSIX compliant,
+# Set gl_cv_func_malloc_posix to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_POSIX],
+[
+ AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
+ [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 are POSIX compliant.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[]],
+ [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ choke me
+ #endif
+ ]])],
+ [gl_cv_func_malloc_posix=yes],
+ [gl_cv_func_malloc_posix=no])
+ ])
+])
diff --git a/m4/malloca.m4 b/m4/malloca.m4
new file mode 100644
index 0000000..b368b20
--- /dev/null
+++ b/m4/malloca.m4
@@ -0,0 +1,15 @@
+# malloca.m4 serial 1
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MALLOCA],
+[
+ dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
+ dnl @ALLOCA@ and @LTALLOCA@.
+ dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
+ AC_REQUIRE([gl_EEMALLOC])
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+])
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
new file mode 100644
index 0000000..90823b0
--- /dev/null
+++ b/m4/manywarnings.m4
@@ -0,0 +1,274 @@
+# manywarnings.m4 serial 8
+dnl Copyright (C) 2008-2016 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_warn_set="$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.
+AC_DEFUN([gl_MANYWARN_ALL_GCC],
+[
+ 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 -W -Werror -Wno-missing-field-initializers is supported
+ dnl with the current $CC $CFLAGS $CPPFLAGS.
+ AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
+ AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -W -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"])
+ AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
+
+ 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_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
+ AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -W -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[void f (void)
+ {
+ typedef struct { int a; int b; } s_t;
+ s_t s1 = { 0, };
+ }
+ ]],
+ [[]])],
+ [gl_cv_cc_nomfi_needed=no],
+ [gl_cv_cc_nomfi_needed=yes])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+ 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_MSG_CHECKING([whether -Wuninitialized is supported])
+ AC_CACHE_VAL([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"])
+ AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
+
+ fi
+
+ # List all gcc warning categories.
+ # To compare this list to your installed GCC's, run this Bash command:
+ #
+ # comm -3 \
+ # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
+ # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort |
+ # grep -v -x -f <(
+ # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+
+ gl_manywarn_set=
+ for gl_manywarn_item in \
+ -W \
+ -Wabi \
+ -Waddress \
+ -Waggressive-loop-optimizations \
+ -Wall \
+ -Wattributes \
+ -Wbad-function-cast \
+ -Wbool-compare \
+ -Wbuiltin-macro-redefined \
+ -Wcast-align \
+ -Wchar-subscripts \
+ -Wchkp \
+ -Wclobbered \
+ -Wcomment \
+ -Wcomments \
+ -Wcoverage-mismatch \
+ -Wcpp \
+ -Wdate-time \
+ -Wdeprecated \
+ -Wdeprecated-declarations \
+ -Wdesignated-init \
+ -Wdisabled-optimization \
+ -Wdiscarded-array-qualifiers \
+ -Wdiscarded-qualifiers \
+ -Wdiv-by-zero \
+ -Wdouble-promotion \
+ -Wduplicated-cond \
+ -Wempty-body \
+ -Wendif-labels \
+ -Wenum-compare \
+ -Wextra \
+ -Wformat-contains-nul \
+ -Wformat-extra-args \
+ -Wformat-nonliteral \
+ -Wformat-security \
+ -Wformat-signedness \
+ -Wformat-y2k \
+ -Wformat-zero-length \
+ -Wframe-address \
+ -Wfree-nonheap-object \
+ -Whsa \
+ -Wignored-attributes \
+ -Wignored-qualifiers \
+ -Wimplicit \
+ -Wimplicit-function-declaration \
+ -Wimplicit-int \
+ -Wincompatible-pointer-types \
+ -Winit-self \
+ -Winline \
+ -Wint-conversion \
+ -Wint-to-pointer-cast \
+ -Winvalid-memory-model \
+ -Winvalid-pch \
+ -Wjump-misses-init \
+ -Wlogical-not-parentheses \
+ -Wlogical-op \
+ -Wmain \
+ -Wmaybe-uninitialized \
+ -Wmemset-transposed-args \
+ -Wmisleading-indentation \
+ -Wmissing-braces \
+ -Wmissing-declarations \
+ -Wmissing-field-initializers \
+ -Wmissing-include-dirs \
+ -Wmissing-parameter-type \
+ -Wmissing-prototypes \
+ -Wmultichar \
+ -Wnarrowing \
+ -Wnested-externs \
+ -Wnonnull \
+ -Wnonnull-compare \
+ -Wnull-dereference \
+ -Wodr \
+ -Wold-style-declaration \
+ -Wold-style-definition \
+ -Wopenmp-simd \
+ -Woverflow \
+ -Woverlength-strings \
+ -Woverride-init \
+ -Wpacked \
+ -Wpacked-bitfield-compat \
+ -Wparentheses \
+ -Wpointer-arith \
+ -Wpointer-sign \
+ -Wpointer-to-int-cast \
+ -Wpragmas \
+ -Wreturn-local-addr \
+ -Wreturn-type \
+ -Wscalar-storage-order \
+ -Wsequence-point \
+ -Wshadow \
+ -Wshift-count-negative \
+ -Wshift-count-overflow \
+ -Wshift-negative-value \
+ -Wsizeof-array-argument \
+ -Wsizeof-pointer-memaccess \
+ -Wstack-protector \
+ -Wstrict-aliasing \
+ -Wstrict-overflow \
+ -Wstrict-prototypes \
+ -Wsuggest-attribute=const \
+ -Wsuggest-attribute=format \
+ -Wsuggest-attribute=noreturn \
+ -Wsuggest-attribute=pure \
+ -Wsuggest-final-methods \
+ -Wsuggest-final-types \
+ -Wswitch \
+ -Wswitch-bool \
+ -Wswitch-default \
+ -Wsync-nand \
+ -Wsystem-headers \
+ -Wtautological-compare \
+ -Wtrampolines \
+ -Wtrigraphs \
+ -Wtype-limits \
+ -Wuninitialized \
+ -Wunknown-pragmas \
+ -Wunsafe-loop-optimizations \
+ -Wunused \
+ -Wunused-but-set-parameter \
+ -Wunused-but-set-variable \
+ -Wunused-function \
+ -Wunused-label \
+ -Wunused-local-typedefs \
+ -Wunused-macros \
+ -Wunused-parameter \
+ -Wunused-result \
+ -Wunused-value \
+ -Wunused-variable \
+ -Wvarargs \
+ -Wvariadic-macros \
+ -Wvector-operation-performance \
+ -Wvla \
+ -Wvolatile-register-var \
+ -Wwrite-strings \
+ \
+ ; do
+ gl_manywarn_set="$gl_manywarn_set $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_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
+ gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
+ gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
+ gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
+
+ # 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_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
+ gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
+ ;;
+ esac
+ fi
+
+ # Disable specific options as needed.
+ if test "$gl_cv_cc_nomfi_needed" = yes; then
+ gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+ fi
+
+ if test "$gl_cv_cc_uninitialized_supported" = no; then
+ gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
+ fi
+
+ $1=$gl_manywarn_set
+])
diff --git a/m4/mbchar.m4 b/m4/mbchar.m4
new file mode 100644
index 0000000..26484fa
--- /dev/null
+++ b/m4/mbchar.m4
@@ -0,0 +1,13 @@
+# mbchar.m4 serial 9
+dnl Copyright (C) 2005-2007, 2009-2016 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 autoconf tests required for use of mbchar.m4
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_MBCHAR],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
diff --git a/m4/mbiter.m4 b/m4/mbiter.m4
new file mode 100644
index 0000000..3383ee4
--- /dev/null
+++ b/m4/mbiter.m4
@@ -0,0 +1,14 @@
+# mbiter.m4 serial 7
+dnl Copyright (C) 2005, 2008-2016 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 autoconf tests required for use of mbiter.h
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_MBITER],
+[
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ :
+])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
new file mode 100644
index 0000000..d370fcc
--- /dev/null
+++ b/m4/mbrtowc.m4
@@ -0,0 +1,664 @@
+# mbrtowc.m4 serial 27 -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2016 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([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],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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_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_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_C_locale_sans_EILSEQ in
+ *yes) ;;
+ *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1],
+ [Define to 1 if the C locale may have encoding errors.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ fi
+ fi
+])
+
+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_TYPE_MBSTATE_T])
+ AC_CHECK_FUNCS_ONCE([mbsinit])
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
+ if test $ac_cv_func_mbsinit = yes && 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([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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_incomplete_state=yes],
+ [gl_cv_func_mbrtowc_incomplete_state=no],
+ [:])
+ 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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ 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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ 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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_nul_retval=yes],
+ [gl_cv_func_mbrtowc_nul_retval=no],
+ [:])
+ fi
+ ])
+])
+
+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*)
+ gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ *) 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_CACHE_CHECK([whether the C locale is free of encoding errors],
+ [gl_cv_C_locale_sans_EILSEQ],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+ gl_cv_C_locale_sans_EILSEQ="guessing no"
+
+ 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 1;
+ 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 1;
+ }
+ return 0;
+ ]])],
+ [gl_cv_C_locale_sans_EILSEQ=yes],
+ [gl_cv_C_locale_sans_EILSEQ=no],
+ [:])])
+])
+
+# Prerequisites of lib/mbrtowc.c.
+AC_DEFUN([gl_PREREQ_MBRTOWC], [
+ :
+])
+
+
+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(
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #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/m4/mbsinit.m4 b/m4/mbsinit.m4
new file mode 100644
index 0000000..88f0836
--- /dev/null
+++ b/m4/mbsinit.m4
@@ -0,0 +1,51 @@
+# mbsinit.m4 serial 8
+dnl Copyright (C) 2008, 2010-2016 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],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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/m4/mbslen.m4 b/m4/mbslen.m4
new file mode 100644
index 0000000..7736529
--- /dev/null
+++ b/m4/mbslen.m4
@@ -0,0 +1,16 @@
+# mbslen.m4 serial 2
+dnl Copyright (C) 2010-2016 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_MBSLEN],
+[
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([mbslen])
+ if test $ac_cv_func_mbslen = yes; then
+ HAVE_MBSLEN=1
+ else
+ HAVE_MBSLEN=0
+ fi
+])
diff --git a/m4/mbsrtowcs.m4 b/m4/mbsrtowcs.m4
new file mode 100644
index 0000000..3b5dc6e
--- /dev/null
+++ b/m4/mbsrtowcs.m4
@@ -0,0 +1,155 @@
+# mbsrtowcs.m4 serial 13
+dnl Copyright (C) 2008-2016 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],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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/m4/mbstate_t.m4 b/m4/mbstate_t.m4
new file mode 100644
index 0000000..0a8eae2
--- /dev/null
+++ b/m4/mbstate_t.m4
@@ -0,0 +1,41 @@
+# mbstate_t.m4 serial 13
+dnl Copyright (C) 2000-2002, 2008-2016 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[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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/m4/mbtowc.m4 b/m4/mbtowc.m4
new file mode 100644
index 0000000..e770bbf
--- /dev/null
+++ b/m4/mbtowc.m4
@@ -0,0 +1,19 @@
+# mbtowc.m4 serial 2
+dnl Copyright (C) 2011-2016 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])
+
+ if false; then
+ REPLACE_MBTOWC=1
+ fi
+])
+
+# Prerequisites of lib/mbtowc.c.
+AC_DEFUN([gl_PREREQ_MBTOWC], [
+ :
+])
diff --git a/m4/memchr.m4 b/m4/memchr.m4
new file mode 100644
index 0000000..25d32f0
--- /dev/null
+++ b/m4/memchr.m4
@@ -0,0 +1,88 @@
+# memchr.m4 serial 12
+dnl Copyright (C) 2002-2004, 2009-2016 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],
+[
+ 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_HEADER_STRING_H_DEFAULTS])
+ m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
+ dnl These days, we assume memchr is present. But if support for old
+ dnl platforms is desired:
+ AC_CHECK_FUNCS_ONCE([memchr])
+ if test $ac_cv_func_memchr = no; then
+ HAVE_MEMCHR=0
+ fi
+ ])
+ if test $HAVE_MEMCHR = 1; then
+ # Detect platform-specific bugs in some versions of glibc:
+ # memchr should not dereference anything with length 0
+ # http://bugzilla.redhat.com/499689
+ # memchr should not dereference overestimated length after a match
+ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # http://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # 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)
+ {
+ 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;
+ }
+ return result;
+]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
+ [dnl Be pessimistic for now.
+ gl_cv_func_memchr_works="guessing no"])])
+ if test "$gl_cv_func_memchr_works" != yes; then
+ REPLACE_MEMCHR=1
+ fi
+ fi
+])
+
+# Prerequisites of lib/memchr.c.
+AC_DEFUN([gl_PREREQ_MEMCHR], [
+ AC_CHECK_HEADERS([bp-sym.h])
+])
diff --git a/m4/mkstemp.m4 b/m4/mkstemp.m4
new file mode 100644
index 0000000..131e4a7
--- /dev/null
+++ b/m4/mkstemp.m4
@@ -0,0 +1,82 @@
+#serial 23
+
+# Copyright (C) 2001, 2003-2007, 2009-2016 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],
+ [[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*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_working_mkstemp="guessing no" ;;
+ 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/m4/mktime.m4 b/m4/mktime.m4
new file mode 100644
index 0000000..23cad73
--- /dev/null
+++ b/m4/mktime.m4
@@ -0,0 +1,268 @@
+# serial 27
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 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.
+
+AC_DEFUN([gl_TIME_T_IS_SIGNED],
+[
+ AC_CACHE_CHECK([whether time_t is signed],
+ [gl_cv_time_t_is_signed],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <time.h>
+ char time_t_signed[(time_t) -1 < 0 ? 1 : -1];]])],
+ [gl_cv_time_t_is_signed=yes],
+ [gl_cv_time_t_is_signed=no])])
+ if test $gl_cv_time_t_is_signed = yes; then
+ AC_DEFINE([TIME_T_IS_SIGNED], [1], [Define to 1 if time_t is signed.])
+ fi
+])
+
+AC_DEFUN([gl_FUNC_MKTIME],
+[
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([gl_TIME_T_IS_SIGNED])
+
+ dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
+ dnl in Autoconf and because it invokes AC_LIBOBJ.
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_DECLS_ONCE([alarm])
+ AC_CHECK_FUNCS_ONCE([tzset])
+ 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 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime=no
+ fi
+ AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+[[/* Test program from Paul Eggert and Tony Leneis. */
+#include <limits.h>
+#include <stdlib.h>
+#include <time.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_DECL_ALARM
+# include <signal.h>
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests. */
+#undef putenv
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable. */
+static char *tz_strings[] = {
+ (char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static int
+spring_forward_gap ()
+{
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (time_t now)
+{
+ struct tm *lt;
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ return 0;
+ }
+ return 1;
+}
+
+static int
+year_2050_test ()
+{
+ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+ ignoring leap seconds. */
+ unsigned long int answer = 2527315200UL;
+
+ struct tm tm;
+ time_t t;
+ tm.tm_year = 2050 - 1900;
+ tm.tm_mon = 2 - 1;
+ tm.tm_mday = 1;
+ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ t = mktime (&tm);
+
+ /* Check that the result is either a failure, or close enough
+ to the correct answer that we can assume the discrepancy is
+ due to leap seconds. */
+ return (t == (time_t) -1
+ || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+int
+main ()
+{
+ int result = 0;
+ time_t t, delta;
+ int i, j;
+ int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
+
+#if HAVE_DECL_ALARM
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (60);
+#endif
+
+ time_t_max = (! TIME_T_IS_SIGNED
+ ? (time_t) -1
+ : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
+ * 2 + 1));
+ time_t_min = (! TIME_T_IS_SIGNED
+ ? (time_t) 0
+ : time_t_signed_magnitude
+ ? ~ (time_t) 0
+ : ~ time_t_max);
+
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
+ if (! mktime_test (t))
+ result |= 1;
+ if ((result & 2) == 0
+ && ! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ result |= 2;
+
+ for (j = 1; (result & 4) == 0; j <<= 1)
+ {
+ if (! bigtime_test (j))
+ result |= 4;
+ if (INT_MAX / 2 < j)
+ break;
+ }
+ if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
+ result |= 8;
+ }
+ if (! irix_6_4_bug ())
+ result |= 16;
+ if (! spring_forward_gap ())
+ result |= 32;
+ if (! year_2050_test ())
+ result |= 64;
+ return result;
+}]])],
+ [gl_cv_func_working_mktime=yes],
+ [gl_cv_func_working_mktime=no],
+ [gl_cv_func_working_mktime=no])
+ ])
+
+ if test $gl_cv_func_working_mktime = no; then
+ REPLACE_MKTIME=1
+ else
+ REPLACE_MKTIME=0
+ fi
+])
+
+AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
+ AC_REQUIRE([gl_FUNC_MKTIME])
+ if test $REPLACE_MKTIME = 0; then
+ dnl BeOS has __mktime_internal in libc, but other platforms don't.
+ AC_CHECK_FUNC([__mktime_internal],
+ [AC_DEFINE([mktime_internal], [__mktime_internal],
+ [Define to the real name of the mktime_internal function.])
+ ],
+ [dnl mktime works but it doesn't export __mktime_internal,
+ dnl so we need to substitute our own mktime implementation.
+ REPLACE_MKTIME=1
+ ])
+ fi
+])
+
+# Prerequisites of lib/mktime.c.
+AC_DEFUN([gl_PREREQ_MKTIME], [:])
diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4
new file mode 100644
index 0000000..853c89d
--- /dev/null
+++ b/m4/mmap-anon.m4
@@ -0,0 +1,55 @@
+# mmap-anon.m4 serial 10
+dnl Copyright (C) 2005, 2007, 2009-2016 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, only MAP_ANON exists.
+# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
+# used.
+
+AC_DEFUN([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/m4/mode_t.m4 b/m4/mode_t.m4
new file mode 100644
index 0000000..0cd40db
--- /dev/null
+++ b/m4/mode_t.m4
@@ -0,0 +1,26 @@
+# mode_t.m4 serial 2
+dnl Copyright (C) 2009-2016 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/m4/msvc-inval.m4 b/m4/msvc-inval.m4
new file mode 100644
index 0000000..f5e4c89
--- /dev/null
+++ b/m4/msvc-inval.m4
@@ -0,0 +1,19 @@
+# msvc-inval.m4 serial 1
+dnl Copyright (C) 2011-2016 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/m4/msvc-nothrow.m4 b/m4/msvc-nothrow.m4
new file mode 100644
index 0000000..58f5c0b
--- /dev/null
+++ b/m4/msvc-nothrow.m4
@@ -0,0 +1,10 @@
+# msvc-nothrow.m4 serial 1
+dnl Copyright (C) 2011-2016 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/m4/multiarch.m4 b/m4/multiarch.m4
new file mode 100644
index 0000000..43b5d05
--- /dev/null
+++ b/m4/multiarch.m4
@@ -0,0 +1,62 @@
+# multiarch.m4 serial 7
+dnl Copyright (C) 2008-2016 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.
+ 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)
+ 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/m4/nanosleep.m4 b/m4/nanosleep.m4
new file mode 100644
index 0000000..12914d4
--- /dev/null
+++ b/m4/nanosleep.m4
@@ -0,0 +1,148 @@
+# serial 36
+
+dnl From Jim Meyering.
+dnl Check for the nanosleep function.
+dnl If not found, use the supplied replacement.
+dnl
+
+# Copyright (C) 1999-2001, 2003-2016 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_HEADER_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_HEADERS_ONCE([sys/time.h])
+ AC_REQUIRE([gl_FUNC_SELECT])
+
+ 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>
+ #if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #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)))
+
+ static void
+ check_for_SIGALRM (int sig)
+ {
+ if (sig != SIGALRM)
+ _exit (1);
+ }
+
+ int
+ main ()
+ {
+ static struct timespec ts_sleep;
+ static struct timespec ts_remaining;
+ static struct sigaction act;
+ /* Test for major problems first. */
+ if (! nanosleep)
+ return 2;
+ act.sa_handler = check_for_SIGALRM;
+ sigemptyset (&act.sa_mask);
+ sigaction (SIGALRM, &act, NULL);
+ ts_sleep.tv_sec = 0;
+ ts_sleep.tv_nsec = 1;
+ 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;
+ 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)' ;;
+ *) # If we don't know, assume the worst.
+ gl_cv_func_nanosleep='guessing no' ;;
+ 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.])
+ ;;
+ *)
+ # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP.
+ for ac_lib in $LIBSOCKET; do
+ case " $LIB_NANOSLEEP " in
+ *" $ac_lib "*) ;;
+ *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";;
+ esac
+ done
+ ;;
+ esac
+ ;;
+ esac
+ else
+ HAVE_NANOSLEEP=0
+ fi
+ LIBS=$nanosleep_save_libs
+])
+
+# Prerequisites of lib/nanosleep.c.
+AC_DEFUN([gl_PREREQ_NANOSLEEP],
+[
+ AC_CHECK_HEADERS_ONCE([sys/select.h])
+ gl_PREREQ_SIG_HANDLER_H
+])
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
new file mode 100644
index 0000000..93dcc68
--- /dev/null
+++ b/m4/netinet_in_h.m4
@@ -0,0 +1,31 @@
+# netinet_in_h.m4 serial 5
+dnl Copyright (C) 2006-2016 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_HEADER_NETINET_IN],
+[
+ AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
+ [gl_cv_header_netinet_in_h_selfcontained],
+ [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
+ [gl_cv_header_netinet_in_h_selfcontained=yes],
+ [gl_cv_header_netinet_in_h_selfcontained=no])
+ ])
+ if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+ NETINET_IN_H=''
+ else
+ NETINET_IN_H='netinet/in.h'
+ AC_CHECK_HEADERS([netinet/in.h])
+ gl_CHECK_NEXT_HEADERS([netinet/in.h])
+ if test $ac_cv_header_netinet_in_h = yes; then
+ HAVE_NETINET_IN_H=1
+ else
+ HAVE_NETINET_IN_H=0
+ fi
+ AC_SUBST([HAVE_NETINET_IN_H])
+ fi
+ AC_SUBST([NETINET_IN_H])
+ AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"])
+])
diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4
new file mode 100644
index 0000000..a2f7196
--- /dev/null
+++ b/m4/nl_langinfo.m4
@@ -0,0 +1,50 @@
+# nl_langinfo.m4 serial 5
+dnl Copyright (C) 2009-2016 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]) dnl for cross-compiles
+ 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.])
+ if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 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
+])
diff --git a/m4/nls.m4 b/m4/nls.m4
new file mode 100644
index 0000000..53cdc8b
--- /dev/null
+++ b/m4/nls.m4
@@ -0,0 +1,32 @@
+# nls.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 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/m4/nocrash.m4 b/m4/nocrash.m4
new file mode 100644
index 0000000..d8dd8f1
--- /dev/null
+++ b/m4/nocrash.m4
@@ -0,0 +1,131 @@
+# nocrash.m4 serial 4
+dnl Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
+
+AC_PREREQ([2.13])
+
+dnl Expands to some code for use in .c programs that will cause the configure
+dnl test to exit instead of crashing. This is useful to avoid triggering
+dnl action from a background debugger and to avoid core dumps.
+dnl Usage: ...
+dnl ]GL_NOCRASH[
+dnl ...
+dnl int main() { nocrash_init(); ... }
+AC_DEFUN([GL_NOCRASH],[[
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X. */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens. */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+ EXC_BAD_ACCESS. */
+static void *
+mach_exception_thread (void *arg)
+{
+ /* Buffer for a message to be received. */
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+ mach_msg_return_t retval;
+ /* Wait for a message on the exception port. */
+ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+ our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (retval != MACH_MSG_SUCCESS)
+ abort ();
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+ mach_port_t self = mach_task_self ();
+ /* Allocate a port on which the thread shall listen for exceptions. */
+ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+ == KERN_SUCCESS) {
+ /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+ MACH_MSG_TYPE_MAKE_SEND)
+ == KERN_SUCCESS) {
+ /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
+ for us. */
+ exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+ /* Create the thread listening on the exception port. */
+ pthread_attr_t attr;
+ pthread_t thread;
+ if (pthread_attr_init (&attr) == 0
+ && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+ && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+ pthread_attr_destroy (&attr);
+ /* Replace the exception port info for these exceptions with our own.
+ Note that we replace the exception port for the entire task, not only
+ for a particular thread. This has the effect that when our exception
+ port gets the message, the thread specific exception port has already
+ been asked, and we don't need to bother about it.
+ See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ task_set_exception_ports (self, mask, our_exception_port,
+ EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+ }
+ }
+ }
+}
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+ switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ case EXCEPTION_STACK_OVERFLOW:
+ case EXCEPTION_GUARD_PAGE:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exit (1);
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+ SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems. */
+#include <signal.h>
+#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/m4/off_t.m4 b/m4/off_t.m4
new file mode 100644
index 0000000..282751b
--- /dev/null
+++ b/m4/off_t.m4
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012-2016 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/m4/open.m4 b/m4/open.m4
new file mode 100644
index 0000000..53d3038
--- /dev/null
+++ b/m4/open.m4
@@ -0,0 +1,91 @@
+# open.m4 serial 14
+dnl Copyright (C) 2007-2016 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])
+ 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])
+ 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
+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.])
+ 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/m4/pathmax.m4 b/m4/pathmax.m4
new file mode 100644
index 0000000..6f8e59a
--- /dev/null
+++ b/m4/pathmax.m4
@@ -0,0 +1,42 @@
+# pathmax.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 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 __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/m4/perror.m4 b/m4/perror.m4
new file mode 100644
index 0000000..743ab7a
--- /dev/null
+++ b/m4/perror.m4
@@ -0,0 +1,63 @@
+# perror.m4 serial 6
+dnl Copyright (C) 2008-2016 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_PERROR],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_R])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
+ dnl since on glibc systems, strerror_r is replaced only for signature
+ dnl issues, and perror is just fine. Rather, we only want to
+ dnl replace perror if strerror_r was replaced for a content fix.
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
+ dnl The system's perror() cannot know about the new errno values we add
+ dnl to <errno.h>, or any fix for strerror(0). Replace it.
+ REPLACE_PERROR=1
+ fi
+ case ${gl_cv_func_strerror_r_works-unset} in
+ unset|*yes)
+ AC_CACHE_CHECK([whether perror matches strerror],
+ [gl_cv_func_perror_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ ]],
+ [[char *str = strerror (-1);
+ if (!getenv("CONFTEST_OUTPUT")) return 0;
+ if (!str) str = "";
+ puts (str);
+ errno = -1;
+ perror ("");
+ return 0;
+ ]])],
+ [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+ && cmp conftest.txt1 conftest.txt2 >/dev/null; then
+ gl_cv_func_perror_works=yes
+ else
+ gl_cv_func_perror_works=no
+ fi
+ rm -rf conftest.txt1 conftest.txt2],
+ [gl_cv_func_perror_works=no],
+ [dnl Guess no when cross-compiling.
+ gl_cv_func_perror_works="guessing no"
+ ])
+ ])
+ if test "$gl_cv_func_perror_works" != yes; then
+ REPLACE_PERROR=1
+ fi
+ ;;
+ *)
+ dnl The system's perror() probably inherits the bugs in the
+ dnl system's strerror_r(). Replace it.
+ REPLACE_PERROR=1
+ ;;
+ esac
+])
diff --git a/m4/pipe.m4 b/m4/pipe.m4
new file mode 100644
index 0000000..0fe6975
--- /dev/null
+++ b/m4/pipe.m4
@@ -0,0 +1,15 @@
+# pipe.m4 serial 2
+dnl Copyright (C) 2010-2016 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/m4/po.m4 b/m4/po.m4
new file mode 100644
index 0000000..84659ea
--- /dev/null
+++ b/m4/po.m4
@@ -0,0 +1,453 @@
+# po.m4 serial 22 (gettext-0.19)
+dnl Copyright (C) 1995-2014 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.19])
+
+ 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/m4/printf.m4 b/m4/printf.m4
new file mode 100644
index 0000000..e495e0c
--- /dev/null
+++ b/m4/printf.m4
@@ -0,0 +1,1555 @@
+# printf.m4 serial 52
+dnl Copyright (C) 2003, 2007-2016 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;
+#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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_sizes_c99="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ beos*) gl_cv_func_printf_long_double="guessing no";;
+ mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
+ *) gl_cv_func_printf_long_double="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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 BeOS.
+ beos*) gl_cv_func_printf_infinite="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_infinite="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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],
+ [
+changequote(,)dnl
+ 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
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_infinite_long_double="guessing no";;
+ esac
+ ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+ ;;
+ *)
+ 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 6.1 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 FreeBSD 6.1 bug. See
+ <http://lists.gnu.org/archive/html/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 <http://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*)
+ 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"])
+ ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_directive_a="guessing no";;
+ 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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_directive_f="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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
+/* See page about "Parameter Validation" on msdn.microsoft.com. */
+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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ mingw*) gl_cv_func_printf_directive_n="guessing no";;
+ *) gl_cv_func_printf_directive_n="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.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
+ openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
+ 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";;
+ *) 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";;
+ 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";;
+ 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 <http://lists.gnu.org/archive/html/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 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 <http://lists.gnu.org/archive/html/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*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_flag_zero="guessing no";;
+ 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" ;;
+ *) 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[
+changequote(,)dnl
+#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));
+}
+changequote([,])dnl
+ ])])
+ 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*) 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_enomem="guessing no";;
+ 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([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*) 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";;
+ # 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ 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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_retval_c99="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) 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";;
+ # 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";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_directive_n="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+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([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],
+ [gl_cv_func_snprintf_size1="guessing yes"])
+ ])
+])
+
+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*) 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";;
+ # 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 mingw.
+ mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ 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 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
+dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
+dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
+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 2011-11 . . # # # . . # . . . # . . . . . . . .
+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 5.0 . . . # # . . . . . . # . # . . . . . .
+dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
+dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
+dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
+dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
+dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . .
+dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . .
+dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . .
+dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . .
diff --git a/m4/progtest.m4 b/m4/progtest.m4
new file mode 100644
index 0000000..b499f79
--- /dev/null
+++ b/m4/progtest.m4
@@ -0,0 +1,91 @@
+# progtest.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2014 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/m4/putenv.m4 b/m4/putenv.m4
new file mode 100644
index 0000000..c3c30d8
--- /dev/null
+++ b/m4/putenv.m4
@@ -0,0 +1,56 @@
+# putenv.m4 serial 20
+dnl Copyright (C) 2002-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+dnl
+dnl Check whether putenv ("FOO") removes FOO from the environment.
+dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
+
+AC_DEFUN([gl_FUNC_PUTENV],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([for putenv compatible with GNU and SVID],
+ [gl_cv_func_svid_putenv],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[
+ /* Put it in env. */
+ if (putenv ("CONFTEST_putenv=val"))
+ return 1;
+
+ /* Try to remove it. */
+ if (putenv ("CONFTEST_putenv"))
+ return 2;
+
+ /* Make sure it was deleted. */
+ if (getenv ("CONFTEST_putenv") != 0)
+ return 3;
+
+ return 0;
+ ]])],
+ gl_cv_func_svid_putenv=yes,
+ gl_cv_func_svid_putenv=no,
+ dnl When crosscompiling, assume putenv is broken.
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_svid_putenv="guessing no" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_svid_putenv" in
+ *yes) ;;
+ *)
+ REPLACE_PUTENV=1
+ ;;
+ esac
+])
+
+# Prerequisites of lib/putenv.c.
+AC_DEFUN([gl_PREREQ_PUTENV],
+[
+ AC_CHECK_DECLS([_putenv])
+])
diff --git a/m4/quote.m4 b/m4/quote.m4
new file mode 100644
index 0000000..50894f8
--- /dev/null
+++ b/m4/quote.m4
@@ -0,0 +1,13 @@
+# quote.m4 serial 6
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 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_QUOTE],
+[
+ dnl Prerequisites of lib/quote.c.
+ dnl (none)
+ :
+])
diff --git a/m4/quotearg.m4 b/m4/quotearg.m4
new file mode 100644
index 0000000..2562375
--- /dev/null
+++ b/m4/quotearg.m4
@@ -0,0 +1,10 @@
+# quotearg.m4 serial 9
+dnl Copyright (C) 2002, 2004-2016 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_QUOTEARG],
+[
+ :
+])
diff --git a/m4/raise.m4 b/m4/raise.m4
new file mode 100644
index 0000000..71c1f4c
--- /dev/null
+++ b/m4/raise.m4
@@ -0,0 +1,34 @@
+# raise.m4 serial 3
+dnl Copyright (C) 2011-2016 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_REQUIRE([gl_MSVC_INVAL])
+ AC_CHECK_FUNCS([raise])
+ if test $ac_cv_func_raise = no; then
+ HAVE_RAISE=0
+ else
+ 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/m4/rawmemchr.m4 b/m4/rawmemchr.m4
new file mode 100644
index 0000000..d3ccb7e
--- /dev/null
+++ b/m4/rawmemchr.m4
@@ -0,0 +1,20 @@
+# rawmemchr.m4 serial 2
+dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_RAWMEMCHR],
+[
+ dnl Persuade glibc <string.h> to declare rawmemchr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([rawmemchr])
+ if test $ac_cv_func_rawmemchr = no; then
+ HAVE_RAWMEMCHR=0
+ fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
new file mode 100644
index 0000000..ede0378
--- /dev/null
+++ b/m4/readlink.m4
@@ -0,0 +1,71 @@
+# readlink.m4 serial 12
+dnl Copyright (C) 2003, 2007, 2009-2016 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_works],
+ [# 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_works=yes], [gl_cv_func_readlink_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_readlink_works="guessing no" ;;
+ esac
+ ])
+ rm -f conftest.link conftest.lnk2])
+ case "$gl_cv_func_readlink_works" 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
+ 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/m4/regex.m4 b/m4/regex.m4
new file mode 100644
index 0000000..abfd262
--- /dev/null
+++ b/m4/regex.m4
@@ -0,0 +1,293 @@
+# serial 66
+
+# Copyright (C) 1996-2001, 2003-2016 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_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"))
+ {
+ {
+ /* http://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
+ <http://www.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;
+ /* This should fail, but succeeds for glibc-2.5. */
+ else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+
+ /* 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;
+
+ /* 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;
+
+ /* 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;
+
+ /* 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;
+ /* This should match, but does not for glibc-2.2.1. */
+ else if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 8;
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+
+ /* 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;
+
+ /* Catch a bug reported by Vin Shelton in
+ http://lists.gnu.org/archive/html/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;
+
+ /* REG_STARTEND was added to glibc on 2004-01-15.
+ Reject older versions. */
+ if (! REG_STARTEND)
+ result |= 64;
+
+#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],
+ dnl When crosscompiling, assume it is not working.
+ [gl_cv_func_re_compile_pattern_working=no])])
+ 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_REQUIRE([gl_GLIBC21])
+ AC_CHECK_HEADERS([libintl.h])
+ AC_CHECK_FUNCS_ONCE([isblank iswctype])
+ AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
+])
diff --git a/m4/secure_getenv.m4 b/m4/secure_getenv.m4
new file mode 100644
index 0000000..3983173
--- /dev/null
+++ b/m4/secure_getenv.m4
@@ -0,0 +1,26 @@
+# Look up an environment variable more securely.
+dnl Copyright 2013-2016 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_SECURE_GETENV],
+[
+ dnl Persuade glibc <stdlib.h> to declare secure_getenv().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([secure_getenv])
+ if test $ac_cv_func_secure_getenv = no; then
+ HAVE_SECURE_GETENV=0
+ fi
+])
+
+# Prerequisites of lib/secure_getenv.c.
+AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
+ AC_CHECK_FUNCS([__secure_getenv])
+ if test $ac_cv_func___secure_getenv = no; then
+ AC_CHECK_FUNCS([issetugid])
+ fi
+ AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid])
+])
diff --git a/m4/select.m4 b/m4/select.m4
new file mode 100644
index 0000000..d193655
--- /dev/null
+++ b/m4/select.m4
@@ -0,0 +1,114 @@
+# select.m4 serial 8
+dnl Copyright (C) 2009-2016 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_HEADER_SYS_SELECT])
+ 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>
+]],[[
+ 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 glibc systems.
+ *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_select_detects_ebadf="guessing no" ;;
+ 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/m4/setenv.m4 b/m4/setenv.m4
new file mode 100644
index 0000000..5d49aba
--- /dev/null
+++ b/m4/setenv.m4
@@ -0,0 +1,160 @@
+# setenv.m4 serial 26
+dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SETENV],
+[
+ AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ else
+ AC_CACHE_CHECK([whether setenv validates arguments],
+ [gl_cv_func_setenv_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+ ]], [[
+ int result = 0;
+ {
+ if (setenv ("", "", 0) != -1)
+ result |= 1;
+ else if (errno != EINVAL)
+ result |= 2;
+ }
+ {
+ if (setenv ("a", "=", 1) != 0)
+ result |= 4;
+ else if (strcmp (getenv ("a"), "=") != 0)
+ result |= 8;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_setenv_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Like gl_FUNC_SETENV, except prepare for separate compilation
+# (no REPLACE_SETENV, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([setenv])
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+ AC_CHECK_FUNCS_ONCE([setenv])
+ gl_PREREQ_SETENV
+])
+
+AC_DEFUN([gl_FUNC_UNSETENV],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_DECLS_ONCE([unsetenv])
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ AC_CHECK_FUNCS([unsetenv])
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ dnl Some BSDs return void, failing to do error checking.
+ AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+ ]],
+ [[]])],
+ [gt_cv_func_unsetenv_ret='int'],
+ [gt_cv_func_unsetenv_ret='void'])])
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+ AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
+ instead of int.])
+ REPLACE_UNSETENV=1
+ fi
+
+ dnl Solaris 10 unsetenv does not remove all copies of a name.
+ dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
+ dnl OpenBSD 4.7 unsetenv("") does not fail.
+ AC_CACHE_CHECK([whether unsetenv obeys POSIX],
+ [gl_cv_func_unsetenv_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+ ]], [[
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+ ]])],
+ [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_unsetenv_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/setenv.c.
+AC_DEFUN([gl_PREREQ_SETENV],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_HEADERS([search.h])
+ AC_CHECK_FUNCS([tsearch])
+])
+
+# Prerequisites of lib/unsetenv.c.
+AC_DEFUN([gl_PREREQ_UNSETENV],
+[
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+])
diff --git a/m4/setlocale.m4 b/m4/setlocale.m4
new file mode 100644
index 0000000..a359069
--- /dev/null
+++ b/m4/setlocale.m4
@@ -0,0 +1,29 @@
+# setlocale.m4 serial 4
+dnl Copyright (C) 2011-2016 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],
+[
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ dnl On native Windows systems, setlocale(category,NULL) does not look at
+ dnl the environment variables LC_ALL, category, and LANG.
+ mingw*) REPLACE_SETLOCALE=1 ;;
+ dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL)
+ dnl is then still "C".
+ cygwin*)
+ case `uname -r` in
+ 1.5.*) REPLACE_SETLOCALE=1 ;;
+ esac
+ ;;
+ esac
+])
+
+# Prerequisites of lib/setlocale.c.
+AC_DEFUN([gl_PREREQ_SETLOCALE],
+[
+ :
+])
diff --git a/m4/sigaction.m4 b/m4/sigaction.m4
new file mode 100644
index 0000000..9b43764
--- /dev/null
+++ b/m4/sigaction.m4
@@ -0,0 +1,40 @@
+# sigaction.m4 serial 7
+dnl Copyright (C) 2008-2016 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/m4/signal_h.m4 b/m4/signal_h.m4
new file mode 100644
index 0000000..bcfd7b4
--- /dev/null
+++ b/m4/signal_h.m4
@@ -0,0 +1,83 @@
+# signal_h.m4 serial 18
+dnl Copyright (C) 2007-2016 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_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_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
+])
+
+AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
+[
+ GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK])
+ GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE])
+ GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
+ GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK])
+ GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION])
+ 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/m4/signalblocking.m4 b/m4/signalblocking.m4
new file mode 100644
index 0000000..5197c50
--- /dev/null
+++ b/m4/signalblocking.m4
@@ -0,0 +1,25 @@
+# signalblocking.m4 serial 14
+dnl Copyright (C) 2001-2002, 2006-2016 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])
+ if test $gl_cv_type_sigset_t = yes; then
+ AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
+ fi
+ if test -z "$gl_cv_func_sigprocmask"; then
+ HAVE_POSIX_SIGNALBLOCKING=0
+ fi
+])
+
+# Prerequisites of lib/sigprocmask.c.
+AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
new file mode 100644
index 0000000..de69025
--- /dev/null
+++ b/m4/size_max.m4
@@ -0,0 +1,79 @@
+# size_max.m4 serial 10
+dnl Copyright (C) 2003, 2005-2006, 2008-2016 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_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=
+ 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 -z "$gl_cv_size_max"; 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])
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/m4/sleep.m4 b/m4/sleep.m4
new file mode 100644
index 0000000..99de5ee
--- /dev/null
+++ b/m4/sleep.m4
@@ -0,0 +1,62 @@
+# sleep.m4 serial 7
+dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SLEEP],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl We expect to see the declaration of sleep() in a header file.
+ dnl Older versions of mingw have a sleep() function that is an alias to
+ dnl _sleep() in MSVCRT. It has a different signature than POSIX sleep():
+ dnl it takes the number of milliseconds as argument and returns void.
+ dnl mingw does not declare this function.
+ AC_CHECK_DECLS([sleep], , , [[#include <unistd.h>]])
+ AC_CHECK_FUNCS_ONCE([sleep])
+ if test $ac_cv_have_decl_sleep != yes; then
+ HAVE_SLEEP=0
+ else
+ dnl Cygwin 1.5.x has a bug where sleep can't exceed 49.7 days.
+ AC_CACHE_CHECK([for working sleep], [gl_cv_func_sleep_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+static void
+handle_alarm (int sig)
+{
+ if (sig != SIGALRM)
+ _exit (2);
+}
+]], [[
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack sleep. */
+ unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
+ unsigned int remaining;
+ signal (SIGALRM, handle_alarm);
+ alarm (1);
+ remaining = sleep (pentecost);
+ if (remaining > pentecost)
+ return 3;
+ if (remaining <= pentecost - 10)
+ return 4;
+ return 0;
+ ]])],
+ [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_sleep_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_sleep_works" in
+ *yes) ;;
+ *)
+ REPLACE_SLEEP=1
+ ;;
+ esac
+ fi
+])
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
new file mode 100644
index 0000000..f876b55
--- /dev/null
+++ b/m4/snprintf.m4
@@ -0,0 +1,54 @@
+# snprintf.m4 serial 6
+dnl Copyright (C) 2002-2004, 2007-2016 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 snprintf only if it does not support %1$s,
+dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
+dnl must guarantee that the decision for replacing snprintf is a superset
+dnl of the reasons checked by libintl.
+AC_DEFUN([gl_FUNC_SNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_cv_func_snprintf_usable=no
+ AC_CHECK_FUNCS([snprintf])
+ if test $ac_cv_func_snprintf = 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_snprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_snprintf_usable = no; then
+ gl_REPLACE_SNPRINTF
+ fi
+ AC_CHECK_DECLS_ONCE([snprintf])
+ if test $ac_cv_have_decl_snprintf = no; then
+ HAVE_DECL_SNPRINTF=0
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_SNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_LIBOBJ([snprintf])
+ if test $ac_cv_func_snprintf = yes; then
+ REPLACE_SNPRINTF=1
+ fi
+ gl_PREREQ_SNPRINTF
+])
+
+# Prerequisites of lib/snprintf.c.
+AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
diff --git a/m4/socketlib.m4 b/m4/socketlib.m4
new file mode 100644
index 0000000..5da64fc
--- /dev/null
+++ b/m4/socketlib.m4
@@ -0,0 +1,86 @@
+# socketlib.m4 serial 1
+dnl Copyright (C) 2008-2016 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).
+ AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
+ [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.
+ 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/m4/sockets.m4 b/m4/sockets.m4
new file mode 100644
index 0000000..7e77a62
--- /dev/null
+++ b/m4/sockets.m4
@@ -0,0 +1,17 @@
+# sockets.m4 serial 7
+dnl Copyright (C) 2008-2016 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/m4/socklen.m4 b/m4/socklen.m4
new file mode 100644
index 0000000..634c43a
--- /dev/null
+++ b/m4/socklen.m4
@@ -0,0 +1,77 @@
+# socklen.m4 serial 10
+dnl Copyright (C) 2005-2007, 2009-2016 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_MSG_CHECKING([for socklen_t equivalent])
+ AC_CACHE_VAL([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_MSG_RESULT([$gl_cv_socklen_t_equiv])
+ 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/m4/sockpfaf.m4 b/m4/sockpfaf.m4
new file mode 100644
index 0000000..dce8b8f
--- /dev/null
+++ b/m4/sockpfaf.m4
@@ -0,0 +1,87 @@
+# sockpfaf.m4 serial 8
+dnl Copyright (C) 2004, 2006, 2009-2016 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_HEADER_SYS_SOCKET])
+ AC_CHECK_HEADERS_ONCE([netinet/in.h])
+
+ AC_MSG_CHECKING([for IPv4 sockets])
+ AC_CACHE_VAL([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)])
+ AC_MSG_RESULT([$gl_cv_socket_ipv4])
+ 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_MSG_CHECKING([for IPv6 sockets])
+ AC_CACHE_VAL([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)])
+ AC_MSG_RESULT([$gl_cv_socket_ipv6])
+ 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_HEADER_SYS_SOCKET])
+ AC_CHECK_HEADERS_ONCE([sys/un.h])
+
+ AC_MSG_CHECKING([for UNIX domain sockets])
+ AC_CACHE_VAL([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)])
+ AC_MSG_RESULT([$gl_cv_socket_unix])
+ 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/m4/ssize_t.m4 b/m4/ssize_t.m4
new file mode 100644
index 0000000..3e7b9e6
--- /dev/null
+++ b/m4/ssize_t.m4
@@ -0,0 +1,23 @@
+# ssize_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2001-2003, 2006, 2010-2016 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/m4/stat-time.m4 b/m4/stat-time.m4
new file mode 100644
index 0000000..231cb74
--- /dev/null
+++ b/m4/stat-time.m4
@@ -0,0 +1,83 @@
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2016 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/m4/stat.m4 b/m4/stat.m4
new file mode 100644
index 0000000..a794975
--- /dev/null
+++ b/m4/stat.m4
@@ -0,0 +1,71 @@
+# serial 11
+
+# Copyright (C) 2009-2016 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]) dnl for cross-compiles
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([lstat])
+ dnl mingw is the only known platform where stat(".") and stat("./") differ
+ AC_CACHE_CHECK([whether stat handles trailing slashes on directories],
+ [gl_cv_func_stat_dir_slash],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/stat.h>
+]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])],
+ [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no],
+ [case $host_os in
+ mingw*) gl_cv_func_stat_dir_slash="guessing no";;
+ *) gl_cv_func_stat_dir_slash="guessing yes";;
+ esac])])
+ 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 glibc systems.
+ *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_stat_file_slash="guessing no" ;;
+ esac
+ ])
+ rm -f conftest.tmp conftest.lnk])
+ case $gl_cv_func_stat_dir_slash in
+ *no) REPLACE_STAT=1
+ AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs
+ help when passed a directory name with a trailing slash]);;
+ esac
+ 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
+])
+
+# Prerequisites of lib/stat.c.
+AC_DEFUN([gl_PREREQ_STAT], [:])
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
new file mode 100644
index 0000000..49980cd
--- /dev/null
+++ b/m4/stdalign.m4
@@ -0,0 +1,57 @@
+# Check for stdalign.h that conforms to C11.
+
+dnl Copyright 2011-2016 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 <stdalign.h>
+ #include <stddef.h>
+
+ /* Test that alignof yields a result consistent with offsetof.
+ This catches GCC bug 52023
+ <http://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) \
+ || (defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
+ || __ICC || 0x5110 <= __SUNPRO_C \
+ || 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
+ STDALIGN_H=''
+ else
+ STDALIGN_H='stdalign.h'
+ fi
+
+ AC_SUBST([STDALIGN_H])
+ AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"])
+])
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
new file mode 100644
index 0000000..ab3e7f5
--- /dev/null
+++ b/m4/stdarg.m4
@@ -0,0 +1,78 @@
+# stdarg.m4 serial 6
+dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Provide a working va_copy in combination with <stdarg.h>.
+
+AC_DEFUN([gl_STDARG_H],
+[
+ STDARG_H=''
+ NEXT_STDARG_H='<stdarg.h>'
+ AC_MSG_CHECKING([for va_copy])
+ AC_CACHE_VAL([gl_cv_func_va_copy], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
+#ifndef va_copy
+void (*func) (va_list, va_list) = va_copy;
+#endif
+ ]])],
+ [gl_cv_func_va_copy=yes],
+ [gl_cv_func_va_copy=no])])
+ AC_MSG_RESULT([$gl_cv_func_va_copy])
+ if test $gl_cv_func_va_copy = no; then
+ dnl Provide a substitute.
+ dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
+ dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
+ dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
+ dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
+ dnl approach on other platforms, because <stdarg.h> often defines only
+ dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
+ dnl not work in this situation.
+ AC_EGREP_CPP([vaccine],
+ [#if defined _AIX && !defined __GNUC__
+ AIX vaccine
+ #endif
+ ], [gl_aixcc=yes], [gl_aixcc=no])
+ if test $gl_aixcc = yes; then
+ dnl Provide a substitute <stdarg.h> file.
+ STDARG_H=stdarg.h
+ gl_NEXT_HEADERS([stdarg.h])
+ dnl Fallback for the case when <stdarg.h> contains only macro definitions.
+ if test "$gl_cv_next_stdarg_h" = '""'; then
+ gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
+ NEXT_STDARG_H="$gl_cv_next_stdarg_h"
+ fi
+ else
+ dnl Provide a substitute in <config.h>, either __va_copy or as a simple
+ dnl assignment.
+ gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
+#ifndef __va_copy
+error, bail out
+#endif
+ ]])],
+ [gl_cv_func___va_copy=yes],
+ [gl_cv_func___va_copy=no])])
+ if test $gl_cv_func___va_copy = yes; then
+ AC_DEFINE([va_copy], [__va_copy],
+ [Define as a macro for copying va_list variables.])
+ else
+ AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
+#define gl_va_copy(a,b) ((a) = (b))])
+ AC_DEFINE([va_copy], [gl_va_copy],
+ [Define as a macro for copying va_list variables.])
+ fi
+ fi
+ fi
+ AC_SUBST([STDARG_H])
+ AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"])
+ AC_SUBST([NEXT_STDARG_H])
+])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
new file mode 100644
index 0000000..a556153
--- /dev/null
+++ b/m4/stdbool.m4
@@ -0,0 +1,104 @@
+# Check for stdbool.h that conforms to C99.
+
+dnl Copyright (C) 2002-2006, 2009-2016 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 6
+
+# Prepare for substituting <stdbool.h> if it is not supported.
+
+AC_DEFUN([AM_STDBOOL_H],
+[
+ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
+
+ # Define two additional variables used in the Makefile substitution.
+
+ if test "$ac_cv_header_stdbool_h" = yes; then
+ STDBOOL_H=''
+ else
+ STDBOOL_H='stdbool.h'
+ fi
+ AC_SUBST([STDBOOL_H])
+ AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
+
+ if test "$ac_cv_type__Bool" = yes; then
+ HAVE__BOOL=1
+ else
+ HAVE__BOOL=0
+ fi
+ AC_SUBST([HAVE__BOOL])
+])
+
+# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
+AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
+
+# 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>
+
+ #if __cplusplus < 201103
+ #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; } 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
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+ ]],
+ [[
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! 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);
+ ]])],
+ [ac_cv_header_stdbool_h=yes],
+ [ac_cv_header_stdbool_h=no])])
+ AC_CHECK_TYPES([_Bool])
+])
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
new file mode 100644
index 0000000..c045c65
--- /dev/null
+++ b/m4/stddef_h.m4
@@ -0,0 +1,51 @@
+dnl A placeholder for <stddef.h>, for platforms that have issues.
+# stddef_h.m4 serial 5
+dnl Copyright (C) 2009-2016 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_STDDEF_H],
+[
+ AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ STDDEF_H=
+ AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
+ [[#include <stddef.h>
+ ]])
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ STDDEF_H=stddef.h
+ 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
+ STDDEF_H=stddef.h
+ fi
+ AC_SUBST([STDDEF_H])
+ AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
+ if test -n "$STDDEF_H"; then
+ gl_NEXT_HEADERS([stddef.h])
+ fi
+])
+
+AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+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/m4/stdint.m4 b/m4/stdint.m4
new file mode 100644
index 0000000..0b4b906
--- /dev/null
+++ b/m4/stdint.m4
@@ -0,0 +1,511 @@
+# stdint.m4 serial 44
+dnl Copyright (C) 2001-2016 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_DEFUN_ONCE([gl_STDINT_H],
+[
+ AC_PREREQ([2.59])dnl
+
+ dnl Check for long long int and unsigned long long int.
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+ if test $ac_cv_type_long_long_int = yes; then
+ HAVE_LONG_LONG_INT=1
+ else
+ HAVE_LONG_LONG_INT=0
+ fi
+ AC_SUBST([HAVE_LONG_LONG_INT])
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+ HAVE_UNSIGNED_LONG_LONG_INT=1
+ else
+ HAVE_UNSIGNED_LONG_LONG_INT=0
+ fi
+ AC_SUBST([HAVE_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>.
+ dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_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>.
+ dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_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;
+
+#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. */
+ 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],
+ [],
+ [dnl When cross-compiling, assume it works.
+ gl_cv_header_working_stdint_h=yes
+ ])
+ ])
+ ])
+ fi
+ if test "$gl_cv_header_working_stdint_h" = yes; then
+ dnl Now see whether the system <stdint.h> works without
+ dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
+ AC_CACHE_CHECK([whether stdint.h predates C++11],
+ [gl_cv_header_stdint_predates_cxx11_h],
+ [gl_cv_header_stdint_predates_cxx11_h=yes
+ 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_predates_cxx11_h=no])])
+
+ if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; 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
+ STDINT_H=
+ else
+ 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
+ else
+ HAVE_SYS_INTTYPES_H=0
+ fi
+ AC_SUBST([HAVE_SYS_INTTYPES_H])
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ else
+ HAVE_SYS_BITYPES_H=0
+ fi
+ AC_SUBST([HAVE_SYS_BITYPES_H])
+
+ gl_STDINT_TYPE_PROPERTIES
+ STDINT_H=stdint.h
+ fi
+ AC_SUBST([STDINT_H])
+ AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_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],
+[[
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.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 $BITSIZEOF_WINT_T -lt 32; then
+ BITSIZEOF_WINT_T=32
+ fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
+
+# Hey Emacs!
+# Local Variables:
+# indent-tabs-mode: nil
+# End:
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
new file mode 100644
index 0000000..f823b94
--- /dev/null
+++ b/m4/stdint_h.m4
@@ -0,0 +1,27 @@
+# stdint_h.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2016 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/m4/stdio_h.m4 b/m4/stdio_h.m4
new file mode 100644
index 0000000..0e38758
--- /dev/null
+++ b/m4/stdio_h.m4
@@ -0,0 +1,221 @@
+# stdio_h.m4 serial 46
+dnl Copyright (C) 2007-2016 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_STDIO_H],
+[
+ dnl For __USE_MINGW_ANSI_STDIO
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ 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 __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 No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ GNULIB_FSCANF=1
+ gl_MODULE_INDICATOR([fscanf])
+ GNULIB_SCANF=1
+ gl_MODULE_INDICATOR([scanf])
+ GNULIB_FGETC=1
+ GNULIB_GETC=1
+ GNULIB_GETCHAR=1
+ GNULIB_FGETS=1
+ GNULIB_FREAD=1
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+ dnl 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
+ AC_LIBOBJ([stdio-read])
+ fi
+ ])
+
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ GNULIB_FPRINTF=1
+ GNULIB_PRINTF=1
+ GNULIB_VFPRINTF=1
+ GNULIB_VPRINTF=1
+ GNULIB_FPUTC=1
+ GNULIB_PUTC=1
+ GNULIB_PUTCHAR=1
+ GNULIB_FPUTS=1
+ GNULIB_PUTS=1
+ GNULIB_FWRITE=1
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
+ dnl 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
+ AC_LIBOBJ([stdio-write])
+ fi
+ ])
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+ dnl 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
+ AC_LIBOBJ([stdio-write])
+ 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_DEFUN([gl_STDIO_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_STDIO_H_DEFAULTS],
+[
+ GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
+ GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
+ GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN])
+ GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
+ GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC])
+ GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS])
+ GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
+ GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
+ GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
+ GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE])
+ GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
+ GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
+ GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD])
+ GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
+ GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF])
+ GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
+ GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
+ GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
+ GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
+ GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
+ GNULIB_GETC=0; AC_SUBST([GNULIB_GETC])
+ GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR])
+ GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
+ GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
+ GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
+ GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
+ GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE])
+ GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
+ GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN])
+ GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
+ GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
+ GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
+ GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
+ GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
+ GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE])
+ GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME])
+ GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT])
+ GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF])
+ GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
+ GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
+ GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING])
+ GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
+ GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE])
+ GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
+ GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF])
+ GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF])
+ GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
+ GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
+ GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
+ GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
+ GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
+ GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
+ GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ 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_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/m4/stdlib_h.m4 b/m4/stdlib_h.m4
new file mode 100644
index 0000000..19107c4
--- /dev/null
+++ b/m4/stdlib_h.m4
@@ -0,0 +1,119 @@
+# stdlib_h.m4 serial 42
+dnl Copyright (C) 2007-2016 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_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
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+ ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
+ initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
+ posix_openpt ptsname ptsname_r random random_r realpath rpmatch
+ secure_getenv setenv setstate setstate_r srandom srandom_r
+ strtod strtoll strtoull unlockpt unsetenv])
+])
+
+AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_STDLIB_H_DEFAULTS],
+[
+ GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT])
+ GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL])
+ GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
+ GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
+ GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG])
+ GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT])
+ GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT])
+ GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX])
+ GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC])
+ GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
+ GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP])
+ GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS])
+ GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
+ GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS])
+ GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT])
+ GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME])
+ GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R])
+ GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
+ GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R])
+ GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM])
+ GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
+ GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
+ GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH])
+ GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
+ GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
+ GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
+ GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
+ GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
+ GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL])
+ GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX])
+ GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT])
+ GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
+ GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
+ HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
+ HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+ HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
+ HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
+ HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
+ 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_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
+ HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_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_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_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
+ 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_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
+ REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+ REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
+ REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
+ REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
+ 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_R=0; AC_SUBST([REPLACE_RANDOM_R])
+ REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
+ REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
+ REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
+ REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
+ REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
+ REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
+])
diff --git a/m4/strcase.m4 b/m4/strcase.m4
new file mode 100644
index 0000000..eefc047
--- /dev/null
+++ b/m4/strcase.m4
@@ -0,0 +1,45 @@
+# strcase.m4 serial 11
+dnl Copyright (C) 2002, 2005-2016 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_HEADER_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_HEADER_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/m4/strerror.m4 b/m4/strerror.m4
new file mode 100644
index 0000000..e286594
--- /dev/null
+++ b/m4/strerror.m4
@@ -0,0 +1,96 @@
+# strerror.m4 serial 17
+dnl Copyright (C) 2002, 2007-2016 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_HEADER_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 "$ERRNO_H:$REPLACE_STRERROR_0" = :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*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_working_strerror="guessing no" ;;
+ 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*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_strerror_0_works="guessing no" ;;
+ 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/m4/strerror_r.m4 b/m4/strerror_r.m4
new file mode 100644
index 0000000..2318927
--- /dev/null
+++ b/m4/strerror_r.m4
@@ -0,0 +1,173 @@
+# strerror_r.m4 serial 15
+dnl Copyright (C) 2002, 2007-2016 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_R],
+[
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+
+ dnl Persuade Solaris <string.h> to declare strerror_r().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
+ dnl are not defined.
+ AC_CHECK_DECLS_ONCE([strerror_r])
+ if test $ac_cv_have_decl_strerror_r = no; then
+ HAVE_DECL_STRERROR_R=0
+ fi
+
+ if test $ac_cv_func_strerror_r = yes; then
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ if test $gl_cv_func_strerror_r_posix_signature = yes; then
+ case "$gl_cv_func_strerror_r_works" in
+ dnl The system's strerror_r has bugs. Replace it.
+ *no) REPLACE_STRERROR_R=1 ;;
+ esac
+ else
+ dnl The system's strerror_r() has a wrong signature. Replace it.
+ REPLACE_STRERROR_R=1
+ fi
+ else
+ dnl The system's strerror_r() cannot know about the new errno values we
+ dnl add to <errno.h>, or any fix for strerror(0). Replace it.
+ REPLACE_STRERROR_R=1
+ fi
+ fi
+])
+
+# Prerequisites of lib/strerror_r.c.
+AC_DEFUN([gl_PREREQ_STRERROR_R], [
+ dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
+ AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
+ AC_CHECK_FUNCS_ONCE([catgets])
+ AC_CHECK_FUNCS_ONCE([snprintf])
+])
+
+# Detect if strerror_r works, but without affecting whether a replacement
+# strerror_r will be used.
+AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
+[
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+
+ AC_CHECK_FUNCS_ONCE([strerror_r])
+ if test $ac_cv_func_strerror_r = yes; then
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ dnl The POSIX prototype is: int strerror_r (int, char *, size_t);
+ dnl glibc, Cygwin: char *strerror_r (int, char *, size_t);
+ dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int);
+ AC_CACHE_CHECK([for strerror_r with POSIX signature],
+ [gl_cv_func_strerror_r_posix_signature],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ int strerror_r (int, char *, size_t);
+ ]],
+ [])],
+ [gl_cv_func_strerror_r_posix_signature=yes],
+ [gl_cv_func_strerror_r_posix_signature=no])
+ ])
+ if test $gl_cv_func_strerror_r_posix_signature = yes; then
+ dnl AIX 6.1 strerror_r fails by returning -1, not an error number.
+ dnl HP-UX 11.31 strerror_r always fails when the buffer length argument
+ dnl is less than 80.
+ dnl FreeBSD 8.s strerror_r claims failure on 0
+ dnl Mac OS X 10.5 strerror_r treats 0 like -1
+ dnl Solaris 10 strerror_r corrupts errno on failure
+ AC_CACHE_CHECK([whether strerror_r works],
+ [gl_cv_func_strerror_r_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <string.h>
+ ]],
+ [[int result = 0;
+ char buf[79];
+ if (strerror_r (EACCES, buf, 0) < 0)
+ result |= 1;
+ errno = 0;
+ if (strerror_r (EACCES, buf, sizeof buf) != 0)
+ result |= 2;
+ strcpy (buf, "Unknown");
+ if (strerror_r (0, buf, sizeof buf) != 0)
+ result |= 4;
+ if (errno)
+ result |= 8;
+ if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
+ result |= 0x10;
+ errno = 0;
+ *buf = 0;
+ if (strerror_r (-3, buf, sizeof buf) < 0)
+ result |= 0x20;
+ if (errno)
+ result |= 0x40;
+ if (!*buf)
+ result |= 0x80;
+ return result;
+ ]])],
+ [gl_cv_func_strerror_r_works=yes],
+ [gl_cv_func_strerror_r_works=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX.
+ aix*) gl_cv_func_strerror_r_works="guessing no";;
+ # Guess no on HP-UX.
+ hpux*) gl_cv_func_strerror_r_works="guessing no";;
+ # Guess no on BSD variants.
+ *bsd*) gl_cv_func_strerror_r_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_strerror_r_works="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+ else
+ dnl The system's strerror() has a wrong signature.
+ dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
+ AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
+ dnl In glibc < 2.14, __xpg_strerror_r does not populate buf on failure.
+ dnl In cygwin < 1.7.10, __xpg_strerror_r clobbers strerror's buffer.
+ if test $ac_cv_func___xpg_strerror_r = yes; then
+ AC_CACHE_CHECK([whether __xpg_strerror_r works],
+ [gl_cv_func_strerror_r_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <string.h>
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int __xpg_strerror_r(int, char *, size_t);
+ ]],
+ [[int result = 0;
+ char buf[256] = "^";
+ char copy[256];
+ char *str = strerror (-1);
+ strcpy (copy, str);
+ if (__xpg_strerror_r (-2, buf, 1) == 0)
+ result |= 1;
+ if (*buf)
+ result |= 2;
+ __xpg_strerror_r (-2, buf, 256);
+ if (strcmp (str, copy))
+ result |= 4;
+ return result;
+ ]])],
+ [gl_cv_func_strerror_r_works=yes],
+ [gl_cv_func_strerror_r_works=no],
+ [dnl Guess no on all platforms that have __xpg_strerror_r,
+ dnl at least until fixed glibc and cygwin are more common.
+ gl_cv_func_strerror_r_works="guessing no"
+ ])
+ ])
+ fi
+ fi
+ fi
+ fi
+])
diff --git a/m4/strftime.m4 b/m4/strftime.m4
new file mode 100644
index 0000000..9598e72
--- /dev/null
+++ b/m4/strftime.m4
@@ -0,0 +1,28 @@
+# serial 33
+
+# Copyright (C) 1996-1997, 1999-2007, 2009-2016 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 and Paul Eggert.
+
+AC_DEFUN([gl_FUNC_GNU_STRFTIME],
+[
+ gl_FUNC_STRFTIME
+])
+
+# These are the prerequisite macros for GNU's strftime.c replacement.
+AC_DEFUN([gl_FUNC_STRFTIME],
+[
+ # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
+ AC_REQUIRE([AC_STRUCT_TIMEZONE])
+
+ AC_REQUIRE([gl_TM_GMTOFF])
+
+ AC_CHECK_FUNCS_ONCE([tzset])
+
+ AC_DEFINE([my_strftime], [nstrftime],
+ [Define to the name of the strftime replacement function.])
+])
diff --git a/m4/string_h.m4 b/m4/string_h.m4
new file mode 100644
index 0000000..0c5ec6f
--- /dev/null
+++ b/m4/string_h.m4
@@ -0,0 +1,120 @@
+# Configure a GNU-like replacement for <string.h>.
+
+# Copyright (C) 2007-2016 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 21
+
+# Written by Paul Eggert.
+
+AC_DEFUN([gl_HEADER_STRING_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_HEADER_STRING_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_BODY],
+[
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_HEADER_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 strsignal strverscmp])
+])
+
+AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+[
+ GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL])
+ GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL])
+ GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
+ GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
+ GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
+ GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
+ GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR])
+ GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
+ GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
+ GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
+ GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
+ GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT])
+ GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
+ GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN])
+ GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK])
+ GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP])
+ GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR])
+ GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR])
+ GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R])
+ GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN])
+ GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN])
+ GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR])
+ GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR])
+ GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR])
+ GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP])
+ GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
+ GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
+ GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR])
+ GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN])
+ GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK])
+ GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN])
+ GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP])
+ GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
+ GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
+ GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R])
+ GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
+ GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
+ HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
+ HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
+ HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
+ 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_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
+ HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
+ REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
+ REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
+ REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
+ REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
+ REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
+ REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
+ REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
+ REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
+ REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
+ REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
+ REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
+ REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
+ REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
+ UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
+])
diff --git a/m4/strings_h.m4 b/m4/strings_h.m4
new file mode 100644
index 0000000..62a62e2
--- /dev/null
+++ b/m4/strings_h.m4
@@ -0,0 +1,52 @@
+# Configure a replacement for <strings.h>.
+# serial 6
+
+# Copyright (C) 2007, 2009-2016 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_HEADER_STRINGS_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_HEADER_STRINGS_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
+[
+ AC_REQUIRE([gl_HEADER_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])
+])
+
+AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS],
+[
+ GNULIB_FFS=0; AC_SUBST([GNULIB_FFS])
+ 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/m4/strndup.m4 b/m4/strndup.m4
new file mode 100644
index 0000000..ac48a22
--- /dev/null
+++ b/m4/strndup.m4
@@ -0,0 +1,58 @@
+# strndup.m4 serial 22
+dnl Copyright (C) 2002-2003, 2005-2016 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_HEADER_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/m4/strnlen.m4 b/m4/strnlen.m4
new file mode 100644
index 0000000..67b3859
--- /dev/null
+++ b/m4/strnlen.m4
@@ -0,0 +1,30 @@
+# strnlen.m4 serial 13
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 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_HEADER_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/m4/strptime.m4 b/m4/strptime.m4
new file mode 100644
index 0000000..0b760e1
--- /dev/null
+++ b/m4/strptime.m4
@@ -0,0 +1,22 @@
+# strptime.m4 serial 7
+dnl Copyright (C) 2007, 2009-2016 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_STRPTIME],
+[
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_CHECK_FUNCS_ONCE([strptime])
+ if test $ac_cv_func_strptime != yes; then
+ HAVE_STRPTIME=0
+ fi
+])
+
+# Prerequisites of lib/strptime.c.
+AC_DEFUN([gl_PREREQ_STRPTIME],
+[
+ AC_REQUIRE([gl_TM_GMTOFF])
+ :
+])
diff --git a/m4/strtoull.m4 b/m4/strtoull.m4
new file mode 100644
index 0000000..78a67c7
--- /dev/null
+++ b/m4/strtoull.m4
@@ -0,0 +1,24 @@
+# strtoull.m4 serial 7
+dnl Copyright (C) 2002, 2004, 2006, 2008-2016 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_STRTOULL],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ dnl We don't need (and can't compile) the replacement strtoull
+ dnl unless the type 'unsigned long long int' exists.
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+ if test "$ac_cv_type_unsigned_long_long_int" = yes; then
+ AC_CHECK_FUNCS([strtoull])
+ if test $ac_cv_func_strtoull = no; then
+ HAVE_STRTOULL=0
+ fi
+ fi
+])
+
+# Prerequisites of lib/strtoull.c.
+AC_DEFUN([gl_PREREQ_STRTOULL], [
+ :
+])
diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4
new file mode 100644
index 0000000..1a5ee4b
--- /dev/null
+++ b/m4/strtoumax.m4
@@ -0,0 +1,28 @@
+# strtoumax.m4 serial 12
+dnl Copyright (C) 2002-2004, 2006, 2009-2016 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_STRTOUMAX],
+[
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+
+ dnl On OSF/1 5.1 with cc, this function is declared but not defined.
+ AC_CHECK_FUNCS_ONCE([strtoumax])
+ AC_CHECK_DECLS_ONCE([strtoumax])
+ if test "$ac_cv_have_decl_strtoumax" = yes; then
+ if test "$ac_cv_func_strtoumax" != yes; then
+ # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
+ REPLACE_STRTOUMAX=1
+ fi
+ else
+ HAVE_DECL_STRTOUMAX=0
+ fi
+])
+
+# Prerequisites of lib/strtoumax.c.
+AC_DEFUN([gl_PREREQ_STRTOUMAX], [
+ AC_CHECK_DECLS([strtoull])
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+])
diff --git a/m4/symlink.m4 b/m4/symlink.m4
new file mode 100644
index 0000000..d15d915
--- /dev/null
+++ b/m4/symlink.m4
@@ -0,0 +1,53 @@
+# serial 6
+# See if we need to provide symlink replacement.
+
+dnl Copyright (C) 2009-2016 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_SYMLINK],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([symlink])
+ dnl The best we can do on mingw is provide a dummy that always fails, so
+ dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1,
+ dnl and Solaris 9, we want to fix a bug with trailing slash handling.
+ if test $ac_cv_func_symlink = no; then
+ HAVE_SYMLINK=0
+ else
+ AC_CACHE_CHECK([whether symlink handles trailing slash correctly],
+ [gl_cv_func_symlink_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ ]],
+ [[int result = 0;
+ if (!symlink ("a", "conftest.link/"))
+ result |= 1;
+ if (symlink ("conftest.f", "conftest.lnk2"))
+ result |= 2;
+ else if (!symlink ("a", "conftest.lnk2/"))
+ result |= 4;
+ return result;
+ ]])],
+ [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_symlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_symlink_works="guessing no" ;;
+ esac
+ ])
+ rm -f conftest.f conftest.link conftest.lnk2])
+ case "$gl_cv_func_symlink_works" in
+ *yes) ;;
+ *)
+ REPLACE_SYMLINK=1
+ ;;
+ esac
+ fi
+])
diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4
new file mode 100644
index 0000000..85cab83
--- /dev/null
+++ b/m4/sys_ioctl_h.m4
@@ -0,0 +1,64 @@
+# sys_ioctl_h.m4 serial 10
+dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN([gl_SYS_IOCTL_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_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(
+ [AC_INCLUDES_DEFAULT([#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])
+])
+
+AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS],
+[
+ GNULIB_IOCTL=0; AC_SUBST([GNULIB_IOCTL])
+ 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/m4/sys_select_h.m4 b/m4/sys_select_h.m4
new file mode 100644
index 0000000..23526e5
--- /dev/null
+++ b/m4/sys_select_h.m4
@@ -0,0 +1,95 @@
+# sys_select_h.m4 serial 20
+dnl Copyright (C) 2006-2016 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_HEADER_SYS_SELECT],
+[
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
+ 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])
+])
+
+AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS],
+[
+ GNULIB_PSELECT=0; AC_SUBST([GNULIB_PSELECT])
+ GNULIB_SELECT=0; AC_SUBST([GNULIB_SELECT])
+ 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/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
new file mode 100644
index 0000000..ae500c7
--- /dev/null
+++ b/m4/sys_socket_h.m4
@@ -0,0 +1,176 @@
+# sys_socket_h.m4 serial 23
+dnl Copyright (C) 2005-2016 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([gl_HEADER_SYS_SOCKET],
+[
+ 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
+
+ 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
+ SYS_SOCKET_H='sys/socket.h'
+ 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
+ SYS_SOCKET_H='sys/socket.h'
+ 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_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
+ HAVE_WS2TCPIP_H=0
+ else
+ HAVE_SYS_SOCKET_H=0
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+ AC_SUBST([HAVE_SYS_SOCKET_H])
+ AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
+# 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])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+[
+ GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
+ GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
+ GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
+ GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
+ GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
+ GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
+ GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
+ GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
+ GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
+ GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
+ GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
+ GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
+ GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
+ GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN])
+ GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4])
+ 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/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
new file mode 100644
index 0000000..3d43b6f
--- /dev/null
+++ b/m4/sys_stat_h.m4
@@ -0,0 +1,96 @@
+# sys_stat_h.m4 serial 28 -*- Autoconf -*-
+dnl Copyright (C) 2006-2016 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([gl_HEADER_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 override 'struct stat'.
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_ST_SIZE=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+ AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
+ [Define to 1 if Gnulib overrides 'struct stat' on Windows so that
+ struct stat.st_size becomes 64-bit.])
+ fi
+
+ 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>
+ ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+ mknod mknodat stat utimensat])
+]) # gl_HEADER_SYS_STAT_H
+
+AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+ GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT])
+ GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT])
+ GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT])
+ GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS])
+ GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
+ GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
+ GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT])
+ GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO])
+ GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT])
+ GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD])
+ GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT])
+ GNULIB_STAT=0; AC_SUBST([GNULIB_STAT])
+ GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT])
+ 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_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_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_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
+ REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
+ REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])
+])
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
new file mode 100644
index 0000000..3061a9c
--- /dev/null
+++ b/m4/sys_time_h.m4
@@ -0,0 +1,111 @@
+# Configure a replacement for <sys/time.h>.
+# serial 8
+
+# Copyright (C) 2007, 2009-2016 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([gl_HEADER_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_HEADER_SYS_TIME_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
+[
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+ 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])
+])
+
+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
+[
+ GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY])
+ 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])
+ HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
+ REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
+ REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL])
+])
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
new file mode 100644
index 0000000..b0aabb4
--- /dev/null
+++ b/m4/sys_types_h.m4
@@ -0,0 +1,24 @@
+# sys_types_h.m4 serial 5
+dnl Copyright (C) 2011-2016 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])
+ 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])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
diff --git a/m4/sys_uio_h.m4 b/m4/sys_uio_h.m4
new file mode 100644
index 0000000..d4d967f
--- /dev/null
+++ b/m4/sys_uio_h.m4
@@ -0,0 +1,31 @@
+# sys_uio_h.m4 serial 1
+dnl Copyright (C) 2011-2016 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_HEADER_SYS_UIO],
+[
+ 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])
+])
+
+AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_UIO_H_DEFAULTS],
+[
+])
diff --git a/m4/sys_wait_h.m4 b/m4/sys_wait_h.m4
new file mode 100644
index 0000000..69ca429
--- /dev/null
+++ b/m4/sys_wait_h.m4
@@ -0,0 +1,36 @@
+# sys_wait_h.m4 serial 6
+dnl Copyright (C) 2008-2016 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_SYS_WAIT_H],
+[
+ AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+
+ dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/wait.h])
+
+ 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.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
+ [waitpid])
+])
+
+AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
+[
+ GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+])
diff --git a/m4/tempname.m4 b/m4/tempname.m4
new file mode 100644
index 0000000..acf4c8d
--- /dev/null
+++ b/m4/tempname.m4
@@ -0,0 +1,19 @@
+#serial 5
+
+# Copyright (C) 2006-2007, 2009-2016 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/m4/time_h.m4 b/m4/time_h.m4
new file mode 100644
index 0000000..eb2a631
--- /dev/null
+++ b/m4/time_h.m4
@@ -0,0 +1,134 @@
+# Configure a more-standard replacement for <time.h>.
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+
+# serial 9
+
+# 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([gl_HEADER_TIME_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_HEADER_TIME_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_TIME_H_BODY],
+[
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ gl_NEXT_HEADERS([time.h])
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+])
+
+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])
+])
+
+AC_DEFUN([gl_TIME_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
+[
+ GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME])
+ GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP])
+ GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME])
+ GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM])
+ GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R])
+ GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ])
+ 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])
+ 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_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_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
+
+ 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/m4/time_r.m4 b/m4/time_r.m4
new file mode 100644
index 0000000..21b4a2c
--- /dev/null
+++ b/m4/time_r.m4
@@ -0,0 +1,58 @@
+dnl Reentrant time functions: localtime_r, gmtime_r.
+
+dnl Copyright (C) 2003, 2006-2016 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_TIME_R],
+[
+ dnl Persuade glibc and Solaris <time.h> to declare localtime_r.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
+ dnl not defined.
+ AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]])
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
+ fi
+
+ AC_CHECK_FUNCS_ONCE([localtime_r])
+ if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
+ AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
+ [gl_cv_time_r_posix],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>]],
+ [[/* We don't need to append 'restrict's to the argument types,
+ even though the POSIX signature has the 'restrict's,
+ since C99 says they can't affect type compatibility. */
+ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+ if (ptr) return 0;
+ /* Check the return type is a pointer.
+ On HP-UX 10 it is 'int'. */
+ *localtime_r (0, 0);]])
+ ],
+ [gl_cv_time_r_posix=yes],
+ [gl_cv_time_r_posix=no])
+ ])
+ if test $gl_cv_time_r_posix = yes; then
+ REPLACE_LOCALTIME_R=0
+ else
+ REPLACE_LOCALTIME_R=1
+ fi
+ else
+ HAVE_LOCALTIME_R=0
+ fi
+])
+
+# Prerequisites of lib/time_r.c.
+AC_DEFUN([gl_PREREQ_TIME_R], [
+ :
+])
diff --git a/m4/time_rz.m4 b/m4/time_rz.m4
new file mode 100644
index 0000000..9b1db1b
--- /dev/null
+++ b/m4/time_rz.m4
@@ -0,0 +1,21 @@
+dnl Time zone functions: tzalloc, localtime_rz, etc.
+
+dnl Copyright (C) 2015-2016 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_TIME_RZ],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_STRUCT_TIMEZONE])
+ AC_CHECK_FUNCS_ONCE([tzset])
+
+ AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]])
+ if test "$ac_cv_type_timezone_t" = yes; then
+ HAVE_TIMEZONE_T=1
+ fi
+])
diff --git a/m4/timegm.m4 b/m4/timegm.m4
new file mode 100644
index 0000000..752aa43
--- /dev/null
+++ b/m4/timegm.m4
@@ -0,0 +1,26 @@
+# timegm.m4 serial 11
+dnl Copyright (C) 2003, 2007, 2009-2016 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_TIMEGM],
+[
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MKTIME])
+ REPLACE_TIMEGM=0
+ AC_CHECK_FUNCS_ONCE([timegm])
+ if test $ac_cv_func_timegm = yes; then
+ if test $gl_cv_func_working_mktime = no; then
+ # Assume that timegm is buggy if mktime is.
+ REPLACE_TIMEGM=1
+ fi
+ else
+ HAVE_TIMEGM=0
+ fi
+])
+
+# Prerequisites of lib/timegm.c.
+AC_DEFUN([gl_PREREQ_TIMEGM], [
+ :
+])
diff --git a/m4/timespec.m4 b/m4/timespec.m4
new file mode 100644
index 0000000..2482518
--- /dev/null
+++ b/m4/timespec.m4
@@ -0,0 +1,11 @@
+#serial 15
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2016 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/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4
new file mode 100644
index 0000000..ce0671f
--- /dev/null
+++ b/m4/tm_gmtoff.m4
@@ -0,0 +1,14 @@
+# tm_gmtoff.m4 serial 3
+dnl Copyright (C) 2002, 2009-2016 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_TM_GMTOFF],
+[
+ AC_CHECK_MEMBER([struct tm.tm_gmtoff],
+ [AC_DEFINE([HAVE_TM_GMTOFF], [1],
+ [Define if struct tm has the tm_gmtoff member.])],
+ ,
+ [#include <time.h>])
+])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
new file mode 100644
index 0000000..544dadb
--- /dev/null
+++ b/m4/unistd_h.m4
@@ -0,0 +1,189 @@
+# unistd_h.m4 serial 68
+dnl Copyright (C) 2006-2016 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([gl_UNISTD_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_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 __WIN32__) && ! defined __CYGWIN__
+# include <io.h>
+# endif
+#endif
+ ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
+ fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
+ gethostname getlogin getlogin_r getpagesize
+ getusershell setusershell endusershell
+ group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
+ readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
+ unlink unlinkat usleep])
+])
+
+AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_UNISTD_H_DEFAULTS],
+[
+ GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR])
+ GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
+ GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
+ GNULIB_DUP=0; AC_SUBST([GNULIB_DUP])
+ GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
+ GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3])
+ GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
+ GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
+ GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT])
+ GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
+ GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT])
+ GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC])
+ GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
+ GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
+ GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
+ GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
+ GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
+ GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
+ GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
+ GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
+ GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
+ GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
+ GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
+ GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
+ GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY])
+ GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
+ GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
+ GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
+ GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
+ GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
+ GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
+ GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
+ GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
+ GNULIB_READ=0; AC_SUBST([GNULIB_READ])
+ GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
+ GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
+ GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
+ GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME])
+ GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
+ GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
+ GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
+ GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
+ GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
+ GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
+ GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK])
+ GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT])
+ GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP])
+ GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
+ HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
+ HAVE_DUP3=1; AC_SUBST([HAVE_DUP3])
+ HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
+ 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_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_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_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_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_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_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
+ REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
+ REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
+ REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
+ 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_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_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_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/m4/unlocked-io.m4 b/m4/unlocked-io.m4
new file mode 100644
index 0000000..c29ec20
--- /dev/null
+++ b/m4/unlocked-io.m4
@@ -0,0 +1,41 @@
+# unlocked-io.m4 serial 15
+
+# Copyright (C) 1998-2006, 2009-2016 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.
+dnl
+dnl See if the glibc *_unlocked I/O macros or functions are available.
+dnl Use only those *_unlocked macros or functions that are declared
+dnl (because some of them were declared in Solaris 2.5.1 but were removed
+dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
+dnl on Solaris 2.6).
+
+AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
+[
+ AC_DEFINE([USE_UNLOCKED_IO], [1],
+ [Define to 1 if you want getc etc. to use unlocked I/O if available.
+ Unlocked I/O can improve performance in unithreaded apps,
+ but it is not safe for multithreaded apps.])
+
+ dnl Persuade glibc and Solaris <stdio.h> to declare
+ dnl fgets_unlocked(), fputs_unlocked() etc.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ 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])
+])
diff --git a/m4/vararrays.m4 b/m4/vararrays.m4
new file mode 100644
index 0000000..93fd66e
--- /dev/null
+++ b/m4/vararrays.m4
@@ -0,0 +1,68 @@
+# Check for variable-length arrays.
+
+# serial 5
+
+# From Paul Eggert
+
+# Copyright (C) 2001, 2009-2016 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.
+
+# This is a copy of AC_C_VARARRAYS from a recent development version
+# of Autoconf. It replaces Autoconf's version, or for pre-2.61 autoconf
+# it defines the macro that Autoconf lacks.
+AC_DEFUN([AC_C_VARARRAYS],
+[
+ AC_CACHE_CHECK([for variable-length arrays],
+ ac_cv_c_vararrays,
+ [AC_EGREP_CPP([defined],
+ [#ifdef __STDC_NO_VLA__
+ defined
+ #endif
+ ],
+ [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Test for VLA support. This test is partly inspired
+ from examples in the C standard. Use at least two VLA
+ functions to detect the GCC 3.4.3 bug described in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
+ */
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ extern int n;
+ int B[100];
+ int fvla (int m, int C[m][m]);
+
+ int
+ simple (int count, int all[static count])
+ {
+ return all[count - 1];
+ }
+
+ int
+ fvla (int m, int C[m][m])
+ {
+ typedef int VLA[m][m];
+ VLA x;
+ int D[m];
+ static int (*q)[m] = &B;
+ int (*s)[n] = q;
+ return C && &x[0][0] == &D[0] && &D[0] == s[0];
+ }
+ #endif
+ ]])],
+ [ac_cv_c_vararrays=yes],
+ [ac_cv_c_vararrays=no])])])
+ if test "$ac_cv_c_vararrays" = yes; then
+ dnl This is for compatibility with Autoconf 2.61-2.69.
+ AC_DEFINE([HAVE_C_VARARRAYS], 1,
+ [Define to 1 if C supports variable-length arrays.])
+ elif test "$ac_cv_c_vararrays" = no; then
+ AC_DEFINE([__STDC_NO_VLA__], 1,
+ [Define to 1 if C does not support variable-length arrays, and
+ if the compiler does not already define this.])
+ fi
+])
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
new file mode 100644
index 0000000..2d4b463
--- /dev/null
+++ b/m4/vasnprintf.m4
@@ -0,0 +1,291 @@
+# vasnprintf.m4 serial 36
+dnl Copyright (C) 2002-2004, 2006-2016 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([AC_TYPE_LONG_LONG_INT])
+ 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([AC_TYPE_LONG_LONG_INT])
+ 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([AC_TYPE_LONG_LONG_INT])
+ 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
+])
+
+# 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/m4/vasprintf.m4 b/m4/vasprintf.m4
new file mode 100644
index 0000000..d7866b1
--- /dev/null
+++ b/m4/vasprintf.m4
@@ -0,0 +1,46 @@
+# vasprintf.m4 serial 6
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2016 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/m4/version-etc.m4 b/m4/version-etc.m4
new file mode 100644
index 0000000..a719182
--- /dev/null
+++ b/m4/version-etc.m4
@@ -0,0 +1,33 @@
+# version-etc.m4 serial 1
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl $1 - configure flag and define name
+dnl $2 - human readable description
+m4_define([gl_VERSION_ETC_FLAG],
+[dnl
+ AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])],
+ [dnl
+ case $withval in
+ yes|no) ;;
+ *) AC_DEFINE_UNQUOTED(AS_TR_CPP([PACKAGE_$1]), ["$withval"], [$2]) ;;
+ esac
+ ])
+])
+
+AC_DEFUN([gl_VERSION_ETC],
+[dnl
+ gl_VERSION_ETC_FLAG([packager],
+ [String identifying the packager of this software])
+ gl_VERSION_ETC_FLAG([packager-version],
+ [Packager-specific version information])
+ gl_VERSION_ETC_FLAG([packager-bug-reports],
+ [Packager info for bug reports (URL/e-mail/...)])
+ if test "X$with_packager" = "X" && \
+ test "X$with_packager_version$with_packager_bug_reports" != "X"
+ then
+ AC_MSG_ERROR([The --with-packager-{bug-reports,version} options require --with-packager])
+ fi
+])
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
new file mode 100644
index 0000000..08440ec
--- /dev/null
+++ b/m4/warn-on-use.m4
@@ -0,0 +1,47 @@
+# warn-on-use.m4 serial 5
+dnl Copyright (C) 2010-2016 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)
+# ---------------------------------------
+# 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_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
+dnl FIXME: gl_Symbol must be used unquoted until we can assume
+dnl autoconf 2.64 or newer.
+ 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/m4/warnings.m4 b/m4/warnings.m4
new file mode 100644
index 0000000..924e21d
--- /dev/null
+++ b/m4/warnings.m4
@@ -0,0 +1,79 @@
+# warnings.m4 serial 11
+dnl Copyright (C) 2008-2016 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.
+#
+# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
+# 2.64 or newer.
+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], m4_defn([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.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[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],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# ---------------------------------------------
+# Adds parameter to WARN_CFLAGS if the compiler supports it when
+# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+#
+# If VARIABLE is a variable name, AC_SUBST it.
+AC_DEFUN([gl_WARN_ADD],
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+gl_COMPILER_OPTION_IF([$1],
+ [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+ [],
+ [$3])
+m4_ifval([$2],
+ [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
+ [AC_SUBST([WARN_CFLAGS])])dnl
+])
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
new file mode 100644
index 0000000..b40b732
--- /dev/null
+++ b/m4/wchar_h.m4
@@ -0,0 +1,225 @@
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
+
+dnl Copyright (C) 2007-2016 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 39
+
+AC_DEFUN([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])
+
+ 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([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+ ]],
+ [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+ wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+ wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
+ wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+ wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth
+ ])
+])
+
+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 <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+ dnl and <http://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_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
+ [gl_cv_header_wchar_h_correct_inline],
+ [gl_cv_header_wchar_h_correct_inline=yes
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+extern int zero (void);
+int main () { return zero(); }
+]])])
+ if AC_TRY_EVAL([ac_compile]); then
+ mv conftest.$ac_objext conftest1.$ac_objext
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int zero (void) { return 0; }
+]])])
+ if AC_TRY_EVAL([ac_compile]); then
+ mv conftest.$ac_objext conftest2.$ac_objext
+ 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
+ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+ ])
+ 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
+ <http://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
+])
+
+AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCHAR_H_DEFAULTS],
+[
+ GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
+ GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
+ GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
+ GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
+ GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
+ GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
+ GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
+ GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
+ GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
+ GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
+ GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
+ GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR])
+ GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP])
+ GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY])
+ GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE])
+ GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET])
+ GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN])
+ GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN])
+ GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY])
+ GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY])
+ GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY])
+ GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY])
+ GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT])
+ GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT])
+ GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP])
+ GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP])
+ GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP])
+ GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP])
+ GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL])
+ GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM])
+ GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP])
+ GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR])
+ GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR])
+ GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN])
+ GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN])
+ GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK])
+ GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR])
+ GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK])
+ GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH])
+ 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_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_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
+ 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])
+])
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
new file mode 100644
index 0000000..2db8c3f
--- /dev/null
+++ b/m4/wchar_t.m4
@@ -0,0 +1,24 @@
+# wchar_t.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2002-2003, 2008-2016 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/m4/wcrtomb.m4 b/m4/wcrtomb.m4
new file mode 100644
index 0000000..267b3c9
--- /dev/null
+++ b/m4/wcrtomb.m4
@@ -0,0 +1,112 @@
+# wcrtomb.m4 serial 11
+dnl Copyright (C) 2008-2016 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],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_WCRTOMB=1
+ else
+ dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
+ dnl 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 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 and Solaris.
+ aix4* | osf* | solaris*) 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>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.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;
+ }
+ 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) ;;
+ *) REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ fi
+])
+
+# Prerequisites of lib/wcrtomb.c.
+AC_DEFUN([gl_PREREQ_WCRTOMB], [
+ :
+])
diff --git a/m4/wctob.m4 b/m4/wctob.m4
new file mode 100644
index 0000000..bdb5299
--- /dev/null
+++ b/m4/wctob.m4
@@ -0,0 +1,127 @@
+# wctob.m4 serial 10
+dnl Copyright (C) 2008-2016 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_WCTOB],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ AC_CHECK_FUNCS_ONCE([wctob])
+ if test $ac_cv_func_wctob = no; then
+ HAVE_WCTOB=0
+ HAVE_DECL_WCTOB=0
+ else
+ HAVE_WCTOB=1
+
+ dnl Solaris 9 has the wctob() function but it does not work.
+ dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned
+ dnl registers, see <http://cygwin.com/ml/cygwin/2010-05/msg00015.html>.
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether wctob works],
+ [gl_cv_func_wctob_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 Solaris <= 9 and Cygwin.
+ solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
+ gl_cv_func_wctob_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wctob_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ case "$host_os" in
+ cygwin*)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+
+register long global __asm__ ("%ebx");
+
+int main ()
+{
+ setlocale (LC_ALL, "en_US.UTF-8");
+
+ global = 0x12345678;
+ if (wctob (0x00FC) != -1)
+ return 1;
+ if (global != 0x12345678)
+ return 2;
+ return 0;
+}]])],
+ [:],
+ [gl_cv_func_wctob_works=no],
+ [:])
+ ;;
+ esac
+ if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ wchar_t wc;
+
+ if (mbtowc (&wc, "\374", 1) == 1)
+ if (wctob (wc) != (unsigned char) '\374')
+ return 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_wctob_works=yes],
+ [gl_cv_func_wctob_works=no],
+ [:])
+ fi
+ ])
+ case "$gl_cv_func_wctob_works" in
+ *yes) ;;
+ *) REPLACE_WCTOB=1 ;;
+ esac
+ if test $REPLACE_WCTOB = 0; then
+
+ dnl IRIX 6.5 has the wctob() function but does not declare it.
+ AC_CHECK_DECLS([wctob], [], [], [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+ if test $ac_cv_have_decl_wctob != yes; then
+ HAVE_DECL_WCTOB=0
+ fi
+ fi
+ fi
+])
+
+# Prerequisites of lib/wctob.c.
+AC_DEFUN([gl_PREREQ_WCTOB], [
+ :
+])
diff --git a/m4/wctomb.m4 b/m4/wctomb.m4
new file mode 100644
index 0000000..7c8b3ef
--- /dev/null
+++ b/m4/wctomb.m4
@@ -0,0 +1,19 @@
+# wctomb.m4 serial 2
+dnl Copyright (C) 2011-2016 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_WCTOMB],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ if false; then
+ REPLACE_WCTOMB=1
+ fi
+])
+
+# Prerequisites of lib/wctomb.c.
+AC_DEFUN([gl_PREREQ_WCTOMB], [
+ :
+])
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
new file mode 100644
index 0000000..accc001
--- /dev/null
+++ b/m4/wctype_h.m4
@@ -0,0 +1,209 @@
+# wctype_h.m4 serial 18
+
+dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
+
+dnl Copyright (C) 2006-2016 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_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])
+
+ 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([[
+ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }
+ ]])],
+ [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+ [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])
+
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+ 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],,,
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #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(
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #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(
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #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([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+ ]],
+ [wctype iswctype wctrans towctrans
+ ])
+])
+
+AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
+[
+ GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
+ GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE])
+ GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE])
+ GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS])
+ GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS])
+ 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])
+])
diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4
new file mode 100644
index 0000000..7a743c0
--- /dev/null
+++ b/m4/wcwidth.m4
@@ -0,0 +1,104 @@
+# wcwidth.m4 serial 23
+dnl Copyright (C) 2006-2016 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_WCWIDTH],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc <wchar.h> to declare wcwidth().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+ AC_CHECK_FUNCS_ONCE([wcwidth])
+
+ AC_CHECK_DECLS([wcwidth], [], [], [[
+/* AIX 3.2.5 declares wcwidth in <string.h>. */
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+ if test $ac_cv_have_decl_wcwidth != yes; then
+ HAVE_DECL_WCWIDTH=0
+ fi
+
+ if test $ac_cv_func_wcwidth = yes; then
+ HAVE_WCWIDTH=1
+ dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
+ dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1.
+ dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1.
+ dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0.
+ dnl This leads to bugs in 'ls' (coreutils).
+ AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales],
+ [gl_cv_func_wcwidth_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+/* AIX 3.2.5 declares wcwidth in <string.h>. */
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+#if !HAVE_DECL_WCWIDTH
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int wcwidth (int);
+#endif
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL)
+ {
+ if (wcwidth (0x0301) > 0)
+ result |= 1;
+ if (wcwidth (0x05B0) > 0)
+ result |= 2;
+ if (wcwidth (0x200B) > 0)
+ result |= 4;
+ if (wcwidth (0xFF1A) == 0)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_wcwidth_works=yes],
+ [gl_cv_func_wcwidth_works=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc and AIX 7 systems.
+ *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";;
+ *) gl_cv_func_wcwidth_works="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+ case "$gl_cv_func_wcwidth_works" in
+ *yes) ;;
+ *no) REPLACE_WCWIDTH=1 ;;
+ esac
+ else
+ HAVE_WCWIDTH=0
+ fi
+ dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not
+ dnl have the wcwidth function, then it does not declare it.
+])
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
new file mode 100644
index 0000000..8ff2a5b
--- /dev/null
+++ b/m4/wint_t.m4
@@ -0,0 +1,32 @@
+# wint_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2003, 2007-2016 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.
+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(
+ [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+ before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#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.])
+ fi
+])
diff --git a/m4/xalloc.m4 b/m4/xalloc.m4
new file mode 100644
index 0000000..f4f540d
--- /dev/null
+++ b/m4/xalloc.m4
@@ -0,0 +1,7 @@
+# xalloc.m4 serial 18
+dnl Copyright (C) 2002-2006, 2009-2016 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/m4/xsize.m4 b/m4/xsize.m4
new file mode 100644
index 0000000..16764e8
--- /dev/null
+++ b/m4/xsize.m4
@@ -0,0 +1,12 @@
+# xsize.m4 serial 5
+dnl Copyright (C) 2003-2004, 2008-2016 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/m4/xstrndup.m4 b/m4/xstrndup.m4
new file mode 100644
index 0000000..3511c80
--- /dev/null
+++ b/m4/xstrndup.m4
@@ -0,0 +1,15 @@
+# xstrndup.m4 serial 2
+dnl Copyright (C) 2003, 2009-2016 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/m4/xstrtol.m4 b/m4/xstrtol.m4
new file mode 100644
index 0000000..f81cd21
--- /dev/null
+++ b/m4/xstrtol.m4
@@ -0,0 +1,10 @@
+#serial 11
+dnl Copyright (C) 2002-2007, 2009-2016 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_XSTRTOL],
+[
+ :
+])
diff --git a/m4/xvasprintf.m4 b/m4/xvasprintf.m4
new file mode 100644
index 0000000..dd01142
--- /dev/null
+++ b/m4/xvasprintf.m4
@@ -0,0 +1,8 @@
+# xvasprintf.m4 serial 2
+dnl Copyright (C) 2006, 2009-2016 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/maint.mk b/maint.mk
new file mode 100644
index 0000000..868e10f
--- /dev/null
+++ b/maint.mk
@@ -0,0 +1,1679 @@
+# -*-Makefile-*-
+# This Makefile fragment tries to be general-purpose enough to be
+# used by many projects via the gnulib maintainer-makefile module.
+
+## Copyright (C) 2001-2016 Free Software Foundation, Inc.
+##
+## This program is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This is reported not to work with make-3.79.1
+# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+ME := maint.mk
+
+# Helper variables.
+_empty =
+_sp = $(_empty) $(_empty)
+
+# _equal,S1,S2
+# ------------
+# If S1 == S2, return S1, otherwise the empty string.
+_equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
+
+# member-check,VARIABLE,VALID-VALUES
+# ----------------------------------
+# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and
+# return it. Die otherwise.
+member-check = \
+ $(strip \
+ $(if $($(1)), \
+ $(if $(findstring $(_sp),$($(1))), \
+ $(error invalid $(1): '$($(1))', expected $(2)), \
+ $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)), \
+ $(error invalid $(1): '$($(1))', expected $(2)))), \
+ $(error $(1) undefined)))
+
+# Do not save the original name or timestamp in the .tar.gz file.
+# Use --rsyncable if available.
+gzip_rsyncable := \
+ $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \
+ && printf %s --rsyncable)
+GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
+
+GIT = git
+VC = $(GIT)
+
+VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
+
+# You can override this variable in cfg.mk to set your own regexp
+# matching files to ignore.
+VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
+
+# This is to preprocess robustly the output of $(VC_LIST), so that even
+# when $(srcdir) is a pathological name like "....", the leading sed command
+# removes only the intended prefix.
+_dot_escaped_srcdir = $(subst .,\.,$(srcdir))
+
+# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
+# when $(srcdir) is not ".".
+ifeq ($(srcdir),.)
+ _prepend_srcdir_prefix =
+else
+ _prepend_srcdir_prefix = | $(SED) 's|^|$(srcdir)/|'
+endif
+
+# In order to be able to consistently filter "."-relative names,
+# (i.e., with no $(srcdir) prefix), this definition is careful to
+# remove any $(srcdir) prefix, and to restore what it removes.
+_sc_excl = \
+ $(or $(exclude_file_name_regexp--$@),^$$)
+VC_LIST_EXCEPT = \
+ $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \
+ | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
+ else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
+ | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
+ $(_prepend_srcdir_prefix)
+
+ifeq ($(origin prev_version_file), undefined)
+ prev_version_file = $(srcdir)/.prev-version
+endif
+
+PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null)
+VERSION_REGEXP = $(subst .,\.,$(VERSION))
+PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
+
+ifeq ($(VC),$(GIT))
+ this-vc-tag = v$(VERSION)
+ this-vc-tag-regexp = v$(VERSION_REGEXP)
+else
+ tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
+ tag-this-version = $(subst .,_,$(VERSION))
+ this-vc-tag = $(tag-package)-$(tag-this-version)
+ this-vc-tag-regexp = $(this-vc-tag)
+endif
+my_distdir = $(PACKAGE)-$(VERSION)
+
+# Old releases are stored here.
+release_archive_dir ?= ../release
+
+# If RELEASE_TYPE is undefined, but RELEASE is, use its second word.
+# But overwrite VERSION.
+ifdef RELEASE
+ VERSION := $(word 1, $(RELEASE))
+ RELEASE_TYPE ?= $(word 2, $(RELEASE))
+endif
+
+# Validate and return $(RELEASE_TYPE), or die.
+RELEASE_TYPES = alpha beta stable
+release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES))
+
+# Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
+# Use alpha.gnu.org for alpha and beta releases.
+# Use ftp.gnu.org for stable releases.
+gnu_ftp_host-alpha = alpha.gnu.org
+gnu_ftp_host-beta = alpha.gnu.org
+gnu_ftp_host-stable = ftp.gnu.org
+gnu_rel_host ?= $(gnu_ftp_host-$(release-type))
+
+url_dir_list ?= $(if $(call _equal,$(gnu_rel_host),ftp.gnu.org), \
+ http://ftpmirror.gnu.org/$(PACKAGE), \
+ ftp://$(gnu_rel_host)/gnu/$(PACKAGE))
+
+# Override this in cfg.mk if you are using a different format in your
+# NEWS file.
+today = $(shell date +%Y-%m-%d)
+
+# Select which lines of NEWS are searched for $(news-check-regexp).
+# This is a sed line number spec. The default says that we search
+# lines 1..10 of NEWS for $(news-check-regexp).
+# If you want to search only line 3 or only lines 20-22, use "3" or "20,22".
+news-check-lines-spec ?= 1,10
+news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
+
+# Prevent programs like 'sort' from considering distinct strings to be equal.
+# Doing it here saves us from having to set LC_ALL elsewhere in this file.
+export LC_ALL = C
+
+## --------------- ##
+## Sanity checks. ##
+## --------------- ##
+
+ifneq ($(_gl-Makefile),)
+_cfg_mk := $(wildcard $(srcdir)/cfg.mk)
+
+# Collect the names of rules starting with 'sc_'.
+syntax-check-rules := $(sort $(shell $(SED) -n \
+ 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME) $(_cfg_mk)))
+.PHONY: $(syntax-check-rules)
+
+ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
+ local-checks-available += $(syntax-check-rules)
+else
+ local-checks-available += no-vc-detected
+no-vc-detected:
+ @echo "No version control files detected; skipping syntax check"
+endif
+.PHONY: $(local-checks-available)
+
+# Arrange to print the name of each syntax-checking rule just before running it.
+$(syntax-check-rules): %: %.m
+sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules))
+.PHONY: $(sc_m_rules_)
+$(sc_m_rules_):
+ @echo $(patsubst sc_%.m, %, $@)
+ @date +%s.%N > .sc-start-$(basename $@)
+
+# Compute and print the elapsed time for each syntax-check rule.
+sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules))
+.PHONY: $(sc_z_rules_)
+$(sc_z_rules_): %.z: %
+ @end=$$(date +%s.%N); \
+ start=$$(cat .sc-start-$*); \
+ rm -f .sc-start-$*; \
+ awk -v s=$$start -v e=$$end \
+ 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
+
+# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
+# that computes and prints elapsed time.
+local-check := \
+ $(patsubst sc_%, sc_%.z, \
+ $(filter-out $(local-checks-to-skip), $(local-checks-available)))
+
+syntax-check: $(local-check)
+endif
+
+# _sc_search_regexp
+#
+# This macro searches for a given construct in the selected files and
+# then takes some action.
+#
+# Parameters (shell variables):
+#
+# prohibit | require
+#
+# Regular expression (ERE) denoting either a forbidden construct
+# or a required construct. Those arguments are exclusive.
+#
+# exclude
+#
+# Regular expression (ERE) denoting lines to ignore that matched
+# a prohibit construct. For example, this can be used to exclude
+# comments that mention why the nearby code uses an alternative
+# construct instead of the simpler prohibited construct.
+#
+# in_vc_files | in_files
+#
+# grep-E-style regexp selecting the files to check. For in_vc_files,
+# the regexp is used to select matching files from the list of all
+# version-controlled files; for in_files, it's from the names printed
+# by "find $(srcdir)". When neither is specified, use all files that
+# are under version control.
+#
+# containing | non_containing
+#
+# Select the files (non) containing strings matching this regexp.
+# If both arguments are specified then CONTAINING takes
+# precedence.
+#
+# with_grep_options
+#
+# Extra options for grep.
+#
+# ignore_case
+#
+# Ignore case.
+#
+# halt
+#
+# Message to display before to halting execution.
+#
+# Finally, you may exempt files based on an ERE matching file names.
+# For example, to exempt from the sc_space_tab check all files with the
+# .diff suffix, set this Make variable:
+#
+# exclude_file_name_regexp--sc_space_tab = \.diff$
+#
+# Note that while this functionality is mostly inherited via VC_LIST_EXCEPT,
+# when filtering by name via in_files, we explicitly filter out matching
+# names here as well.
+
+# Initialize each, so that envvar settings cannot interfere.
+export require =
+export prohibit =
+export exclude =
+export in_vc_files =
+export in_files =
+export containing =
+export non_containing =
+export halt =
+export with_grep_options =
+
+# By default, _sc_search_regexp does not ignore case.
+export ignore_case =
+_ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :)
+
+define _sc_say_and_exit
+ dummy=; : so we do not need a semicolon before each use; \
+ { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; };
+endef
+
+define _sc_search_regexp
+ dummy=; : so we do not need a semicolon before each use; \
+ \
+ : Check arguments; \
+ test -n "$$prohibit" && test -n "$$require" \
+ && { msg='Cannot specify both prohibit and require' \
+ $(_sc_say_and_exit) } || :; \
+ test -z "$$prohibit" && test -z "$$require" \
+ && { msg='Should specify either prohibit or require' \
+ $(_sc_say_and_exit) } || :; \
+ test -z "$$prohibit" && test -n "$$exclude" \
+ && { msg='Use of exclude requires a prohibit pattern' \
+ $(_sc_say_and_exit) } || :; \
+ test -n "$$in_vc_files" && test -n "$$in_files" \
+ && { msg='Cannot specify both in_vc_files and in_files' \
+ $(_sc_say_and_exit) } || :; \
+ test "x$$halt" != x \
+ || { msg='halt not defined' $(_sc_say_and_exit) }; \
+ \
+ : Filter by file name; \
+ if test -n "$$in_files"; then \
+ files=$$(find $(srcdir) | grep -E "$$in_files" \
+ | grep -Ev '$(_sc_excl)'); \
+ else \
+ files=$$($(VC_LIST_EXCEPT)); \
+ if test -n "$$in_vc_files"; then \
+ files=$$(echo "$$files" | grep -E "$$in_vc_files"); \
+ fi; \
+ fi; \
+ \
+ : Filter by content; \
+ test -n "$$files" && test -n "$$containing" \
+ && { files=$$(grep -l "$$containing" $$files); } || :; \
+ test -n "$$files" && test -n "$$non_containing" \
+ && { files=$$(grep -vl "$$non_containing" $$files); } || :; \
+ \
+ : Check for the construct; \
+ if test -n "$$files"; then \
+ if test -n "$$prohibit"; then \
+ grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
+ | grep -vE "$${exclude:-^$$}" \
+ && { msg="$$halt" $(_sc_say_and_exit) } || :; \
+ else \
+ grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
+ | grep . \
+ && { msg="$$halt" $(_sc_say_and_exit) } || :; \
+ fi \
+ else :; \
+ fi || :;
+endef
+
+sc_avoid_if_before_free:
+ @$(srcdir)/$(_build-aux)/useless-if-before-free \
+ $(useless_free_options) \
+ $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \
+ { echo '$(ME): found useless "if" before "free" above' 1>&2; \
+ exit 1; } || :
+
+sc_cast_of_argument_to_free:
+ @prohibit='\<free *\( *\(' halt="don't cast free argument" \
+ $(_sc_search_regexp)
+
+sc_cast_of_x_alloc_return_value:
+ @prohibit='\*\) *x(m|c|re)alloc\>' \
+ halt="don't cast x*alloc return value" \
+ $(_sc_search_regexp)
+
+sc_cast_of_alloca_return_value:
+ @prohibit='\*\) *alloca\>' \
+ halt="don't cast alloca return value" \
+ $(_sc_search_regexp)
+
+sc_space_tab:
+ @prohibit='[ ] ' \
+ halt='found SPACE-TAB sequence; remove the SPACE' \
+ $(_sc_search_regexp)
+
+# Don't use *scanf or the old ato* functions in "real" code.
+# They provide no error checking mechanism.
+# Instead, use strto* functions.
+sc_prohibit_atoi_atof:
+ @prohibit='\<([fs]?scanf|ato([filq]|ll)) *\(' \
+ halt='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
+ $(_sc_search_regexp)
+
+# Use STREQ rather than comparing strcmp == 0, or != 0.
+sp_ = strcmp *\(.+\)
+sc_prohibit_strcmp:
+ @prohibit='! *strcmp *\(|\<$(sp_) *[!=]=|[!=]= *$(sp_)' \
+ exclude='# *define STRN?EQ\(' \
+ halt='replace strcmp calls above with STREQ/STRNEQ' \
+ $(_sc_search_regexp)
+
+# Really. You don't want to use this function.
+# It may fail to NUL-terminate the destination,
+# and always NUL-pads out to the specified length.
+sc_prohibit_strncpy:
+ @prohibit='\<strncpy *\(' \
+ halt='do not use strncpy, period' \
+ $(_sc_search_regexp)
+
+# Pass EXIT_*, not number, to usage, exit, and error (when exiting)
+# Convert all uses automatically, via these two commands:
+# git grep -l '\<exit *(1)' \
+# | grep -vEf .x-sc_prohibit_magic_number_exit \
+# | xargs --no-run-if-empty \
+# perl -pi -e 's/(^|[^.])\b(exit ?)\(1\)/$1$2(EXIT_FAILURE)/'
+# git grep -l '\<exit *(0)' \
+# | grep -vEf .x-sc_prohibit_magic_number_exit \
+# | xargs --no-run-if-empty \
+# perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
+sc_prohibit_magic_number_exit:
+ @prohibit='(^|[^.])\<(usage|exit|error) ?\(-?[0-9]+[,)]' \
+ exclude='exit \(77\)|error ?\(((0|77),|[^,]*)' \
+ halt='use EXIT_* values rather than magic number' \
+ $(_sc_search_regexp)
+
+# Using EXIT_SUCCESS as the first argument to error is misleading,
+# since when that parameter is 0, error does not exit. Use '0' instead.
+sc_error_exit_success:
+ @prohibit='error *\(EXIT_SUCCESS,' \
+ in_vc_files='\.[chly]$$' \
+ halt='found error (EXIT_SUCCESS' \
+ $(_sc_search_regexp)
+
+# "FATAL:" should be fully upper-cased in error messages
+# "WARNING:" should be fully upper-cased, or fully lower-cased
+sc_error_message_warn_fatal:
+ @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
+ | grep -E '"Warning|"Fatal|"fatal' && \
+ { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
+ exit 1; } || :
+
+# Error messages should not start with a capital letter
+sc_error_message_uppercase:
+ @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
+ | grep -E '"[A-Z]' \
+ | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \
+ { echo '$(ME): found capitalized error message' 1>&2; \
+ exit 1; } || :
+
+# Error messages should not end with a period
+sc_error_message_period:
+ @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
+ | grep -E '[^."]\."' && \
+ { echo '$(ME): found error message ending in period' 1>&2; \
+ exit 1; } || :
+
+sc_file_system:
+ @prohibit=file''system \
+ ignore_case=1 \
+ halt='found use of "file''system"; spell it "file system"' \
+ $(_sc_search_regexp)
+
+# Don't use cpp tests of this symbol. All code assumes config.h is included.
+sc_prohibit_have_config_h:
+ @prohibit='^# *if.*HAVE''_CONFIG_H' \
+ halt='found use of HAVE''_CONFIG_H; remove' \
+ $(_sc_search_regexp)
+
+# Nearly all .c files must include <config.h>. However, we also permit this
+# via inclusion of a package-specific header, if cfg.mk specified one.
+# config_h_header must be suitable for grep -E.
+config_h_header ?= <config\.h>
+sc_require_config_h:
+ @require='^# *include $(config_h_header)' \
+ in_vc_files='\.c$$' \
+ halt='the above files do not include <config.h>' \
+ $(_sc_search_regexp)
+
+# Print each file name for which the first #include does not match
+# $(config_h_header). Like grep -m 1, this only looks at the first match.
+perl_config_h_first_ = \
+ -e 'BEGIN {$$ret = 0}' \
+ -e 'if (/^\# *include\b/) {' \
+ -e ' if (not m{^\# *include $(config_h_header)}) {' \
+ -e ' print "$$ARGV\n";' \
+ -e ' $$ret = 1;' \
+ -e ' }' \
+ -e ' \# Move on to next file after first include' \
+ -e ' close ARGV;' \
+ -e '}' \
+ -e 'END {exit $$ret}'
+
+# You must include <config.h> before including any other header file.
+# This can possibly be via a package-specific header, if given by cfg.mk.
+sc_require_config_h_first:
+ @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
+ files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') && \
+ perl -n $(perl_config_h_first_) $$files || \
+ { echo '$(ME): the above files include some other header' \
+ 'before <config.h>' 1>&2; exit 1; } || :; \
+ else :; \
+ fi
+
+sc_prohibit_HAVE_MBRTOWC:
+ @prohibit='\bHAVE_MBRTOWC\b' \
+ halt="do not use $$prohibit; it is always defined" \
+ $(_sc_search_regexp)
+
+# To use this "command" macro, you must first define two shell variables:
+# h: the header name, with no enclosing <> or ""
+# re: a regular expression that matches IFF something provided by $h is used.
+define _sc_header_without_use
+ dummy=; : so we do not need a semicolon before each use; \
+ h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \
+ if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
+ files=$$(grep -l '^# *include '"$$h_esc" \
+ $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
+ grep -LE "$$re" $$files | grep . && \
+ { echo "$(ME): the above files include $$h but don't use it" \
+ 1>&2; exit 1; } || :; \
+ else :; \
+ fi
+endef
+
+# Prohibit the inclusion of assert.h without an actual use of assert.
+sc_prohibit_assert_without_use:
+ @h='assert.h' re='\<assert *\(' $(_sc_header_without_use)
+
+# Prohibit the inclusion of close-stream.h without an actual use.
+sc_prohibit_close_stream_without_use:
+ @h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use)
+
+# Prohibit the inclusion of getopt.h without an actual use.
+sc_prohibit_getopt_without_use:
+ @h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
+
+# Don't include quotearg.h unless you use one of its functions.
+sc_prohibit_quotearg_without_use:
+ @h='quotearg.h' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
+
+# Don't include quote.h unless you use one of its functions.
+sc_prohibit_quote_without_use:
+ @h='quote.h' re='\<quote((_n)? *\(|_quoting_options\>)' \
+ $(_sc_header_without_use)
+
+# Don't include this header unless you use one of its functions.
+sc_prohibit_long_options_without_use:
+ @h='long-options.h' re='\<parse_long_options *\(' \
+ $(_sc_header_without_use)
+
+# Don't include this header unless you use one of its functions.
+sc_prohibit_inttostr_without_use:
+ @h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \
+ $(_sc_header_without_use)
+
+# Don't include this header unless you use one of its functions.
+sc_prohibit_ignore_value_without_use:
+ @h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \
+ $(_sc_header_without_use)
+
+# Don't include this header unless you use one of its functions.
+sc_prohibit_error_without_use:
+ @h='error.h' \
+ re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
+ $(_sc_header_without_use)
+
+# Don't include xalloc.h unless you use one of its functions.
+# Consider these symbols:
+# perl -lne '/^# *define (\w+)\(/ and print $1' lib/xalloc.h|grep -v '^__';
+# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h
+# Divide into two sets on case, and filter each through this:
+# | sort | perl -MRegexp::Assemble -le \
+# 'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g'
+# Note this was produced by the above:
+# _xa1 = \
+#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup)
+# But we can do better, in at least two ways:
+# 1) take advantage of two "dup"-suffixed strings:
+# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup)
+# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable
+# "char|[cmz]"
+# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
+_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
+_xa2 = X([CZ]|N?M)ALLOC
+sc_prohibit_xalloc_without_use:
+ @h='xalloc.h' \
+ re='\<($(_xa1)|$(_xa2)) *\('\
+ $(_sc_header_without_use)
+
+# Extract function names:
+# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/hash.h
+_hash_re = \
+clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
+_hash_fn = \<($(_hash_re)) *\(
+_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
+sc_prohibit_hash_without_use:
+ @h='hash.h' \
+ re='$(_hash_fn)|$(_hash_struct)'\
+ $(_sc_header_without_use)
+
+sc_prohibit_cloexec_without_use:
+ @h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \
+ $(_sc_header_without_use)
+
+sc_prohibit_posixver_without_use:
+ @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
+
+sc_prohibit_same_without_use:
+ @h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
+
+sc_prohibit_hash_pjw_without_use:
+ @h='hash-pjw.h' \
+ re='\<hash_pjw\>' \
+ $(_sc_header_without_use)
+
+sc_prohibit_safe_read_without_use:
+ @h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
+ $(_sc_header_without_use)
+
+sc_prohibit_argmatch_without_use:
+ @h='argmatch.h' \
+ re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
+ $(_sc_header_without_use)
+
+sc_prohibit_canonicalize_without_use:
+ @h='canonicalize.h' \
+ re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode|file_name)' \
+ $(_sc_header_without_use)
+
+sc_prohibit_root_dev_ino_without_use:
+ @h='root-dev-ino.h' \
+ re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
+ $(_sc_header_without_use)
+
+sc_prohibit_openat_without_use:
+ @h='openat.h' \
+ re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat|(FCHMOD|FCHOWN|STAT)AT_INLINE)\>' \
+ $(_sc_header_without_use)
+
+# Prohibit the inclusion of c-ctype.h without an actual use.
+ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
+|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
+sc_prohibit_c_ctype_without_use:
+ @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \
+ $(_sc_header_without_use)
+
+# The following list was generated by running:
+# man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \
+# | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt
+_sig_functions = \
+ bsd_signal kill killpg pthread_kill pthread_sigmask raise sigaction \
+ sigaddset sigaltstack sigdelset sigemptyset sigfillset sighold sigignore \
+ siginterrupt sigismember signal sigpause sigpending sigprocmask sigqueue \
+ sigrelse sigset sigsuspend sigtimedwait sigwait sigwaitinfo
+_sig_function_re = $(subst $(_sp),|,$(strip $(_sig_functions)))
+# The following were extracted from "man signal.h" manually.
+_sig_types_and_consts = \
+ MINSIGSTKSZ SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK \
+ SA_RESETHAND SA_RESTART SA_SIGINFO SIGEV_NONE SIGEV_SIGNAL \
+ SIGEV_THREAD SIGSTKSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SS_DISABLE \
+ SS_ONSTACK mcontext_t pid_t sig_atomic_t sigevent siginfo_t sigset_t \
+ sigstack sigval stack_t ucontext_t
+# generated via this:
+# perl -lne '/^#ifdef (SIG\w+)/ and print $1' lib/sig2str.c|sort -u|fmt -70
+_sig_names = \
+ SIGABRT SIGALRM SIGALRM1 SIGBUS SIGCANCEL SIGCHLD SIGCLD SIGCONT \
+ SIGDANGER SIGDIL SIGEMT SIGFPE SIGFREEZE SIGGRANT SIGHUP SIGILL \
+ SIGINFO SIGINT SIGIO SIGIOT SIGKAP SIGKILL SIGKILLTHR SIGLOST SIGLWP \
+ SIGMIGRATE SIGMSG SIGPHONE SIGPIPE SIGPOLL SIGPRE SIGPROF SIGPWR \
+ SIGQUIT SIGRETRACT SIGSAK SIGSEGV SIGSOUND SIGSTKFLT SIGSTOP SIGSYS \
+ SIGTERM SIGTHAW SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 \
+ SIGUSR2 SIGVIRT SIGVTALRM SIGWAITING SIGWINCH SIGWIND SIGWINDOW \
+ SIGXCPU SIGXFSZ
+_sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_consts)))
+
+# Prohibit the inclusion of signal.h without an actual use.
+sc_prohibit_signal_without_use:
+ @h='signal.h' \
+ re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \
+ $(_sc_header_without_use)
+
+# Don't include stdio--.h unless you use one of its functions.
+sc_prohibit_stdio--_without_use:
+ @h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\(' \
+ $(_sc_header_without_use)
+
+# Don't include stdio-safer.h unless you use one of its functions.
+sc_prohibit_stdio-safer_without_use:
+ @h='stdio-safer.h' re='\<((f(re)?|p)open|tmpfile)_safer *\(' \
+ $(_sc_header_without_use)
+
+# Prohibit the inclusion of strings.h without a sensible use.
+# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
+sc_prohibit_strings_without_use:
+ @h='strings.h' \
+ re='\<(strn?casecmp|ffs(ll)?)\>' \
+ $(_sc_header_without_use)
+
+# Get the list of symbol names with this:
+# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt
+_intprops_names = \
+ TYPE_IS_INTEGER TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM \
+ INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND \
+ INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW \
+ INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW \
+ INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW \
+ INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \
+ INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW \
+ INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW
+_intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
+# Prohibit the inclusion of intprops.h without an actual use.
+sc_prohibit_intprops_without_use:
+ @h='intprops.h' \
+ re='\<($(_intprops_syms_re)) *\(' \
+ $(_sc_header_without_use)
+
+_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
+# Prohibit the inclusion of stddef.h without an actual use.
+sc_prohibit_stddef_without_use:
+ @h='stddef.h' \
+ re='\<($(_stddef_syms_re))\>' \
+ $(_sc_header_without_use)
+
+_de1 = dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)?
+_de2 = (versionsort|struct dirent|getdirentries|alphasort|scandir(at)?)(64)?
+_de3 = MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen
+_dirent_syms_re = $(_de1)|$(_de2)|$(_de3)
+# Prohibit the inclusion of dirent.h without an actual use.
+sc_prohibit_dirent_without_use:
+ @h='dirent.h' \
+ re='\<($(_dirent_syms_re))\>' \
+ $(_sc_header_without_use)
+
+# Prohibit the inclusion of verify.h without an actual use.
+sc_prohibit_verify_without_use:
+ @h='verify.h' \
+ re='\<(verify(true|expr)?|static_assert) *\(' \
+ $(_sc_header_without_use)
+
+# Don't include xfreopen.h unless you use one of its functions.
+sc_prohibit_xfreopen_without_use:
+ @h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use)
+
+sc_obsolete_symbols:
+ @prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
+ halt='do not use HAVE''_FCNTL_H or O'_NDELAY \
+ $(_sc_search_regexp)
+
+# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
+
+# Each nonempty ChangeLog line must start with a year number, or a TAB.
+sc_changelog:
+ @prohibit='^[^12 ]' \
+ in_vc_files='^ChangeLog$$' \
+ halt='found unexpected prefix in a ChangeLog' \
+ $(_sc_search_regexp)
+
+# Ensure that each .c file containing a "main" function also
+# calls set_program_name.
+sc_program_name:
+ @require='set_program_name *\(.*\);' \
+ in_vc_files='\.c$$' \
+ containing='\<main *(' \
+ halt='the above files do not call set_program_name' \
+ $(_sc_search_regexp)
+
+# Ensure that each .c file containing a "main" function also
+# calls bindtextdomain.
+sc_bindtextdomain:
+ @require='bindtextdomain *\(' \
+ in_vc_files='\.c$$' \
+ containing='\<main *(' \
+ halt='the above files do not call bindtextdomain' \
+ $(_sc_search_regexp)
+
+# Require that the final line of each test-lib.sh-using test be this one:
+# Exit $fail
+# Note: this test requires GNU grep's --label= option.
+Exit_witness_file ?= tests/test-lib.sh
+Exit_base := $(notdir $(Exit_witness_file))
+sc_require_test_exit_idiom:
+ @if test -f $(srcdir)/$(Exit_witness_file); then \
+ die=0; \
+ for i in $$(grep -l -F 'srcdir/$(Exit_base)' \
+ $$($(VC_LIST) tests)); do \
+ tail -n1 $$i | grep '^Exit .' > /dev/null \
+ && : || { die=1; echo $$i; } \
+ done; \
+ test $$die = 1 && \
+ { echo 1>&2 '$(ME): the final line in each of the above is not:'; \
+ echo 1>&2 'Exit something'; \
+ exit 1; } || :; \
+ fi
+
+sc_trailing_blank:
+ @prohibit='[ ]$$' \
+ halt='found trailing blank(s)' \
+ exclude='^Binary file .* matches$$' \
+ $(_sc_search_regexp)
+
+# Match lines like the following, but where there is only one space
+# between the options and the description:
+# -D, --all-repeated[=delimit-method] print all duplicate lines\n
+longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
+sc_two_space_separator_in_usage:
+ @prohibit='^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
+ halt='help2man requires at least two spaces between an option and its description'\
+ $(_sc_search_regexp)
+
+# A regexp matching function names like "error" that may be used
+# to emit translatable messages.
+_gl_translatable_diag_func_re ?= error
+
+# Look for diagnostics that aren't marked for translation.
+# This won't find any for which error's format string is on a separate line.
+sc_unmarked_diagnostics:
+ @prohibit='\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \
+ exclude='(_|ngettext ?)\(' \
+ halt='found unmarked diagnostic(s)' \
+ $(_sc_search_regexp)
+
+# Avoid useless parentheses like those in this example:
+# #if defined (SYMBOL) || defined (SYM2)
+sc_useless_cpp_parens:
+ @prohibit='^# *if .*defined *\(' \
+ halt='found useless parentheses in cpp directive' \
+ $(_sc_search_regexp)
+
+# List headers for which HAVE_HEADER_H is always true, assuming you are
+# using the appropriate gnulib module. CAUTION: for each "unnecessary"
+# #if HAVE_HEADER_H that you remove, be sure that your project explicitly
+# requires the gnulib module that guarantees the usability of that header.
+gl_assured_headers_ = \
+ cd $(gnulib_dir)/lib && echo *.in.h|$(SED) 's/\.in\.h//g'
+
+# Convert the list of names to upper case, and replace each space with "|".
+az_ = abcdefghijklmnopqrstuvwxyz
+AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ
+gl_header_upper_case_or_ = \
+ $$($(gl_assured_headers_) \
+ | tr $(az_)/.- $(AZ_)___ \
+ | tr -s ' ' '|' \
+ )
+sc_prohibit_always_true_header_tests:
+ @or=$(gl_header_upper_case_or_); \
+ re="HAVE_($$or)_H"; \
+ prohibit='\<'"$$re"'\>' \
+ halt=$$(printf '%s\n' \
+ 'do not test the above HAVE_<header>_H symbol(s);' \
+ ' with the corresponding gnulib module, they are always true') \
+ $(_sc_search_regexp)
+
+sc_prohibit_defined_have_decl_tests:
+ @prohibit='(#[ ]*ifn?def|\<defined)\>[ (]+HAVE_DECL_' \
+ halt='HAVE_DECL macros are always defined' \
+ $(_sc_search_regexp)
+
+# ==================================================================
+gl_other_headers_ ?= \
+ intprops.h \
+ openat.h \
+ stat-macros.h
+
+# Perl -lne code to extract "significant" cpp-defined symbols from a
+# gnulib header file, eliminating a few common false-positives.
+# The exempted names below are defined only conditionally in gnulib,
+# and hence sometimes must/may be defined in application code.
+gl_extract_significant_defines_ = \
+ /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\
+ && $$2 !~ /(?:rpl_|_used_without_)/\
+ && $$1 !~ /^(?:NSIG|ENODATA)$$/\
+ && $$1 !~ /^(?:SA_RESETHAND|SA_RESTART)$$/\
+ and print $$1
+
+# Create a list of regular expressions matching the names
+# of macros that are guaranteed to be defined by parts of gnulib.
+define def_sym_regex
+ gen_h=$(gl_generated_headers_); \
+ (cd $(gnulib_dir)/lib; \
+ for f in *.in.h $(gl_other_headers_); do \
+ test -f $$f \
+ && perl -lne '$(gl_extract_significant_defines_)' $$f; \
+ done; \
+ ) | sort -u \
+ | $(SED) 's/^/^ *# *(define|undef) */;s/$$/\\>/'
+endef
+
+# Don't define macros that we already get from gnulib header files.
+sc_prohibit_always-defined_macros:
+ @if test -d $(gnulib_dir); then \
+ case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \
+ echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
+ esac; \
+ $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \
+ && { echo '$(ME): define the above via some gnulib .h file' \
+ 1>&2; exit 1; } || :; \
+ fi
+# ==================================================================
+
+# Prohibit checked in backup files.
+sc_prohibit_backup_files:
+ @$(VC_LIST) | grep '~$$' && \
+ { echo '$(ME): found version controlled backup file' 1>&2; \
+ exit 1; } || :
+
+# Require the latest GPL.
+sc_GPL_version:
+ @prohibit='either ''version [^3]' \
+ halt='GPL vN, N!=3' \
+ $(_sc_search_regexp)
+
+# Require the latest GFDL. Two regexp, since some .texi files end up
+# line wrapping between 'Free Documentation License,' and 'Version'.
+_GFDL_regexp = (Free ''Documentation.*Version 1\.[^3]|Version 1\.[^3] or any)
+sc_GFDL_version:
+ @prohibit='$(_GFDL_regexp)' \
+ halt='GFDL vN, N!=3' \
+ $(_sc_search_regexp)
+
+# Don't use Texinfo's @acronym{}.
+# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
+texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
+sc_texinfo_acronym:
+ @prohibit='@acronym\{' \
+ in_vc_files='$(texinfo_suffix_re_)' \
+ halt='found use of Texinfo @acronym{}' \
+ $(_sc_search_regexp)
+
+cvs_keywords = \
+ Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
+
+sc_prohibit_cvs_keyword:
+ @prohibit='\$$($(cvs_keywords))\$$' \
+ halt='do not use CVS keyword expansion' \
+ $(_sc_search_regexp)
+
+# This Perl code is slightly obfuscated. Not only is each "$" doubled
+# because it's in a Makefile, but the $$c's are comments; we cannot
+# use "#" due to the way the script ends up concatenated onto one line.
+# It would be much more concise, and would produce better output (including
+# counts) if written as:
+# perl -ln -0777 -e '/\n(\n+)$/ and print "$ARGV: ".length $1' ...
+# but that would be far less efficient, reading the entire contents
+# of each file, rather than just the last two bytes of each.
+# In addition, while the code below detects both blank lines and a missing
+# newline at EOF, the above detects only the former.
+#
+# This is a perl script that is expected to be the single-quoted argument
+# to a command-line "-le". The remaining arguments are file names.
+# Print the name of each file that does not end in exactly one newline byte.
+# I.e., warn if there are blank lines (2 or more newlines), or if the
+# last byte is not a newline. However, currently we don't complain
+# about any file that contains exactly one byte.
+# Exit nonzero if at least one such file is found, otherwise, exit 0.
+# Warn about, but otherwise ignore open failure. Ignore seek/read failure.
+#
+# Use this if you want to remove trailing empty lines from selected files:
+# perl -pi -0777 -e 's/\n\n+$/\n/' files...
+#
+require_exactly_one_NL_at_EOF_ = \
+ foreach my $$f (@ARGV) \
+ { \
+ open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \
+ my $$p = sysseek (F, -2, 2); \
+ my $$c = "seek failure probably means file has < 2 bytes; ignore"; \
+ my $$last_two_bytes; \
+ defined $$p and $$p = sysread F, $$last_two_bytes, 2; \
+ close F; \
+ $$c = "ignore read failure"; \
+ $$p && ($$last_two_bytes eq "\n\n" \
+ || substr ($$last_two_bytes,1) ne "\n") \
+ and (print $$f), $$fail=1; \
+ } \
+ END { exit defined $$fail }
+sc_prohibit_empty_lines_at_EOF:
+ @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
+ || { echo '$(ME): empty line(s) or no newline at EOF' \
+ 1>&2; exit 1; } || :
+
+# Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
+# This is a bit of a kludge, since it prevents use of the string
+# even in comments, but for now it does the job with no false positives.
+sc_prohibit_stat_st_blocks:
+ @prohibit='[.>]st_blocks' \
+ halt='do not use st_blocks; use ST_NBLOCKS' \
+ $(_sc_search_regexp)
+
+# Make sure we don't define any S_IS* macros in src/*.c files.
+# They're already defined via gnulib's sys/stat.h replacement.
+sc_prohibit_S_IS_definition:
+ @prohibit='^ *# *define *S_IS' \
+ halt='do not define S_IS* macros; include <sys/stat.h>' \
+ $(_sc_search_regexp)
+
+# Perl block to convert a match to FILE_NAME:LINENO:TEST,
+# that is shared by two definitions below.
+perl_filename_lineno_text_ = \
+ -e ' {' \
+ -e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \
+ -e ' ($$v = $$&) =~ s/\n/\\n/g;' \
+ -e ' print "$$ARGV:$$n:$$v\n";' \
+ -e ' }'
+
+prohibit_doubled_words_ = \
+ the then in an on if is it but for or at and do to
+# expand the regex before running the check to avoid using expensive captures
+prohibit_doubled_word_expanded_ = \
+ $(join $(prohibit_doubled_words_),$(addprefix \s+,$(prohibit_doubled_words_)))
+prohibit_doubled_word_RE_ ?= \
+ /\b(?:$(subst $(_sp),|,$(prohibit_doubled_word_expanded_)))\b/gims
+prohibit_doubled_word_ = \
+ -e 'while ($(prohibit_doubled_word_RE_))' \
+ $(perl_filename_lineno_text_)
+
+# Define this to a regular expression that matches
+# any filename:dd:match lines you want to ignore.
+# The default is to ignore no matches.
+ignore_doubled_word_match_RE_ ?= ^$$
+
+sc_prohibit_doubled_word:
+ @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \
+ | grep -vE '$(ignore_doubled_word_match_RE_)' \
+ | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
+
+# A regular expression matching undesirable combinations of words like
+# "can not"; this matches them even when the two words appear on different
+# lines, but not when there is an intervening delimiter like "#" or "*".
+# Similarly undesirable, "See @xref{...}", since an @xref should start
+# a sentence. Explicitly prohibit any prefix of "see" or "also".
+# Also prohibit a prefix matching "\w+ +".
+# @pxref gets the same see/also treatment and should be parenthesized;
+# presume it must *not* start a sentence.
+bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)\@xref\{
+bad_pxref_re_ ?= (?:[.!?]|(?:see|also))\s+\@pxref\{
+prohibit_undesirable_word_seq_RE_ ?= \
+ /(?:\bcan\s+not\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
+prohibit_undesirable_word_seq_ = \
+ -e 'while ($(prohibit_undesirable_word_seq_RE_))' \
+ $(perl_filename_lineno_text_)
+# Define this to a regular expression that matches
+# any filename:dd:match lines you want to ignore.
+# The default is to ignore no matches.
+ignore_undesirable_word_sequence_RE_ ?= ^$$
+
+sc_prohibit_undesirable_word_seq:
+ @perl -n -0777 $(prohibit_undesirable_word_seq_) \
+ $$($(VC_LIST_EXCEPT)) \
+ | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \
+ && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || :
+
+# Except for shell files and for loops, double semicolon is probably a mistake
+sc_prohibit_double_semicolon:
+ @prohibit='; *;[ {} \]*(/[/*]|$$)' \
+ in_vc_files='\.[chly]$$' \
+ exclude='\bfor *\(.*\)' \
+ halt="Double semicolon detected" \
+ $(_sc_search_regexp)
+
+_ptm1 = use "test C1 && test C2", not "test C1 -''a C2"
+_ptm2 = use "test C1 || test C2", not "test C1 -''o C2"
+# Using test's -a and -o operators is not portable.
+# We prefer test over [, since the latter is spelled [[ in configure.ac.
+sc_prohibit_test_minus_ao:
+ @prohibit='(\<test| \[+) .+ -[ao] ' \
+ halt='$(_ptm1); $(_ptm2)' \
+ $(_sc_search_regexp)
+
+# Avoid a test bashism.
+sc_prohibit_test_double_equal:
+ @prohibit='(\<test| \[+) .+ == ' \
+ containing='#! */bin/[a-z]*sh' \
+ halt='use "test x = x", not "test x =''= x"' \
+ $(_sc_search_regexp)
+
+# Each program that uses proper_name_utf8 must link with one of the
+# ICONV libraries. Otherwise, some ICONV library must appear in LDADD.
+# The perl -0777 invocation below extracts the possibly-multi-line
+# definition of LDADD from the appropriate Makefile.am and exits 0
+# when it contains "ICONV".
+sc_proper_name_utf8_requires_ICONV:
+ @progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
+ if test "x$$progs" != x; then \
+ fail=0; \
+ for p in $$progs; do \
+ dir=$$(dirname "$$p"); \
+ perl -0777 \
+ -ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \
+ $$dir/Makefile.am && continue; \
+ base=$$(basename "$$p" .c); \
+ grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
+ || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
+ done; \
+ test $$fail = 1 && \
+ { echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
+ exit 1; } || :; \
+ fi
+
+# Warn about "c0nst struct Foo const foo[]",
+# but not about "char const *const foo" or "#define const const".
+sc_redundant_const:
+ @prohibit='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
+ halt='redundant "const" in declarations' \
+ $(_sc_search_regexp)
+
+sc_const_long_option:
+ @prohibit='^ *static.*struct option ' \
+ exclude='const struct option|struct option const' \
+ halt='add "const" to the above declarations' \
+ $(_sc_search_regexp)
+
+NEWS_hash = \
+ $$($(SED) -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
+ $(srcdir)/NEWS \
+ | perl -0777 -pe \
+ 's/^Copyright.+?Free\sSoftware\sFoundation,\sInc\.\n//ms' \
+ | md5sum - \
+ | $(SED) 's/ .*//')
+
+# Ensure that we don't accidentally insert an entry into an old NEWS block.
+sc_immutable_NEWS:
+ @if test -f $(srcdir)/NEWS; then \
+ test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
+ { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
+ fi
+
+# Update the hash stored above. Do this after each release and
+# for any corrections to old entries.
+update-NEWS-hash: NEWS
+ perl -pi -e 's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \
+ $(srcdir)/cfg.mk
+
+# Ensure that we use only the standard $(VAR) notation,
+# not @...@ in Makefile.am, now that we can rely on automake
+# to emit a definition for each substituted variable.
+# However, there is still one case in which @VAR@ use is not just
+# legitimate, but actually required: when augmenting an automake-defined
+# variable with a prefix. For example, gettext uses this:
+# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
+# otherwise, makeinfo would put German or French (current locale)
+# navigation hints in the otherwise-English documentation.
+#
+# Allow the package to add exceptions via a hook in cfg.mk;
+# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by
+# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'.
+_makefile_at_at_check_exceptions ?=
+sc_makefile_at_at_check:
+ @perl -ne '/\@\w+\@/' \
+ -e ' && !/(\w+)\s+=.*\@\1\@$$/' \
+ -e ''$(_makefile_at_at_check_exceptions) \
+ -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \
+ $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
+ && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
+
+news-check: NEWS
+ $(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $< \
+ | grep -E $(news-check-regexp) >/dev/null; then \
+ :; \
+ else \
+ echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \
+ exit 1; \
+ fi
+
+sc_makefile_TAB_only_indentation:
+ @prohibit='^ [ ]{8}' \
+ in_vc_files='akefile|\.mk$$' \
+ halt='found TAB-8-space indentation' \
+ $(_sc_search_regexp)
+
+sc_m4_quote_check:
+ @prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \
+ in_vc_files='(^configure\.ac|\.m4)$$' \
+ halt='quote the first arg to AC_DEF*' \
+ $(_sc_search_regexp)
+
+fix_po_file_diag = \
+'you have changed the set of files with translatable diagnostics;\n\
+apply the above patch\n'
+
+# Generate a list of files in which to search for translatable strings.
+perl_translatable_files_list_ = \
+ -e 'foreach $$file (@ARGV) {' \
+ -e ' \# Consider only file extensions with one or two letters' \
+ -e ' $$file =~ /\...?$$/ or next;' \
+ -e ' \# Ignore m4 and mk files' \
+ -e ' $$file =~ /\.m[4k]$$/ and next;' \
+ -e ' \# Ignore a .c or .h file with a corresponding .l or .y file' \
+ -e ' $$file =~ /(.+)\.[ch]$$/ && (-e "$${1}.l" || -e "$${1}.y")' \
+ -e ' and next;' \
+ -e ' \# Skip unreadable files' \
+ -e ' -r $$file or next;' \
+ -e ' print "$$file ";' \
+ -e '}'
+
+# Verify that all source files using _() (more specifically, files that
+# match $(_gl_translatable_string_re)) are listed in po/POTFILES.in.
+po_file ?= $(srcdir)/po/POTFILES.in
+generated_files ?= $(srcdir)/lib/*.[ch]
+_gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
+sc_po_check:
+ @if test -f $(po_file); then \
+ grep -E -v '^(#|$$)' $(po_file) \
+ | grep -v '^src/false\.c$$' | sort > $@-1; \
+ files=$$(perl $(perl_translatable_files_list_) \
+ $$($(VC_LIST_EXCEPT)) $(generated_files)); \
+ grep -E -l '$(_gl_translatable_string_re)' $$files \
+ | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \
+ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
+ || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
+ rm -f $@-1 $@-2; \
+ fi
+
+# Sometimes it is useful to change the PATH environment variable
+# in Makefiles. When doing so, it's better not to use the Unix-centric
+# path separator of ':', but rather the automake-provided '$(PATH_SEPARATOR)'.
+msg = 'Do not use ":" above; use $$(PATH_SEPARATOR) instead'
+sc_makefile_path_separator_check:
+ @prohibit='PATH[=].*:' \
+ in_vc_files='akefile|\.mk$$' \
+ halt=$(msg) \
+ $(_sc_search_regexp)
+
+# Check that 'make alpha' will not fail at the end of the process,
+# i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release)
+# and is read-only.
+writable-files:
+ $(AM_V_GEN)if test -d $(release_archive_dir); then \
+ for file in $(DIST_ARCHIVES); do \
+ for p in ./ $(release_archive_dir)/; do \
+ test -e $$p$$file || continue; \
+ test -w $$p$$file \
+ || { echo ERROR: $$p$$file is not writable; fail=1; }; \
+ done; \
+ done; \
+ test "$$fail" && exit 1 || : ; \
+ else :; \
+ fi
+
+v_etc_file = $(gnulib_dir)/lib/version-etc.c
+sample-test = tests/sample-test
+texi = doc/$(PACKAGE).texi
+# Make sure that the copyright date in $(v_etc_file) is up to date.
+# Do the same for the $(sample-test) and the main doc/.texi file.
+sc_copyright_check:
+ @require='enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' \
+ in_files=$(v_etc_file) \
+ halt='out of date copyright in $(v_etc_file); update it' \
+ $(_sc_search_regexp)
+ @require='# Copyright \(C\) '$$(date +%Y)' Free' \
+ in_vc_files=$(sample-test) \
+ halt='out of date copyright in $(sample-test); update it' \
+ $(_sc_search_regexp)
+ @require='Copyright @copyright\{\} .*'$$(date +%Y) \
+ in_vc_files=$(texi) \
+ halt='out of date copyright in $(texi); update it' \
+ $(_sc_search_regexp)
+
+# If tests/help-version exists and seems to be new enough, assume that its
+# use of init.sh and path_prepend_ is correct, and ensure that every other
+# use of init.sh is identical.
+# This is useful because help-version cross-checks prog --version
+# with $(VERSION), which verifies that its path_prepend_ invocation
+# sets PATH correctly. This is an inexpensive way to ensure that
+# the other init.sh-using tests also get it right.
+_hv_file ?= $(srcdir)/tests/help-version
+_hv_regex_weak ?= ^ *\. .*/init\.sh"
+# Fix syntax-highlighters "
+_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
+sc_cross_check_PATH_usage_in_tests:
+ @if test -f $(_hv_file); then \
+ grep -l 'VERSION mismatch' $(_hv_file) >/dev/null \
+ || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2; \
+ exit 0; }; \
+ grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \
+ || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
+ exit 1; }; \
+ good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file)); \
+ grep -LFx "$$good" \
+ $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT))) \
+ | grep . && \
+ { echo "$(ME): the above files use path_prepend_ inconsistently" \
+ 1>&2; exit 1; } || :; \
+ fi
+
+# BRE regex of file contents to identify a test script.
+_test_script_regex ?= \<init\.sh\>
+
+# In tests, use "compare expected actual", not the reverse.
+sc_prohibit_reversed_compare_failure:
+ @prohibit='\<compare [^ ]+ ([^ ]*exp|/dev/null)' \
+ containing='$(_test_script_regex)' \
+ halt='reversed compare arguments' \
+ $(_sc_search_regexp)
+
+# #if HAVE_... will evaluate to false for any non numeric string.
+# That would be flagged by using -Wundef, however gnulib currently
+# tests many undefined macros, and so we can't enable that option.
+# So at least preclude common boolean strings as macro values.
+sc_Wundef_boolean:
+ @prohibit='^#define.*(yes|no|true|false)$$' \
+ in_files='$(CONFIG_INCLUDE)' \
+ halt='Use 0 or 1 for macro values' \
+ $(_sc_search_regexp)
+
+# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might
+# not be constant, or might overflow a stack. In general, use PATH_MAX as
+# a limit, not an array or alloca size.
+sc_prohibit_path_max_allocation:
+ @prohibit='(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX' \
+ halt='Avoid stack allocations of size PATH_MAX' \
+ $(_sc_search_regexp)
+
+sc_vulnerable_makefile_CVE-2009-4029:
+ @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
+ in_files='(^|/)Makefile\.in$$' \
+ halt=$$(printf '%s\n' \
+ 'the above files are vulnerable; beware of running' \
+ ' "make dist*" rules, and upgrade to fixed automake' \
+ ' see http://bugzilla.redhat.com/542609 for details') \
+ $(_sc_search_regexp)
+
+sc_vulnerable_makefile_CVE-2012-3386:
+ @prohibit='chmod a\+w \$$\(distdir\)' \
+ in_files='(^|/)Makefile\.in$$' \
+ halt=$$(printf '%s\n' \
+ 'the above files are vulnerable; beware of running' \
+ ' "make distcheck", and upgrade to fixed automake' \
+ ' see http://bugzilla.redhat.com/CVE-2012-3386 for details') \
+ $(_sc_search_regexp)
+
+vc-diff-check:
+ $(AM_V_GEN)(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
+ $(AM_V_at)if test -s vc-diffs; then \
+ cat vc-diffs; \
+ echo "Some files are locally modified:" 1>&2; \
+ exit 1; \
+ else \
+ rm vc-diffs; \
+ fi
+
+rel-files = $(DIST_ARCHIVES)
+
+gnulib_dir ?= $(srcdir)/gnulib
+gnulib-version = $$(cd $(gnulib_dir) \
+ && { git describe || git rev-parse --short=10 HEAD; } )
+bootstrap-tools ?= autoconf,automake,gnulib
+
+gpgv = $$(gpgv2 --version >/dev/null && echo gpgv2 || echo gpgv)
+# If it's not already specified, derive the GPG key ID from
+# the signed tag we've just applied to mark this release.
+gpg_key_ID ?= \
+ $$(cd $(srcdir) \
+ && git cat-file tag v$(VERSION) \
+ | $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null \
+ | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+
+translation_project_ ?= coordinator@translationproject.org
+
+# Make info-gnu the default only for a stable release.
+announcement_Cc_stable = $(translation_project_), $(PACKAGE_BUGREPORT)
+announcement_mail_headers_stable = \
+ To: info-gnu@gnu.org \
+ Cc: $(announcement_Cc_) \
+ Mail-Followup-To: $(PACKAGE_BUGREPORT)
+
+announcement_Cc_alpha = $(translation_project_)
+announcement_mail_headers_alpha = \
+ To: $(PACKAGE_BUGREPORT) \
+ Cc: $(announcement_Cc_)
+
+announcement_mail_Cc_beta = $(announcement_mail_Cc_alpha)
+announcement_mail_headers_beta = $(announcement_mail_headers_alpha)
+
+announcement_mail_Cc_ ?= $(announcement_mail_Cc_$(release-type))
+announcement_mail_headers_ ?= $(announcement_mail_headers_$(release-type))
+announcement: NEWS ChangeLog $(rel-files)
+# Not $(AM_V_GEN) since the output of this command serves as
+# announcement message: it would start with " GEN announcement".
+ $(AM_V_at)$(srcdir)/$(_build-aux)/announce-gen \
+ --mail-headers='$(announcement_mail_headers_)' \
+ --release-type=$(release-type) \
+ --package=$(PACKAGE) \
+ --prev=$(PREV_VERSION) \
+ --curr=$(VERSION) \
+ --gpg-key-id=$(gpg_key_ID) \
+ --srcdir=$(srcdir) \
+ --news=$(srcdir)/NEWS \
+ --bootstrap-tools=$(bootstrap-tools) \
+ $$(case ,$(bootstrap-tools), in (*,gnulib,*) \
+ echo --gnulib-version=$(gnulib-version);; esac) \
+ --no-print-checksums \
+ $(addprefix --url-dir=, $(url_dir_list))
+
+.PHONY: release-commit
+release-commit:
+ $(AM_V_GEN)cd $(srcdir) \
+ && $(_build-aux)/do-release-commit-and-tag \
+ -C $(abs_builddir) $(RELEASE)
+
+## ---------------- ##
+## Updating files. ##
+## ---------------- ##
+
+ftp-gnu = ftp://ftp.gnu.org/gnu
+www-gnu = http://www.gnu.org
+
+upload_dest_dir_ ?= $(PACKAGE)
+upload_command = \
+ $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \
+ --to $(gnu_rel_host):$(upload_dest_dir_) \
+ $(rel-files)
+emit_upload_commands:
+ @echo =====================================
+ @echo =====================================
+ @echo '$(upload_command)'
+ @echo '# send the ~/announce-$(my_distdir) e-mail'
+ @echo =====================================
+ @echo =====================================
+
+.PHONY: upload
+upload:
+ $(AM_V_GEN)$(upload_command)
+
+define emit-commit-log
+ printf '%s\n' 'maint: post-release administrivia' '' \
+ '* NEWS: Add header line for next release.' \
+ '* .prev-version: Record previous version.' \
+ '* cfg.mk (old_NEWS_hash): Auto-update.'
+endef
+
+.PHONY: no-submodule-changes
+no-submodule-changes:
+ $(AM_V_GEN)if test -d $(srcdir)/.git \
+ && git --version >/dev/null 2>&1; then \
+ diff=$$(cd $(srcdir) && git submodule -q foreach \
+ git diff-index --name-only HEAD) \
+ || exit 1; \
+ case $$diff in '') ;; \
+ *) echo '$(ME): submodule files are locally modified:'; \
+ echo "$$diff"; exit 1;; esac; \
+ else \
+ : ; \
+ fi
+
+submodule-checks ?= no-submodule-changes public-submodule-commit
+
+# Ensure that each sub-module commit we're using is public.
+# Without this, it is too easy to tag and release code that
+# cannot be built from a fresh clone.
+.PHONY: public-submodule-commit
+public-submodule-commit:
+ $(AM_V_GEN)if test -d $(srcdir)/.git \
+ && git --version >/dev/null 2>&1; then \
+ cd $(srcdir) && \
+ git submodule --quiet foreach \
+ 'test "$$(git rev-parse "$$sha1")" \
+ = "$$(git merge-base origin "$$sha1")"' \
+ || { echo '$(ME): found non-public submodule commit' >&2; \
+ exit 1; }; \
+ else \
+ : ; \
+ fi
+# This rule has a high enough utility/cost ratio that it should be a
+# dependent of "check" by default. However, some of us do occasionally
+# commit a temporary change that deliberately points to a non-public
+# submodule commit, and want to be able to use rules like "make check".
+# In that case, run e.g., "make check gl_public_submodule_commit="
+# to disable this test.
+gl_public_submodule_commit ?= public-submodule-commit
+check: $(gl_public_submodule_commit)
+
+.PHONY: alpha beta stable release
+ALL_RECURSIVE_TARGETS += alpha beta stable
+alpha beta stable: $(local-check) writable-files $(submodule-checks)
+ $(AM_V_GEN)test $@ = stable \
+ && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
+ || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
+ || :
+ $(AM_V_at)$(MAKE) vc-diff-check
+ $(AM_V_at)$(MAKE) news-check
+ $(AM_V_at)$(MAKE) distcheck
+ $(AM_V_at)$(MAKE) dist
+ $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
+ $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
+
+release:
+ $(AM_V_GEN)$(MAKE) _version
+ $(AM_V_GEN)$(MAKE) $(release-type)
+
+# Override this in cfg.mk if you follow different procedures.
+release-prep-hook ?= release-prep
+
+gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
+.PHONY: release-prep
+release-prep:
+ $(AM_V_GEN)$(MAKE) --no-print-directory -s announcement \
+ > ~/announce-$(my_distdir)
+ $(AM_V_at)if test -d $(release_archive_dir); then \
+ ln $(rel-files) $(release_archive_dir); \
+ chmod a-w $(rel-files); \
+ fi
+ $(AM_V_at)echo $(VERSION) > $(prev_version_file)
+ $(AM_V_at)$(MAKE) update-NEWS-hash
+ $(AM_V_at)perl -pi \
+ -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' \
+ $(srcdir)/NEWS
+ $(AM_V_at)msg=$$($(emit-commit-log)) || exit 1; \
+ cd $(srcdir) && $(VC) commit -m "$$msg" -a
+
+# Override this with e.g., -s $(srcdir)/some_other_name.texi
+# if the default $(PACKAGE)-derived name doesn't apply.
+gendocs_options_ ?=
+
+.PHONY: web-manual
+web-manual:
+ $(AM_V_GEN)test -z "$(manual_title)" \
+ && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
+ $(AM_V_at)cd '$(srcdir)/doc'; \
+ $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \
+ -o '$(abs_builddir)/doc/manual' \
+ --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
+ "$(PACKAGE_NAME) - $(manual_title)"
+ $(AM_V_at)echo " *** Upload the doc/manual directory to web-cvs."
+
+.PHONY: web-manual-update
+web-manual-update:
+ $(AM_V_GEN)cd $(srcdir) \
+ && $(_build-aux)/gnu-web-doc-update -C $(abs_builddir)
+
+
+# Code Coverage
+
+init-coverage:
+ $(MAKE) $(AM_MAKEFLAGS) clean
+ lcov --directory . --zerocounters
+
+COVERAGE_CCOPTS ?= "-g --coverage"
+COVERAGE_OUT ?= doc/coverage
+
+build-coverage:
+ $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS)
+ $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check
+ mkdir -p $(COVERAGE_OUT)
+ lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \
+ --capture
+
+gen-coverage:
+ genhtml --output-directory $(COVERAGE_OUT) \
+ $(COVERAGE_OUT)/$(PACKAGE).info \
+ --highlight --frames --legend \
+ --title "$(PACKAGE_NAME)"
+
+coverage: init-coverage build-coverage gen-coverage
+
+# Some projects carry local adjustments for gnulib modules via patches in
+# a gnulib patch directory whose default name is gl/ (defined in bootstrap
+# via local_gl_dir=gl). Those patches become stale as the originals evolve
+# in gnulib. Use this rule to refresh any stale patches. It applies each
+# patch to the original in $(gnulib_dir) and uses the temporary result to
+# generate a fuzz-free .diff file. If you customize the name of your local
+# gnulib patch directory via bootstrap.conf, this rule detects that name.
+# Run this from a non-VPATH (i.e., srcdir) build directory.
+.PHONY: refresh-gnulib-patches
+refresh-gnulib-patches:
+ gl=gl; \
+ if test -f bootstrap.conf; then \
+ t=$$(perl -lne '/^\s*local_gl_dir=(\S+)/ and $$d=$$1;' \
+ -e 'END{defined $$d and print $$d}' bootstrap.conf); \
+ test -n "$$t" && gl=$$t; \
+ fi; \
+ for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do \
+ b=$$(printf %s "$$diff"|$(SED) 's/\.diff$$//'); \
+ VERSION_CONTROL=none \
+ patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1; \
+ ( cd $(gnulib_dir) || exit 1; \
+ git diff "$$b" > "../$$gl/$$diff"; \
+ git checkout $$b ) || exit 1; \
+ done
+
+# Update gettext files.
+PACKAGE ?= $(shell basename $(PWD))
+PO_DOMAIN ?= $(PACKAGE)
+POURL = http://translationproject.org/latest/$(PO_DOMAIN)/
+PODIR ?= po
+refresh-po:
+ rm -f $(PODIR)/*.po && \
+ echo "$(ME): getting translations into po (please ignore the robots.txt ERROR 404)..." && \
+ wget --no-verbose --directory-prefix $(PODIR) --no-directories --recursive --level 1 --accept .po --accept .po.1 $(POURL) && \
+ echo 'en@boldquot' > $(PODIR)/LINGUAS && \
+ echo 'en@quot' >> $(PODIR)/LINGUAS && \
+ ls $(PODIR)/*.po | $(SED) 's/\.po//;s,$(PODIR)/,,' | \
+ sort >> $(PODIR)/LINGUAS
+
+ # Running indent once is not idempotent, but running it twice is.
+INDENT_SOURCES ?= $(C_SOURCES)
+.PHONY: indent
+indent:
+ indent $(INDENT_SOURCES)
+ indent $(INDENT_SOURCES)
+
+# If you want to set UPDATE_COPYRIGHT_* environment variables,
+# put the assignments in this variable.
+update-copyright-env ?=
+
+# Run this rule once per year (usually early in January)
+# to update all FSF copyright year lists in your project.
+# If you have an additional project-specific rule,
+# add it in cfg.mk along with a line 'update-copyright: prereq'.
+# By default, exclude all variants of COPYING; you can also
+# add exemptions (such as ChangeLog..* for rotated change logs)
+# in the file .x-update-copyright.
+.PHONY: update-copyright
+update-copyright:
+ $(AM_V_GEN)grep -l -w Copyright \
+ $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
+ | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
+
+# This tight_scope test is skipped with a warning if $(_gl_TS_headers) is not
+# overridden and $(_gl_TS_dir)/Makefile.am does not mention noinst_HEADERS.
+
+# NOTE: to override any _gl_TS_* default value, you must
+# define the variable(s) using "export" in cfg.mk.
+_gl_TS_dir ?= src
+
+ALL_RECURSIVE_TARGETS += sc_tight_scope
+sc_tight_scope: tight-scope.mk
+ @fail=0; \
+ if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \
+ > /dev/null \
+ && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
+ > /dev/null 2>&1; then \
+ echo '$(ME): skipping $@'; \
+ else \
+ $(MAKE) -s -C $(_gl_TS_dir) \
+ -f Makefile \
+ -f $(abs_top_srcdir)/cfg.mk \
+ -f $(abs_top_builddir)/$< \
+ _gl_tight_scope \
+ || fail=1; \
+ fi; \
+ rm -f $<; \
+ exit $$fail
+
+tight-scope.mk: $(ME)
+ @rm -f $@ $@-t
+ @perl -ne '/^# TS-start/.../^# TS-end/ and print' $(srcdir)/$(ME) > $@-t
+ @chmod a=r $@-t && mv $@-t $@
+
+ifeq (a,b)
+# TS-start
+
+# Most functions should have static scope.
+# Any that don't must be marked with 'extern', but 'main'
+# and 'usage' are exceptions: they're always extern, but
+# do not need to be marked. Symbols matching '__.*' are
+# reserved by the compiler, so are automatically excluded below.
+_gl_TS_unmarked_extern_functions ?= main usage
+_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\w+) *\(/
+
+# If your project uses a macro like "XTERN", then put
+# the following in cfg.mk to override this default:
+# export _gl_TS_extern = extern|XTERN
+_gl_TS_extern ?= extern
+
+# The second nm|grep checks for file-scope variables with 'extern' scope.
+# Without gnulib's progname module, you might put program_name here.
+# Symbols matching '__.*' are reserved by the compiler,
+# so are automatically excluded below.
+_gl_TS_unmarked_extern_vars ?=
+
+# NOTE: the _match variables are perl expressions -- not mere regular
+# expressions -- so that you can extend them to match other patterns
+# and easily extract matched variable names.
+# For example, if your project declares some global variables via
+# a macro like this: GLOBAL(type, var_name, initializer), then you
+# can override this definition to automatically extract those names:
+# export _gl_TS_var_match = \
+# /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/
+_gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?\])?;/
+
+# The names of object files in (or relative to) $(_gl_TS_dir).
+_gl_TS_obj_files ?= *.$(OBJEXT)
+
+# Files in which to search for the one-line style extern declarations.
+# $(_gl_TS_dir)-relative.
+_gl_TS_headers ?= $(noinst_HEADERS)
+_gl_TS_other_headers ?= *.h
+
+.PHONY: _gl_tight_scope
+_gl_tight_scope: $(bin_PROGRAMS)
+ sed_wrap='s/^/^_?/;s/$$/$$/'; \
+ t=exceptions-$$$$; \
+ trap 's=$$?; rm -f $$t; exit $$s' 0; \
+ for sig in 1 2 3 13 15; do \
+ eval "trap 'v=`expr $$sig + 128`; (exit $$v); exit $$v' $$sig"; \
+ done; \
+ src=`for f in $(SOURCES); do \
+ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
+ hdr=`for f in $(_gl_TS_headers); do \
+ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
+ ( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions); \
+ grep -h -A1 '^extern .*[^;]$$' $$src \
+ | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \
+ perl -lne \
+ '$(_gl_TS_function_match) and print $$1' $$hdr; \
+ ) | sort -u | $(SED) "$$sed_wrap" > $$t; \
+ nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \
+ && { echo the above functions should have static scope >&2; \
+ exit 1; } || : ; \
+ ( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars); \
+ perl -lne '$(_gl_TS_var_match) and print $$1' \
+ $$hdr $(_gl_TS_other_headers) \
+ ) | sort -u | $(SED) "$$sed_wrap" > $$t; \
+ nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \
+ | sort -u | grep -Ev -f $$t \
+ && { echo the above variables should have static scope >&2; \
+ exit 1; } || :
+# TS-end
+endif
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..918d863
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,39 @@
+# Automakefile for GNU diffutils man pages
+
+# Copyright (C) 2002, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1
+EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) help2man
+MAINTAINERCLEANFILES = $(dist_man1_MANS)
+
+S = $(top_srcdir)/src
+cmp.1: $S/cmp.c cmp.x
+diff.1: $S/diff.c diff.x
+diff3.1: $S/diff3.c diff3.x
+sdiff.1: $S/sdiff.c sdiff.x
+
+# Directory in which just-built programs reside. It is used
+# to ensure help2man invokes them via the use of PATH below.
+bin_dir = ../src
+
+# Depend on the former to get version number changes.
+$(dist_man1_MANS): $(SRC_VERSION_C) help2man
+ $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \
+ && test -x $(bin_dir)/$$base \
+ && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \
+ | PATH="$(bin_dir)$(PATH_SEPARATOR)$$PATH" \
+ $(srcdir)/help2man -i - -i $(srcdir)/$$base.x \
+ -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@
diff --git a/man/Makefile.in b/man/Makefile.in
new file mode 100644
index 0000000..a7dc647
--- /dev/null
+++ b/man/Makefile.in
@@ -0,0 +1,1451 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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@
+
+# Automakefile for GNU diffutils man pages
+
+# Copyright (C) 2002, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+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@
+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@
+subdir = man
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)"
+NROFF = nroff
+MANS = $(dist_man1_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1
+EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) help2man
+MAINTAINERCLEANFILES = $(dist_man1_MANS)
+S = $(top_srcdir)/src
+
+# Directory in which just-built programs reside. It is used
+# to ensure help2man invokes them via the use of PATH below.
+bin_dir = ../src
+all: all-am
+
+.SUFFIXES:
+$(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) --gnu man/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu man/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):
+install-man1: $(dist_man1_MANS)
+ @$(NORMAL_INSTALL)
+ @list1='$(dist_man1_MANS)'; \
+ list2=''; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(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
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+ for dir in "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+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:
+
+clean-generic:
+
+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)
+
+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 "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
+ ctags-am distclean distclean-generic 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-man1 install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags-am uninstall uninstall-am uninstall-man \
+ uninstall-man1
+
+.PRECIOUS: Makefile
+
+cmp.1: $S/cmp.c cmp.x
+diff.1: $S/diff.c diff.x
+diff3.1: $S/diff3.c diff3.x
+sdiff.1: $S/sdiff.c sdiff.x
+
+# Depend on the former to get version number changes.
+$(dist_man1_MANS): $(SRC_VERSION_C) help2man
+ $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \
+ && test -x $(bin_dir)/$$base \
+ && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \
+ | PATH="$(bin_dir)$(PATH_SEPARATOR)$$PATH" \
+ $(srcdir)/help2man -i - -i $(srcdir)/$$base.x \
+ -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@
+
+# 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/man/cmp.1 b/man/cmp.1
new file mode 100644
index 0000000..3f581f5
--- /dev/null
+++ b/man/cmp.1
@@ -0,0 +1,74 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
+.TH CMP "1" "August 2016" "diffutils 3.5" "User Commands"
+.SH NAME
+cmp \- compare two files byte by byte
+.SH SYNOPSIS
+.B cmp
+[\fIOPTION\fR]... \fIFILE1 \fR[\fIFILE2 \fR[\fISKIP1 \fR[\fISKIP2\fR]]]
+.SH DESCRIPTION
+Compare two files byte by byte.
+.PP
+The optional SKIP1 and SKIP2 specify the number of bytes to skip
+at the beginning of each file (zero by default).
+.PP
+Mandatory arguments to long options are mandatory for short options too.
+.TP
+\fB\-b\fR, \fB\-\-print\-bytes\fR
+print differing bytes
+.TP
+\fB\-i\fR, \fB\-\-ignore\-initial\fR=\fISKIP\fR
+skip first SKIP bytes of both inputs
+.TP
+\fB\-i\fR, \fB\-\-ignore\-initial\fR=\fISKIP1\fR:SKIP2
+skip first SKIP1 bytes of FILE1 and
+first SKIP2 bytes of FILE2
+.TP
+\fB\-l\fR, \fB\-\-verbose\fR
+output byte numbers and differing byte values
+.TP
+\fB\-n\fR, \fB\-\-bytes\fR=\fILIMIT\fR
+compare at most LIMIT bytes
+.TP
+\fB\-s\fR, \fB\-\-quiet\fR, \fB\-\-silent\fR
+suppress all normal output
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+output version information and exit
+.PP
+SKIP values may be followed by the following multiplicative suffixes:
+kB 1000, K 1024, MB 1,000,000, M 1,048,576,
+GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.
+.PP
+If a FILE is '\-' or missing, read standard input.
+Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
+.SH AUTHOR
+Written by Torbjorn Granlund and David MacKenzie.
+.SH "REPORTING BUGS"
+Report bugs to: bug\-diffutils@gnu.org
+.br
+GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
+.br
+General help using GNU software: <http://www.gnu.org/gethelp/>
+.SH COPYRIGHT
+Copyright \(co 2016 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+diff(1), diff3(1), sdiff(1)
+.PP
+The full documentation for
+.B cmp
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B cmp
+programs are properly installed at your site, the command
+.IP
+.B info cmp
+.PP
+should give you access to the complete manual.
diff --git a/man/cmp.x b/man/cmp.x
new file mode 100644
index 0000000..5c9ef82
--- /dev/null
+++ b/man/cmp.x
@@ -0,0 +1,2 @@
+[SEE ALSO]
+diff(1), diff3(1), sdiff(1)
diff --git a/man/diff.1 b/man/diff.1
new file mode 100644
index 0000000..7dd33cc
--- /dev/null
+++ b/man/diff.1
@@ -0,0 +1,266 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
+.TH DIFF "1" "August 2016" "diffutils 3.5" "User Commands"
+.SH NAME
+diff \- compare files line by line
+.SH SYNOPSIS
+.B diff
+[\fIOPTION\fR]... \fIFILES\fR
+.SH DESCRIPTION
+Compare FILES line by line.
+.PP
+Mandatory arguments to long options are mandatory for short options too.
+.TP
+\fB\-\-normal\fR
+output a normal diff (the default)
+.TP
+\fB\-q\fR, \fB\-\-brief\fR
+report only when files differ
+.TP
+\fB\-s\fR, \fB\-\-report\-identical\-files\fR
+report when two files are the same
+.TP
+\fB\-c\fR, \fB\-C\fR NUM, \fB\-\-context\fR[=\fINUM\fR]
+output NUM (default 3) lines of copied context
+.TP
+\fB\-u\fR, \fB\-U\fR NUM, \fB\-\-unified\fR[=\fINUM\fR]
+output NUM (default 3) lines of unified context
+.TP
+\fB\-e\fR, \fB\-\-ed\fR
+output an ed script
+.TP
+\fB\-n\fR, \fB\-\-rcs\fR
+output an RCS format diff
+.TP
+\fB\-y\fR, \fB\-\-side\-by\-side\fR
+output in two columns
+.TP
+\fB\-W\fR, \fB\-\-width\fR=\fINUM\fR
+output at most NUM (default 130) print columns
+.TP
+\fB\-\-left\-column\fR
+output only the left column of common lines
+.TP
+\fB\-\-suppress\-common\-lines\fR
+do not output common lines
+.TP
+\fB\-p\fR, \fB\-\-show\-c\-function\fR
+show which C function each change is in
+.TP
+\fB\-F\fR, \fB\-\-show\-function\-line\fR=\fIRE\fR
+show the most recent line matching RE
+.TP
+\fB\-\-label\fR LABEL
+use LABEL instead of file name and timestamp
+(can be repeated)
+.TP
+\fB\-t\fR, \fB\-\-expand\-tabs\fR
+expand tabs to spaces in output
+.TP
+\fB\-T\fR, \fB\-\-initial\-tab\fR
+make tabs line up by prepending a tab
+.TP
+\fB\-\-tabsize\fR=\fINUM\fR
+tab stops every NUM (default 8) print columns
+.TP
+\fB\-\-suppress\-blank\-empty\fR
+suppress space or tab before empty output lines
+.TP
+\fB\-l\fR, \fB\-\-paginate\fR
+pass output through 'pr' to paginate it
+.TP
+\fB\-r\fR, \fB\-\-recursive\fR
+recursively compare any subdirectories found
+.TP
+\fB\-\-no\-dereference\fR
+don't follow symbolic links
+.TP
+\fB\-N\fR, \fB\-\-new\-file\fR
+treat absent files as empty
+.TP
+\fB\-\-unidirectional\-new\-file\fR
+treat absent first files as empty
+.TP
+\fB\-\-ignore\-file\-name\-case\fR
+ignore case when comparing file names
+.TP
+\fB\-\-no\-ignore\-file\-name\-case\fR
+consider case when comparing file names
+.TP
+\fB\-x\fR, \fB\-\-exclude\fR=\fIPAT\fR
+exclude files that match PAT
+.TP
+\fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR
+exclude files that match any pattern in FILE
+.TP
+\fB\-S\fR, \fB\-\-starting\-file\fR=\fIFILE\fR
+start with FILE when comparing directories
+.TP
+\fB\-\-from\-file\fR=\fIFILE1\fR
+compare FILE1 to all operands;
+FILE1 can be a directory
+.TP
+\fB\-\-to\-file\fR=\fIFILE2\fR
+compare all operands to FILE2;
+FILE2 can be a directory
+.TP
+\fB\-i\fR, \fB\-\-ignore\-case\fR
+ignore case differences in file contents
+.TP
+\fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR
+ignore changes due to tab expansion
+.TP
+\fB\-Z\fR, \fB\-\-ignore\-trailing\-space\fR
+ignore white space at line end
+.TP
+\fB\-b\fR, \fB\-\-ignore\-space\-change\fR
+ignore changes in the amount of white space
+.TP
+\fB\-w\fR, \fB\-\-ignore\-all\-space\fR
+ignore all white space
+.TP
+\fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR
+ignore changes where lines are all blank
+.TP
+\fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR
+ignore changes where all lines match RE
+.TP
+\fB\-a\fR, \fB\-\-text\fR
+treat all files as text
+.TP
+\fB\-\-strip\-trailing\-cr\fR
+strip trailing carriage return on input
+.TP
+\fB\-D\fR, \fB\-\-ifdef\fR=\fINAME\fR
+output merged file with '#ifdef NAME' diffs
+.TP
+\fB\-\-GTYPE\-group\-format\fR=\fIGFMT\fR
+format GTYPE input groups with GFMT
+.TP
+\fB\-\-line\-format\fR=\fILFMT\fR
+format all input lines with LFMT
+.TP
+\fB\-\-LTYPE\-line\-format\fR=\fILFMT\fR
+format LTYPE input lines with LFMT
+.IP
+These format options provide fine\-grained control over the output
+.IP
+of diff, generalizing \fB\-D\fR/\-\-ifdef.
+.TP
+LTYPE is 'old', 'new', or 'unchanged'.
+GTYPE is LTYPE or 'changed'.
+.IP
+GFMT (only) may contain:
+.TP
+%<
+lines from FILE1
+.TP
+%>
+lines from FILE2
+.TP
+%=
+lines common to FILE1 and FILE2
+.TP
+%[\-][WIDTH][.[PREC]]{doxX}LETTER
+printf\-style spec for LETTER
+.IP
+LETTERs are as follows for new group, lower case for old group:
+.TP
+F
+first line number
+.TP
+L
+last line number
+.TP
+N
+number of lines = L\-F+1
+.TP
+E
+F\-1
+.TP
+M
+L+1
+.TP
+%(A=B?T:E)
+if A equals B then T else E
+.IP
+LFMT (only) may contain:
+.TP
+%L
+contents of line
+.TP
+%l
+contents of line, excluding any trailing newline
+.TP
+%[\-][WIDTH][.[PREC]]{doxX}n
+printf\-style spec for input line number
+.IP
+Both GFMT and LFMT may contain:
+.TP
+%%
+%
+.TP
+%c'C'
+the single character C
+.TP
+%c'\eOOO'
+the character with octal code OOO
+.TP
+C
+the character C (other characters represent themselves)
+.TP
+\fB\-d\fR, \fB\-\-minimal\fR
+try hard to find a smaller set of changes
+.TP
+\fB\-\-horizon\-lines\fR=\fINUM\fR
+keep NUM lines of the common prefix and suffix
+.TP
+\fB\-\-speed\-large\-files\fR
+assume large files and many scattered small changes
+.TP
+\fB\-\-color\fR[=\fIWHEN\fR]
+colorize the output; WHEN can be 'never', 'always',
+or 'auto' (the default)
+.TP
+\fB\-\-palette\fR=\fIPALETTE\fR
+specify the colors to use when \fB\-\-color\fR is active
+PALETTE is a colon\-separated list terminfo capabilities
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+output version information and exit
+.PP
+FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'.
+If \fB\-\-from\-file\fR or \fB\-\-to\-file\fR is given, there are no restrictions on FILE(s).
+If a FILE is '\-', read standard input.
+Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
+.SH AUTHOR
+Written by Paul Eggert, Mike Haertel, David Hayes,
+Richard Stallman, and Len Tower.
+.SH "REPORTING BUGS"
+Report bugs to: bug\-diffutils@gnu.org
+.br
+GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
+.br
+General help using GNU software: <http://www.gnu.org/gethelp/>
+.SH COPYRIGHT
+Copyright \(co 2016 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1)
+.PP
+The full documentation for
+.B diff
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B diff
+programs are properly installed at your site, the command
+.IP
+.B info diff
+.PP
+should give you access to the complete manual.
diff --git a/man/diff.x b/man/diff.x
new file mode 100644
index 0000000..fdb69d2
--- /dev/null
+++ b/man/diff.x
@@ -0,0 +1,2 @@
+[SEE ALSO]
+wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1)
diff --git a/man/diff3.1 b/man/diff3.1
new file mode 100644
index 0000000..2560146
--- /dev/null
+++ b/man/diff3.1
@@ -0,0 +1,100 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
+.TH DIFF3 "1" "August 2016" "diffutils 3.5" "User Commands"
+.SH NAME
+diff3 \- compare three files line by line
+.SH SYNOPSIS
+.B diff3
+[\fIOPTION\fR]... \fIMYFILE OLDFILE YOURFILE\fR
+.SH DESCRIPTION
+Compare three files line by line.
+.PP
+Mandatory arguments to long options are mandatory for short options too.
+.TP
+\fB\-A\fR, \fB\-\-show\-all\fR
+output all changes, bracketing conflicts
+.TP
+\fB\-e\fR, \fB\-\-ed\fR
+output ed script incorporating changes
+from OLDFILE to YOURFILE into MYFILE
+.TP
+\fB\-E\fR, \fB\-\-show\-overlap\fR
+like \fB\-e\fR, but bracket conflicts
+.TP
+\fB\-3\fR, \fB\-\-easy\-only\fR
+like \fB\-e\fR, but incorporate only nonoverlapping changes
+.TP
+\fB\-x\fR, \fB\-\-overlap\-only\fR
+like \fB\-e\fR, but incorporate only overlapping changes
+.TP
+\fB\-X\fR
+like \fB\-x\fR, but bracket conflicts
+.TP
+\fB\-i\fR
+append 'w' and 'q' commands to ed scripts
+.TP
+\fB\-m\fR, \fB\-\-merge\fR
+output actual merged file, according to
+\fB\-A\fR if no other options are given
+.TP
+\fB\-a\fR, \fB\-\-text\fR
+treat all files as text
+.TP
+\fB\-\-strip\-trailing\-cr\fR
+strip trailing carriage return on input
+.TP
+\fB\-T\fR, \fB\-\-initial\-tab\fR
+make tabs line up by prepending a tab
+.TP
+\fB\-\-diff\-program\fR=\fIPROGRAM\fR
+use PROGRAM to compare files
+.TP
+\fB\-L\fR, \fB\-\-label\fR=\fILABEL\fR
+use LABEL instead of file name
+(can be repeated up to three times)
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+output version information and exit
+.PP
+The default output format is a somewhat human\-readable representation of
+the changes.
+.PP
+The \fB\-e\fR, \fB\-E\fR, \fB\-x\fR, \fB\-X\fR (and corresponding long) options cause an ed script
+to be output instead of the default.
+.PP
+Finally, the \fB\-m\fR (\fB\-\-merge\fR) option causes diff3 to do the merge internally
+and output the actual merged file. For unusual input, this is more
+robust than using ed.
+.PP
+If a FILE is '\-', read standard input.
+Exit status is 0 if successful, 1 if conflicts, 2 if trouble.
+.SH AUTHOR
+Written by Randy Smith.
+.SH "REPORTING BUGS"
+Report bugs to: bug\-diffutils@gnu.org
+.br
+GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
+.br
+General help using GNU software: <http://www.gnu.org/gethelp/>
+.SH COPYRIGHT
+Copyright \(co 2016 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+cmp(1), diff(1), sdiff(1)
+.PP
+The full documentation for
+.B diff3
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B diff3
+programs are properly installed at your site, the command
+.IP
+.B info diff3
+.PP
+should give you access to the complete manual.
diff --git a/man/diff3.x b/man/diff3.x
new file mode 100644
index 0000000..0751208
--- /dev/null
+++ b/man/diff3.x
@@ -0,0 +1,2 @@
+[SEE ALSO]
+cmp(1), diff(1), sdiff(1)
diff --git a/man/help2man b/man/help2man
new file mode 100755
index 0000000..e6207e5
--- /dev/null
+++ b/man/help2man
@@ -0,0 +1,671 @@
+#!/usr/bin/perl -w
+
+# Generate a short man page from --help and --version output.
+# Copyright (C) 1997-2005, 2009-2011, 2013, 2015-2016 Free Software Foundation,
+# Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Written by Brendan O'Dea <bod@debian.org>
+# Available from ftp://ftp.gnu.org/gnu/help2man/
+
+use 5.008;
+use strict;
+use Getopt::Long;
+use Text::Tabs qw(expand);
+use POSIX qw(strftime setlocale LC_ALL);
+
+my $this_program = 'help2man';
+my $this_version = '1.40.4';
+
+sub _ { $_[0] }
+sub configure_locale
+{
+ my $locale = shift;
+ die "$this_program: no locale support (Locale::gettext required)\n"
+ unless $locale eq 'C';
+}
+
+sub dec { $_[0] }
+sub enc { $_[0] }
+sub enc_user { $_[0] }
+sub kark { die +(sprintf shift, @_), "\n" }
+sub N_ { $_[0] }
+
+my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version;
+GNU %s %s
+
+Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010,
+2011 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.
+
+Written by Brendan O'Dea <bod@debian.org>
+EOT
+
+my $help_info = enc_user sprintf _(<<'EOT'), $this_program, $this_program;
+'%s' generates a man page out of '--help' and '--version' output.
+
+Usage: %s [OPTION]... EXECUTABLE
+
+ -n, --name=STRING description for the NAME paragraph
+ -s, --section=SECTION section number for manual page (1, 6, 8)
+ -m, --manual=TEXT name of manual (User Commands, ...)
+ -S, --source=TEXT source of program (FSF, Debian, ...)
+ -L, --locale=STRING select locale (default "C")
+ -i, --include=FILE include material from 'FILE'
+ -I, --opt-include=FILE include material from 'FILE' if it exists
+ -o, --output=FILE send output to 'FILE'
+ -p, --info-page=TEXT name of Texinfo manual
+ -N, --no-info suppress pointer to Texinfo manual
+ -l, --libtool exclude the 'lt-' from the program name
+ --help print this help, then exit
+ --version print version number, then exit
+
+EXECUTABLE should accept '--help' and '--version' options and produce output on
+stdout although alternatives may be specified using:
+
+ -h, --help-option=STRING help option string
+ -v, --version-option=STRING version option string
+ --version-string=STRING version string
+ --no-discard-stderr include stderr when parsing option output
+
+Report bugs to <bug-help2man@gnu.org>.
+EOT
+
+my $section = 1;
+my $manual = '';
+my $source = '';
+my $help_option = '--help';
+my $version_option = '--version';
+my $discard_stderr = 1;
+my ($opt_name, @opt_include, $opt_output, $opt_info, $opt_no_info, $opt_libtool,
+ $version_text);
+
+my %opt_def = (
+ 'n|name=s' => \$opt_name,
+ 's|section=s' => \$section,
+ 'm|manual=s' => \$manual,
+ 'S|source=s' => \$source,
+ 'L|locale=s' => sub { configure_locale pop },
+ 'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
+ 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
+ 'o|output=s' => \$opt_output,
+ 'p|info-page=s' => \$opt_info,
+ 'N|no-info' => \$opt_no_info,
+ 'l|libtool' => \$opt_libtool,
+ 'help' => sub { print $help_info; exit },
+ 'version' => sub { print $version_info; exit },
+ 'h|help-option=s' => \$help_option,
+ 'v|version-option=s' => \$version_option,
+ 'version-string=s' => \$version_text,
+ 'discard-stderr!' => \$discard_stderr,
+);
+
+# Parse options.
+Getopt::Long::config('bundling');
+die $help_info unless GetOptions %opt_def and @ARGV == 1;
+
+my %include = ();
+my %append = ();
+my @include = (); # retain order given in include file
+
+# Process include file (if given). Format is:
+#
+# [section name]
+# verbatim text
+#
+# or
+#
+# /pattern/
+# verbatim text
+#
+
+while (@opt_include)
+{
+ my ($inc, $required) = @{shift @opt_include};
+
+ next unless -f $inc or $required;
+ kark N_("%s: can't open '%s' (%s)"), $this_program, $inc, $!
+ unless open INC, $inc;
+
+ my $key;
+ my $hash = \%include;
+
+ while (<INC>)
+ {
+ # Convert input to internal Perl format, so that multibyte
+ # sequences are treated as single characters.
+ $_ = dec $_;
+
+ # [section]
+ if (/^\[([^]]+)\]\s*$/)
+ {
+ $key = uc $1;
+ $key =~ s/^\s+//;
+ $key =~ s/\s+$//;
+ $hash = \%include;
+ push @include, $key unless $include{$key};
+ next;
+ }
+
+ # /pattern/
+ if (m!^/(.*)/([ims]*)\s*$!)
+ {
+ my $pat = $2 ? "(?$2)$1" : $1;
+
+ # Check pattern.
+ eval { $key = qr($pat) };
+ if ($@)
+ {
+ $@ =~ s/ at .*? line \d.*//;
+ die "$inc:$.:$@";
+ }
+
+ $hash = \%append;
+ next;
+ }
+
+ # Check for options before the first section--anything else is
+ # silently ignored, allowing the first for comments and
+ # revision info.
+ unless ($key)
+ {
+ # handle options
+ if (/^-/)
+ {
+ local @ARGV = split;
+ GetOptions %opt_def;
+ }
+
+ next;
+ }
+
+ $hash->{$key} ||= '';
+ $hash->{$key} .= $_;
+ }
+
+ close INC;
+
+ kark N_("%s: no valid information found in '%s'"), $this_program, $inc
+ unless $key;
+}
+
+# Compress trailing blank lines.
+for my $hash (\(%include, %append))
+{
+ for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ }
+}
+
+sub get_option_value;
+
+# Grab help and version info from executable.
+my $help_text = get_option_value $ARGV[0], $help_option;
+$version_text ||= get_option_value $ARGV[0], $version_option;
+
+# Translators: the following message is a strftime(3) format string, which in
+# the English version expands to the month as a word and the full year. It
+# is used on the footer of the generated manual pages. If in doubt, you may
+# just use %x as the value (which should be the full locale-specific date).
+my $date = enc strftime _("%B %Y"), localtime;
+(my $program = $ARGV[0]) =~ s!.*/!!;
+my $package = $program;
+my $version;
+
+if ($opt_output)
+{
+ unlink $opt_output or kark N_("%s: can't unlink %s (%s)"),
+ $this_program, $opt_output, $! if -e $opt_output;
+
+ open STDOUT, ">$opt_output"
+ or kark N_("%s: can't create %s (%s)"), $this_program, $opt_output, $!;
+}
+
+# The first line of the --version information is assumed to be in one
+# of the following formats:
+#
+# <version>
+# <program> <version>
+# {GNU,Free} <program> <version>
+# <program> ({GNU,Free} <package>) <version>
+# <program> - {GNU,Free} <package> <version>
+#
+# and separated from any copyright/author details by a blank line.
+
+($_, $version_text) = ((split /\n+/, $version_text, 2), '');
+
+if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or
+ /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
+{
+ $program = $1;
+ $package = $2;
+ $version = $3;
+}
+elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/)
+{
+ $program = $2;
+ $package = $1 ? "$1$2" : $2;
+ $version = $3;
+}
+else
+{
+ $version = $_;
+}
+
+$program =~ s!.*/!!;
+
+# No info for 'info' itself.
+$opt_no_info = 1 if $program eq 'info';
+
+# Translators: "NAME", "SYNOPSIS" and other one or two word strings in all
+# upper case are manual page section headings. The man(1) manual page in your
+# language, if available should provide the conventional translations.
+for ($include{_('NAME')})
+{
+ if ($opt_name) # --name overrides --include contents.
+ {
+ $_ = "$program \\- $opt_name\n";
+ }
+ elsif ($_) # Use first name given as $program
+ {
+ $program = $1 if /^([^\s,]+)(?:,?\s*[^\s,\\-]+)*\s+\\?-/;
+ }
+ else # Set a default (useless) NAME paragraph.
+ {
+ $_ = sprintf _("%s \\- manual page for %s %s") . "\n", $program,
+ $program, $version;
+ }
+}
+
+# Man pages traditionally have the page title in caps.
+my $PROGRAM = uc $program;
+
+# Set default page head/footers
+$source ||= "$program $version";
+unless ($manual)
+{
+ for ($section)
+ {
+ if (/^(1[Mm]|8)/) { $manual = enc _('System Administration Utilities') }
+ elsif (/^6/) { $manual = enc _('Games') }
+ else { $manual = enc _('User Commands') }
+ }
+}
+
+# Extract usage clause(s) [if any] for SYNOPSIS.
+# Translators: "Usage" and "or" here are patterns (regular expressions) which
+# are used to match the usage synopsis in program output. An example from cp
+# (GNU coreutils) which contains both strings:
+# Usage: cp [OPTION]... [-T] SOURCE DEST
+# or: cp [OPTION]... SOURCE... DIRECTORY
+# or: cp [OPTION]... -t DIRECTORY SOURCE...
+my $PAT_USAGE = _('Usage');
+my $PAT_USAGE_CONT = _('or');
+if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CONT): +\S).*)*)//om)
+{
+ my @syn = $3 . $4;
+
+ if ($_ = $5)
+ {
+ s/^\n//;
+ for (split /\n/) { s/^ *(($PAT_USAGE_CONT): +)?//o; push @syn, $_ }
+ }
+
+ my $synopsis = '';
+ for (@syn)
+ {
+ $synopsis .= ".br\n" if $synopsis;
+ s!^\S*/!!;
+ s/^lt-// if $opt_libtool;
+ s/^(\S+) *//;
+ $synopsis .= ".B $1\n";
+ s/\s+$//;
+ s/(([][]|\.\.+)+)/\\fR$1\\fI/g;
+ s/^/\\fI/ unless s/^\\fR//;
+ $_ .= '\fR';
+ s/(\\fI)( *)/$2$1/g;
+ s/\\fI\\fR//g;
+ s/^\\fR//;
+ s/\\fI$//;
+ s/^\./\\&./;
+
+ $synopsis .= "$_\n";
+ }
+
+ $include{_('SYNOPSIS')} ||= $synopsis;
+}
+
+# Process text, initial section is DESCRIPTION.
+my $sect = _('DESCRIPTION');
+$_ = "$help_text\n\n$version_text";
+
+# Normalise paragraph breaks.
+s/^\n+//;
+s/\n*$/\n/;
+s/\n\n+/\n\n/g;
+
+# Join hyphenated lines.
+s/([A-Za-z])-\n *([A-Za-z])/$1$2/g;
+
+# Temporarily exchange leading dots, apostrophes and backslashes for
+# tokens.
+s/^\./\x80/mg;
+s/^'/\x81/mg;
+s/\\/\x82/g;
+
+# Translators: patterns are used to match common program output. In the source
+# these strings are all of the form of "my $PAT_something = _('...');" and are
+# regular expressions. If there is more than one commonly used string, you
+# may separate alternatives with "|". Spaces in these expressions are written
+# as " +" to indicate that more than one space may be matched. The string
+# "(?:[\\w-]+ +)?" in the bug reporting pattern is used to indicate an
+# optional word, so that either "Report bugs" or "Report _program_ bugs" will
+# be matched.
+my $PAT_BUGS = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to');
+my $PAT_AUTHOR = _('Written +by');
+my $PAT_OPTIONS = _('Options');
+my $PAT_ENVIRONMENT = _('Environment');
+my $PAT_FILES = _('Files');
+my $PAT_EXAMPLES = _('Examples');
+my $PAT_FREE_SOFTWARE = _('This +is +free +software');
+
+# Start a new paragraph (if required) for these.
+s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
+
+# Convert iso-8859-1 copyright symbol or (c) to nroff
+# character.
+s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg;
+
+sub convert_option;
+
+while (length)
+{
+ # Convert some standard paragraph names.
+ if (s/^($PAT_OPTIONS): *\n//o)
+ {
+ $sect = _('OPTIONS');
+ next;
+ }
+ if (s/^($PAT_ENVIRONMENT): *\n//o)
+ {
+ $sect = _('ENVIRONMENT');
+ next;
+ }
+ if (s/^($PAT_FILES): *\n//o)
+ {
+ $sect = _('FILES');
+ next;
+ }
+ elsif (s/^($PAT_EXAMPLES): *\n//o)
+ {
+ $sect = _('EXAMPLES');
+ next;
+ }
+
+ # Copyright section
+ if (/^Copyright /)
+ {
+ $sect = _('COPYRIGHT');
+ }
+
+ # Bug reporting section.
+ elsif (/^($PAT_BUGS) /o)
+ {
+ $sect = _('REPORTING BUGS');
+ }
+
+ # Author section.
+ elsif (/^($PAT_AUTHOR)/o)
+ {
+ $sect = _('AUTHOR');
+ }
+
+ # Examples, indicated by an indented leading $, % or > are
+ # rendered in a constant width font.
+ if (/^( +)([\$\%>] )\S/)
+ {
+ my $indent = $1;
+ my $prefix = $2;
+ my $break = '.IP';
+ $include{$sect} ||= '';
+ while (s/^$indent\Q$prefix\E(\S.*)\n*//)
+ {
+ $include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n";
+ $break = '.br';
+ }
+
+ next;
+ }
+
+ my $matched = '';
+ $include{$sect} ||= '';
+
+ # Sub-sections have a trailing colon and the second line indented.
+ if (s/^(\S.*:) *\n / /)
+ {
+ $matched .= $& if %append;
+ $include{$sect} .= qq(.SS "$1"\n);
+ }
+
+ my $indent = 0;
+ my $content = '';
+
+ # Option with description.
+ if (s/^( {1,10}([+-]\S.*?))(?:( +(?!-))|\n( {20,}))(\S.*)\n//)
+ {
+ $matched .= $& if %append;
+ $indent = length ($4 || "$1$3");
+ $content = ".TP\n\x84$2\n\x84$5\n";
+ unless ($4)
+ {
+ # Indent may be different on second line.
+ $indent = length $& if /^ {20,}/;
+ }
+ }
+
+ # Option without description.
+ elsif (s/^ {1,10}([+-]\S.*)\n//)
+ {
+ $matched .= $& if %append;
+ $content = ".HP\n\x84$1\n";
+ $indent = 80; # not continued
+ }
+
+ # Indented paragraph with tag.
+ elsif (s/^( +(\S.*?) +)(\S.*)\n//)
+ {
+ $matched .= $& if %append;
+ $indent = length $1;
+ $content = ".TP\n\x84$2\n\x84$3\n";
+ }
+
+ # Indented paragraph.
+ elsif (s/^( +)(\S.*)\n//)
+ {
+ $matched .= $& if %append;
+ $indent = length $1;
+ $content = ".IP\n\x84$2\n";
+ }
+
+ # Left justified paragraph.
+ else
+ {
+ s/(.*)\n//;
+ $matched .= $& if %append;
+ $content = ".PP\n" if $include{$sect};
+ $content .= "$1\n";
+ }
+
+ # Append continuations.
+ while ($indent ? s/^ {$indent}(\S.*)\n// : s/^(\S.*)\n//)
+ {
+ $matched .= $& if %append;
+ $content .= "\x84$1\n";
+ }
+
+ # Move to next paragraph.
+ s/^\n+//;
+
+ for ($content)
+ {
+ # Leading dot and apostrophe protection.
+ s/\x84\./\x80/g;
+ s/\x84'/\x81/g;
+ s/\x84//g;
+
+ # Convert options.
+ s/(^| |\()(-[][\w=-]+)/$1 . convert_option $2/mge;
+
+ # Escape remaining hyphens
+ s/-/\x83/g;
+
+ if ($sect eq 'COPYRIGHT')
+ {
+ # Insert line breaks before additional copyright messages
+ # and the disclaimer.
+ s/\n(Copyright |$PAT_FREE_SOFTWARE)/\n.br\n$1/og;
+ }
+ elsif ($sect eq 'REPORTING BUGS')
+ {
+ # Handle multi-line bug reporting sections of the form:
+ #
+ # Report <program> bugs to <addr>
+ # GNU <package> home page: <url>
+ # ...
+ s/\n([[:upper:]])/\n.br\n$1/g;
+ }
+ }
+
+ # Check if matched paragraph contains /pat/.
+ if (%append)
+ {
+ for my $pat (keys %append)
+ {
+ if ($matched =~ $pat)
+ {
+ $content .= ".PP\n" unless $append{$pat} =~ /^\./;
+ $content .= $append{$pat};
+ }
+ }
+ }
+
+ $include{$sect} .= $content;
+}
+
+# Refer to the real documentation.
+unless ($opt_no_info)
+{
+ my $info_page = $opt_info || $program;
+
+ $sect = _('SEE ALSO');
+ $include{$sect} ||= '';
+ $include{$sect} .= ".PP\n" if $include{$sect};
+ $include{$sect} .= sprintf _(<<'EOT'), $program, $program, $info_page;
+The full documentation for
+.B %s
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B %s
+programs are properly installed at your site, the command
+.IP
+.B info %s
+.PP
+should give you access to the complete manual.
+EOT
+}
+
+# Output header.
+print <<EOT;
+.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
+.TH $PROGRAM "$section" "$date" "$source" "$manual"
+EOT
+
+# Section ordering.
+my @pre = (_('NAME'), _('SYNOPSIS'), _('DESCRIPTION'), _('OPTIONS'),
+ _('ENVIRONMENT'), _('FILES'), _('EXAMPLES'));
+
+my @post = (_('AUTHOR'), _('REPORTING BUGS'), _('COPYRIGHT'), _('SEE ALSO'));
+my $filter = join '|', @pre, @post;
+
+# Output content.
+for my $sect (@pre, (grep ! /^($filter)$/o, @include), @post)
+{
+ if ($include{$sect})
+ {
+ my $quote = $sect =~ /\W/ ? '"' : '';
+ print enc ".SH $quote$sect$quote\n";
+
+ for ($include{$sect})
+ {
+ # Replace leading dot, apostrophe, backslash and hyphen
+ # tokens.
+ s/\x80/\\&./g;
+ s/\x81/\\&'/g;
+ s/\x82/\\e/g;
+ s/\x83/\\-/g;
+
+ # Convert some latin1 chars to troff equivalents
+ s/\xa0/\\ /g; # non-breaking space
+
+ print enc $_;
+ }
+ }
+}
+
+close STDOUT or kark N_("%s: error writing to %s (%s)"), $this_program,
+ $opt_output || 'stdout', $!;
+
+exit;
+
+# Call program with given option and return results.
+sub get_option_value
+{
+ my ($prog, $opt) = @_;
+ my $stderr = $discard_stderr ? '/dev/null' : '&1';
+ my $value = join '',
+ map { s/ +$//; expand $_ }
+ map { dec $_ }
+ `$prog $opt 2>$stderr`;
+
+ unless ($value)
+ {
+ my $err = N_("%s: can't get '%s' info from %s%s");
+ my $extra = $discard_stderr
+ ? "\n" . N_("Try '--no-discard-stderr' if option outputs to stderr")
+ : '';
+
+ kark $err, $this_program, $opt, $prog, $extra;
+ }
+
+ return $value;
+}
+
+# Convert option dashes to \- to stop nroff from hyphenating 'em, and
+# embolden. Option arguments get italicised.
+sub convert_option
+{
+ local $_ = '\fB' . shift;
+
+ s/-/\x83/g;
+ unless (s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/)
+ {
+ s/=(.)/\\fR=\\fI$1/;
+ s/ (.)/ \\fI$1/;
+ $_ .= '\fR';
+ }
+
+ $_;
+}
diff --git a/man/sdiff.1 b/man/sdiff.1
new file mode 100644
index 0000000..f055c70
--- /dev/null
+++ b/man/sdiff.1
@@ -0,0 +1,102 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
+.TH SDIFF "1" "August 2016" "diffutils 3.5" "User Commands"
+.SH NAME
+sdiff \- side-by-side merge of file differences
+.SH SYNOPSIS
+.B sdiff
+[\fIOPTION\fR]... \fIFILE1 FILE2\fR
+.SH DESCRIPTION
+Side\-by\-side merge of differences between FILE1 and FILE2.
+.PP
+Mandatory arguments to long options are mandatory for short options too.
+.TP
+\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
+operate interactively, sending output to FILE
+.TP
+\fB\-i\fR, \fB\-\-ignore\-case\fR
+consider upper\- and lower\-case to be the same
+.TP
+\fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR
+ignore changes due to tab expansion
+.TP
+\fB\-Z\fR, \fB\-\-ignore\-trailing\-space\fR
+ignore white space at line end
+.TP
+\fB\-b\fR, \fB\-\-ignore\-space\-change\fR
+ignore changes in the amount of white space
+.TP
+\fB\-W\fR, \fB\-\-ignore\-all\-space\fR
+ignore all white space
+.TP
+\fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR
+ignore changes whose lines are all blank
+.TP
+\fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR
+ignore changes all whose lines match RE
+.TP
+\fB\-\-strip\-trailing\-cr\fR
+strip trailing carriage return on input
+.TP
+\fB\-a\fR, \fB\-\-text\fR
+treat all files as text
+.TP
+\fB\-w\fR, \fB\-\-width\fR=\fINUM\fR
+output at most NUM (default 130) print columns
+.TP
+\fB\-l\fR, \fB\-\-left\-column\fR
+output only the left column of common lines
+.TP
+\fB\-s\fR, \fB\-\-suppress\-common\-lines\fR
+do not output common lines
+.TP
+\fB\-t\fR, \fB\-\-expand\-tabs\fR
+expand tabs to spaces in output
+.TP
+\fB\-\-tabsize\fR=\fINUM\fR
+tab stops at every NUM (default 8) print columns
+.TP
+\fB\-d\fR, \fB\-\-minimal\fR
+try hard to find a smaller set of changes
+.TP
+\fB\-H\fR, \fB\-\-speed\-large\-files\fR
+assume large files, many scattered small changes
+.TP
+\fB\-\-diff\-program\fR=\fIPROGRAM\fR
+use PROGRAM to compare files
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+output version information and exit
+.PP
+If a FILE is '\-', read standard input.
+Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
+.SH AUTHOR
+Written by Thomas Lord.
+.SH "REPORTING BUGS"
+Report bugs to: bug\-diffutils@gnu.org
+.br
+GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
+.br
+General help using GNU software: <http://www.gnu.org/gethelp/>
+.SH COPYRIGHT
+Copyright \(co 2016 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+cmp(1), diff(1), diff3(1)
+.PP
+The full documentation for
+.B sdiff
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B sdiff
+programs are properly installed at your site, the command
+.IP
+.B info sdiff
+.PP
+should give you access to the complete manual.
diff --git a/man/sdiff.x b/man/sdiff.x
new file mode 100644
index 0000000..fdc9c3e
--- /dev/null
+++ b/man/sdiff.x
@@ -0,0 +1,2 @@
+[SEE ALSO]
+cmp(1), diff(1), diff3(1)
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..cf85d7b
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,32 @@
+ca
+cs
+da
+de
+el
+eo
+es
+fi
+fr
+ga
+gl
+he
+hr
+hu
+id
+it
+ja
+lv
+ms
+nb
+nl
+pl
+pt_BR
+ro
+ru
+sr
+sv
+tr
+uk
+vi
+zh_CN
+zh_TW
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..65184f6
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,475 @@
+# 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.19
+GETTEXT_MACRO_VERSION = 0.19
+
+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@
+
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
+# 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
+ package_gnu="$(PACKAGE_GNU)"; \
+ test -n "$$package_gnu" || { \
+ 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=yes; \
+ else \
+ package_gnu=no; \
+ fi; \
+ }; \
+ if test "$$package_gnu" = "yes"; then \
+ package_prefix='GNU '; \
+ else \
+ package_prefix=''; \
+ 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_prefix}@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): $(POFILESDEPS)
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
+ 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:
+ test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
+ @$(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/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..8a3afda
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,83 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \
+ \
+ --flag=_:1:pass-c-format\
+ --flag=N_:1:pass-c-format\
+ --flag=error:3:c-format --flag=error_at_line:5:c-format\
+\
+ --from-code=UTF-8\
+ --flag=asprintf:2:c-format --flag=vasprintf:2:c-format\
+ --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\
+ --flag=message:1:c-format --flag=message5:1:c-format\
+ --flag=try_help:1:c-format\
+ $${end_of_xgettext_options+}
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty. If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU =
+
+# 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-diffutils@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
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+# --previous to keep previous msgids of translated messages,
+# --quiet to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed. Possible values are "yes" and "no". Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist". Possible values are "yes" and
+# "no". Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..c379074
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,36 @@
+# List of files that contain translatable strings.
+
+# Copyright (C) 2001-2002, 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+lib/argmatch.c
+lib/c-stack.c
+lib/error.c
+lib/file-type.c
+lib/getopt.c
+lib/quotearg.c
+lib/regcomp.c
+lib/xalloc-die.c
+lib/xfreopen.c
+lib/xstrtol-error.c
+lib/version-etc.c
+
+src/analyze.c
+src/cmp.c
+src/diff.c
+src/diff3.c
+src/dir.c
+src/sdiff.c
+src/util.c
diff --git a/po/Rules-quot b/po/Rules-quot
new file mode 100644
index 0000000..7b92c7e
--- /dev/null
+++ b/po/Rules-quot
@@ -0,0 +1,58 @@
+# This file, Rules-quot, can be copied and used freely without restrictions.
+# 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 | \
+ { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
+ $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
+ ;; \
+ *) \
+ $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
+ ;; \
+ esac } 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/po/boldquot.sed b/po/boldquot.sed
new file mode 100644
index 0000000..4b937aa
--- /dev/null
+++ b/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/po/ca.gmo b/po/ca.gmo
new file mode 100644
index 0000000..00ae7a7
--- /dev/null
+++ b/po/ca.gmo
Binary files differ
diff --git a/po/ca.po b/po/ca.po
new file mode 100644
index 0000000..96bf182
--- /dev/null
+++ b/po/ca.po
@@ -0,0 +1,1666 @@
+# Catalan messages for diffutils.
+# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Ernest Adrogu Calveras <eadrogue@gmx.net>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 2.8.7\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2004-04-21 13:33+0200\n"
+"Last-Translator: Ernest Adrogu Calveras <eadrogue@gmx.net>\n"
+"Language-Team: Catalan <ca@dodds.net>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "el valor %s per l'opci --bytes no s vlid"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "el valor %s per l'opci --bytes no s vlid"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "error del programa"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "desbordament de pila"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Error no identificat del sistema"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "fitxer ordinari buit"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "fitxer ordinari"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "directori"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "enlla simblic"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "cua de missatges"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semfor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objecte de memria compartida"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "objecte de memria tipificada"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "fitxer especial de blocs"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "fitxer especial de carcters"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "cua FIFO"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "fitxer especial de blocs"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "fitxer especial de carcters"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "fitxer estrambtic"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "fitxer especial de blocs"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "connector"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "fitxer estrambtic"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: l'opci %s s ambigua\n"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: l'opci -W %s s ambigua\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: l'opci --%s no admet arguments\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: l'opci %c%s no admet arguments\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: l'opci %s requereix arguments\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: opci no reconeguda --%s\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: opci no reconeguda %c%s\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opci no vlida -- %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: l'opci requereix arguments -- %c\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: l'opci -W %s s ambigua\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: l'opci -W %s no admet arguments\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: l'opci %s requereix arguments\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succs"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Cap resultat"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "L'expressi regular no s vlida"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "El carcter de collaci no s vlid"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "El nom de la classe de carcter no s vlid"
+
+# al final o al principi? eac
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Hi ha una barra invertida al final"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Hi ha una referncia cap enrera no vlida"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Hi ha un signe [ o ^[ desaparellat"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Hi ha un signe ( o \\( desaparellat"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Hi ha un signe \\{ desaparellat"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "El contingut de \\{\\} no s vlid"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "El lmit superior de l'interval no vlid"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memria exhaurida"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "L'expressi regular precedent no s vlida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Final prematur de l'expressi regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "L'expressi regular s massa gran"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Hi ha un signe ) o \\) desaparellat"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "No hi ha cap expressi regular prvia"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memria exhaurida"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr "Error no identificat del sistema"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "el valor %s per l'opci --bytes no s vlid"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr ""
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Escrit per %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Escrit per %s i %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Escrit per %s, %s i %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Escrit per %s, %s, %s,\n"
+"i %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Escrit per %s, %s, %s,\n"
+"%s, i %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Excrit per %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, i altres.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Els fitxers %s i %s difereixen\n"
+
+#: src/analyze.c:455
+#, fuzzy, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Els fitxers %s i %s difereixen\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "No hi ha cap carcter de salt de lnia al final del fitxer"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Proveu %s --help per obtenir ms informaci."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "el valor %s per l'opci --ignore-initial no s vlid"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "les opcions -l i -s sn incompatibles"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "error d'escriptura"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "sortida estndard"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes Mostra els octets que difereixen."
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr "-i SALT --ignore-initial=SALT Ignora els primers SALT octets."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+" Ignora els primers SALT1 octets de FITXER1 i els primers SALT2 de FITXER2."
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose Mostra la posici i valor dels octets que difereixen."
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n LMIT --bytes=LMIT Compara com a mxim LMIT octets."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Mostra la versi del programa."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Mode d's: %s [OPCI]... FITXER1 [FITXER2 [SALT1 [SALT2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Compara dos fitxers octet a octet."
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"SALT1 i SALT2 sn el nombre d'octets que es passen per alt de cada fitxer."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Els valors de SALT poden tenir els segents sufixs multiplicadors:\n"
+"kB per 1000, K per 1024, MB per 1.000.000, M per 1.048.576, GB per\n"
+"1.000.000.000, G per 1.073.741.824, i aix amb T, P, E, Z i Y."
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Si un FITXER s - o falta, llegeix l'entrada estndard."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"L'estat de sortida s 0 si les entrades sn iguals, 1 si sn diferents\n"
+"i 2 en cas d'error."
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "el valor %s per l'opci --bytes no s vlid"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "falta un operand desprs de %s"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "sobra l'operand %s"
+
+# mirar el comentari del codi font
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s i %s difereixen: octet %s, lnia %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s i %s difereixen: l'octet %s, lnia %s, s %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: final de fitxer a %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "el nombre de lnies de context %s no s vlid"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "aquest sistema no suporta paginaci"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "massa opcions d'etiqueta de fitxer"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "l'amplada %s no s vlida"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "opcions d'amplada incompatibles"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "el nombre de lnies d'horitz %s no s vlid"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "la distncia de tabulaci %s no s vlida"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "opcions de distncia de tabulaci incompatibles"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "heu especificat les opcions --from-file i --to-file al mateix temps"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal Genera un diff normal."
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief Indica noms si els fitxers difereixen o no."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files Avisa quan dos fitxers sn idntics."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w NM --width=NM No ms de NM (130 per omissi) carcters per lnia."
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed Genera un script ed."
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Genera un diff en format RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w NM --width=NM No ms de NM (130 per omissi) carcters per lnia."
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+"-l --left-column Noms escriu les lnies en com a la columna esquerra."
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines No mostra les lnies en com."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=FITXER1 Compara FITXER1 amb tots els operands. FITXER1 pot ser\n"
+" un directori."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Expandeix les tabulacions de la sortida a espais."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab Alinea el text de cada lnia amb un carcter de tabulaci."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+"--tabsize=NM Estableix la distncia de tabulaci en NM (8 per omissi)\n"
+" carcters."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l --paginate Pagina la sortida amb el programa pr."
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r --recursive Compara recursivament qualsevol subdirectori existent."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file Considera els fitxers inexistents com si fssin buits."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+"--unidirectional-new-file Tracta els fitxers primers inexistents com si\n"
+" fssin buits."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+"--ignore-file-name-case Ignora diferncies entre majscules i minscules "
+"en\n"
+" els noms dels fitxers."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case T en compte diferncies entre majscules i\n"
+" minscules en comparar noms de fitxers."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x PAT --exclude=PAT Exclou fitxers que coincideixen amb PAT."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X FITXER --exclude-from=FITXER Exclou fitxers que coincideixen amb\n"
+" qualsevol patr de FITXER."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S FITXER --starting-file=FITXER Comena per FITXER quan es comparen\n"
+" directoris."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=FITXER1 Compara FITXER1 amb tots els operands. FITXER1 pot ser\n"
+" un directori."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=FITXER1 Compara tots els operands amb FITXER2. FITXER2 pot ser\n"
+" un directori."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i --ignore-case Ignora diferncies entre majscules i minscules."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Ignora canvis provocats per la distncia de\n"
+" tabulaci."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Ignora tot l'espai en blanc."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change Ignora canvis en la quantitat d'espai en blanc."
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space Ignora tot l'espai en blanc."
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B --ignore-blank-lines Ignora canvis en lnies que estan en blanc."
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I ER --ignore-matching-lines=ER Ignora canvis en lnies que continguin ER."
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Tracta tots els fitxers com a text."
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Treu els carcters finals de retorn de carro de "
+"l'entrada."
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Escriu i llegeix dades en mode binari."
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D NOM --ifdef=NOM Genera un fitxer combinat amb diferncies expressades\n"
+" amb directives `#ifdef NOM'."
+
+# `grups' o `grups de lnies' (no queda prou clar)
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--TIPUSG-group-format=FMTG Similar, per formata els grups TIPUSG amb FMTG."
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr "--line-format=FMTL Similar, per formata totes les lnies amb FMTL."
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--TIPUSL-line-format=FMTL Similar, per formata les lnies TIPUSL amb FMTL."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" TIPUSL pot ser old (velles), new (noves), o "
+"unchanged (inalterades).\n"
+" TIPUSG pot ser qualsevol TIPUSL o b changed (alterades)."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" FMTG pot contenir:\n"
+" %< lnies de FITXER1\n"
+" %> lnies de FITXER2\n"
+" %= lnies comunes de FITXER1 i FITXER2\n"
+" %[-][AMPLADA][.[PRECISI]]{doxX}LLETRA espec. estil printf per a "
+"LLETRA\n"
+" LLETRA s una de les segents pels grups nous (en minscules pels "
+"vells):\n"
+" F nombre de la primera lnia\n"
+" L nombre de l'ltima lnia\n"
+" N nombre de lnies del grup = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" FMTL pot contenir:\n"
+" %L contingut de la lnia\n"
+" %l contingut de la lnia sense el salt de lnia final\n"
+" %[-][AMPLADA][.[PRECISI]]{doxX}n espec. estil printf pel nombre de "
+"lnia"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Tant FMTG com FMTL poden contenir:\n"
+" %% %\n"
+" %c'C' el carcter C\n"
+" %c'\\OOO' el carcter de codi octal OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Intenta trobar canvis mnims."
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=NM No descarta NM lnies amb prefix i sufix com."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"-H --speed-large-files Assumeix fitxers grans i molts canvis petits "
+"dispersos."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal Genera un diff normal."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Mostra la versi del programa."
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FITXERS s FITXER1 FITXER2 o DIR1 DIR2 o DIR FITXER... o FITXER... "
+"DIR."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Amb les opcions --from-file o --to-file no hi ha restriccions de FITXERS."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "Si FITXER s -, llegeix l'entrada estndard."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Mode d's: %s [OPCI]... FITXERS\n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr "Compara fitxers lnia per lnia."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "el valor %s per l'opci %s s conflictiu"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "opcions d'estil de sortida conflictives"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "l'amplada %s no s vlida"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Noms a %s: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "no es pot comparar - amb un directori"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "l'opci -D no funciona amb directoris"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdirectoris comuns: %s i %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "El fitxer %s s un %s mentre que el fitxer %s s un %s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Els fitxers %s i %s difereixen\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Els fitxers %s i %s sn idntics\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr ""
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "opcions incompatibles"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "heu especificat - per ms d'un fitxer d'entrada"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lectura fallida"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A --show-all Mostra tots els canvis, senyalant els conflictes amb "
+"separadors."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Mostra els canvis no comuns de FITXER-VELL a FITXER2 en FITXER1."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap Mostra els canvis no comuns, senyalant els conflictes "
+"amb\n"
+" separadors."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3 --easy-only Mostra els canvis no comuns i no solapats."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only Mostra els canvis solapats."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Afegeix les instruccions w i q a l'script ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Tracta tots els fitxers com a text."
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Treu els carcters finals de retorn de carro de "
+"l'entrada."
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab Alinea el text de cada lnia amb un carcter de tabulaci."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAMA Usa PROGRAMA per comparar fitxers."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Mostra la versi del programa."
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Mode d's: %s [OPCI]... FITXER1 FITXER-VELL FITXER2\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Compara tres fitxers lnia per lnia."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"L'estat de sortida s 0 si s'acaba amb xit, 1 si hi ha conflictes\n"
+"i 2 en cas d'error."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "error intern: format dels blocs diff desmanegat"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff ha fallat: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "error intern: tipus de diff invlid en process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "el format diff no s vlid: el separador de canvis no s vlid"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "el format diff no s vlid: l'ltima lnia est incompleta"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "no s'ha pogut invocar el programa subsidiari %s"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "el format diff no s vlid: carcters invlids al principi de lnia"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "error intern: tipus de diff no vlid passat a la sortida"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "el fitxer d'entrada s'ha encongit"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "no es poden comparar els noms de fitxer %s i %s"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr ""
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o FITXER --output=FITXER Opera interactivament, i envia la sortida a "
+"FITXER."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case No distingeix entre majscules i minscules."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Ignora canvis provocats per la distncia de\n"
+" tabulaci."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Ignora tot l'espai en blanc."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change Ignora canvis en la quantitat d'espai en blanc."
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space Ignora tot l'espai en blanc."
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B --ignore-blank-lines Ignora canvis en lnies que estan en blanc."
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I ER --ignore-matching-lines=ER Ignora canvis en lnies que continguin ER."
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Treu els carcters finals de retorn de carro de "
+"l'entrada."
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Tracta tots els fitxers com a text."
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w NM --width=NM No ms de NM (130 per omissi) carcters per lnia."
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l --left-column Noms escriu les lnies en com a la columna esquerra."
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines No mostra les lnies en com."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Expandeix les tabulacions de la sortida a espais."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+"--tabsize=NM Estableix la distncia de tabulaci en NM (8 per omissi)\n"
+" carcters."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Intenta trobar canvis mnims."
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files Assumeix fitxers grans i molts canvis petits "
+"dispersos."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAMA Usa PROGRAMA per comparar fitxers."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Mostra la versi del programa."
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Mode d's: %s [OPCI]... FITXER1 FITXER2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Combina diferncies entre fitxers en dues columnes"
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "no es pot combinar interactivament l'entrada estndard"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "ambds fitxers sn directoris"
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEdita i usa les dues versions, amb un encapalament afegit.\n"
+"eb:\tEdita i usa les dues versions.\n"
+"el:\tEdita i usa la versi de l'esquerra.\n"
+"er:\tEdita i usa la versi de la dreta.\n"
+"e:\tEdita una nova versi.\n"
+"l:\tUsa la versi de l'esquerra.\n"
+"r:\tUsa la versi de la dreta.\n"
+"s:\tInclou les lnies comunes silenciosament\n"
+"v:\tInclou les lnies comunes i informa amb loquacitat\n"
+"q:\tSurt.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: opci no reconeguda --%s\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opci illegal -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Aix s programari lliure; vegeu el codi font per les condicions de "
+#~ "cpia. No\n"
+#~ "hi ha CAP garantia, ni tan sols de COMERCIABILITAT o ADEQUACI A UN "
+#~ "PROPSIT.\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SALT1:SALT2 --ignore-initial=SALT1:SALT2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent No mostra res; torna l'estat de sortida i prou."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Mostra aquesta ajuda."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Comuniqueu errors a <bug-gnu-utils@gnu.org>."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "l'opci -%ld s obsoleta; useu -%c %ld"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "l'opci -%ld s obsoleta; eviteu-la"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NM --context[=NM] Escriu NM (3 per omissi) lnies de "
+#~ "context.\n"
+#~ "-u -U NM --unified[=NM] Escriu NM (3 per omissi) lnies de "
+#~ "context\n"
+#~ " unificat.\n"
+#~ " --label ETIQUETA Usa ETIQUETA en lloc del nom del fitxer.\n"
+#~ " -p --show-c-function Mostra en quina funci C es troba cada canvi.\n"
+#~ " -F ER --show-function-line=ER Mostra la lnia ms recent que "
+#~ "contingui ER."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Disposa el resultat en dues columnes.\n"
+#~ " -W NM --width=NM No ms de NM (130 per omissi) carcters per "
+#~ "lnia.\n"
+#~ " --left-column Noms mostra les lnies en com a la columna esquerra.\n"
+#~ " --suppress-common-lines No mostra les lnies en com."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Assumeix fitxers grans i molts canvis petits "
+#~ "dispersos."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Mostra els canvis solapats, amb separadors."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Produeix un fitxer de canvis combinat en lloc d'un script "
+#~ "ed\n"
+#~ " (usant l'opci -A per omissi)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L ETIQUETA --label=ETIQUETA Usa ETIQUETA en lloc del nom del fitxer."
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "no s'ha trobat el programa subsidiari %s"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "el programa subsidiari %s ha fallat"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "el programa subsidiari %s Ha fallat (estat de sortida %d)"
diff --git a/po/cs.gmo b/po/cs.gmo
new file mode 100644
index 0000000..af7d123
--- /dev/null
+++ b/po/cs.gmo
Binary files differ
diff --git a/po/cs.po b/po/cs.po
new file mode 100644
index 0000000..9930a70
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,1577 @@
+# Czech translations for the GNU diffutils messages.
+# Copyright (C) 1998, 2002, 2004, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Petr Kočvara <petr.kocvara@nemfm.cz>, 1998, 2002, 2004, 2010
+# Petr Pisar <petr.pisar@atlas.cz, 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2014-04-16 06:33+0200\n"
+"Last-Translator: Petr Pisar <petr.pisar@atlas.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: 8-bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "neplatný argument „%3$s“ přepínače %1$s%2$s"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "neplatný argument „%3$s“ přepínače %1$s%2$s"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "chyba programu"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "přetečení zásobníku"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Neznámá chyba systému"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "obyčejný prázdný soubor"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "obyčejný soubor"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "adresář"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "symbolický odkaz"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "fronta zpráv"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objekt sdílené paměti"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "objekt typové paměti"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "speciální blokový soubor"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "speciální znakový soubor"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "roura"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "speciální blokový soubor"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "speciální znakový soubor"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "soubor neznámého typu"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "speciální blokový soubor"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "soket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "soubor neznámého typu"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: přepínač „%s“ není jednoznačný; možnosti:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: přepínač „-W %s“ není jednoznačný\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, 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"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: přepínač „%c%s“ musí být zadán bez argumentu\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: přepínač „--%s“ vyžaduje argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: neznámý přepínač „--%s“\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: neznámý přepínač „%c%s“\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: neznámý přepínač – „%c“\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: přepínač vyžaduje argument – „%c“\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: přepínač „-W %s“ není jednoznačný\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, 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"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: přepínač „-W %s“ vyžaduje argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "„"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "“"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Hotovo"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Žádná shoda"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Neplatný regulární výraz"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Neplatný znak porovnání"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Neplatné jméno třídy znaků"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Koncové zpětné lomítko"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Neplatný zpětný odkaz"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Nepárová [ nebo ]^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Nepárová ( nebo \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Nepárová \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Neplatný obsah \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Neplatný konec rozsahu"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Paměť vyčerpána"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Neplatný předchozí regulární výraz"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Předčasný konec regulárního výrazu"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regulární výraz je příliš dlouhý"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Nepárová ) nebo \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Předchozí regulární výraz neexistuje"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "paměť vyčerpána"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "neznámý proud"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "nelze znovuotevřít %s v módu %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "neplatný argument „%3$s“ přepínače %1$s%2$s"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "neplatná přípona argumentu „%3$s“ přepínače %2$s%1$s"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "argument „%3$s“ přepínače %1$s%2$s je příliš velký"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Balíček připravil %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Balíček připravil %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Toto je svobodné programové vybavení: máte právo měnit jej a dále šířit.\n"
+"Není poskytována ŽÁDNÁ ZÁRUKA, jak jen zákon dovoluje.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Autor: %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Autoři: %s a %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Autoři: %s, %s a %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Autoři: %s, %s, %s\n"
+"a %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Autoři: %s, %s, %s,\n"
+"%s a %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Autoři: %s, %s, %s,\n"
+"%s, %s a %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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Autoři: %s, %s, %s,\n"
+"%s, %s, %s a %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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Autoři: %s, %s, %s,\n"
+"%s, %s, %s, %s\n"
+"a %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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Autoři: %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s a %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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Autoři: %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s a další.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Chyby v programu oznamujte na adrese %s (anglicky),\n"
+"připomínky k překladu na adrese <translation-team-cs@lists.sourceforge.net>\n"
+"(česky).\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+"Chyby v programu %s oznamujte (anglicky) na: %s\n"
+"Připomínky k překladu (česky) na: <translation-team-cs@lists.sourceforge."
+"net>\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Domovská stránka %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Domovská stránka programu %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Obecná pomoc při používání softwaru GNU:: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Soubory %s a %s jsou různé\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binární soubory %s a %s jsou rozdílné\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Chybí znak konce řádku na konci souboru"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Více informací získáte příkazem „%s --help“."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "neplatná hodnota --ignore-inital „%s“"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "přepínače -l a -s nejsou kompatibilní"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "zápis selhal"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standardní výstup"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes vypíše rozdílné bajty"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr "-i, --ignore-initial=N přeskočí prvních N bajtů obou vstupů"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=N1:N2 přeskočí prvních N1 bajtů SOUBORU1 a\n"
+" prvních N2 bajtů SOUBORU2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose vypíše pozice a hodnoty rozdílných bajtů"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMIT porovná nejvýše LIMIT bajtů"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent potlačí veškerý běžný výstup"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help zobrazí tuto nápovědu a skončí"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v --version vypíše údaje o verzi a skončí"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Použití: %s [PŘEPÍNAČ]… SOUBOR1 [SOUBOR2 [N1 [N2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Porovnává dva soubory bajt po bajtu."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Volitelné argumenty N1 a N2 udávají počet bajtů, které budou přeskočeny\n"
+"na začátku každého souboru (výchozí je nula)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Povinné argumenty dlouhých přepínačů jsou též povinné u krátkých forem.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Hodnoty N1 a N2 mohou být doplněny následujícími násobnými příponami:\n"
+"kB 1000, K 1024, MB 1 000 000, M 1 048 576,\n"
+"GB 1 000 000 000, G 1 073 741 824 a stejně tak i pro T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Pokud SOUBOR je „-“ nebo nebo chybí, bude čten standardní vstup."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Návratový kód je roven 0 pokud jsou vstupy shodné, 1 pokud se liší a 2 při "
+"chybě."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "neplatná hodnota přepínače --bytes „%s“"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "po „%s“ chybí operand"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "operand „%s“ je nadbytečný"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s se liší: bajt %s, řádek %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s se liší: bajt %s, řádek %s je %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: konec souboru v %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "neplatná délka kontextu „%s“"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "přestránkování není na tomto počítači podporováno"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "příliš mnoho přepínačů popisu souboru"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "nesprávná délka „%s“"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "konfliktní volby šířky výstupu"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "neplatná výška obzoru „%s“"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "nesprávná hodnota --tabsize „%s“"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "konfliktní přepínače tabsize"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "parametry --from-file i to-file použity najednou"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal normálním formát výstupu diff (výchozí)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief výstup pouze při rozdílných souborech"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files hlásí shodné soubory"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C POČET, --context[=POČET]\n"
+" vypíše POČET (výchozí je 3) řádků\n"
+" kopírovaného kontextu"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U POČET, --unified[=POČET]\n"
+" vypíše POČET (výchozí je 3) řádků\n"
+" unifikovaného kontextu"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed vypíše skript pro ed"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs vypíše rozdíl ve formátu RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side vypíše ve dvou sloupcích"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=POČET vypíše nejvýše POČET (výchozí je 130)\n"
+" tiskových sloupců"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column vypíše pouze levý sloupec společných řádků"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines nevypisuje shodné řádky"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function ukáže, ve které funkci C se změna nachází"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RV ukáže poslední řádek odpovídající RV"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label NÁZEV použije NÁZEV místo názvu souboru\n"
+" (lze opakovat)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs ve výstupu převede tabulátory na mezery"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab na začátek řádků se vloží tabulátor"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=POČET tabulátor zastavuje každých POČET\n"
+" (výchozí je 8) tiskových sloupců"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty potlačí mezeru nebo tabulátor před prázdnými\n"
+"   řádky výstupu"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate výstup projde přes „pr“ pro přestránkování"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r --recursive rekurzivně porovná všechny nalezené "
+"podadresáře"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference nenásleduje symbolické odkazy"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file neexistující soubory považuje za prázdné"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file neexistující soubory z prvního adresáře\n"
+" považuje za prázdné"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case ignoruje velikost písmen v názvech souborů"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case bere v potaz velikost písmen v názvech "
+"souborů"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=VZOR vynechá soubory odpovídající VZORU"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=SOUBOR vynechá soubory, které odpovídají\n"
+" libovolnému vzoru ze SOUBORU"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=SOUBOR při porovnávání adresářů začne SOUBOREM"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=SOUBOR1 porovná SOUBOR1 se všemi operandy,\n"
+" SOUBOR1 může být adresář"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=SOUBOR2 porovná všechny operandy se SOUBOREM2,\n"
+" SOUBOR2 může být adresář"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case ignoruje velikost písmen v obsahu souborů"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion ignoruje změny v odsazení tabulátorem"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ignoruje bílá místa na konci řádku"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change ignoruje změny v počtu bílých míst"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space ignoruje všechna bílá místa"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignoruje změny v případě prázdných řádků"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RV ignoruje změny na všech řádcích\n"
+" odpovídajících RV"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text pokládá všechny soubory za text"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr odstraní ukončovací znak CR na vstupu"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+" --binary data čte a zapisuje data v binárním režimu"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NÁZEV vypíše sloučený soubor s rozdíly „#ifdef "
+"NÁZEV“"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT formátuje vstupní skupiny GTYPE podle FMTS"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT formátuje všechny vstupní řádky podle LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT formátuje vstupní řádky LTYPE podle LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Tyto formátovací přepínače poskytují jemnou kontrolu nad výstupem diffu\n"
+" a zobecňují -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE je „old“ (starý), „new“ (nový) nebo „unchanged“ (nezměněn). GTYPE\n"
+" je LTYPE nebo „changed“ (změněn)."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT může obsahovat:\n"
+" %< řádky ze SOUBORU1\n"
+" %> řádky ze SOUBORU2\n"
+" %= řádky společné pro SOUBOR1 i SOUBOR2\n"
+" %[-][DÉLKA][.[PŘESNOST]]{doxX}ZNAK formát stylu printf pro ZNAK\n"
+" ZNAKy dále jsou pro novou skupinu, malými písmeny pro starou skupinu:\n"
+" F číslo prvního řádku\n"
+" L číslo posledního řádku\n"
+" N počet řádků = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) pokud A se rovná B, tak T, jinak E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (pouze) smí obsahovat:\n"
+" %L obsah řádku\n"
+" %l obsah řádku, bez znaku konce řádku\n"
+" %[-][ŠÍŘKA][.[PŘESNOST]]{doxX}n formát stylu printf pro číslo "
+"vstupního\n"
+" řádku"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Jak GFMT, tak i LFMT smí obsahovat:\n"
+" %% %\n"
+" %c'C' jeden znak C\n"
+" %c'\\000' znak s osmičkovým kódem 000\n"
+" C znak C (ostatní znaky zastupují samy sebe)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal pokusí se nalézt nejmenší sadu změn"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=POČET\n"
+" ponechá POČET shodných řádků předpony a přípony"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files předpokládá velké soubory a mnoho rozptýlených\n"
+" drobných změn"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal normálním formát výstupu diff (výchozí)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help zobrazí tuto nápovědu a skončí"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vypíše údaje o verzi a skončí"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"SOUBORY jsou „SOUBOR1 SOUBOR2“ nebo „ADRESÁŘ1 ADRESÁŘ2' nebo\n"
+"„ADRESÁŘ SOUBOR…“ nebo „SOUBOR… ADRESÁŘ“."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Pokud je uveden --from-file nebo --to-file, pak nejsou u SOUBORŮ žádná "
+"omezení."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Pokud SOUBOR bude „-“, bude čten standardní vstup."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Použití: %s [PŘEPÍNAČ]… SOUBORY\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Porovnává SOUBORY řádek po řádku."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "konfliktní hodnota „%2$s“ přepínače „%1$s“"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "konfliktní přepínače pro styl výstupu"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "nesprávná délka „%s“"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Pouze v %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "„-“ s adresářem nelze porovnat"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D přepínač nepodporuje práci s adresáři"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Společné podadresáře: %s a %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Soubor %s je %s zatímco soubor %s je %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Symbolické odkazy %s a %s se liší\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Soubory %s a %s jsou identické\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "nekompatibilní přepínače"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "„-“ zadáno pro více než jeden vstupní soubor"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "čtení selhalo"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all vypíše všechny rozdíly, konflikty v závorkách"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed vypíše ed skript zahrnující změny mezi\n"
+" STARÝM_SOUBOREM a VAŠÍM_SOUBOREM do MÉHO_SOUBORU"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap jako -e, ale konflikty umístí do závorek"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only jako -e, ale zahrne jen nepřekrývající se změny"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only jako -e, ale zahrne jen překrývající se změny"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X jako -x, ale konflikty umístí do závorek"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i přidá příkazy „w“ a „q“ do skriptů pro ed"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge vypíše vlastní spojený soubor podle -A, nebyly-"
+"li\n"
+" uvedeny další přepínače"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text pokládá všechny soubory za text"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr odstraní ukončovací znak CR na vstupu"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab na začátek řádků se vloží tabulátor"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM použije PROGRAM k porovnání souborů"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=NÁZEV použije NÁZEV namísto názvu souboru\n"
+" (lze opakovat až třikrát)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help zobrazí tuto nápovědu a skončí"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vypíše údaje o verzi a skončí"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Použití: %s [PŘEPÍNAČ]… MŮJ_SOUBOR STARÝ_SOUBOR VÁŠ_SOUBOR\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Porovnání tří souborů řádek po řádku."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Výchozí výstupní formát je více méně člověkem čitelná reprezentace změn.\n"
+"\n"
+"Přepínače -e, -E, -x, -X (a odpovídající dlouhé přepínače) způsobí vypsání\n"
+"skriptu pro program ed namísto výchozího formátu.\n"
+"\n"
+"Nakonec přepínač -m (--merge) způsobí, že diff3 provede spojení sám a "
+"vypíše\n"
+"vlastní spojený soubor. V případě neobvyklého vstupu, je toto spolehlivější\n"
+"způsob než použití programu ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Návratová hodnota je 0 při úspěchu, 1 při konfliktu a 2 při chybě."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "vnitřní chyba: chyba ve formátu diff bloků"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff selhal: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "vnitřní chyba: nesprávný typ diffu v process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "neplatný formát diff souboru; neplatný oddělovač změny"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "neplatný formát diff souboru; nekompletní poslední řádek"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "pomocný program „%s“ nebylo možné zavolat"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "neplatný formát diff souboru; nesprávné úvodní znaky na řádku"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "vnitřní chyba: nesprávný typ diffu pro výstup"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "vstupní soubor se zmenšil"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "nelze porovnat názvy souborů „%s“ a „%s“"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: smyčka v rekurzi adresářů"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=SOUBOR interaktivní režim, výstup půjde do SOUBORU"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case nerozlišuje velká a malá písmena"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion ignoruje změny v odsazení tabulátorem"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignoruje všechny bílé znaky na konci řádku"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change ignoruje změny v počtu bílých znaků"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space ignoruje všechny bílé znaky"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines ignoruje změny v případě prázdných řádků"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RV ignoruje změny na všech řádcích\n"
+" odpovídajících RV"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr odstraní ukončovací znak CR na vstupu"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text pokládá všechny soubory za text"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=POČET vypíše nejvýše POČET (výchozí je 130) "
+"tiskových\n"
+" sloupců"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column vypíše pouze levý sloupec společných řádků"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines nevypisuje společné řádky"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs ve výstupu převede tabulátory na mezery"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=POČET tabulátor zastavuje každých POČET (výchozí je "
+"8)\n"
+" tiskových sloupců"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal pokusí se nalézt nejmenší sadu změn"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files předpokládá velké soubory a mnoho rozptýlených\n"
+" drobných změn"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM použije PROGRAM k porovnání souborů"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help zobrazí tuto nápovědu a skončí"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vypíše údaje o verzi a skončí"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Použití: %s [PŘEPÍNAČ]… SOUBOR1 SOUBOR2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Spojí změny mezi SOUBOREM1 a SOUBOREM2 v režimu „vedle sebe“."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "interaktivně nelze standardní vstup sloučit"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "oba soubory k porovnání jsou adresáři"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEditace - použije obě verze, každou obdaří hlavičkou.\n"
+"eb:\tEditace - použije obě verze.\n"
+"el nebo e1:\tEditace - použije levou verzi.\n"
+"er nebo e2:\tEditace - použije pravou verzi.\n"
+"e:\tZahození obou verzí a editace nové verze.\n"
+"l nebo 1:\tPoužije levou verzi.\n"
+"r nebo 2:\tPoužije pravou verzi.\n"
+"s:\tV tichosti vloží společné řádky.\n"
+"v:\tUpozorní na vložení společných řádků.\n"
+"q:\tUkončení.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: neznámý přepínač „--%s“\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i N1:N2 --ignore-initial=N1:N2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent Žádný výstup; vrátí pouze status."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Vypíše tuto nápovědu."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C POČ --context[=POČ] Vypíše POČ (implicitně 3) řádky "
+#~ "kopírovaného\n"
+#~ " kontextu.\n"
+#~ "-u -U POČ --unified[=POČ] Vypíše POČ (implicitně 3) řádky "
+#~ "sjednoceného\n"
+#~ " kontextu.\n"
+#~ " -L POPIS --label POPIS Použije POPIS místo jména souboru.\n"
+#~ " -p --show-c-function U každé změny vypíše jméno C funkce, ve které "
+#~ "se\n"
+#~ " tato změna nachází.\n"
+#~ " -F RV --show-function-line=RV Vypíše nejnovější řádky odpovídající RV."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Výstup ve dvou sloupcích.\n"
+#~ " -W POČ --width=POČ Vypíše maximálně POČ (implicitně 130) znaků na "
+#~ "řádek.\n"
+#~ " --left-column Vypíše pouze levý sloupec společných řádků.\n"
+#~ " --suppress-common-lines Nevypíše společné řádky."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Předpokládá velké soubory a mnoho rozptýlených\n"
+#~ " drobných změn."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Vypíše překrývající se změny, uzavřené v závorkách."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Vypíše spojený soubor místo ed skriptu (implicitně -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L POPIS --label=POPIS Použije POPIS místo jména souboru."
diff --git a/po/da.gmo b/po/da.gmo
new file mode 100644
index 0000000..c8982b1
--- /dev/null
+++ b/po/da.gmo
Binary files differ
diff --git a/po/da.po b/po/da.po
new file mode 100644
index 0000000..de10aa1
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,1602 @@
+# Danish diffutils translation po-file
+# Copyright (C) 2000, 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+# Claus Hindsgaul <claus_h@image.dk>, 2000-2002.
+# Ask Hjorth Larsen <asklarsen@gmail.com>, 2010-2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils-3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-11-03 14:34+0100\n"
+"Last-Translator: Ask Hjorth Larsen <asklarsen@gmail.com>\n"
+"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 0.9.5\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "ugyldigt %s%s-argument '%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "ugyldigt %s%s-argument '%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programfejl"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stakoverløb"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Ukendt systemfejl"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "almindelig tom fil"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "almindelig fil"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "katalog"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "symbolsk lænke"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "meddelelseskø"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "signal"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "delt hukommelses-objekt"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "typeangivet hukommelses-objekt"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "blok-specialfil"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "tegn-specialfil"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "blok-specialfil"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "tegn-specialfil"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "mystisk fil"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "blok-specialfil"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "stik"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "mystisk fil"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: tilvalget '%s' er flertydigt; muligheder:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: tilvalget '-W %s' er flertydigt\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: tilvalg '--%s' tillader ikke et argument\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: tilvalg '%c%s' tillader ikke et argument\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: tilvalg '--%s' kræver et argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: ukendt tilvalg '--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: ukendt tilvalg '%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ugyldigt tilvalg -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: tilvalg kræver et argument -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: tilvalget '-W %s' er flertydigt\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: tilvalget '-W %s' tillader ikke et argument\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: tilvalget '-W %s' tillader ikke et argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "'"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succes"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Ingen match"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ugyldigt regulært udtryk"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ugyldig sammenlignings-tegn"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ugyldigt navn på tegn-klasse"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Efterstillet backslash"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ugyldig bagud-reference"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Uparret [ eller [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Uparret ( eller \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Uparret \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ugyldigt indhold af \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ugyldig område-afslutning"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Hukommelse opbrugt"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ugyldigt foranstillet regulært udtryk"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "For tidlig afslutning på regulært udtryk"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "For stort regulært udtryk"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Uparret ) eller \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Intet foranstillet regulært udtryk"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "hukommelse opbrugt"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "ukendt strøm"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "kunne ikke genåbne %s i tilstand %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "ugyldigt %s%s-argument '%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "ugyldig endelse i %s%s-argument '%s'"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s-argumentet '%s' er for stort"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Pakket af %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Pakket af %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+# første linje passer netop ind i 80 linjer (hvilket ikke ville være tilfældet med 'version' frem for 'udgave'
+#: lib/version-etc.c:86
+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 udgave 3 eller nyere <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Dette er fri software: Du kan frit ændre og videredistribuere det.\n"
+"Der gives INGEN GARANTI, i den grad som dette er tilladt af loven.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Skrevet af %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Skrevet af %s og %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Skrevet af %s, %s og %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Skrevet af %s, %s, %s\n"
+"og %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Skrevet af %s, %s, %s,\n"
+"%s og %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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 og andre.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapportér fejl til: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Rapportér fejl i %s til: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Hjemmeside for %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Hjemmeside for %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr "Generel hjælp til GNU-programmer: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Filerne %s og %s er forskellige\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binære filer %s og %s er forskellige\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Intet linjeskift ved filafslutning"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Prøv '%s --help' for mere information."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "ugyldig værdi '%s' for --ignore-initial"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "tilvalgene -l og -s er inkompatible"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "skrivning mislykkedes"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standard-ud"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes vis afvigende byte"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SPRING spring de første SPRING byte over i begge\n"
+" input"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SPRING1:SPRING2 spring de første SPRING1 byte af FIL1 "
+"og\n"
+" SPRING2 byte af FIL2 over"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose vis numre og værdier for de byte, der er "
+"forskellige"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=GRÆNSE sammenlign højst GRÆNSE byte"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent undertryk al normal udskrift"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjælpetekst og afslut"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versionsoplysninger og afslut"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Brug: %s [TILVALG]... FIL1 [FIL2 [SPRING1 [SPRING2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Sammenlign to filer byte for byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"De valgfri SPRING1 og SPRING2 angiver antallet af byte, der skal springes\n"
+"over ved begyndelsen af hver fil (normalt 0)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Obligatoriske argumenter til lange tilvalg er også obligatoriske til de "
+"korte.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"SPRING-værdier kan efterfølges af følgende enheder:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, og så videre for T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Såfremt en FIL er '-' eller mangler, læses fra standard-ind."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Slutstatus er 0 hvis inddata er ens, 1 hvis ikke, og 2 hvis der er problemer."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "ugyldig værdi '%s' for --bytes"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "manglende operand efter '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "ekstra operand '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s afviger: byte %s, linje %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s afviger: tegn %s, linje %s er %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: filafslutning på %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "ugyldig kontekstlængde '%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "paginering understøttes ikke af denne vært"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "for mange fil-mærke tilvalg"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "ugyldig bredde '%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "modstridende breddeangivelser"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "ugyldig horisontlængde '%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "ugyldig tabulatorbredde '%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "modstridende angivelser af tabulatorbredde"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "både --from-file og --to-file er angivet"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal udskriv en almindelig diff (forvalg)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief angiv kun når filerne er forskellige"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files rapportér hvis to filer er ens"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C ANTAL, --context[=ANTAL] udskriv ANTAL (normalt 3) linjer med "
+"kopieret\n"
+" kontekst"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U ANTAL, --unified[=ANTAL] Udskriv højst ANTAL (normalt 3) linjer\n"
+" forenet kontekst"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed udskriv et ed-script"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs udskriv en diff i RCS-format"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side udskriv i to kolonner"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=ANTAL udskriv højst ANTAL (normalt 130) kolonner"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column udskriv kun venstre kolonne i fælles linjer"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines udskriv ikke fælles linjer"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function vis hvilken C-funktion hver ændring er i"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE vis den seneste linje der matcher RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label MÆRKAT brug MÆRKAT frem for filnavn\n"
+" (kan gentages)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs lav tabulatorer om til mellemrum i udskrift"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab få tabulatorer på linje ved at forudstille en\n"
+" tabulator"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ANTAL tabulatorstop for hver ANTAL (normalt 8) "
+"kolonner"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty intet mellemrum eller tabulator før tomme\n"
+" ud-linjer"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate led uddata gennem 'pr' for at sideinddele det"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive sammenlign alle fundne underkataloger "
+"rekursivt"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference følg ikke symbolske lænker"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file behandl manglende filer som var de tomme"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file behandl manglende førstefiler som var de "
+"tomme"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case ingen forskel på store og små bogstaver ved\n"
+" sammenligning af filnavne"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case skeln mellem store og små bogstaver ved\n"
+" sammenligning af filnavne"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=MØNSTER udelad filer, det matcher MØNSTER"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FIL udelad filer, der matcher ethvert mønster i "
+"FIL"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FIL start med FIL, når der sammenlignes kataloger"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FIL1 sammenlign FIL1 med alle operander; FIL1 må\n"
+" godt være et katalog"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FIL1 sammenlign alle operander med FIL2. FIL2 "
+"må\n"
+" godt være et katalog"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i, --ignore-case ignorér versalforskelle i filindhold"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorér ændringer der skyldes\n"
+" tabulatoromsætning"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignorér blanke tegn ved linjens afslutning"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change ignorér ændringer i mængden af blanke tegn"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space ignorér alle blanke tegn"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B, --ignore-blank-lines ignorér ændringer med kun tomme linjer"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=MØNSTER ignorér ændringer, hvis linjer alle\n"
+" matcher MØNSTER"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandl alle filer som tekst"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr fjern afsluttende vognretur i inddata"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary læs og skriv data binært"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAVN udskriv flettet fil med '#ifdef NAVN'-differ"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT formatér GTYPE-inputgrupper med GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT formatér alle inputlinjer med LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT formatér LTYPE-inputlinjer med LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Disse formattilvalg giver finkontrol over udskriften af diff, og\n"
+" generaliserer -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE er 'old' (gammel), 'new' (ny) eller 'unchanged' (uændret).\n"
+" GTYPE er LTYPE eller 'changed' (ændret)."
+
+# hvad er PREC? Det står ingen steder i filen. PRÆC blev brugt i tidligere
+# oversættelse, så beholder. -Ask
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (kun) må indeholde:\n"
+" %< linjer fra FIL\n"
+" %> linjer fra FIL2\n"
+" %= linjer både i FIL1 og FIL2\n"
+" %[-][BREDDE][.[PRÆC]]{doxX}BOGSTAV printf-angivelse for BOGSTAV\n"
+" BOGSTAVer er som følger for ny gruppe, eller som små bogstaver for "
+"gammel\n"
+" gruppe:\n"
+" F første linjenummer\n"
+" L sidste linjenummer\n"
+" N antal linjer = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) hvis A lig med B så T, ellers E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (kun) må indeholde:\n"
+" %L indhold af linje\n"
+" %l indhold af linje, undtagen eventuelt følgende linjeskift\n"
+" %[-][BREDDE][.[PRÆC]]{doxX}n printf-angivelse for inputlinjenummer"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT og LFMT kan begge indeholde:\n"
+" %% %\n"
+" %c'C' tegnet C\n"
+" %c'\\OOO' tegnet med oktalkode OOO\n"
+" C tegnet C (andre tegn repræsenterer sig selv)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal grundigt forsøg på at finde et mindre antal "
+"ændringer"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=ANTAL behold ANTAL linjer af fælles præfiks og suffiks"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files antag store filer og mange spredte, små ændringer"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal udskriv en almindelig diff (forvalg)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjælpetekst og afslut"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versionsoplysninger og afslut"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILER er 'FIL1 FIL2' eller 'KATALOG1 KATALOG2' eller 'KATALOG FIL...' eller "
+"'FIL... KATALOG'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Hvis --from-file eller --to-file er givet, er der ingen restriktioner på "
+"FILer."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Såfremt en FIL er '-', læses fra standard-ind."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Brug: %s [TILVALG]... FILER\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Sammenlign filer linjevis."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "modstridende værdi for %s-tilvalget: '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "modstridende valg af uddata-stil"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "ugyldig bredde '%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Kun i %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "kan ikke sammenligne '-' med et katalog"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D tilvalg understøttes ikke for kataloger"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Identiske underkataloger: %s og %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Filen %s er en %s mens filen %s er en %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "De symbolske lænker %s og %s er forskellige\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Filerne %s og %s er identiske\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "inkompatible tilvalg"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' angivet for mere end én ind-fil"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "læsning mislykkedes"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all udskriv alle ændringer, med konflikter i "
+"parenteser"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed udskriv et ed-script som udfører ændringerne\n"
+" fra GAMMELFIL til DINFIL ind i MINFIL"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap som -e, men sæt konflikter i parentes"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only som -e, men inkludér kun ikke-overlappende "
+"ændringer"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only som -e, men inkludér kun overlappende ændringer"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X som -x, men sæt konflikter i parenteser"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i tilføj 'w' og 'q'-kommandoer til ed-script"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge udskriv faktisk flettet fil ifølge -A\n"
+" hvis ingen andre tilvalg er givet"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandl alle filer som tekst"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr fjern afsluttende vognretur i inddata"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab få tabulatorer på linje ved at forudstille\n"
+" en tabulator"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM brug PROGRAM til at sammenligne filerne"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=MÆRKAT brug MÆRKAT frem for filnavn\n"
+" (kan gentages op til tre gange)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjælpetekst og afslut"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versionsoplysninger og afslut"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Brug: %s [TILVALG]... MINFIL GAMMELFIL DINFIL\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Sammenlign tre filer linje for linje."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Som standard bruges et rimelig læsevenligt udskriftsformat til "
+"repræsentation\n"
+"af ændringerne.\n"
+"\n"
+"Tilvalgene -e, -E, -x, -X (og de tilsvarende lange) får et ed-script til at\n"
+"blive udskrevet frem for standardopførslen.\n"
+"\n"
+"Endelig får tilvalget -m (--merge) diff3 til at flette internt, og udskrive\n"
+"den faktiske flettede fil. Til usædvanlige inddata er dette mere robust "
+"end\n"
+"med ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Slutstatus er 0 hvis succes, 1 hvis der er konflikter, 2 hvis der er "
+"problemer."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "intern fejl: rod i formatet på diff blokke"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff fejlede: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "intern fejl: ugyldig diff type i process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "ugyldigt diff format; ugyldig ændrings-separator"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "ugyldigt diff format; uafsluttet sidste linje"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "hjælpeprogrammet '%s' kunne ikke køres"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "ugyldigt diff format; forkerte linje-begyndelses-tegn"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "intern fejl: ugyldig diff type sendt til uddata"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "ind-fil formindskedes"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "kan ikke sammenligne filnavnene '%s' og '%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekursiv katalogløkke"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=FIL arbejd interaktivt, og send uddata til FIL"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i, --ignore-case anse store og små bogstaver for at være ens"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorér ændringer, der skyldes "
+"tabulatoromsætning"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignorér blanke tegn ved linjens afslutning"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change ignorér ændringer i mængden af blanke tegn"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space ignorér alle blanke tegn"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignorér ændringer med udelukkende blanke linjer"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=MØNSTER ignorér ændringer, hvis linjer alle\n"
+" matcher MØNSTER"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr fjern afsluttende vognretur i inddata"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandl alle filer som tekst"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-w, --width=ANTAL udskriv højst ANTAL (normalt 130) søjler"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l, --left-column vis kun venstre kolonne af fælles linjer"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines vis ingen fælles linjer"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs lav tabulatorer om til mellemrum i output"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ANTAL tabulatorstop for hver ANTAL (normalt 8) "
+"kolonner"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal forsøg ihærdigt at finde et mindre antal "
+"ændringer"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files antag store filer og mange spredte, små "
+"ændringer"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM brug PROGRAM til at sammenligne filerne"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjælpetekst og afslut"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versionsoplysninger og afslut"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Brug: %s [TILVALG]... FIL1 FIL2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Side om side-fletning af forskelle mellem FIL1 og FIL2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "kan ikke indflette standard input interaktivt"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "begge filer der sammenlignes er kataloger"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tRedigér og brug så begge udgaver, hver udstyret med et hoved.\n"
+"eb:\tRedigér og brug så begge udgaver.\n"
+"el eller e1:\tRedigér og brug så venstre udgave.\n"
+"er eller e2:\tRedigér og brug så højre udgave.\n"
+"e:\tForkast begge udgaver og redigér så en ny.\n"
+"l eller 1:\tBrug venstre udgave.\n"
+"r eller 2:\tBrug højre udgave.\n"
+"s:\tMedtag fælles linjer uden at skrive meddelelser.\n"
+"v:\tMedtag og vis fælles linjer.\n"
+"q:\tAfslut.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: ukendt tilvalg '--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SPRING1:SPRING2 --ignore-initial=SPRING1:SPRING2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Ingen udskrift; sæt kun en afslutnings-slut-kode."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Vis denne hjælpetekst."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C ANTAL --context[=ANTAL] Udskriv ANTAL (normalt 3) linjer af "
+#~ "kopieret kontekst.\n"
+#~ "-u -U ANTAL --unified[=ANTAL] Udskriv ANTAL (normalt 3) linjer af "
+#~ "forenet kontekst.\n"
+#~ " -L MÆRKE --label MÆRKE Brug MÆRKE i stedet for filnavn.\n"
+#~ " -p --show-c-function Vis hvilken C funktion hver ændring er i.\n"
+#~ " -F MØNSTER --show-function-line=MØNSTER Vis den sidste foregående "
+#~ "linje, der matcher MØNSTER."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L MÆRKE --label=MÆRKE Brug MÆRKE i stedet for filnavn."
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the file named COPYING."
+#~ msgstr ""
+#~ "Dette program kommer HELT UDEN GARANTI i den udstrækning, loven tillader "
+#~ "det.\n"
+#~ "Du må videredistribuere kopier af dette program\n"
+#~ "under betingelserne i GNU General Public License (GPL).\n"
+#~ "Se filen COPYING for flere oplysninger om dette."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ugyldigt tilvalg -- %c\n"
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Skrevet af Torbjorn Granlund og David MacKenzie."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Raportér programfejl på engelsk til <bug-gnu-utils@gnu.org>."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Skrevet af Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman og Len Tower."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "Tilvalget '-%ld' er forældet; benyt '-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "Tilvalget '-%ld' er forældet; udelad det"
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "hjælpeprogram '%s' er ikke eksekverbart"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "hjælpeprogram '%s' fejlede"
diff --git a/po/de.gmo b/po/de.gmo
new file mode 100644
index 0000000..28a9aa8
--- /dev/null
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..744babe
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,1668 @@
+# German messages for GNU diffutils.
+# This file is distributed under the same license as the diffutils package.
+# Copyright (C) 1996, 2001, 2002, 2012, 2013 Free Software Foundation, Inc.
+# Karl Eichwalder <keichwa@gmx.net>, 1996
+# Martin von Löwis <martin@v.loewis.de>, 1997, 2001, 2002
+# Jakob Kramer <jakob.kramer@gmx.de>, 2012, 2013.
+# Benno Schulenberg <bensberg@justemail.net>, 2013.
+# Mario Blättermann <mario.blaettermann@gmail.com>, 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2014-04-20 20:43+0100\n"
+"Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>\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-Generator: Poedit 1.5.4\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "ungültiges %s%s-Argument »%s«"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "ungültiges %s%s-Argument »%s«"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "Programmfehler"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "Stacküberlauf"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "normale leere Datei"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "normale Datei"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "Verzeichnis"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "Symbolische Verknüpfung"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "Nachrichten-Warteschlange"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "Semaphor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "gemeinsames Speicherobjekt"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "typisiertes Speicherobjekt"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "Blockorientiertes Gerät"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "Zeichenorientiertes Gerät"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "FIFO"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "Blockorientiertes Gerät"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "Zeichenorientiertes Gerät"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "seltsame Datei"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "Blockorientiertes Gerät"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "Socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "seltsame Datei"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: Option »%s« ist mehrdeutig, Möglichkeiten:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: Option »-W %s« ist mehrdeutig\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: Option »--%s« erlaubt kein Argument.\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: Option »%c%s« erlaubt kein Argument.\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: Option »%s« verlangt ein Argument.\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: Unbekannte Option »--%s«.\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: Unbekannte Option »%c%s«.\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ungültige Option -- »%c«\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: Option verlangt ein Argument -- »%c«\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: Option »-W %s« ist mehrdeutig\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: Option »-W %s« erlaubt kein Argument.\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: Option »-W %s« verlangt ein Argument.\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "»"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "«"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Erfolg."
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Keine Übereinstimmung."
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ungültiger regulärer Ausdruck."
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ungültiges Sortierzeichen."
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ungültiger Name für Zeichenklasse."
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Extra Backslash."
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ungültige Rückreferenz."
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Öffnende [ oder [^ ohne schließende."
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Öffnende ( oder \\( ohne schließende."
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Öffnende \\{ ohne schließende."
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ungültiger Inhalt von \\{\\}."
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ungültiges Bereichsende."
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Speicher verbraucht."
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ungültiger vorhergehender regulärer Ausdruck."
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Vorzeitiges Ende des regulären Ausdrucks."
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regulärer Ausdruck ist zu groß."
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Schließende ) oder \\) ohne öffnende."
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Kein vorhergehender regulärer Ausdruck."
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "Speicher verbraucht."
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "Standardeingabe"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "Standardausgabe"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "Standardfehlerausgabe"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "unbekannter Datenstrom"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "%s konnte mit Modus %s nicht wieder geöffnet werden"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "ungültiges %s%s-Argument »%s«"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "ungültiger Suffix in %s%s Argument »%s«"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s Argument »%s« ist zu groß"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Paket erstellt von %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Paket erstellt von %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Lizenz GPLv3+: GNU GPL Version 3 oder später <http://www.gnu.org/licenses/"
+"gpl.html>.\n"
+"Dies ist freie Software: Sie dürfen sie verändern und verbreiten.\n"
+"Es gibt KEINE GARANTIE, soweit diese nicht durch das Gesetz vorgeschrieben\n"
+"wird.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Geschrieben von %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Geschrieben von %s und %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Geschrieben von %s, %s und %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Geschrieben von %s, %s, %s\n"
+"und %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Geschrieben von %s, %s, %s,\n"
+"%s und %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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 weiteren.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Fehlerberichte an %s.\n"
+"Übersetzungsfehler an <http://translationproject.org/team/de.html>.\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Berichten Sie Fehler in %s an %s.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Homepage von %s: <%s>.\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Homepage von %s: <http://www.gnu.org/software/%s/>.\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Allgemeine Hilfe zur Benutzung von GNU-Software: <http://www.gnu.org/gethelp/"
+">\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Dateien %s und %s sind verschieden.\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binärdateien %s und %s sind verschieden.\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Kein Zeilenumbruch am Dateiende."
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "»%s --help« gibt Ihnen mehr Informationen."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "ungültiger --ignore-initial-Wert »%s«."
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "Die Optionen -l und -s sind inkompatibel."
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "Schreibfehler."
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "Standardausgabe"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes Unterschiedliche Bytes ausgeben."
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SKIP Die ersten SKIP Bytes der Eingabe "
+"überspringen."
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SKIP1:SKIP2 Die ersten SKIP1 Bytes von DATEI1\n"
+" und die ersten SKIP2 Bytes von DATEI2 "
+"überspringen."
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose Bytenummern und Werte aller unterschiedlichen "
+"Bytes ausgeben."
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMIT Höchstens LIMIT Bytes vergleichen."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent Alle normalen Ausgaben unterdrücken."
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help Diese Hilfe anzeigen und beenden."
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, -version Versionsinformation ausgeben und beenden."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Aufruf: %s [OPTION]... DATEI1 [DATEI2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Zwei Dateien Byte für Byte vergleichen."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Die optionalen Argumente SKIP1 und SKIP2 geben die Zahl der Bytes an,\n"
+"die in jeder Datei übersprungen werden (standardmäßig null)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Nötige Argumente für lange Optionen sind auch für kurze Optionen nötig.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"SKIP-Werte dürfen die folgenden multiplikativen Anhänge haben:\n"
+"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n"
+"GB 1.000.000.000, G 1.073.741.824, und so weiter für T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Wenn DATEI »-« ist oder fehlt, von der Standardeingabe lesen."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Der Rückgabewert des Programms ist 0, falls die Eingaben identisch\n"
+"sind, 1 falls sie unterschiedlich sind und 2, falls es Probleme gab."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "ungültiger --bytes-Wert »%s«"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "fehlender Operand nach »%s«"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "extra Operand »%s«."
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s differieren: Byte %s, Zeile %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s differieren: Zeichen %s, Zeile %s ist %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF auf %s.\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "ungültige Kontextlänge »%s«."
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "Seitenumbruch wird auf diesem System nicht unterstützt."
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "Zu viele Datei-Label-Optionen wurden angegeben."
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "ungültige Breite »%s«."
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "widersprüchliche Breitenoptionen"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "ungültige Horizontlänge »%s«."
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "ungültige Tabulatorbreite »%s«."
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "widersprüchliche Tabulatorbreitenoptionen."
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file und --to-file sind beide angegeben."
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal Ein normales Diff ausgeben (Standard)."
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+"-q, --brief Nur ausgeben, ob die Dateien verschieden sind."
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files Meldung, wenn zwei Dateien gleich sind."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C ZAHL, --context[=ZAHL] ZAHL Zeilen des kopierten Kontexts ausgeben "
+"(Vorgabe: 3)."
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U ZAHL, --unified[=ZAHL] ZAHL Zeilen des Unified-Kontexts ausgeben "
+"(Vorgabe: 3)."
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed Ein ed-Skript ausgeben."
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs Im RCS-Format ausgeben."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side In zwei Spalten ausgeben."
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=ZAHL Maximal ZAHL Druckspalten pro Zeile ausgeben\n"
+" (Vorgabe: 130)."
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column Nur linke Spalte der gemeinsamen Zeilen "
+"ausgeben."
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines Keine gemeinsamen Zeilen ausgeben."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function Für jede Änderung zeigen, in welcher C-"
+"Funktion sie ist"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RE Die neueste Zeile zeigen, die dem Muster RE "
+"entspricht"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label LABEL LABEL statt des Dateinamens benutzen\n"
+" (kann wiederholt werden)."
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, -expand-tabs Tabulatoren in der Ausgabe zu Leerzeichen "
+"ausdehnen."
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Einrückungen durch vorangestellte Tabulatoren "
+"erzeugen."
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ZAHL Tabulatorstopps sind alle ZAHL Spalten "
+"(Vorgabe: 8)."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty Leerzeichen oder Tabulator vor leeren\n"
+" Ausgabezeilen verhindern."
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate Ausgabe an »pr« zum Seitenumbruch übergeben."
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive Rekursiv alle Unterverzeichnisse vergleichen."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+" --no-derefence Symbolischen Verknüpfungen nicht folgen."
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file Fehlende Dateien als leer betrachten."
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file Die ersten fehlenden Dateien als leer "
+"betrachten."
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case Unterschiede der Groß/Kleinschreibung von "
+"Dateinamen\n"
+" ignorieren."
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case Unterschiede der Groß/Kleinschreibung von \n"
+" Dateinamen beachten."
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=MUSTER Dateien ausschließen, die auf MUSTER passen."
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=DATEI Dateien überspringen, die auf eines der\n"
+" Muster in DATEI passen."
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=DATEI Beim Verzeichnisvergleich mit DATEI beginnen."
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=DATEI1 DATEI1 mit allen Operanden vergleichen.\n"
+" DATEI1 kann ein Verzeichnis sein."
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=DATEI2 Alle Operanden mit DATEI2 vergleichen.\n"
+" DATEI2 kann ein Verzeichnis sein."
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case Unterschiede der Groß/Kleinschreibung\n"
+" im Dateiinhalt ignorieren."
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Änderungen aufgrund von Tabausdehnungen "
+"ignorieren."
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space Freiraum am Zeilenende ignorieren."
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Änderungen im Leerraum ignorieren."
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space Freiraum ignorieren."
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines Die Änderungen übergehen, wo alle Zeilen "
+"leer sind."
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Änderungen ignorieren, bei denen alle "
+"Zeilen\n"
+" auf das Muster RE passen."
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Alle Dateien als Text behandeln."
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Wagenrücklauf (CR) am Zeilenende\n"
+" beim Einlesen entfernen."
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+" --binary Daten im Binärmodus lesen und schreiben."
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAME Zusammengefügte Datei mit »#ifdef NAME« in\n"
+" die Ausgabe mischen."
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT GTYPE-Eingabe mit GFMT formatieren."
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT Alle Eingabe-Zeilen mit LFMT formatieren."
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT LTYPE-Eingabe mit LFMT formatieren."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Diese Formatoptionen stellen haargenaue Kontrolle über die Eingabe\n"
+" von diff bereit, indem -D/--ifdef verallgemeinert wird."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE kann »old«, »new« oder »unchanged« sein. GTYPE ist LTYPE oder "
+"»changed«."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT kann (nur) enthalten:\n"
+" %< Zeilen von DATEI1.\n"
+" %> Zeilen von DATEI2.\n"
+" %= Zeilen, die sowohl zu DATEI1 als auch zu DATEI2 gehören.\n"
+" %[-][BREITE][.[PRÄZ]]{doxX}BUCHST Ausgabe nach printf-Regeln für "
+"BUCHST.\n"
+" Folgende BUCHTSTaben gelten für neue Gruppen, Kleinschreibung für "
+"alte:\n"
+" F Erste Zeilennummer.\n"
+" L Letzte Zeilennummer.\n"
+" N Zahl der Zeilen = L-F+1.\n"
+" E F-1.\n"
+" M L+1.\n"
+" %(A=B?T:E) Falls A gleich B, dann T, sonst E."
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT kann (nur) enthalten:\n"
+" %L Inhalt der Zeile.\n"
+" %l Inhalt der Zeile, ohne Zeilenumbruch am Ende.\n"
+" %[-][BREITE][.[PRÄZ]]{doxX}n Zeilennummer im printf-Stil."
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT und LFMT können enthalten:\n"
+" %% %\n"
+" %c'C' das einzelne Zeichen C\n"
+" %c'\\OOO' das Zeichen mit dem Oktalcode OOO\n"
+" C Das Zeichen C (andere Zeichen stellen sich selbst dar)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal Aufwendig nach einem kleineren Satz von Änderungen "
+"suchen."
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=ZAHL ZAHL Zeilen mit gemeinsamem Prä- und Suffix "
+"behalten."
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files Es werden große Dateien und viele verstreute, "
+"kleine\n"
+" Änderungen vermutet."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal Ein normales Diff ausgeben (Standard)."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help Diese Hilfe anzeigen und beenden."
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, -version Versionsinformation ausgeben und beenden."
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"DATEIEN sind »DATEI1 DATEI2« oder »VERZ1 VERZ2« oder »VERZ DATEI...«\n"
+"oder »DATEI... VERZ«."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Wenn --from-file oder --to-file angegeben werden, gibt es keine\n"
+"Einschränkungen für DATEI(EN)."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Wenn DATEI »-« ist, von der Standardeingabe lesen."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Aufruf: %s [OPTION]... DATEIEN\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "DATEIEN Zeile für Zeile vergleichen."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "Widersprüchlicher %s-Optionswert »%s«."
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "Widersprüchliche Optionen für den Ausgabestil."
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "ungültige Breite »%s«."
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Nur in %s: %s.\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "»-« kann nicht mit Verzeichnis verglichen werden."
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "Option -D nicht unterstützt bei Verzeichnissen"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Gemeinsame Unterverzeichnisse: %s und %s.\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Datei %s ist ein %s, während Datei %s ein %s ist.\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Symbolische Verknüpfungen %s und %s sind verschieden.\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Dateien %s und %s sind identisch.\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "Inkompatible Optionen."
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "»-« für mehr als eine Eingabedatei angegeben."
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "Lesefehler."
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all Alle Änderungen ausgeben, Konflikte in Klammern."
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed ed-Script ausgeben, das die Änderungen\n"
+" von DEINEDATEI und ALTEDATEI in MEINEDATEI\n"
+" integriert."
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E --show-overlap Wie -e, aber Konflikte in Klammern."
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only Wie -e, aber nur nichtüberlappende Änderungen "
+"integrieren."
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only Wie -e, aber nur überlappende Änderungen "
+"integrieren."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X Wie -x, aber Konflikte in Klammern."
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i An ed-Skripte »w«- und »q«-Befehle anhängen."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge Zusammengefügte Datei ausgeben, wie -A,\n"
+" falls keine anderen Optionen übergeben wurden."
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Alle Dateien als Text behandeln."
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Wagenrücklauf (CR) am Zeilenende beim Einlesen "
+"entfernen."
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Einrückungen durch vorangestellte Tabulatoren "
+"erzeugen."
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAMM PROGRAMM zum Vergleichen von Dateien verwenden."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=LABEL LABEL statt des Dateinamens benutzen\n"
+" (kann bis zu dreimal wiederholt werden)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help Diese Hilfe anzeigen und beenden."
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version Versionsinformation ausgeben und beenden."
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Aufruf: %s [OPTION]... MEINEDATEI ALTEDATEI DEINEDATEI\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Drei Dateien Zeile für Zeile vergleichen."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Das Standardausgabeformat ist eine einigermaßen menschenlesbare\n"
+"Darstellung der Änderungen.\n"
+"\n"
+"Die Optionen -e, -E, -x und -X (und deren entsprechende lange Versionen)\n"
+"erzeugen ein ed-Skript als Ausgabe statt des Standards.\n"
+"\n"
+"Abschließend versucht die Option -m (--merge), dass diff3 die Änderungen\n"
+"intern zusammenführt und die eigentliche, zusammengeführte Datei ausgegeben\n"
+"wird. Für ungewöhnliche Eingaben ist dies robuster, als ed zu benutzen.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Der Rückgabewert des Programms ist 0, falls es erfolgreich ist, 1 falls\n"
+"es Konflikte gibt und 2 falls Probleme auftreten."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "Interner Fehler: Format für diff-Blöcke ist durcheinander."
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: »diff« ist gescheitert: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "Interner Fehler: Ungültiger diff-Typ in process_diff."
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "Ungültiges Diff-Format; ungültiger Änderungstrenner."
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "Ungültiges Diff-Format; fehlende letzte Zeile."
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "Unterprogramm »%s« konnte nicht aufgerufen werden."
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "Ungültiges Diff-Format; inkorrektes Zeichen in führender Zeile"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "Interner Fehler: Ungültiger diff-Typ an Ausgabe übergeben."
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "Eingabedatei schrumpfte."
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "Die Dateinamen »%s« und »%s« können nicht verglichen werden."
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: Rekursive Verzeichnisschleife"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=DATEI Interaktiv arbeiten, Ausgabe in DATEI speichern."
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i, --ignore-case Nicht zwischen Groß- und Kleinschreibung "
+"unterscheiden."
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Änderungen aufgrund von Tabausdehnungen "
+"ignorieren."
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space Freiraum am Zeilenende ignorieren."
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Änderungen im Leerraum ignorieren."
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space Leerraum ignorieren."
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines Die Änderungen übergehen, wo die Zeilen leer "
+"sind."
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Änderungen ignorieren, bei denen alle "
+"Zeilen\n"
+" auf das Muster RE passen."
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Wagenrücklauf (CR) am Zeilenende beim Einlesen "
+"entfernen."
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Alle Dateien als Text betrachten."
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=ZAHL Maximale ZAHL Druckspalten pro Zeile (Vorgabe: "
+"130)."
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column Nur linke Spalte der gemeinsamen Zeilen "
+"ausgeben."
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines Keine gemeinsamen Zeilen ausgeben."
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs Tabulatoren in der Ausgabe zu Leerzeichen "
+"ausdehnen."
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ZAHL Tabulatorstopps sind alle ZAHL Spalten "
+"(Vorgabe: 8)."
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal Aufwendig nach einem kleineren Satz von "
+"Änderungen suchen."
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files Es werden große Dateien und viele verstreute, "
+"kleine\n"
+" Änderungen vermutet."
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAMM PROGRAMM zum Vergleichen von Dateien verwenden."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help Diese Hilfe anzeigen und beenden."
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, -version Versionsinformation ausgeben und beenden."
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Aufruf: %s [OPTION]... DATEI1 DATEI2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr ""
+"Nebeneinanderstehendes Zusammenbringen der Unterschiede zwischen\n"
+"DATEI1 und DATEI2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "Die Standardeingabe kann nicht interaktiv gemischt werden."
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "Beide zu vergleichende Dateien sind Verzeichnisse."
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEditieren, dann beide Versionen benutzen, jede mit einem Kopf "
+"dekoriert.\n"
+"eb:\tEditieren, dann beide Versionen benutzen.\n"
+"el oder e1:\tEditieren, dann linke Version benutzen.\n"
+"er oder e2:\tEditieren, dann rechte Version benutzen.\n"
+"e:\tBeide Versionen verwerfen und dann eine neue Version editieren.\n"
+"l:\tLinke Version benutzen.\n"
+"r:\tRechte Version benutzen.\n"
+"s:\tStillschweigend gemeinsame Zeilen übernehmen.\n"
+"v:\tAusführlich gemeinsame Zeilen übernehmen.\n"
+"q:\tBeenden.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: Unbekannte Option »--%s«.\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the file named COPYING."
+#~ msgstr ""
+#~ "Dieses Programm wird ohne Gewährleistung geliefert, soweit dies\n"
+#~ "gesetzlich zulässig ist. Sie können es unter den Bedingungen der GNU\n"
+#~ "General Public License weitergeben. \n"
+#~ "Details dazu enthält die Datei COPYING."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ungültige Option -- %c.\n"
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Geschrieben von Torbjorn Granlund und David MacKenzie."
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s -quiet --silent Keine Ausgabe; nur den Exit-Status setzen."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Nur diese Hilfe zeigen."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Fehlerberichte bitte an <bug-gnu-utils@gnu.org>."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Geschrieben von Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman und Len Tower."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "Die Option »-%ld« ist veraltet; verwenden Sie »-%c %ld«."
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "Die Option »-%ld« ist veraltet; lassen Sie sie weg."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ " -c, -C ZAHL, --context[=ZAHL] ZAHL Zeilen des kopierten Kontextes "
+#~ "ausgeben\n"
+#~ " (Vorgabe: 3).\n"
+#~ " -u, -U ZAHL, --unified[=ZAHL] ZAHL Zeilen des \"unifizierten\" "
+#~ "Kontextes ausgeben\n"
+#~ " (Vorgabe: 3).\n"
+#~ " --label LABEL LABEL statt Dateiname verwenden.\n"
+#~ " -p, --show-c-function Anzeigen, in welcher C-Funktion die "
+#~ "Veränderung\n"
+#~ " vorkommt.\n"
+#~ " -F RE, --show-function-line=RE Die nächste Zeile anzeigen, auf die RE "
+#~ "zutrifft."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y -side-by-side In zwei Spalten ausgeben.\n"
+#~ " -W ZAHL --width=ZAHL Maximal ZAHL Zeichen pro Zeile ausgeben(Vorgabe: "
+#~ "130).\n"
+#~ " --left-column Nur linke Spalte gemeinsamer Zeilen ausgeben.\n"
+#~ " ---suppress-common-lines Keine gemeinsamen Zeilen ausgeben."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Es werden große Dateien und viele Änderungen "
+#~ "vermutet."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Überlappende Änderungen geklammert ausgeben."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Zusammengeführte Datei anstelle von ed-Skript ausgeben "
+#~ "(Vorgabe -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L LABEL --label=LABEL LABEL anstelle des Dateinamens verwenden."
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "Unterprogramm »%s« schlug fehl."
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "Unterprogramm »%s« ist nicht ausführbar."
diff --git a/po/diffutils.pot b/po/diffutils.pot
new file mode 100644
index 0000000..e46b771
--- /dev/null
+++ b/po/diffutils.pot
@@ -0,0 +1,1349 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# This file is distributed under the same license as the GNU diffutils package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.5\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\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"
+
+#: lib/argmatch.c:133
+#, c-format
+msgid "invalid argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+msgid "Valid arguments are:"
+msgstr ""
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr ""
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr ""
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr ""
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr ""
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr ""
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr ""
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr ""
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr ""
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr ""
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr ""
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr ""
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr ""
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+msgid "multiplexed block special file"
+msgstr ""
+
+#: lib/file-type.c:84
+msgid "multiplexed character special file"
+msgstr ""
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+msgid "named file"
+msgstr ""
+
+#: lib/file-type.c:93
+msgid "network special file"
+msgstr ""
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr ""
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr ""
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr ""
+
+#: lib/getopt.c:619
+#, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr ""
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr ""
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr ""
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr ""
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr ""
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr ""
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr ""
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr ""
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr ""
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr ""
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr ""
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr ""
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr ""
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr ""
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr ""
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr ""
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr ""
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr ""
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr ""
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr ""
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr ""
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr ""
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr ""
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr ""
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr ""
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr ""
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr ""
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr ""
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr ""
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr ""
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr ""
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr ""
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr ""
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr ""
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr ""
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr ""
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr ""
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr ""
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr ""
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr ""
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr ""
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr ""
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr ""
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr ""
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr ""
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr ""
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr ""
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr ""
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr ""
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr ""
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr ""
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr ""
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr ""
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr ""
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr ""
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr ""
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr ""
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr ""
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr ""
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+msgid " or 'auto' (the default)"
+msgstr ""
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr ""
+
+#: src/diff.c:981
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr ""
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr ""
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr ""
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr ""
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr ""
+
+#: src/diff.c:1057
+#, c-format
+msgid "invalid color '%s'"
+msgstr ""
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr ""
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr ""
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr ""
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr ""
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr ""
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr ""
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr ""
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr ""
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr ""
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr ""
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr ""
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr ""
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr ""
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr ""
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr ""
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr ""
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr ""
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr ""
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr ""
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr ""
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr ""
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr ""
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr ""
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr ""
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr ""
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr ""
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr ""
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr ""
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr ""
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr ""
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr ""
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr ""
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr ""
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+
+#: src/util.c:663
+#, c-format
+msgid "unrecognized prefix: %s"
+msgstr ""
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/el.gmo b/po/el.gmo
new file mode 100644
index 0000000..4f92c73
--- /dev/null
+++ b/po/el.gmo
Binary files differ
diff --git a/po/el.po b/po/el.po
new file mode 100644
index 0000000..e19a028
--- /dev/null
+++ b/po/el.po
@@ -0,0 +1,1531 @@
+# translation of diffutils to Greek
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+# Lefteris Dimitroulakis <edimitro@tee.gr>, 2004.
+# Lefteris Dimitroulakis <ledimitro@gmail.com>, 2013, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils-3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2014-11-28 23:51+0200\n"
+"Last-Translator: Lefteris Dimitroulakis <ledimitro@gmail.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: 8bit\n"
+"X-Generator: Lokalize 1.5\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "μη έγκυρο %s%s όρισμα «%s»"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "μη έγκυρο %s%s όρισμα «%s»"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "σφάλμα προγράμματος"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "υπερχείλιση στοίβας"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Άγνωστο σφάλμα συστήματος"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "τυπικό κενό αρχείο"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "τυπικό αρχείο"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "κατάλογος"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "συμβολικός σύνδεσμος"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "ουρά μηνύματος"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "σηματοφορέας"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "αντικείμενο κοινόχρηστης μνήμης"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "typed memory object"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "ειδικό αρχείο μπλοκ"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "ειδικό αρχείο χαρακτήρων"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "ειδικό αρχείο μπλοκ"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "ειδικό αρχείο χαρακτήρων"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "αλλόκοτο αρχείο"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "ειδικό αρχείο μπλοκ"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "αλλόκοτο αρχείο"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: η επιλογή «%s» είναι ασαφής·επιλογές:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: η επιλογή «-W %s» είναι ασαφής\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: η επιλογή «--%s» δεν επιτρέπει όρισμα\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: η επιλογή «%c%s» δεν επιτρέπει όρισμα\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: η επιλογή «--%s» απαιτεί όρισμα\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: η επιλογή «--%s» δεν αναγνωρίζεται\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: η επιλογή «%c%s» δεν αναγνωρίζεται\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: η επιλογή -- «%c» δεν είναι έγκυρη\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: η επιλογή απαιτεί όρισμα -- «%c»\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: η επιλογή «-W %s» είναι ασαφής\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: η επιλογή «-W %s» δεν επιτρέπει όρισμα\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: η επιλογή «-W %s» απαιτεί όρισμα\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "«"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "»"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Επιτυχία"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Δεν υπάρχει ταίριασμα"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Μη έγκυρη κανονική έκφραση"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Μη έγκυρος χαρακτήρας διαταξινόμησης"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Μη έγκυρο όνομα κλάσεως χαρακτήρων"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Αντιπλαγία στο τέλος"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Άκυρη πίσω παραπομπή"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Δε βρέθηκε [ ή [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Δε βρέθηκε ( ή \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Δε βρέθηκε \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Το περιεχόμενο του \\{\\} είναι άκυρο"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Άκυρο πέρας διαστήματος"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Η μνήμη εξαντλήθηκε"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Η προηγούμενη κανονική έκφραση είναι άκυρη"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Πρόωρο τέλος κανονικής έκφρασης"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Πολύ μεγάλη κανονική έκφραση"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Δε βρέθηκε ) ή \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Δεν προηγήθηκε κανονική έκφραση"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "η μνήμη εξαντλήθηκε"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "άγνωστο ρεύμα"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "αποτυχία ξανανοίγματος %s σε κατάσταση %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "μη έγκυρο %s%s όρισμα «%s»"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "μη έγκυρη κατάληξη «%s» στο όρισμα %s%s"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s όρισμα «%s» πολύ μεγάλο"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Packaged by %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Packaged by %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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"
+"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"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Γράφτηκε από %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Γράφτηκε από %s και %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Γράφτηκε από %s, %s,και %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Γράφτηκε από τους %s, %s, %s,\n"
+"και %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Γράφτηκε από τους %s, %s, %s,\n"
+"%s, και %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Γράφτηκε από τους %s, %s, %s,\n"
+"%s, %s, και %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Report bugs to: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Report %s bugs to: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s home page: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s home page: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Γενική βοήθεια στη χρήση λογισμικού GNU: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Τα αρχεία %s και %s διαφέρουν\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Τα δυαδικά αρχεία %s και %s διαφέρουν\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Δεν υπάρχει χαρακτήρας νέας γραμμής στο τέλος του αρχείου"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Δοκιμάστε «%s --help» για περισσότερες πληροφορίες."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "άκυρη τιμή --ignore-initial «%s»"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "οι επιλογές -l και -s είναι ασύμβατες"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "η εγγραφή απέτυχε"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "κανονική έξοδος"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes Εμφανίζει bytes που διαφέρουν."
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SKIP Παράβλεψη των πρώτων SKIP bytes και των δύο "
+"εισόδων"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SKIP1:SKIP2 παράβλεψη των πρώτων SKIP1 bytes του "
+"αρχείου FILE1 και\n"
+" των πρώτων SKIP2 bytes του αρχείου FILE2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose Έξοδος αριθμού και τιμής όλων των bytes που διαφέρουν."
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=ΟΡΙΟ Σύγκριση το πολύ ΟΡΙΟ bytes."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent απάλειψη κανονικής εξόδου"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version εμφάνιση πληροφοριών έκδοσης κι έξοδος"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... ΑΡΧΕΙΟ1 [ΑΡΧΕΙΟ2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Σύγκριση δύο αρχείων byte προς byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Οι προαιρετικές παράμετροι SKIP1 και SKIP2 καθορίζουν τον αριθμό των bytes "
+"προς παράβλεψη\n"
+"στην αρχή κάθε αρχείου (η προεπιλογή είναι μηδέν)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Υποχρεωτικά ορίσματα στις μακρές επιλογές είναι υποχρεωτικά και στις κοντές "
+"επιλογές επίσης.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Οι τιμές SKIP μπορούν ν' ακολουθούνται\n"
+"από τα παρακάτω πολαπλασιαστικά επιθέματα :\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, κτλ γιά T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Αν ένα ΑΡΧΕΙΟ είναι «-» ή απών, τότε ανάγνωση από την κανονική είσοδο."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Η έξοδος είναι 0 αν τα δεδομένα αρχεία είναι ίδια, 1 αν είναι διαφορετικά,\n"
+"2 αν υπάρχει πρόβλημα."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "άκυρη τιμή «%s» για την επιλογή --bytes "
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "απών τελεστέος μετά από «%s»"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "συμπληρωματικός τελεστέος «%s»"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s διαφέρουν: byte %s, γραμμή %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s διαφέρουν: byte %s, γραμμή %s είναι %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: Τέλος-Αρχείου (EOF) σε %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "μη έγκυρο μήκος συμφραζομένων «%s»"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "Η αρίθμιση σελίδων δεν υποστηρίζεται σ' αυτόν τον υπολογιστή"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "πάρα πολλές επιλογές ετικέττας αρχείου"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "άκυρο πλάτος «%s»"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "αντικρουόμενες επιλογές πλάτους"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "άκυρο μήκος ορίζοντα «%s»"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "άκυρο μήκος στηλοθέτησης `%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "αντικρουόμενες επιλογές μήκους στηλοθέτησης"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file και --to-file έχουν οριστεί μαζί"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal Δημιουργία ενός κανονικού `diff' (προεπιλογή)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief αποτέλεσμα στην έξοδο μόνο αν τ' αρχεία διαφέρουν"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files Ειδοποιεί όταν δύο αρχεία είναι ίδια"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=NUM] έξοδος NUM (προεπιλογή 3) γραμμές of copied "
+"context"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed εμφανίζει ένα ed script"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Δημιουργία αρχείου «diff» σε μορφή RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side έξοδος σε δυο στήλες"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+"--left-column Εμφάνιση μόνο της αριστερής στήλης των ταυτόσημων γραμμών."
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Οι ταυτόσημες γραμμές δεν εμφανίζονται."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function εμφάνιση σε ποιά συνάρτηση C βρίσκεται κάθε αλλαγή"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RE εμφάνιση του πιο πρόσφατου ταιριάσματος "
+"γραμμής RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"-L, --label=LABEL χρήση LABEL αντί ονόματος αρχείου\n"
+" (μπορεί να επαναληφθεί)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs Μετατροπή στηλοθετών σε διαστήματα στην έξοδο."
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Στοίχιση των στηλοθετών με την επιπρόσθεση ενός στην "
+"αρχή."
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ΑΡ Ο αριθμός διαστημάτων του στηλοθέτη είναι ΑΡ (προεπιλογή 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty απάλειψη διαστήματος ή στ/θέτη πριν από κενές "
+"γραμμές στην έξοδο"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+" -l, --paginate Έξοδος δια μέσου του «pr» ώστε να αριθμιθούν οι σελίδες"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r, --recursive Αναδρομική σύγκριση όσων υποκαταλόγων βρεθούν"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference μην ακολουθείς συμβολικούς συνδέσμους"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file Θεωρεί τα απόντα αρχεία ως κενά"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr "--unidirectional-new-file Θεωρεί τα απόντα πρώτα αρχεία ως κενά."
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+"--ignore-file-name-case Αγνοεί τις διαφορές λόγω πεζών-κεφαλαίων\n"
+" κατά τη σύγκριση ονομάτων αρχείων."
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case Λαμβάνει υπ' όψιν τις διαφορές λόγω\n"
+" πεζών-κεφαλαίων κατά τη σύγκριση ονομάτων αρχείων."
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=PAT Εξαίρεση αρχείων με όνομα που ταιριάζει με PAT."
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=ΑΡΧΕΙΟ Εξαίρεση αρχείων με όνομα που ταιράζει\n"
+" με τα ονόματα που βρίσκονται στο ΑΡΧΕΙΟ"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=ΑΡΧΕΙΟ Εκκίνηση σύγκρισης καταλόγων από το ΑΡΧΕΙΟ"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=ΑΡΧΕΙΟ1 Σύγκριση ΑΡΧΕΙΟ1 με όλους τους τελεστέους·\n"
+" ΑΡΧΕΙΟ1 μπορεί να είναι κατάλογος"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=ΑΡΧΕΙΟ2 Σύγκριση όλων των τελεστέων στο ΑΡΧΕΙΟ2·\n"
+" ΑΡΧΕΙΟ2 μπορεί να είναι κατάλογος"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case Αγνοεί τις διαφορές λόγω πεζών-κεφαλαίων στα περιεχόμενα "
+"των αρχείων"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Αγνοεί αλλαγές οφειλόμενες στη στηλοθέτηση"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space αγνοεί λευκά διαστήματα στο τέλος γραμμής"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change Αγνοεί αλλαγές οφειλόμενες στον αριθμό λευκών "
+"διαστημάτων."
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space Αγνοεί όλα τα λευκά διαστήματα."
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines Αγνοεί αλλαγές οφειλόμενες στις λευκές γραμμές"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Αγνοεί αλλαγές που οι γραμμές τους "
+"ταιριάζουν με RE."
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Θεωρεί όλα τα αρχεία ως κείμενο."
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Απαλειφή του χαρακτήρα επιστροφής στην είσοδο."
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Ανάγνωση και εγγραφή πληροφορίας σε δυαδική μορφή."
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=ΟΝΟΜΑ Έξοδος συγχωνευμένου αρχείου με τις διαφορές «#ifdef "
+"NAME»."
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr "--GTYPE-group-format=GFMT μορφοποίηση ομάδων εισόδου GTYPE με GFMT."
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+"--line-format=LFMT μορφοποίηση όλων των γραμμών εισόδου με LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr "--LTYPE-line-format=LFMT μορφοποίηση γραμμών εισόδου LTYPE με LFMT."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+"Αυτές οι επιλογές μορφής παρέχουν λεπτομερή έλεγχο πάνω στην έξοδο\n"
+" του diff, γενικεύοντας -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE είναι «old», «new», ή «unchanged». GTYPE είναι LTYPE ή «changed»."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+"GFMT μπορεί να περιέχει:\n"
+" %< για να δηλώνει γραμμές από το ΑΡΧΕΙΟ1\n"
+" %> για να δηλώνει γραμμές από το ΑΡΧΕΙΟ2\n"
+" %= για να δηλώνει ταυτόσημες γραμμές μεταξύ των ΑΡΧΕΙΟ1 και ΑΡΧΕΙΟ2\n"
+" %[-][ΠΛΑΤΟΣ][.[PREC]]{doxX}ΓΡΑΜΜΑ, προδιαγραφές του ΓΡΑΜΜΑτος\n"
+" στο στύλ της printf(), ως ακολούθως γιά τη νέα ομάδα\n"
+" ενώ με πεζά για τη παλαιά ομάδα:\n"
+" F αριθμός πρώτης γραμμής\n"
+" L αριθμός τελευταίας γραμμής\n"
+" N αριθμός γραμμών = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) αν A ίσον B τότε T αλλιώς E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT μπορεί να περιέχει:\n"
+" %L για το περιεχόμενο της γραμμής\n"
+" %l για το περιεχόμενο της γραμμής χωρίς το τέλος γραμμής\n"
+" %[-][ΠΛΑΤΟΣ][.[PREC]]{doxX}n την προδιαγραφή του αριθμού γραμμής\n"
+" εισόδου κατά τη μορφή της printf()"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT και LFMT μπορεί να περιέχουν:\n"
+" %% %\n"
+" %c'C' το μοναδικό χαρακτήρα C\n"
+" %c'\\OOO' το χαρακτήρα με οκταδικό κωδικό OOO\n"
+" C το χαρακτήρα C (οι άλλοι χαρακτήρες αναπαριστούν τον εαυτόν τους)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal προσπάθεια εύρεσης μικρότερου συνόλου διαφορών."
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+"--horizon-lines=ΑΡ Διατηρεί ΑΡ γραμμές με ταυτόσημα προθέματα κι επιθέματα."
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"--speed-large-files Υποθέτει μεγάλα αρχεία με πολλές σκόρπιες μικροαλλαγές."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal Δημιουργία ενός κανονικού `diff' (προεπιλογή)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Εμφάνιση πληροφοριών έκδοσης κι έξοδος"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"ΑΡΧΕΙΑ είναι «ΑΡΧΕΙΟ1 ΑΡΧΕΙΟ2» ή «ΚΑΤ1 ΚΑΤ2» ή «ΚΑΤ ΑΡΧΕΙΟ...» ή «ΑΡΧΕΙΟ..."
+"ΚΑΤ»."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Αν δίδεται το --from-file ή το --to-file, τότε δεν υπάρχει περιορισμός στα "
+"ΑΡΧΕΙΑ."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Αν ένα ΑΡΧΕΙΟ είναι «-», τότε ανάγνωση από την τυπική είσοδο."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... ΑΡΧΕΙΑ\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Σύγκριση αρχείων γραμμή προς γραμμή."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "η επιλογή %s είναι αντικρουόμενη με την τιμή «%s»"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "αντικρουόμενες επιλογές για τη μορφή εξόδου"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "άκυρο πλάτος «%s»"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Μόνο στο %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "Αδύνατη η σύγκριση του «-» με ένα κατάλογο"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "Η επιλογή -D δεν υποστηρίζεται για καταλόγους"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Οι υποκατάλογοι %s και %s είναι ταυτόσημοι\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Το αρχείο %s είναι %s ενώ το αρχείο %s είναι %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Οι συμβολικοί σύνδεσμοι %s και %s διαφέρουν\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Τα αρχεία %s καί %s είναι πανομοιότυπα\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "ασύμβατες επιλογές"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "«-» ορίστηκε για περισσότερα από ένα αρχεία εισόδου"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "αποτυχία ανάγνωσης"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A --show-all Έξοδος όλων των διαφορών σε αγκύλες."
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed έξοδος ενός ed script που περιλαμβάνει τις αλλαγές από OLDFILE σε "
+"YOURFILE στο MYFILE"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap όπως -e, αλλά οι διαφορές σε αγκύλες"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only όπως -e, αλλά περιλαμβάνει μόνο τις μη "
+"αλληλοεπικαλυπτόμενες αλλαγές"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only όπως -e, αλλά περιλαμβάνει μόνο τις αλληλοκαλυπτόμενες "
+"αλλαγές"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X like -x, but bracket conflicts"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i προσάρτηση των εντολών «w» και «q» στα σενάρια του «ed»"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge έξοδος του συγχωνευμένου αρχείου σύμφωνα με την\n"
+" -A αν δεν δίνεται άλλη επιλογή"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Θεωρεί όλα τα αρχεία ως κείμενο."
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Απαλειφή του χαρακτήρα επιστροφής στην είσοδο."
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab στοίχιση των στηλοθετών με την επιπρόσθεση ενός στην "
+"αρχή."
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=ΠΡΟΓΡ Χρήση του ΠΡΟΓΡάμματος στη σύγκριση αρχείων."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=LABEL χρήση LABEL αντί ονόματος αρχείου\n"
+" (μπορεί να επαναληφθεί μέχρι τρεις φορές)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version εμφάνιση πληροφοριών έκδοσης κι έξοδος"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... MYFILE OLDFILE YOURFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Σύγκριση τριών αρχείων γραμμή προς γραμμή."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Η προεπιλεγμένη μορφή εξόδου είναι η λίγο πολύ αναγνώσιμη αναπαράσταση των "
+"αλλαγών.\n"
+"\n"
+"Οι -e, -E, -x, -X (και οι αντίστοιχες μακρές) επιλογές δημιουργούν ένα ed "
+"script\n"
+"στην έξοδο αντί της προεπιλογής.\n"
+"\n"
+"Τελικά, η επιλογή -m (--merge) υποχρεώνει το diff3 να κάνει τη συγχώνευση "
+"εσωτερικά\n"
+"και να εμφανίσει στην έξοδο το συγχωνευμένο αρχείο. Για μη συνηθισμένη "
+"είσοδο, αυτό είναι\n"
+"σταθερότερο απο την χρήση του ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Σε επιτυχία η έξοδος είναι 0, σε σύγκρουση 1 και σε πρόβλημα 2."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "εσωτερικό σφάλμα: μπέρδεμα στις μορφές των μπλοκ diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: αποτυχία του diff: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "εσωτερικό σφάλμα: άκυρος τύπος diff στο process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "άκυρη μορφή diff· άκυρος οριοθέτης αλλαγής"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "άκυρη μορφή diff· ασυμπλήρωτη τελευταία γραμμή"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "το υποπρόγραμμα «%s» δεν ήταν δυνατόν να κληθεί"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "άκυρη μορφή diff· λάθος χαρακτήρες στη γραμμή αποτελεσμάτων"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "εσωτερικό σφάλμα: άκυρος τύπος diff πέρασε στην έξοδο"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "Το αρχείο εισόδου συρρικνώθηκε"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "αδύνατη η σύγκριση των ονομάτων αρχείων «%s» και «%s»"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: αναδρομικός βρόχος στον κατάλογο"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=ΑΡΧΕΙΟ Αλληλεπιδραστική λειτουργία με αποστολή εξόδου στο "
+"ΑΡΧΕΙΟ."
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case Θεωρεί πεζά-κεφαλαία ίδια"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Αγνοεί αλλαγές οφειλόμενες στη στηλοθέτηση"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space αγνοεί το λευκό διάστημα στο τέλος γραμμής"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change αγνοεί αλλαγές οφειλόμενες στον αριθμό λευκών "
+"διαστημάτων"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space Αγνοεί όλα τα λευκά διαστήματα."
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines Αγνοεί αλλαγές οφειλόμενες στις λευκές γραμμές"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE αγνοεί αλλαγές που οι γραμμές τους "
+"ταιριάζουν με RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Απαλειφή του χαρακτήρα επιστροφής στην είσοδο"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Θεωρεί όλα τα αρχεία ως κείμενο"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=ΑΡ Έξοδος με το πολύ ΑΡ στήλες εκτύπωσης (προεπιλογή 130)."
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l, --left-column Εμφάνιση στην αριστερή στήλη των κοινών γραμμών"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines Οι ταυτόσημες γραμμές δεν εμφανίζονται"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs Μετατροπή στηλοθετών σε διαστήματα στην έξοδο"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ΑΡ Ο αριθμός διαστημάτων του στηλοθέτη είναι ΑΡ (προεπιλογή 8) "
+"στήλες"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal προσπάθεια εύρεσης μικρότερου συνόλου αλλαγών"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files Υποθέτει μεγάλα αρχεία με πολλές σκόρπιες "
+"μικροδιαφορές"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=ΠΡΟΓΡ Χρήση του ΠΡΟΓΡάμματος στη σύγκριση αρχείων"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help εμφάνιση αυτής εδώ της βοήθειας κι έξοδος "
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v --version ονόμα, έκδοση κι έξοδος"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Χρήση: %s [ΕΠΙΛΟΓΗ]... ΑΡΧΕΙΟ1 ΑΡΧΕΙΟ2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Συγχώνευση δίπλα-δίπλα των διαφορών των ΑΡΧΕΙΟ1 και ΑΡΧΕΙΟ2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "αδυνατώ να συγχωνεύσω αλληλεπιδραστικά την πρότυπη είσοδο."
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "και τα δύο προς σύγκριση αρχεία είναι κατάλογοι"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tΔιόρθωση και μετά χρήση και των δύο παραλλαγών,\n"
+"εκάστη διακοσμημένη με επικεφαλίδα.\n"
+"eb:\tΔιόρθωση και μετά χρήση και των δύο παραλλαγών.\n"
+"el:\tΔιόρθωση και μετά χρήση της αριστερής παραλλαγής.\n"
+"er:\tΔιόρθωση και μετά χρήση της δεξιάς παραλλαγής.\n"
+"e:\tΔιόρθωση νέας παραλλαγής.\n"
+"l:\tΧρήση αριστερής παραλλαγής.\n"
+"r:\tΧρήση δεξιάς παραλλαγής.\n"
+"s:\tΣυμπεριλαμβάνει τις ταυτόσημες γραμμές σιωπηρά.\n"
+"v:\tΣυμπεριλαμβάνει τις ταυτόσημες γραμμές και το επισημαίνει.\n"
+"q:\tΈξοδος.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: η επιλογή «--%s» δεν αναγνωρίζεται\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-v, --version output version information and exit"
+#~ msgstr "-v --version εμφάνιση έκδοσης κι έξοδος."
+
+#~ msgid " --label LABEL use LABEL instead of file name (can be repeated)"
+#~ msgstr ""
+#~ " --label LABEL χρήση LABEL αντί ονόματος αρχείου (μπορεί να "
+#~ "επαναληφθεί)"
diff --git a/po/en@boldquot.header b/po/en@boldquot.header
new file mode 100644
index 0000000..fedb6a0
--- /dev/null
+++ b/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/po/en@quot.header b/po/en@quot.header
new file mode 100644
index 0000000..a9647fc
--- /dev/null
+++ b/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/po/eo.gmo b/po/eo.gmo
new file mode 100644
index 0000000..4bdd1a6
--- /dev/null
+++ b/po/eo.gmo
Binary files differ
diff --git a/po/eo.po b/po/eo.po
new file mode 100644
index 0000000..10dd52d
--- /dev/null
+++ b/po/eo.po
@@ -0,0 +1,1523 @@
+# Esperantaj mesaĝoj por GNU diffutils.
+# Copyright (C) 1996, 2001, 2002, 2004, 2013 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Edmund GRIMLEY EVANS <edmundo@rano.org>, 2001, 2002, 2003, 2004.
+# Felipe Castro <fefcas@gmail.com>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2013-10-31 13:16-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-Generator: Poedit 1.5.4\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "malvalida %s%s-argumento '%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "malvalida %s%s-argumento '%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "program-eraro"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stako tro granda"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Nekonata sistemeraro"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "normala malplena dosiero"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "normala dosiero"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "dosierujo"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "simbola ligo"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "mesaĝovico"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semaforo"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "komuna memoro"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "tipita memora objekto"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "blok-aparatdosiero"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "sign-aparatdosiero"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "blok-aparatdosiero"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "sign-aparatdosiero"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "stranga dosiero"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "blok-aparatdosiero"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "konektilo"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "stranga dosiero"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: la modifilo '%s' estas plursenca; ebloj:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: la modifilo '-W %s' estas plursenca\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: la modifilo '--%s' ne permesas argumenton\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: la modifilo '%c%s' ne permesas argumenton\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: la modifilo '--%s' postulas argumenton\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: nerekonata modifilo '--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: nerekonata modifilo '%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: malvalida modifilo -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: la modifilo postulas argumenton -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: la modifilo '-W %s' estas plursenca\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: la modifilo '-W %s' ne permesas argumenton\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: la modifilo '-W %s' postulas argumenton\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "‘"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "’"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sukceso"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nenia trafo"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Malvalida regulesprimo"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Malvalida ordiga signo"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Malvalida nomo de signoklaso"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Vosta retroklino"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Malvalida retroreferenco"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Neparigita [ aŭ [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Neparigita ( aŭ \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Neparigita \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Malvalida kunteksto de \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Malvalida intervalo-fino"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoro estas elĉerpita"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Malvalida antaŭa regulesprimo"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Neatendita fino de regulesprimo"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regula esprimo tro grandas"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Neparigita ) aŭ \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Mankas antaŭa regulesprimo"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoro elĉerpiĝis"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "ĉefenigujo"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "ĉefeligujo"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "ĉeferar-eligujo"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "nekonata fluo"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "malsukcesis remalfermi %s per reĝimo %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "malvalida %s%s-argumento '%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "malvalida sufikso en %s%s-argumento '%s'"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s-argumento '%s' tro larĝas"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Pakigita de %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Pakigita de %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Permeso GPLv3+: GNU GPL versio 3 aŭ posta <http://gnu.org/licenses/gpl."
+"html>.\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"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Verkita de %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Verkita de %s kaj %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Verkita de %s, %s, kaj %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Verkita de %s, %s, %s,\n"
+"kaj %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Verkita de %s, %s, %s,\n"
+"%s, kaj %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Raportu program-misojn al: %s\n"
+"\n"
+"Raportu tradukajn misojn al: <translation-team-eo@lists.sourceforge.net>\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Raportu %s misojn al: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s hejm-paĝo: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s hejm-paĝo: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Ĝenerala helpo por uzi programaron GNU: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Dosieroj %s kaj %s estas malsamaj\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Ciferecaj dosieroj %s kaj %s estas malsamaj\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Mankas linifino ĉe fino de dosiero"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn GRANLUND"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MACKENZIE"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Provu '%s --help' por pli da informoj."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "malvalida valoro '%s' de --ignore-initial"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "modifiloj -l kaj -s malakordas"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "skriberaro"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "normala eligo"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes eligi malsamajn bajtojn"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i N --ignore-initial=SALTO preterpasi la unuajn SALTO bajtojn de ambaŭ "
+"enigoj"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SALT1:SALT2 pretersalti la unuajn SALT1 bajtojn de\n"
+" DOSIERO1 kaj la unuajn SALT2 bajtojn\n"
+" de DOSIERO2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose montri numerojn kaj valorojn de ĉiuj malsamaj "
+"bajtoj"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMO kompari maksimume LIMO bajtojn"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent forkaŝi ĉiun normalan eligon"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help montri ĉi tiun helpon kaj eliri"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr " -v, --version eligi informon pri versio kaj eliri"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Uzmaniero: %s [MODIFILO]... DOSIERO1 [DOSIERO2 [SALT1 [SALT2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Kompari du dosierojn bajton post bajto."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"La nedevigaj SALT1 kaj SALT2 indikas la nombron da bajtoj por salti\n"
+"en la komenco de ĉiu dosiero (aprioras nulo)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Nepraj argumentoj por longaj modifiloj ankaŭ nepras por la mallongaj.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Valoroj de SALTO povas esti sekvataj de la sekvaj multobligaj sufiksoj:\n"
+"kB 1000, K 1024, MB 1 000 000, M 1 048 576,\n"
+"GB 1 000 000 000, G 1 073 741 824, kaj tiel plu por T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Se DOSIERO estas '-' aŭ mankas, legi la normalan enigon."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Elig-valoro estas 0 se enigoj estas samaj, 1 se malsamaj, 2 se problemaj."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "malvalida valoro '%s' de --bytes"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "mankas argumento post '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "superflua argumento '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s malsamas: bajto %s, linio %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s malsamas: bajto %s, linio %s estas %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF ĉe %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul EGGERT"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike HAERTEL"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David HAYES"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard STALLMANN"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len TOWER"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "malvalida longo '%s' de kunteksto"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "dispaĝigo ne eblas kun ĉi tiu sistemo"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "tro multe da dosier-etikedaj modifiloj"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "malvalida larĝo '%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "malakordaj modifiloj pri larĝo"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "malvalida horizonta longo '%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "malvalida TAB-larĝo '%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "malkongruaj modifiloj pri TAB-larĝo"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file kaj --to-file ambaŭ specifitaj"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal montri normalan malsamon (aprioras)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief montri nur kiam la dosieroj malsamas"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files montri kiam du dosieroj samas"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=NUM] montri NUM (aprioras 3) liniojn da kopiita "
+"kunteksto"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NUM, --unified[=NUM] montri NUM (aprioras 3) liniojn da unuigita "
+"kunteksto"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed montri ed-skripton"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs montri malsamon laŭ RCS-formo"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side montri en du kolumnoj"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NUM montri maksimume NUM (aprioras 130) kolumnojn"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column montri nur la maldekstran kolumnon de komunaj "
+"linioj"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines ne montri komunajn liniojn"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function montri en kiu C-funkcio ĉiu ŝanĝo estas"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RE montri la plej freŝa linio kongruanta al RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETIKEDO uzi ETIKEDOn anstataŭ dosiernomo\n"
+" (povas esti ripetata)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs etendigi tabojn al spacoj en la eligo"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab ĝustigi tabojn per antaŭmeto de tabo"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM tab-lokoj estas post ĉiuj NUM (aprioras 8) "
+"kolumnoj"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty forkaŝi spacon aŭ tabon antaŭ malplenaj "
+"eligitaj linioj"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate pasigi la eligon tra 'pr' por enpaĝigi ĝin"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive rikure kompari trovitajn subdosierujojn"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference ne sekvi simbolajn ligojn"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file trakti mankantajn dosierojn kiel malplenajn"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file trakti mankantajn unuajn dosierojn kiel "
+"malplenajn"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case preteratenti usklecon dum komparo de "
+"dosiernomoj"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case konsideri usklecon dum komparo de dosiernomoj"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=ŜABLONO forigi dosierojn, kiuj kongruas kun ŜABLONO"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=DOSIERO forigi dosierojn, kiuj kongruas kun iu "
+"ŝablono en DOSIERO"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=DOSIERO komenci per DOSIERO, komparante dosierujojn"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=DOSIERO1 kompari DOSIERO1 kun ĉiuj argumentoj;\n"
+" DOSIERO1 povas esti dosierujo"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=DOSIERO2 kompari ĉiujn argumentojn kun DOSIERO2;\n"
+" DOSIERO2 povas esti dosierujo"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case preteratenti malsamojn en uskleco en "
+"dosierenhavo"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion preteratenti ŝanĝojn kaŭzatajn de tab-"
+"etendigo"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space preteratenti blank-spacon ĉe linifino"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change preteratenti ŝanĝojn en kvanto da blank-spaco"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space preteratenti ĉiun blankan spacon"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines preteratenti ŝanĝojn, kie linioj estas ĉiuj "
+"malplenaj"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE preteratenti ŝanĝojn, kie ĉiuj linioj "
+"kongruas al RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text trakti ĉiujn dosierojn kiel tekstajn"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr forigi linifinan CR ĉe enigo"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary legi kaj skribi datumaron ciferece"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NOMO montri kunfanditan dosieron kun malsamoj "
+"'#ifdef NOMO'"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT enformigi enig-grupojn GTYPE per GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT enformigi ĉiujn enigliniojn per LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT enformigi enig-grupojn LTYPE per LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Tiuj enformigaj modifiloj provizas rafinitan regadon pri la eligo\n"
+" de diff, ĝeneraliganta -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE estas 'old', 'new' aŭ 'unchanged'. GTYPE estas LTYPE aŭ 'changed'."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (nur) povas enhavi:\n"
+" %< linioj el DOSIERO1\n"
+" %> linioj el DOSIERO2\n"
+" %= linioj komunaj al DOSIERO1 kaj DOSIERO2\n"
+" %[-][LARĜO][.[PREC]]{doxX}LITERO printf-stila indiko por LITERO\n"
+" LITEROJ estas jenaj por nova grupo, minuskle por malnova grupo:\n"
+" F unua lininumero\n"
+" L lasta lininumero\n"
+" N nombro de linioj = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) se A egalas al B, do T, male E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (nur) povas enhavi:\n"
+" %L enhavo de linio\n"
+" %l enhavo linio, sen eventuala linifino\n"
+" %[-][LARĜO][.[PREC]]{doxX}n printf-stila indiko de lininumero"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Kaj GFMT kaj LFMT povas enhavi:\n"
+" %% %\n"
+" %c'C' la unuopa signo C\n"
+" %c'\\000' la signo kun okuma kodo OOO\n"
+" C la signo C (aliaj signoj reprezentas ili mem)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal strebe serĉi pli etan aron da ŝanĝoj"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=NUM teni NUM liniojn de la komuna prefikso kaj sufikso"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files atendi grandajn dosierojn kaj multajn disajn "
+"ŝanĝetojn"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal montri normalan malsamon (aprioras)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help montri ĉi tiun helpon kaj eliri"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version montri informon pri versio kaj eliri"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"DOSIEROJ estas 'DOSIERO1 DOSIERO2' aŭ 'UJO1 UJO2' aŭ 'UJO DOSIERO...' aŭ "
+"'DOSIERO... UJO'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Se --from-file aŭ --to-file estas donita, ne estas limigoj por DOSIERO(j)."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Se DOSIERO estas '-', legi la ĉefenigujon."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Uzmaniero: %s [MODIFILO]... DOSIEROJ\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Kompari DOSIEROJn linion post linio."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "malakorda valoro de opcio %s: '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "malakordaj modifiloj pri elig-stilo"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "malvalida larĝo '%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Nur en %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "ne eblas kompari '-' al dosierujo"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "modifilo -D ne estas subtenata kun dosierujoj"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Komunaj subdosierujoj: %s kaj %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Dosiero %s estas %s, dum dosiero %s estas %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Simbolaj ligoj %s kaj %s malsamas\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Dosieroj %s kaj %s samas\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy SMITH"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "malkongruaj modifiloj"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' indikita por pli ol unu enigdosiero"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lego fiaskis"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all montri ĉiujn ŝanĝojn, kun konfliktoj inter "
+"krampoj"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed montri ed-skripton enkorpigantan ŝanĝojn\n"
+" de PRADOSIERO al VIADOSIERO en MIADOSIEROn"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap kiel -e, sed kun konfliktoj inter krampoj"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only kiel -e, sed enkorpigi nur ne-interkovriĝantajn "
+"ŝanĝojn"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only kiel -e, sed enkorpigi nur interkovriĝantajn "
+"ŝanĝojn"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X kiel -x, sed kun konfliktoj inter krampoj"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i aldoni la komandojn 'w' kaj 'q' al ed-skriptoj"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge montri veran kunfanditan dosieron, akorde al\n"
+" -A se neniu alia modifilo ĉeestas"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text trakti ĉiujn dosierojn kiel tekstajn"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr forigi linifinan CR ĉe enigo"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab ĝustigi tabojn per antaŭmeto de tabo"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAMO uzi PROGRAMOn por kompari dosierojn"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETIKEDO uzi ETIKEDOn anstataŭ dosiernomo\n"
+" (povas esti ripetata ĝis 3 fojoj)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help montri ĉi tiun helpon kaj eliri"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version eligi informon pri versio kaj eliri"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Uzmaniero: %s [MODIFILO]... MIADOSIERO PRADOSIERO VIADOSIERO\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Kompari tri dosierojn linion post linio."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"La apriora elig-formo estas iom hom-legebla reprezento de la ŝanĝoj.\n"
+"\n"
+"La modifiloj -e, -E, -x, -X (kaj korespondaj long-formoj) eligas ed-"
+"skripton\n"
+"anstataŭ la aprioron.\n"
+"\n"
+"Fine, la modifilo -m (--merge) igas ke diff3 kunfandu interne kaj\n"
+"eligu la veran kunfanditan dosieron. Por ne-ordinara enigo, tio ĉi estas\n"
+"pli fortika ol la uzo de ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Elig-valoro estas 0 por sukceso, 1 por konfliktoj, 2 por problemo."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "interna eraro: fuŝo en formato de diff-blokoj"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff malsukcesis: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "interna eraro: malvalida diff-speco en process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "malvalida diff-formato; malvalida ŝanĝ-apartigilo"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "malvalida diff-formato; malkompleta lasta linio"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "ne eblis alvoki la subprogramon '%s'"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "malvalida diff-formato; malĝusta signo en antaŭa linio"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "interna eraro: malvalida diff-speco donita al eligo"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "enigdosiero ŝrumpis"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "ne eblas kompari dosiernomojn '%s' kaj '%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rikura dosieruja ciklo"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas LORD"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=DOSIERO funkcii interage, sendante eligon al DOSIERO"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i, --ignore-case konsideri majusklojn kaj minusklojn kiel samajn"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion preteratenti ŝanĝojn kaŭzatajn de tab-etendigo"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space preteratenti ĉiun blank-spacon ĉe linifino"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change preteratenti ŝanĝojn en la kvanto da blank-"
+"spaco"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space preteratenti ĉiun blank-spacon"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines preteratenti ŝanĝojn, kie linioj estas ĉiuj "
+"malplenaj"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE preteratenti ŝanĝojn, kie ĉiuj linioj "
+"kongruas al RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr forigi linifinan CR ĉe enigo"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text trakti ĉiujn dosierojn kiel tekstajn"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=NUM montri maksimume NUM (aprioras 130) kolumnojn"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column montri nur la maldekstran kolumnon de komunaj "
+"linioj"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines ne eligi komunajn liniojn"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs etendigi tabojn al spacoj en la eligo"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM tab-lokoj estas post ĉiu NUM (aprioras 8) "
+"kolumnoj"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal strebe serĉi pli etan aron da ŝanĝoj"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files atendi grandajn dosierojn kaj multajn disajn "
+"ŝanĝetojn"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAMO uzi PROGRAMOn por kompari dosierojn"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help montri ĉi tiun helpon kaj eliri"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version montri informon pri versio kaj eliri"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Uzmaniero: %s [MODIFILO]... DOSIERO1 DOSIERO2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Apuda kunfando de malsamoj inter DOSIERO1 kaj DOSIERO2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "ne eblas interage kunfandi la ĉefenigujon"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "ambaŭ komparendaj dosieroj estas dosierujoj"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tredakti kaj uzi ambaŭ versiojn, ĉiu kun kaplinioj.\n"
+"eb:\tredakti kaj uzi ambaŭ versiojn.\n"
+"el aŭ e1:\tredakti kaj uzi maldekstran version.\n"
+"er aŭ e2:\tredakti kaj uzi dekstran version.\n"
+"e:\tredakti novan version.\n"
+"l aŭ 1:\tuzi maldekstran version.\n"
+"r aŭ 2:\tuzi dekstran version.\n"
+"s:\tsilente transpreni komunajn liniojn.\n"
+"v:\tlaŭte transpreni komunajn liniojn.\n"
+"q:\tĉesi.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: nerekonata modifilo '--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/es.gmo b/po/es.gmo
new file mode 100644
index 0000000..ff5465a
--- /dev/null
+++ b/po/es.gmo
Binary files differ
diff --git a/po/es.po b/po/es.po
new file mode 100644
index 0000000..e1ce803
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,1902 @@
+# Mensajes en español para GNU diffutils.
+# Copyright (C) 1996, 2001, 2002, 2004, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Iñaky Pérez González <inaky@peloncho.fis.ucm.es>, 1996.
+# Santiago Vila Doncel <sanvila@unex.es>, 2001, 2002, 2004, 2009, 2010, 2011, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2013-02-19 00:30+0100\n"
+"Last-Translator: Santiago Vila Doncel <sanvila@unex.es>\n"
+"Language-Team: Spanish <es@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "argumento de %s%s inválido '%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "argumento de %s%s inválido '%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "error del programa"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "desbordamiento de pila"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Error del sistema desconocido"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "fichero regular vacío"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "fichero regular"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "directorio"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "enlace simbólico"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "cola de mensajes"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semáforo"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objeto de memoria compartido"
+
+# ¿Alguien sabe lo que es esto?
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "objeto de memoria `typed'"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "fichero especial de bloques"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "fichero especial de caracteres"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "`fifo'"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "fichero especial de bloques"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "fichero especial de caracteres"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+# FIXME
+# se podría decir algo más decente para "weird" ... pero ¿qué?
+# ¿ no habitual ? em
+# ¡Nchts! Prefiero extraño ... no habitual me suena muy difuso
+# siempre podemos poner escachifollado ;) ipg
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "fichero extraño"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "fichero especial de bloques"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "`socket'"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+# FIXME
+# se podría decir algo más decente para "weird" ... pero ¿qué?
+# ¿ no habitual ? em
+# ¡Nchts! Prefiero extraño ... no habitual me suena muy difuso
+# siempre podemos poner escachifollado ;) ipg
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "fichero extraño"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: la opción '%s' es ambigua; posibilidades:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: la opción '-W %s' es ambigua\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: la opción '--%s' no admite ningún argumento\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: la opción '%c%s' no admite ningún argumento\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: la opción '--%s' requiere un argumento\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: opción no reconocida '--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: opción no reconocida '%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opción inválida -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: la opción requiere un argumento -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: la opción '-W %s' es ambigua\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: la opción '-W %s' no admite ningún argumento\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: la opción '-W %s' requiere un argumento\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "«"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "»"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Conseguido"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "No hay ninguna coincidencia"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expresión regular inválida"
+
+# Se refiere probablemente a cosas tales como que la c con la h es "ch",
+# aunque este ejemplo ya no es válido, pues la Real Academia dice
+# que para propósitos de ordenación son letras independientes.
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carácter de unión inválido"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Carácter de clase inválido"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barra invertida al final"
+
+# FIXME
+# Retro-referencia es lo mejor que se me ocurre ... claro, que acepto
+# sugerencias ;)
+# ¿Referencia hacia atrás? sv
+# Me suena a cangrejo ;) ... no se ... a ver que opinan Enrique y el resto de
+# la gente ... La verdad es que prefiero Retro-referencia a referencia hacia
+# atrás (más que nada es por que es la traducción que se hace, como por
+# ejemplo en backfeed -- retroalimentación) IPG
+# En glibc.1.10.1 :
+# # posix/regex.c:946
+# msgid "Invalid back reference"
+# msgstr "Referencia hacia atrás no válida" em
+# Si no fuese porque has traducido tu la glibc, te preguntaría quien ha sido
+# el asesino que ha puesto eso :) Momento que voy a mirar la enciclopedia
+# esa que tenemos decorando la estantería ;) ... ¡¡Ja jaaaa!! :) ¡Palidecerás
+# ante esta cita! "Diccionario Enciclopédico Espasa-Calpe". Edición de Dios
+# sabe cuando (la décima, creo), volumen 15, página 8846, tercera columna,
+# tal que a la mitad:
+#
+# retrocontrol. (De retro- y control.) m. Biol. Fenómeno de autocontrol por
+# el cual la excesiva acumulación de una hormona en la sangre actúa sobre
+# la glándula corespondiente e inhibe automáticamente su producción. Se
+# utiliza mucho internacionalmente la voz inglesa --feed-back-- para expre-
+# sar esta idea.
+#
+# Y mejor ... para rematar :). Misma página, primera columna, cuarta entrada:
+#
+# retro-. (del lat. retro, --hacia atrás--) pref. que lleva a lugar o tiempo
+# anterior a la significación de las voces simples a que se halla unida:
+# retro-traer, retro-vender ...
+#
+# ¡¡Quiyos!! Hay dos páginas de retro-"algo" ... :) ¡no me digáis después
+# de esto que preferís "hacia atrás"! y máxime cuando está aceptado preponer
+# retro- para ello :) Si no os importa, y a no ser que venga alguno de la
+# RALE y me castre por ello, dejaré retro-referencia.
+# ipg
+# Un comentario: No serán los de la RALE los que hagan eso, sino los
+# que no lo entiendan. Aún después de ver tus acertadas referencias, pienso
+# que referencia hacia atrás se puede entender mejor, pero por supuesto,
+# no estoy dispuesto a matar por ello... sv
+# :) Gracias, pero por ahora dejaré retro-referencia, me parece más clara
+# en cuanto al significado preciso de la frase. ipg
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Retro-referencia inválida"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ó [^ desemparejados"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ó \\( desemparejado"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ desemparejado"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "El contenido de \\{\\} no es válido"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Final de rango inválido"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoria agotada"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente inválida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Final prematuro de la expresión regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "La expresión regular es demasiado grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ó \\) desemparejado"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "No hay ninguna expresión regular previa"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria agotada"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "entrada estándar"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "salida estándar"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "salida de error estándar"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "flujo desconocido"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "fallo al reabrir %s con modo %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "argumento de %s%s inválido '%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "sufijo inválido en el argumento de %s%s '%s'"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s argumento '%s' demasiado grande"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Empaquetado por %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Empaquetado por %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Licencia GPLv3+: GPL de GNU versión 3 o posterior <http://gnu.org/licenses/"
+"gpl.html>.\n"
+"Esto es software libre, usted es libre de cambiarlo y redistribuirlo.\n"
+"No hay NINGUNA GARANTÍA, hasta donde permite la ley.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Escrito por %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Escrito por %s y %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Escrito por %s, %s, y %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Escrito por %s, %s, %s,\n"
+"y %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Escrito por %s, %s, %s,\n"
+"%s, y %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Comunicar errores en el programa a: %s\n"
+"Comunicar errores de traducción a es@li.org y al último traductor.\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Comunicar errores de %s a: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s página inicial: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s página inicial: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Ayuda general sobre el uso de software de GNU: <http://www.gnu.org/gethelp/"
+">\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Los ficheros %s y %s son distintos\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Los ficheros binarios %s y %s son distintos\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "No hay ningún carácter de nueva línea al final del fichero"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Pruebe '%s --help' para más información."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "valor --ignore-initial inválido '%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "las opciones -l y -s son incompatibles"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "la escritura falló"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "salida estándar"
+
+# Muestra como caracteres los bytes que difieran
+# queda más claro, creo yo em
+# Yo no le veo diferencia (¿será por qué lo parí yo? ;) ipg
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes muestra los bytes que son distintos"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SALTO salta los primeros SALTO bytes de\n"
+" las dos entradas"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SALTO1:SALTO2 salta los primeros SALTO1 bytes de "
+"FICHERO1\n"
+" y los primeros SALTO2 bytes de FICHERO2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose muestra los números de byte y valores de todos los bytes "
+"que\n"
+" difieran"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LÍMITE compara como máximo LÍMITE bytes"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent suprime toda la salida normal"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help muestra esta ayuda y finaliza"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version informa de la versión y finaliza"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Modo de empleo: %s [OPCIÓN]... FICHERO1 [FICHERO2 [SALTO1 [SALTO2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Compara dos ficheros byte por byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Los parámetros opcionales SALTO1 y SALTO2 especifican el número de\n"
+"bytes que se saltan en cada fichero (cero por omisión)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Los argumentos obligatorios para las opciones largas son también "
+"obligatorios\n"
+"para las opciones cortas.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Los valores SALTO pueden estar seguidos por los siguientes sufijos\n"
+"multiplicadores:\n"
+"kB 1.000, K 1.024, MB 1.000.000, M 1.048.576,\n"
+"GB 1.000.000.000, G 1.073.741.824, y así en adelante para T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Si un FICHERO es '-' o no se especifica, lee la entrada estándar."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"El estado de salida es 0 si las entradas son iguales, 1 si son diferentes,\n"
+"2 en caso de problema."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "valor --bytes inválido '%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "falta un operando después de '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "operando extra '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s son distintos: byte %s, línea %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s son distintos: el byte %s, en la línea %s es %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: fin de fichero encontrado en %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "longitud de contexto inválida '%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "este sistema no admite paginación"
+
+# FIXME
+# me sace a mi que esto no se parece ni un ápice a lo que
+# se quiere decir en realidad. He mirado los docs y no consigo
+# encontrarle un buen significado, así que pido ayuda ;)
+# Ni p... idea em
+# La opción -L LABEL puedes usarla, una o dos veces, pero no más. A eso
+# se refiere. la opción de etiqueta de fichero se ha especificado demasiadas
+# veces. O más cortito, dejarlo como está :) em+
+# Me parece que así está bien ...
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "demasiadas opciones de etiqueta de fichero"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "ancho inválido '%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "opciones de ancho conflictivas"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "longitud del horizonte inválida '%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "tamaño de tab inválido '%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "opciones de tamaño de tab conflictivas"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "se ha especificado tanto --from-file como --to-file"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal produce un diff normal (predeterminado)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+"-q --brief indica sólo si los ficheros son diferentes o no"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s --report-identical-files notifica cuándo dos ficheros son idénticos"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NÚM, --context[=NÚM] muestra NÚM (por omisión 3) líneas de contexto"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NÚM, --unified[=NÚM] muestra NÚM (por omisión 3) línea de contexto\n"
+" unificado"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed produce un script ed"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs produce un diff en formato RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side muestra en dos columnas"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NÚM muestra como mucho NÚM columnas de "
+"impresión\n"
+" (por omisión 130)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column muestra sólo en la columna izquierda las líneas "
+"comunes"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines no muestra las líneas comunes"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function muestra en qué función C está cada cambio"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=ER muestra la línea más reciente que encaje con ER"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETIQUETA utiliza ETIQUETA en lugar del nombre del "
+"fichero\n"
+" (se puede repetir)"
+
+# Aquí a lo mejor también: la salida -> el resultado. sv
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t --expand-tabs expande los tabuladores a espacios en la salida"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab hace que los tabuladores se alineen\n"
+" anteponiendo uno"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NÚM los topes de tabulación están separados por NÚM "
+"columnas\n"
+" de impresión (por omisión, 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty suprime espacios o tabs antes de una línea "
+"vacía"
+
+# Sugerencia: la salida -> el resultado.
+# (y paginarla -> paginarlo, en su caso). sv
+# Yo personalmente prefiero `la salida'; si traducimos literalmente el
+# inglés es eso, no cabe duda, pero poner `el resultado' no me cuadra.
+# Lo digo porque tenemos una entrada y una salida (por un lado entran
+# los cerdos a la máquina de hacer chorizos, y por otro salen). Creo
+# que con esto me guiaré por lo que haya hecho el resto de la gente.
+# Si sabes qué han hecho ... :). ipg
+# Te mandaré el gettext, para que veas lo que vale un peine... sv
+# X'D ... no soy tan malo ... ipg
+# Medita de nuevo si no usas resultado em
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate pasa la salida a través de 'pr' para paginarla"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive compara recursivamente todos los "
+"subdirectorios"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference no sigue los enlaces simbólicos"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file trata los ficheros que no existan como vacíos"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file trata los ficheros originales que no "
+"existan\n"
+" como vacíos"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case descarta las diferencias entre mayúsculas y\n"
+" minúsculas al comparar los nombres de los "
+"ficheros"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case considera distintas mayúsculas y minúsculas\n"
+" cuando compara los nombres de los ficheros"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=PAT excluye los ficheros que coincidan con PAT"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FICHERO excluye los ficheros que coincidan con "
+"alguna\n"
+" expresión regular de FICHERO"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FICHERO comienza por FICHERO cuando se comparan\n"
+" directorios"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FICHERO1 compara FICHERO1 con todos los operandos;\n"
+" FICHERO1 puede ser un directorio"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FICHERO2 compara todos los operandos con FICHERO2\n"
+" FICHERO2 puede ser un directorio"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case descarta las diferencias entre mayúsculas y "
+"minúsculas\n"
+" en el contenido de los ficheros"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion descarta cambios debidos a expansiones de "
+"tabs"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space descarta espacio en blanco al final de línea"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change descarta las diferencias en la cantidad de\n"
+" espacio en blanco"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space descarta los espacios en blanco"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines descarta los cambios en líneas completamente "
+"vacías"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=EXPR-REG descarta las líneas que coincidan con "
+"EXPR-REG"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text trata todos los ficheros como de tipo texto"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr elimina los retornos de carro finales en la "
+"entrada"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+" --binary lee y escribe los datos en modo binario"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NOMBRE genera un fichero combinado que muestra las\n"
+" diferencias con '#ifdef NOMBRE'"
+
+# Propongo similar -> parecida. Ver gettext. sv
+# Hmmm ... prefiero similar. Antes estaba puesto `parecida' y la verdad,
+# no quedaba tan bien. ipg
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT formatea los grupos de entrada GTYPE con GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT formatea todas las líneas de entrada con LFMT"
+
+# ídem. sv
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT formatea las líneas de entrada LTYPE con LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Estas opciones de formato proporcionan un control preciso sobre el "
+"resultado\n"
+" de diff, generalizando -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE es 'old' (antiguo), 'new' (nuevo) o 'unchanged' (sin cambios).\n"
+" GTYPE es como LTYPE o 'changed' (cambiado)."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (solamente) puede contener:\n"
+" %< líneas del FICHERO1\n"
+" %> líneas del FICHERO2\n"
+" %= líneas comunes a FICHERO1 y FICHERO2\n"
+" %[-][ANCHO][.[PRECISIÓN]]{doxX}LETRA especificación printf para LETRA\n"
+" Las LETRAs pueden ser como siguen para grupos nuevos (en minúsculas\n"
+" para grupos antiguos):\n"
+" F número de la primera línea\n"
+" L número de la última línea\n"
+" N número de líneas = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) si A es igual a B entonces T en caso contrario E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (solamente) puede contener:\n"
+" %L contenido de la línea\n"
+" %l contenido de la línea, excluyendo caracteres de nueva línea finales\n"
+" %[-][ANCHO][.[PRECISIÓN]]{doxX}n especificación en estilo printf para "
+"el\n"
+" número de línea de entrada"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Tanto GFMT como LFMT pueden contener:\n"
+" %% %\n"
+" %c'C' el carácter C\n"
+" %c'\\OOO' el carácter con código octal OOO\n"
+" C el carácter C (los otros caracteres se representan a sí mismos)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal se esfuerza en encontrar un grupo de cambios menor"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=NÚM mantiene NÚM líneas de prefijos y sufijos comunes"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files supone que los ficheros son grandes y los cambios "
+"son\n"
+" numerosos, pequeños y dispersos"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal produce un diff normal (predeterminado)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help muestra esta ayuda y finaliza"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version informa de la versión y finaliza"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FICHEROS puede ser 'FICHERO1 FICHERO2' o 'DIRECTORIO1 DIRECTORIO2'\n"
+" o 'DIRECTORIO FICHERO...' o 'FICHERO... DIRECTORIO'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr "Si se da --from-file o --to-file, no hay restricciones en FICHERO(s)."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Si un FICHERO es '-', lee la entrada estándar."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Modo de empleo: %s [OPCIÓN]... FICHEROS\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Compara FICHEROS línea por línea."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "la opción %s tiene el valor conflictivo '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "las especificaciones del estilo de salida son conflictivas"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "ancho inválido '%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Sólo en %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "no se puede comparar '-' con un directorio"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "la opción -D no se puede usar con directorios"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdirectorios comunes: %s y %s\n"
+
+# Nota: El segundo y el cuarto `%s' son tipos de fichero.
+# Por ejemplo, "texto C", "texto FORTRAN", etc.
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "El fichero %s es un %s mientras que el %s es un %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Los enlaces simbólicos %s y %s son distintos\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Los ficheros %s y %s son idénticos\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "opciones incompatibles"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "se ha especificado '-' para más de un fichero de entrada"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "la lectura falló"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all muestra todos los cambios, encerrando los "
+"conflictos\n"
+" entre corchetes"
+
+# Sería ideal traducir OLDFILE y YOURFILE. sv
+# Sí, eso pensé yo, pero no sé como ponerlo para que quede bien ...
+# Esto no hay quien lo entienda, piénsalo 3 minutos más si te apetece :) em+
+#
+# OLDFILE FICHERO-ANTIGUO
+# YOURFILE TU-FICHERO
+# MYFILE MI-FICHERO
+#
+# Pongo eso por ahora, pero espero una sugerencia mejor ;)
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed muestra un `script' ed incorporando los cambios entre\n"
+" FICHERO-ANTIGUO y TU-FICHERO a MI-FICHERO"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap como -e, pero encerrando los conflictos\n"
+" entre corchetes"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only como -e, pero solamente incorpora los cambios "
+"que\n"
+" no se superponen"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only como -e, pero solamente muestra los cambios que "
+"se\n"
+" solapan"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X como -x, pero encierra conflictos entre corchetes"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i añade las órdenes 'w' y 'q' a los scripts ed"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge muestra el fichero combinado, de acuerdo con -A "
+"si\n"
+" no se especifica ninguna otra opción"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text trata todos los ficheros como de tipo texto"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr elimina los retornos de carro finales en la "
+"entrada"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab hace que los tabuladores se alineen anteponiendo "
+"uno"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAMA utiliza PROGRAMA para comparar los ficheros"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETIQUETA utiliza ETIQUETA en lugar del nombre del "
+"fichero\n"
+" (se puede reperir hasta tres veces)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help muestra esta ayuda y finaliza"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v --version informa de la versión y finaliza"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Modo de empleo: %s [OPCIÓN]... MI-FICHERO FICHERO-ANTIGUO TU-FICHERO\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Compara tres ficheros línea por línea."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"El formato de salida predeterminado es una representación más o menos "
+"legible\n"
+"de los cambios.\n"
+"\n"
+"Las opciones -e, -E, -x, -X (y sus correspondientes versiones largas) "
+"generan\n"
+"un `script' ed en lugar del resultado predeterminado.\n"
+"\n"
+"Finalmente, la opción -m (--merge) hace que diff3 realice la combinación\n"
+"internamente y muestra el fichero combinado. Para ciertas entradas, esto "
+"es\n"
+"más robusto que usar ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"El estado de salida es 0 en caso de éxito, 1 si hay conflictos, 2 en caso "
+"de\n"
+"problema."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "error interno: fallo en el formato de los bloques diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff falló: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "error interno: tipo de diff inválido en process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "formato de diff inválido; separador de cambio inválido"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "formato de diff inválido; línea final incompleta"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "no se ha podido invocar al programa subsidiario '%s'"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr ""
+"formato de diff inválido; caracteres incorrectos al comienzo de la línea"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "error interno: tipo de diff inválido pasado a la salida"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "el fichero de entrada ha menguado"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "no se pueden comparar los nombres de fichero '%s' y '%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: bucle de directorio recursivo"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=FICHERO opera interactivamente, enviando el "
+"resultado\n"
+" al fichero FICHERO"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case considera iguales mayúsculas y minúsculas"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion descarta cambios debidos a expansiones de tabs"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space descarta espacio en blanco al final de línea"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change descarta las diferencias en la cantidad "
+"espacio\n"
+" en blanco"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space descarta todo el espacio en blanco"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines descarta los cambios cuyas líneas son todas "
+"vacías"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=EXPR-REG descarta las líneas que coincidan con "
+"EXPR-REG"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr elimina los retornos de carro finales en la "
+"entrada"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text trata todos los ficheros como de tipo texto"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=NÚM muestra como mucho NÚM columnas de impresión\n"
+" (por omisión 130)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column muestra sólo la columna izquierda de líneas "
+"comunes"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines no muestra las líneas comunes"
+
+# Aquí a lo mejor también: la salida -> el resultado. sv
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs expande los tabuladores a espacios en la salida"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NÚM los topes de tabulación están separados por "
+"NÚM\n"
+" columnas de impresión (por omisión, 8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal se esfuerza en encontrar un grupo de cambios "
+"menor"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files supone que los ficheros son grandes y los "
+"cambios\n"
+" son numerosos, pequeños y dispersos"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAMA utiliza PROGRAMA para comparar los ficheros"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help muestra esta ayuda y finaliza"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version informa de la versión y finaliza"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Modo de empleo: %s [OPCIÓN]... FICHERO1 FICHERO2\n"
+
+# Se admiten sugerencias.
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr ""
+"Combinación a dos columnas de las diferencias entre FICHERO1 y FICHERO2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "no se puede mezclar interactivamente con la entrada estándar"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "los dos ficheros que hay que comparar son directorios"
+
+# FIXME
+# ¿sugerencias para traducir mejor "verbosely"?
+# ¿ Con verborrea ?, ;)
+# era una broma, ¿ qué tal prolijamente ? em
+# Huy ... mi famosa enciclopedia no dice en prolijo nada que se
+# parezca a dar mucho la lata ... casi que lo dejamos, ¿no? ipg
+# Sugerencia -> `verbosamente' -> con detalle. sv
+# Hfff ... es que `con detalle' suena más a dar detalles de lo
+# que es cada cosa, que no a que se está haciendo ipg
+# Federico ha usado "prolijamente" en tar. Algo habrá que hacer, porque
+# verbosamente no me suena a español. ¿Existe eso? sv
+# A mi tampoco ... voy a ver si conecto con el diccionario de Anaya
+# y lo miro ... a veeeeerrr ... ya ta:
+# prolijo, -a: Del lat. prolixus = fluyente.
+# 1. (adjetivo, -a). Largo, muy extenso.
+# 2. (adjetivo, -a). Cuidadoso o esmerado con exceso.
+# 3. (adjetivo, -a). Cargante, molesto.
+# FAM: Prolijamente, prolijidad.
+# SIN. 1. Amplio. 3. Impertinente, pesado.
+# ANT. 1. Lacónico, conciso. 2. Descuidado. 3. Ameno.
+# (Referencia: http://www.anaya.es/dict/Buscar)
+#
+# Pues está claro que es castellano (o español), pero yo no lo había
+# oído hasta ahora, y me imagino que mucha gente estará igual. Yo
+# voto por buscar algo más común (y creo que verbosamente vale,
+# momento que lo bujco). ipg
+#
+# ¿ Lo encontraste ? , yo no lo he oído en mi vida, y me suena a verborrea, que
+# es más bien despectivo. ¿ qué tal `con detalle' ? em+
+# Dejo verbosamente, que al menos el alma precavida lo asociará con que hay
+# mucho verbo :) ipg
+#
+# Pero vamos a ver, ¿la palabra "verbosamente" existe?
+# A mí me parece completamente un "palabro". sv
+# ## ¿Por qué no la buscas en algún diccionario? sv
+# ## Momeneto ... en la Espasa Calpe viene:
+# ## verbosamente: adverbio, con verbosidad.
+# ## En Anaya (http://www.anaya.es/dict):
+# ## verbosidad
+# ## I. De verbo.
+# ## 1. (sustantivo femenino). Verborrea.
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed: Edita y usa ambas versiones, cada una decorada con una cabecera.\n"
+"eb: Edita y usa ambas versiones.\n"
+"el ó e1: Edita y usa la versión izquierda.\n"
+"er ó e2: Edita y usa la versión derecha.\n"
+"e: Edita una nueva versión.\n"
+"l ó 1: Usa la versión izquierda.\n"
+"r ó 2: Usa la versión derecha.\n"
+"s: Incluye líneas comunes silenciosamente.\n"
+"v: Incluye líneas comunes verbosamente.\n"
+"q: Salir.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: opción no reconocida '--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid ""
+#~ "-b --ignore-space-change ignore changes in the amount of white "
+#~ "space"
+#~ msgstr ""
+#~ "-b, --ignore-space-change descarta las diferencias en la cantidad "
+#~ "de\n"
+#~ " espacio en blanco"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SALTO1:SALTO2 --ignore-initial=SALTO1:SALTO2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent No muestra nada, sólo da un código de salida."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Muestra esta ayuda y finaliza."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NÚM --context[=NÚM] Muestra NÚM (3 por omisión) líneas de "
+#~ "contexto\n"
+#~ "-u -U NÚM --unified[=NÚM] Muestra NÚM (3 por omisión) líneas de "
+#~ "contexto\n"
+#~ " unificado.\n"
+#~ " --label NOMBRE Usa NOMBRE en lugar del nombre de fichero.\n"
+#~ " -p --show-c-function Muestra en qué función C se encuentra cada "
+#~ "cambio.\n"
+#~ " -F EXPR-REG --show-function-line=EXPR-REG Muestra la línea más "
+#~ "reciente\n"
+#~ " que coincida con EXPR-REG."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Genera salida en dos columnas.\n"
+#~ " -W NÚM --width=NÚM Genera como máximo NÚM (130 por omisión) "
+#~ "caracteres\n"
+#~ " por línea.\n"
+#~ " --left-column Muestra sólo la columna izquierda en las líneas "
+#~ "comunes.\n"
+#~ " --suppress-common-lines No muestra las líneas comunes."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Supone que los ficheros son grandes y los cambios "
+#~ "son\n"
+#~ " numerosos, pequeños y dispersos."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Muestra los cambios superpuestos (entre corchetes)."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Produce un fichero mezclado en lugar de un\n"
+#~ " script ed (por omisión -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L NOMBRE --label=NOMBRE Usa NOMBRE en lugar del nombre de fichero."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opción ilegal -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Esto es software libre; vea el código fuente para las condiciones de "
+#~ "copia.\n"
+#~ "No hay NINGUNA garantía; ni siquiera de COMERCIABILIDAD o ADECUACIÓN "
+#~ "PARA\n"
+#~ "UN PROPÓSITO EN PARTICULAR.\n"
+
+# Véase "A bug's life".
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Comunicar bichos a <bug-gnu-utils@gnu.org>."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "la opción `-%ld' está obsoleta; utilice `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "la opción `-%ld' está obsoleta; omítala"
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "no se encontró el programa subsidiario `%s'"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "el programa subsidiario `%s' falló"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "el programa subsidiario `%s' falló (estado de salida %d)"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "Este programa viene sin NINGUNA GARANTÍA, hasta donde permite la ley.\n"
+#~ "Se pueden redistribuir copias de este programa bajo los términos de la\n"
+#~ "Licencia Pública General de GNU.\n"
+#~ "Para más información sobre esto, vea los ficheros llamados COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Escrito por Torbjörn Granlund y David MacKenzie."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Escrito por Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, y Len Tower."
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "el programa subsidiario `%s' no es ejecutable"
+
+# Creo que es suficientemente decente, pero se admiten sugerencias.
+#~ msgid "--inhibit-hunk-merge Do not merge hunks."
+#~ msgstr "--inhibit-hunk-merge No junta los trozos."
+
+#~ msgid "context length specified twice"
+#~ msgstr "la longitud del contexto se ha especificado dos veces"
+
+#~ msgid "multiple `--from-file' options"
+#~ msgstr "se han dado varias opciones `--from-file'"
+
+#~ msgid "multiple `--to-file' options"
+#~ msgstr "se han dado varias opciones `--to-file'"
+
+#~ msgid "regular empty executable file"
+#~ msgstr "fichero regular ejecutable vacío"
+
+#~ msgid "regular executable file"
+#~ msgstr "fichero regular vacío"
+
+#~ msgid ": not found\n"
+#~ msgstr ": no encontrado\n"
+
+#~ msgid "-D%s: conflicting #ifdef format"
+#~ msgstr "-D%s: formato #ifdef conflictivo"
+
+#~ msgid "%s: conflicting line format"
+#~ msgstr "%s: formato de línea conflictivo"
+
+#~ msgid "conflicting group format"
+#~ msgstr "formato de grupo conflictivo"
+
+#~ msgid "--ignore-initial value must be a nonnegative integer"
+#~ msgstr "el valor de --ignore-initial debe ser un entero no negativo"
+
+#~ msgid "column width must be a positive integer"
+#~ msgstr "el ancho de la columna debe ser un entero positivo"
+
+#~ msgid "context length must be a nonnegative integer"
+#~ msgstr "la longitud del contexto ha de ser un entero no negativo"
+
+#~ msgid "horizon must be a nonnegative integer"
+#~ msgstr "el horizonte (horizon) ha de ser un entero no negativo"
diff --git a/po/fi.gmo b/po/fi.gmo
new file mode 100644
index 0000000..d61b185
--- /dev/null
+++ b/po/fi.gmo
Binary files differ
diff --git a/po/fi.po b/po/fi.po
new file mode 100644
index 0000000..48a62cc
--- /dev/null
+++ b/po/fi.po
@@ -0,0 +1,1666 @@
+# Finnish translation of GNU diffutils.
+# This file is distributed under the same license as the diffutils package.
+# Copyright © 2016 Free Software Foundation, Inc.
+# Lauri Nurmi <lanurmi@iki.fi>, 2002-2004,2015-2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2016-05-26 21:28+0300\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-Generator: Poedit 1.8.7\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "argumentti %s on virheellinen %s:lle"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "argumentti %s on virheellinen %s:lle"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "ohjelmavirhe"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "pinon ylivuoto"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Tuntematon järjestelmävirhe"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "tavallinen tyhjä tiedosto"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "tavallinen tiedosto"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "hakemisto"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "symbolinen linkki"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "viestijono"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafori"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "jaettu muistiobjekti"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "tyypitetty muistiobjekti"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "lohkolaite-erikoistiedosto"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "merkkilaite-erikoistiedosto"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "lohkolaite-erikoistiedosto"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "merkkilaite-erikoistiedosto"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "outo tiedosto"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "lohkolaite-erikoistiedosto"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "pistoke"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "outo tiedosto"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: valitsin ”%s” on moniselitteinen; vaihtoehdot:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: valitsin ”-W %s” on moniselitteinen\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: valitsin ”--%s” ei salli argumenttia\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: valitsin ”%c%s” ei salli argumenttia\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: valitsin ”--%s” vaatii argumentin\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: tunnistamaton valitsin ”--%s”\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: tunnistamaton valitsin ”%c%s”\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: virheellinen valitsin -- ”%c”\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: valitsin vaatii argumentin -- ”%c”\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: valitsin ”-W %s” on moniselitteinen\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: valitsin ”-W %s” ei salli argumenttia\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: valitsin ”%s” vaatii argumentin\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "”"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Onnistui"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Ei vastaavuutta"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Virheellinen säännöllinen lauseke"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Virheellinen vertailumerkki"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Virheellinen merkkiluokan nimi"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Kenoviiva lopussa"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Virheellinen takaisinviittaus"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Pariton [ tai [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Pariton ( tai \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Pariton \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Virheellinen \"\\{\\}\":n sisältö"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Virheellinen välin loppu"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Muisti lopussa"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Virheellinen edeltävä säännöllinen lauseke"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Ennenaikainen säännöllisen lausekkeen loppu"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Liian suuri säännöllinen lauseke"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Pariton ) tai \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Ei edellistä säännöllistä lauseketta"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "muisti lopussa"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "vakiosyöte"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "vakiotuloste"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "vakiovirhetuloste"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "tuntematon virta"
+
+#: lib/xfreopen.c:39
+#, fuzzy, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "%s: Oikeuksien muuttaminen tilaan %s ei onnistu"
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "argumentti %s on virheellinen %s:lle"
+
+#: lib/xstrtol-error.c:68
+#, fuzzy, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "virheellinen loppuliite ”%.*s” liukulukuvakiolla"
+
+#: lib/xstrtol-error.c:72
+#, fuzzy, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "lukumäärä %s on liian suuri"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Paketoinut %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Paketoinut %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Lisenssi GPLv3+: GNU GPL versio 3 tai myöhempi <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Tämä on vapaa ohjelmisto; sitä saa vapaasti muuttaa ja levittää edelleen.\n"
+"Siinä määrin kuin laki sallii, TAKUUTA EI OLE.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Kirjoittanut %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Kirjoittaneet %s ja %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Kirjoittaneet %s, %s ja %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Kirjoittaneet %s, %s,\n"
+"%s ja %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Kirjoittaneet %s, %s,\n"
+"%s, %s ja %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Ilmoita ohjelmistovioista (englanniksi) osoitteeseen: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Ilmoita %s-vioista (englanniksi) osoitteeseen %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s-kotisivu: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s-kotisivu: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Yleisohjeita GNU-ohjelmistojen käyttöön: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Tiedostot %s ja %s eroavat\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binääritiedostot %s ja %s eroavat\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Ei rivinvaihtoa tiedoston lopussa"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Komento ”%s --help” antaa lisää tietoa."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "virheellinen alkuarvo jäsenelle %qE"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "valitsimet -l ja -s eivät ole yhteensopivia"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "kirjoitus epäonnistui"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "vakiotuloste"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes Tulostaa eroavat tavut."
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i OHITA --ignore-initial=OHITA Ohittaa syötteen ensimmäiset OHITA tavua."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+" Ohittaa TIEDOSTO1:n ensimmäiset OHITA1 tavua, ja TIEDOSTO2:n ensimmäiset "
+"OHITA2 tavua."
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-I --verbose Näytä kaikkien eroavien tavujen sijainnit ja arvot"
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n RAJA --bytes=RAJA Vertaa korkeintaan RAJAn verran tavuja."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent vaienna kaikki tavanomainen tuloste"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help näytä tämä ohje ja poistu"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version näytä versiotiedot ja poistu"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Käyttö: %s [VALITSIN]... TIEDOSTO1 [TIEDOSTO2 [OHITA1 [OHITA2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Vertaa kahta tiedostoa tavu tavulta."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"OHITA1 ja OHITA2 ovat jokaisen tiedostn alusta ohitettavien tavujen\n"
+"määrä (oletusarvo on nolla)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Pitkien valitsinten pakolliset argumentit ovat pakollisia myös lyhyille.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"OHITA-arvoihin voidaan liittää perään seuraavat kertoimet:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, sekä T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Jos TIEDOSTOa ei ole annettu, tai se on ”-”, luetaan vakiosyötettä."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Paluuarvo on 0, jos syötteet ovat samoja, 1 jos erilaisia, "
+"ongelmatilanteissa 2."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "virheellinen arvo ”%s” valitsimelle --bytes"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "puuttuva operandi argumentin ”%s” jälkeen"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "ylimääräinen operandi ”%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s eroavat: tavu %s, rivi %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s eroavat: tavu %s, rivi %s on %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: Tiedoston %s loppu\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "virheellinen kontekstin pituus ”%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "tämä isäntä ei tue sivunumerointia"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "liian monta tiedostonimivalitsinta"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "virheellinen leveys \"%s\""
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "ristiriitaiset leveysvalinnat"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "virheellinen horisontin pituus \"%s\""
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "virheellinen sarkaimen koko \"%s\""
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "ristiriitaiset sarkaimen kokovalinnat"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "sekä valitsin --from-file että --to-file on määritetty"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal Tulosta normaali diff."
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief Kertoo vain, eroavatko tiedostot."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files Ilmoita, jos kaksi tiedostoa ovat samat."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w MÄÄRÄ --width=MÄÄRÄ Tulosta enintään MÄÄRÄ (oletus 130) merkkiä riville."
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed Tulosta ed-skripti."
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Tulosta RCS-muotoinen diff."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w MÄÄRÄ --width=MÄÄRÄ Tulosta enintään MÄÄRÄ (oletus 130) merkkiä riville."
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column Tulosta vain yhteisten rivien vasen palsta"
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Älä tulosta yhteisiä rivejä."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=TIEDOSTO1 Vertaa TIEDOSTO1:ä kaikkiin operandeihin. TIEDOSTO1 "
+"voi olla hakemisto."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Laajentaa sarkaimet välilyönneiksi tulosteessa."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab Lisää sarkain rivien alkuun."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr "--tabsize=KOKO Sarkaimen koko on KOKO (oletus 8) merkkiä."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l --paginate Ohjaa tuloste ohjelman \"pr\" läpi sivunumerointia varten."
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive vertaa löytyneitä alihakemistoja "
+"rekursiivisesti"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file Käsittele puuttuvia tiedostoja tyhjinä."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr "--unidirectional-new-file Käsittele puuttuvia tiedostoja tyhjinä."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+"--ignore-file-name-case Älä huomioi kirjainkokoa tiedostojen nimiä "
+"verrattaessa."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case Kirjainkoko huomioidaan tiedostonimiä "
+"verrattaessa."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x HAHMO --exclude=HAHMO Jätä pois tiedostot, jotka vastaavat HAHMOa."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X TIEDOSTO --exclude-from=TIEDOSTO Jätä pois TIEDOSTOssa listatut "
+"tiedostot."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S TIEDOSTO --starting-file=TIEDOSTO Aloita TIEDOSTOlla verrattaessa "
+"hakemistoja."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=TIEDOSTO1 Vertaa TIEDOSTO1:ä kaikkiin operandeihin. TIEDOSTO1 "
+"voi olla hakemisto."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=TIEDOSTO2 Vertaa kaikkia operandeja TIEDOSTO2:een. TIEDOSTO2 voi "
+"olla hakemisto."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i --ignore-case Älä huomioi kirjainkokoa tiedostojen sisältöä "
+"verrattaessa."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Älä huomioi sarkainten laajennuksesta johtuvia "
+"eroja."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-white-space Älä huomioi tyhjiä merkkejä."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change Älä huomioi tyhjistä merkeistä johtuvia eroja."
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-white-space älä huomioi tyhjiä merkkejä"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B --ignore-blank-lines älä huomioi tyhjistä riveistä johtuvia eroja"
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I SI --ignore-matching-lines=SI Älä huomioi eroavia rivejä, jotka "
+"vastaavat säännöllistä lauseketta."
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a --text käsittelee kaikki tiedostot tekstinä"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr poista vaununpalautus syötteen lopusta"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary lue ja kirjoita dataa binääritilassa"
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D NIMI --ifdef=NIMI Tulosta yhdistetty tiedosto näyttämään \"#ifdef NIMI"
+"\"-erot."
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GTYYPPI-group-format=GMUOTO Sama, muotoile GTYYPPIset syöteryhmät "
+"GMUOTOon."
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LMUOTO muotoile kaikki syöterivit LMUOTOon"
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --line-format=LMUOTO muotoile kaikki syöterivit LMUOTOon"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYYPPI on \"old\", \"new\" tai \"unchanged\". GTYYPPI on LTYYPPI tai "
+"\"changed\"."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GMUOTO voi sisältää:\n"
+" %< rivejä TIEDOSTO1:stä\n"
+" %> rivejä TIEDOSTO2:sta\n"
+" %= TIEDOSTO1:n ja TIEDOSTO2:n yhteiset rivit\n"
+" %[-][LEVEYS][.[TARKK]]{doxX}KIRJAIN printf-tyylimääritys KIRJAIMELLE\n"
+" KIRJAIMET ovat seuraavat uudelle ryhmälle; pienet kirjaimet vanhalle "
+"ryhmälle:\n"
+" F ensimmäinen rivinumero\n"
+" L viimeinen rivinumero\n"
+" N rivien määrä = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LMUOTO voi sisältää:\n"
+" %L rivin sisältö\n"
+" %l rivin sisältö, mahdollinen edeltävä rivinvaihto poislukien\n"
+" %[-][LEVEYS][.[TARKK]]{doxX}n syöterivin numero printf-tyylillä"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Sekä GMUOTO että LMUOTO voivat sisältää:\n"
+" %% %\n"
+" %c'C' yksittäinen merkki C\n"
+" %c'\\OOO' yksittäinen merkki oktaalikoodilla OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Yrittää löytää pienemmän määrän muutoksia."
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+"--horizon-lines=MÄÄRÄ Säilytä MÄÄRÄ riviä yhteisestä etu- ja "
+"jälkiliitteestä."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"-H --speed-large-files Oleta suuret tiedostot, joissa pieniä muutoksia "
+"ympäri tiedoston."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal Tulosta normaali diff."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+#, fuzzy
+msgid " --help display this help and exit"
+msgstr " --help näytä tämä ohje ja poistu"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version näytä versiotiedot ja poistu"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"TIEDOSTOT ovat \"TIEDOSTO1 TIEDOSTO2\" tai \"HAK1 HAK2\" tai \"HAK "
+"TIEDOSTO...\" tai \"TIEDOSTO... HAK\"."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr "Tiedoston lisääminen hakemiston %s ulkopuolelta epäonnistui"
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr ""
+"\n"
+"Jos TIEDOSTOa ei ole annettu, tai se on ”-”, luetaan vakiosyötettä.\n"
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Käyttö: %s [VALITSIN]... TIEDOSTOT\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Vertaa TIEDOSTOja rivi riviltä."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "ristiriitaiset tyypit kohteelle %<%c%s%>:lle"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "ristiriitaiset tulostustyylin valinnat"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "virheellinen leveys \"%s\""
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Vain hakemistossa %s: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "hakemiston %s luominen ei onnistu"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "valitsin -D ei toimi hakemistojen kanssa"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Yhteiset alihakemistot: %s ja %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Tiedosto %s on %s, kun taas tiedosto %s on %s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Tiedostot %s ja %s eroavat\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Tiedostot %s ja %s ovat identtiset\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "yhteensopimattomat valitsimet"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "Voidaan antaa vain yksi syötetiedosto!\n"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lukeminen epäonnistui"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A --show-all Tulosta kaikki muutokset, ristiriidat merkiten."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Tulosta VANHANTIEDOSTON yhdistämättömät muutokset TIEDOSTOOSI "
+"verrattuna TIEDOSTOONI."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap Tulosta yhdistämättömät muutokset, ristiriidat merkiten."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3 --easy-only Tulosta yhdistämättömät ei-päällekkäiset muutokset."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only Tulosta päällekkäiset muutokset."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Lisää komennot \"w\" ja \"q\" ed-skripteihin."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text käsittele kaikki tiedostot tekstinä"
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr poista vaununpalautus syötteen lopusta"
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab Lisää sarkain rivien alkuun."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=OHJELMA Käytä OHJELMAa tiedostojen vertaamiseen."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help näytä tämä ohje ja poistu"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version näytä versiotiedot ja poistu"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Käyttö: %s [VALITSIN]... TIEDOSTONI VANHATIEDOSTO TIEDOSTOSI\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Vertaa kolmea tiedostoa rivi riviltä."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Paluuarvo on onnistuessa 0, ristiriitatilanteissa 1, ja ongelmatilanteissa 2."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "sisäinen virhe: virhe diff-lohkojen muodossa"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff epäonnistui: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "sisäinen virhe: virheellinen diff-tyyppi funktiossa process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "virheellinen diff-muoto; virheellinen muutoserotin"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "virheellinen diff-muoto; viimeinen rivi vajaa"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "apuohjelmaa \"%s\" ei voitu käynnistää"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "virheellinen diff-muoto; väärät rivin alkumerkit"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "sisäinen virhe: virheellinen diff-muoto välitetty tulosteeseen"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "syötetiedosto kutistui"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "tiedostonimiä %s ja %s ei voi vertailla"
+
+#: src/dir.c:225
+#, fuzzy, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: syöte sisältää silmukan:"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o TIEDOSTO --output=TIEDOSTO Vuorovaikutteinen toiminta, tuloste "
+"TIEDOSTOon."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case Käsittele isot ja pienet kirjaimet samoina."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Älä huomioi sarkainten laajennuksesta johtuvia "
+"eroja."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-white-space Älä huomioi tyhjiä merkkejä."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change Älä huomioi tyhjistä merkeistä johtuvia eroja."
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space älä huomioi tyhjiä merkkejä"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines älä huomioi tyhjistä riveistä johtuvia eroja"
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I SI --ignore-matching-lines=SI Älä huomioi eroavia rivejä, jotka "
+"vastaavat säännöllistä lauseketta."
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr poista vaununpalautus syötteen lopusta"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a --text käsittele kaikki tiedostot tekstinä"
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w MÄÄRÄ --width=MÄÄRÄ Tulosta enintään MÄÄRÄ (oletus 130) merkkiä riville."
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column Tulosta vain yhteisten rivien vasen palsta"
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Älä tulosta yhteisiä rivejä."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Laajentaa sarkaimet välilyönneiksi tulosteessa."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr "--tabsize=KOKO Sarkaimen koko on KOKO (oletus 8) merkkiä."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Yrittää löytää pienemmän määrän muutoksia."
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files Oleta suuret tiedostot, joissa pieniä muutoksia "
+"ympäri tiedoston."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=OHJELMA Käytä OHJELMAa tiedostojen vertaamiseen."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help näytä tämä ohje ja poistu"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v --version näytä versiotiedot ja poistu"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Käyttö: %s [VALITSIN]...TIEDOSTO1 TIEDOSTO2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr ""
+"Tiedostojen TIED1 ja TIED2 erojen yhdistäminen vierekkäisillä palstoilla."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "vakiosyötettä ei voi yhdistää vuorovaikutteisesti"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "molemmat vertailtavat tiedostot ovat hakemistoja"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tMuokkaa ja käytä molempia versioita, kumpaankin otsake.\n"
+"eb:\tMuokkaa ja käytä molempia versioita.\n"
+"el tai e1:\tMuokkaa ja käytä vasenta versiota.\n"
+"er tai e2:\tMuokkaa ja käytä oikeata versiota.\n"
+"e:\tHylkää molemmat versiot ja muokkaa uusi.\n"
+"l tai 1:\tKäytä vasenta versiota.\n"
+"r tai 2:\tKäytä oikeata versiota.\n"
+"s:\tSisällytä yhteiset rivit automaattisesti, ilmoittamatta.\n"
+"v:\tSisällytä yhteiset rivit automaattisesti, ilmoittaen.\n"
+"q:\tLopeta.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: tunnistamaton valitsin ”--%s”\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: virheellinen valitsin -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Tämä on vapaa ohjelmisto; katsokaa kopiointiehdot lähdekoodista. Takuuta "
+#~ "EI\n"
+#~ "OLE; ei edes KAUPALLISESTI HYVÄKSYTTÄVÄSTÄ LAADUSTA tai SOPIVUUDESTA "
+#~ "TIETTYYN\n"
+#~ "TARKOITUKSEEN.\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i OHITA1:OHITA2 --ignore-initial=OHITA1:OHITA2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent Ei tulostusta; vain paluuarvo."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Näyttää tämän ohjeen."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr ""
+#~ "Ilmoita ohjelmistovioista (englanniksi) osoitteeseen <bug-gnu-utils@gnu."
+#~ "org>."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "valitsin \"-%ld\" on vanhentunut, käytä \"-%c %ld\""
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "valitsin \"-%ld\" on vanhentunut; jätä se pois"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C MÄÄRÄ --context[=MÄÄRÄ] Tulosta MÄÄRÄ (oletus 3) riviä kopioitua "
+#~ "kontekstia.\n"
+#~ "-u -U MÄÄRÄ --unified[=MÄÄRÄ] Tulosta MÄÄRÄ (oletus 3) riviä "
+#~ "yhdistettyä kontekstia.\n"
+#~ " --label NIMIÖ Käytä NIMIÖtä tiedostonimen sijaan.\n"
+#~ " -p --show-c-function Näytä, minkä C-funktion sisällä kukin muutos "
+#~ "on.\n"
+#~ " -F SI --show-function-line=SI Näytä viimeisin säännöllistä lauseketta "
+#~ "vastaava rivi."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Tulosta kahdelle palstalle.\n"
+#~ " -W MÄÄRÄ --width=MÄÄRÄ Tulosta korkeintaan MÄÄRÄ (oletus 130) merkkiä "
+#~ "riville.\n"
+#~ " --left-column Tulosta vain yhteisten rivien vasen palsta.\n"
+#~ " --suppress-common-lines Älä tulosta yhteisiä rivejä."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Olettaa tiedostojen olevan suuria ja muutosten "
+#~ "pieniä sekä hajanaisia."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Tulosta päällekkäiset muutokset sulkeiden sisään."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Tulosta yhdistetty tiedosto ed-skriptin sijaan (oletus -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L NIMIÖ --label=NIMIÖ Käytä NIMIÖtä tiedostonimen sijaan."
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "apuohjelmaa \"%s\" ei löytynyt"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "apuohjelman \"%s\" suoritus epäonnistui"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "apuohjelman \"%s\" suoritus epäonnistui (paluuarvo %d)"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "Tällä ohjelmalla EI - lain sallimissa rajoissa - OLE TAKUUTA.\n"
+#~ "Tämän ohjelman kopioita saa levittää GNU:n General Public Licensen \n"
+#~ "mukaisesti. Lisää tietoa näistä asioista on tiedostossa COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Kirjoittaneet Torbjörn Granlund ja David MacKenzie."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Kirjoittaneet Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman ja Len Tower."
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "apuohjelma \"%s\" ei ole käynnistettävä"
diff --git a/po/fr.gmo b/po/fr.gmo
new file mode 100644
index 0000000..831acea
--- /dev/null
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..4a15ed1
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,1777 @@
+# Messages français pour GNU concernant diffutils.
+# Copyright (C) 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+# Michel Robitaille <robitail@IRO.UMontreal.CA>, 1996.
+# Frédéric Marchal <fmarchal@perso.be>, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-10-31 08:16+0100\n"
+"Last-Translator: Frédéric Marchal <fmarchal@perso.be>\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: 8-bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Lokalize 1.0\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "argument pour %s%s pas valable: « %s »"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "argument pour %s%s pas valable: « %s »"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "erreur du programme"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "débordement de pile"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Erreur système inconnue"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "fichier régulier vide"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "fichier régulier"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "répertoire"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "lien symbolique"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "queue de messages"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "sémaphore"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objet en mémoire partagée"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "objet mémoire typé"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "fichier spécial-blocs"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "fichier spécial-caractères"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "« fifo »"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "fichier spécial-blocs"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "fichier spécial-caractères"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "fichier bizarre"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "fichier spécial-blocs"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "« socket »"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "fichier bizarre"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: l'option « %s » est ambiguë ; les possibilités sont :"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: l'option « -W %s » est ambiguë\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: l'option « --%s » n'accepte aucun argument\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: l'option « %c%s » n'accepte aucun argument\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: l'option « --%s » requiert un argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: l'option « --%s » n'est pas reconnue\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: l'option « %c%s » n'est pas reconnue\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: l'option -- « %c » est invalide\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: l'option -- « %c » requiert un argument\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: l'option « -W %s » est ambiguë\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: l'option « -W %s » n'accepte aucun argument.\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: l'option « -W %s » requiert un argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "« "
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr " »"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succès"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Pas de concordance"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "L'expression régulière est invalide"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Le caractère de regroupement est invalide"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Le nom d'un ensemble de caractères est invalide"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barre oblique inverse à la fin"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "La référence arrière est invalide"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ or [^ sans vis-à-vis"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr " ( ou \\( sans vis-à-vis"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ sans vis-à-vis"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Le contenu de \\{\\} est invalide"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "La fin d'intervalle est invalide"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Mémoire épuisée"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "L'expression régulière précédente est invalide"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Fin prématurée de l'expression régulière"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expression régulière trop grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") or \\) sans vis-à-vis"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "N'est pas précédé d'une expression régulière"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "mémoire épuisée"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "flux inconnu"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "impossible de ré-ouvrir %s avec le mode %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "argument pour %s%s pas valable: « %s »"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "suffixe par valable dans l'argument de %s%s: « %s »"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s: argument « %s » trop grand"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Empaqueté par %s(%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Empaqueté par %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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 version 3 ou ultérieure <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Ceci est un logiciel libre: vous êtes libre de le changer et de le "
+"redistribuer.\n"
+"Il n'y a PAS de GARANTIE, dans les limites permises par la loi.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Écrit par %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Écrit par %s et %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Écrit par %s, %s et %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Écrit par %s, %s, %s\n"
+"et %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Écrit par %s, %s, %s\n"
+"%s et %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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 autres.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Signalez les bugs à: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+"Signalez les bugs de %s à: %s\n"
+"Signalez les bugs de traduction à traduc@traduc.org\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "site internet de %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "site internet de %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Aide générale sur l'utilisation des logiciels GNU: <http://www.gnu.org/"
+"gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Les fichiers %s et %s sont différents\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Les fichiers binaires %s et %s sont différents\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Pas de fin de ligne à la fin du fichier"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Utilisez « %s --help » pour en savoir d'avantage."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "valeur invalide pour --ignore-initial: « %s »"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "options -l et -s sont incompatibles"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "échec d'écriture"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "sortie standard"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes Afficher les octets qui diffèrent"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=N Escamoter les N premiers octets des entrées"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=N1:N2 Escamoter les N1 premiers octets de FICHIER1 et "
+"les N2 premiers octets de FICHIER2."
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose Afficher les numéros d'octets et les valeurs de "
+"tous les octets qui diffèrent."
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMITE Comparer au plus LIMITE octets"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent Supprimer la sortie normale"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help Afficher cette aide et terminer"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Afficher le nom et la version du logiciel puis "
+"terminer"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Usage: %s [OPTION]... FICHIER1 [FICHIER2 [SAUT1 [SAUT2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Comparer deux fichiers octet par octet."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Les paramètres optionnels SAUT1 et SAUT2 indiquent le nombre d'octets à "
+"escamoter\n"
+"au début de chaque fichier (zéro par défaut)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Les paramètres requis pour les options longues sont également requis pour "
+"les options courtes.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"valeurs de SAUT peuvent être suivies par un des suffixes multiplicateurs "
+"suivants:\n"
+"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n"
+"GB 1.000.000.000, G 1.073.741.824, et ainsi de suite pour T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Si un FICHIER est « - » ou manquant, lire sur l'entrée standard."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Le statut de fin d'exécution est 0 si les entrées sont les mêmes, 1 si "
+"différentes et 2 si problématiques."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "valeur invalide pour --bytes: « %s »"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "opérande manquante après « %s »"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "opérande supplémentaire « %s »"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s sont différents: octet %s, ligne %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s diffèrent: octet %s, ligne %s est %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: Fin-de-fichier (EOF) sur %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "longueur du contexte invalide « %s »"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "La pagination n'est pas supporté sur cette machine"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "Trop de noms de fichiers dans les options"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "largeur invalide « %s »"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "options de largeur conflictuelles"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "longueur d'horizon invalide « %s »"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "taille de tabulation invalide « %s »"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "options conflictuelles de taille de tabulation"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file et --to-file ont été spécifiés ensemble"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+" --normal Produire un « diff » en format normal (par "
+"défaut)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+"-q, --brief Indiquer seulement si les fichiers diffèrent"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s, --report-identical-files Indiquer si les deux fichiers sont identiques"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C N, --context[=N] Afficher N (3 par défaut) lignes du "
+"contexte copié"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U N, --unified[=N] Afficher N (3 par défaut) lignes dans "
+"le context unifié"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed Générer un script pour « ed »"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr ""
+"-n, --rcs Générer un fichier « diff » au format RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side Affichage sur deux colonnes"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=N Limiter la sortie à au plus N colonnes "
+"imprimées (130 par défaut)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column Afficher les lignes identiques uniquement dans "
+"la colonne de gauche"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines Ne pas afficher les lignes identiques"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function Afficher dans quelle fonction C le changement "
+"se trouve"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RE Montrer la ligne la plus récente correspondant "
+"à RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ÉTIQUETTE Utiliser ÉTIQUETTE au lieu du nom de fichier\n"
+" (peut être répété)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs Étaler les tabulateurs en espaces dans la "
+"sortie"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Aligner les tabulateurs en préfixant un "
+"tabulateur"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=N Les balises de tabulation sont à chaque N (8 "
+"par défaut) colonnes"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty Supprimer les espaces et les tabulations avant "
+"les lignes vides"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate Relayer la sortie à « pr » afin de la paginer"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive Comparer récursivement les sous-répertoires "
+"trouvés"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference Ne pas suivre les liens symboliques"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file Traiter les fichiers absents comme des "
+"fichiers vides"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file Traiter les premiers fichiers absents comme "
+"vides"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case Ignorer la casse lors de la comparaison des "
+"noms de fichiers"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case Tenir compte de la casse lors de la "
+"comparaison des noms de fichiers"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=PAT Exclure les fichiers dont les noms concordent "
+"avec le PATron"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FICHIER Exclure les fichiers dont les noms\n"
+" concordent avec ceux contenus dans le FICHIER"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FICHIER Débuter la comparaison des répertoires par le "
+"FICHIER"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FICHIER1 Comparer le FICHIER1 à toutes les opérandes.\n"
+" FICHIER1 peut être un répertoire"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FICHIER2 Comparer toutes les opérandes à FICHIER2.\n"
+" FICHIER2 peut être un répertoire"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case Ignorer les différences de casses dans le "
+"contenu des fichiers"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Ignorer les changements liés à l'expansion des "
+"tabulations"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space Ignorer les blancs d'espacement à la fin "
+"de la ligne"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change Ignorer les changements dans le nombre "
+"d'espaces"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space Ignorer tout blanc d'espacement"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines Ignorer les changements dont toutes les lignes "
+"sont blanches"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Ignorer les différences dont toutes les\n"
+" lignes concordent avec l'expression régulière RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text Traiter tous les fichiers comme des textes"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Éliminer les retours de chariot de l'entrée"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary Lire et écrire les données en binaire"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NOM Afficher les fichiers fusionnés en marquant les "
+"différences par des « #ifdef NOM »"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT Formater les groupes d'entrée GTYPE avec GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT Formater toutes les lignes d'entrée avec LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT Formater les lignes d'entrée LTYPE avec LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Ces options de formatage fournissent un contrôle fin sur la sortie\n"
+" de diff et généralise -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE peut être soit « old », « new », ou « unchanged ». GTYPE prend une "
+"des valeurs de LTYPE ou « changed »."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (uniquement) peut contenir :\n"
+" %< pour marquer les lignes du FICHIER1\n"
+" %> pour marquer les lignes du FICHIER2\n"
+" %= pour marquer les lignes identiques entre FICHIER1 et FICHIER2\n"
+" %[-][LARGEUR][.[PREC]]{doxX}LETTRE la spécification de LETTRE\n"
+" est identique à la notation de printf()\n"
+" dont les codes possibles de LETTRE sont\n"
+" en majuscule pour le nouveau groupe, \n"
+" en minuscules pour l'ancien groupe:\n"
+" F numéro de la première ligne\n"
+" L numéro de la dernière ligne\n"
+" N nombre de lignes = L-F+1\n"
+" E F-1\n"
+" M L+1 %(A=B?T:E) si A égal B alors T sinon E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (uniquement) peut contenir :\n"
+" %L pour le contenu de la ligne\n"
+" %l pour le contenu de la ligne sans fin de ligne\n"
+" %[-][LARGEUR][.[PREC]]{doxX}n la spécification du numéro de ligne\n"
+" d'entrée selon le format de printf"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT et LFMT peuvent contenir :\n"
+" %% %\n"
+" %c«C» le caractère «C» lui-même\n"
+" %c'\\OOO» le caractère dont le code octal est OOO C le "
+"caractère C (les autres caractères se représentent eux-mêmes)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal Rechercher assidûment le plus petit ensemble de "
+"différences"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=N Retenir N lignes ayant des préfixes et suffixes "
+"identiques"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files Suppose de grands fichiers et de nombreux "
+"petits changements éparpillés"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr ""
+" --normal Produire un « diff » en format normal (par "
+"défaut)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help Afficher cette aide et terminer"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Afficher le nom et la version du logiciel et "
+"terminer"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FICHIERS sont « FICHIER1 FICHIER2 » ou « RÉP1 RÉP2 » ou « RÉP FICHIER... » "
+"ou « FICHIER... RÉP »."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Si --from-file ou --to-file sont fournis, il n'y a pas de restriction sur "
+"les FICHIERS."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Si un FICHIER est « - » alors lire depuis l'entrée standard."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Usage: %s [OPTION]... FICHIERS\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Comparer les fichiers ligne par ligne."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "valeur conflictuelle de l'option %s: « %s »"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "options de style de sortie conflictuelles"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "largeur invalide « %s »"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Seulement dans %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "ne peut comparer « - » avec un répertoire"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "L'option -D ne traite pas les répertoires"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Les sous-répertoires %s et %s sont identiques\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Le fichier %s est un %s alors que le fichier %s est un %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Les liens symboliques %s et %s sont différents\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Les fichiers %s et %s sont identiques\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "options incompatibles"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "« - » fourni pour plus d'un fichier d'entrée"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lecture non-réussie"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all Afficher toutes les différences avec les "
+"conflits entre crochets"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed Écrire un script ed incorporant les "
+"changements\n"
+" du fichier ORIGINAL vers le fichier MODIFIÉ\n"
+" vers le fichier de SORTIE"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap Comme -e mais les conflits sont entre crochets"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only Comme -e mais n'inclut que les changements qui "
+"ne se recoupent pas"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only Comme -e mais inclut les changements qui se recoupent"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X Comme -x mais le conflits sont entre crochets"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i Ajouter les commandes « w » et « q » au script "
+"« ed »"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge Écrire le fichier fusionné selon -A si aucune "
+"autre\n"
+" option n'est spécifiée"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text Traiter tous les fichiers comme des textes"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Éliminer les retours de chariot de l'entrée"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Aligner les tabulateurs en préfixant un "
+"tabulateur"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROG Utiliser le PROGramme pour comparer les "
+"fichiers"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ÉTIQUETTE Utiliser l'ÉTIQUETTE au lieu du nom de "
+"fichier\n"
+" (peut être répété jusqu'à trois fois)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help Afficher cette aide et terminer"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Afficher le nom et la version du logiciel et "
+"terminer"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Comparer trois fichiers ligne par ligne."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Le format de sortie par défaut est une représentation plus ou moins lisible\n"
+"par un humain des changements.\n"
+"\n"
+"Les options -e, -E, -x, -X (et les options longues correspondantes) "
+"provoquent\n"
+"l'écriture d'un script ed au lieu de la sortie par défaut.\n"
+"\n"
+"Finalement, l'option -m (--merge) demande à diff3 de fusionner en interne\n"
+"et de sortir le fichier fusionné. Pour des entrées inhabituelles, c'est "
+"plus\n"
+"robuste que d'utiliser ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Le statut de fin d'exécution est 0 si réussite, 1 si en conflit et 2 si "
+"problématique."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "erreur interne: mélange dans le format des blocs « diff »"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: échec de « diff » : "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "erreur interne: type de « diff » invalide dans process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "format de « diff » invalide ; séparateur de changement invalide"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "format de « diff » invalide ; dernière ligne incomplète"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "programme subsidiaire « %s » n'a pu être invoqué"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr ""
+"format de « diff » invalide ; caractères incorrects au début de la ligne"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "erreur interne : type de « diff » invalide fourni en sortie"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "le fichier d'entrée a rétréci"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "ne peut comparer les noms de fichier « %s » et « %s »"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: boucle récursive dans le répertoire"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=FICHIER Agir interactivement, avec sortie sur FICHIER"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case Banaliser majuscules et minuscules"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Ignorer les changements liés à l'expansion des "
+"tabulations"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space Ignorer les blancs d'espacement à la fin "
+"de la ligne"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Ignorer les changements dans l'espacement"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space Ignorer tout blanc d'espacement"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines Ignorer les changements dont toutes les lignes "
+"sont blanches"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Ignorer les différences dont toutes les\n"
+" lignes concordent avec l'expression régulière RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Éliminer les retours de chariot de l'entrée"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text Traiter tous les fichiers comme des textes"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=N Limiter la sortie à au plus N colonnes "
+"imprimées (130 par défaut)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column Afficher uniquement la colonne de gauche des "
+"lignes identiques"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines Ne pas afficher les lignes identiques"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs Étaler les tabulateurs en espaces dans la sortie"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=N Les balises de tabulation sont à chaque N (8 "
+"par défaut) colonnes"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal Rechercher assidûment le plus petit ensemble de "
+"différences"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files Suppose de grands fichiers et de nombreux "
+"petits changements éparpillés"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROG Utiliser le PROGramme pour comparer les fichiers"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help Afficher cette aide et terminer"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Afficher le nom et la version du logiciel et "
+"terminer"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Usage: %s [OPTION]... FICHIER1 FICHIER2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Fusion côte à côte des différences des fichiers."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "ne peut fusionner l'entrée standard interactivement"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "les deux fichiers à comparer sont des répertoires"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tÉditer puis utiliser les deux versions, chacune chapeautée d'une en-"
+"tête.\n"
+"eb:\tÉditer puis utiliser les deux versions.\n"
+"el ou e1:\tÉditer puis utiliser la version de gauche.\n"
+"er ou e2:\tÉditer puis utiliser la version de droite.\n"
+"e:\tAbandonne les deux version puis éditer une nouvelle version.\n"
+"l ou 1:\tUtiliser la version de gauche.\n"
+"r ou 2:\tUtiliser la version de droite.\n"
+"s:\tInclure les lignes identiques silencieusement.\n"
+"v:\tInclure les lignes identiques et le signaler.\n"
+"q:\tQuitter.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: l'option « --%s » n'est pas reconnue\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SAUT1:SAUT2 --ignore-initial=SAUT1:SAUT2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Ne rien afficher, produire seulement un constat de "
+#~ "fin d'exécution"
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Afficher l'aide-mémoire."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C N --context[=N] Afficher N lignes de contexte (3 par "
+#~ "défaut)\n"
+#~ "-u -U N --unified[=N] Afficher N lignes du contexte unifié (3 par "
+#~ "défaut)\n"
+#~ " --label ÉTIQ Utiliser l'ÉTIQuette comme nom de fichier.\n"
+#~ " -p --show-c-function Identifier la fonction C contenant chaque "
+#~ "différence.\n"
+#~ " -F EXPREG\n"
+#~ " --show-function-line=EXPREG\n"
+#~ " Afficher la ligne la plus récente qui "
+#~ "concorde\n"
+#~ " avec l'EXPression RÉGulière."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Afficher la sortie sur deux colonnes.\n"
+#~ " -w N --width=N Limiter la sortie à N caractères par ligne "
+#~ "(130 par défaut).\n"
+#~ " --left-column Afficher seulement la colonne de gauche pour "
+#~ "les lignes identiques.\n"
+#~ " --suppress-common-lines Ne pas afficher les lignes identiques."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Suppose de grands fichiers et de nombreux petits "
+#~ "changements dispersés."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Afficher les différences qui se recoupent entre crochets."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Afficher le fichier fusionné plutôt qu'un script "
+#~ "«ed» (implique -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L ÉTIQ --label=ÉTIQ Utiliser l'ÉTIQuette plutôt que le nom du fichier."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: l'option -- %c est illégale.\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Ce logiciel est libre; vous pouvez le redistribuer selon les termes de "
+#~ "la\n"
+#~ "licence GNU General Public License. AUCUNE garantie n'est donnée.\n"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Rapporter toutes anomalies à <bug-gnu-utils@gnu.org>"
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "l'option « -%ld » est obsolète; utilise « -%c %ld »"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "l'option « -%ld » est obsolète; l'omettre"
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "programme de service « %s » non repéré"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "échec du programme de service « %s »"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "échec du programme subsidiaire « %s » (statut d'exécution %d)"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "Ce programme est fourni sans AUCUNE GARANTIE, tel que permis par la loi.\n"
+#~ "Vous pouvez le redistribuer selon les termes de « GNU General Public "
+#~ "License »,\n"
+#~ "lire le texte du fichier COPYING pour plus de détails.\n"
+#~ "Pour plus d'informations, voir le fichier portant le nom COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Écrit par Torbjorn Granlund et David MacKenzie."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Écrit par Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman et Len Tower."
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "programme de service « %s » n'est pas exécutable"
+
+# src/diff.c:882 MRO
+#~ msgid "--inhibit-hunk-merge Do not merge hunks."
+#~ msgstr "--inhibit-hunk-merge ne pas faire la fusion des hunks"
+
+#~ msgid "context length specified twice"
+#~ msgstr "La longueur du contexte a été spécifié deux fois."
+
+#~ msgid "multiple `--from-file' options"
+#~ msgstr "options multiples de `--from-file'"
+
+#~ msgid "multiple `--to-file' options"
+#~ msgstr "options multiples de `--to-file'"
+
+#~ msgid "regular empty executable file"
+#~ msgstr "fichier régulier exécutable vide"
+
+#~ msgid "regular executable file"
+#~ msgstr "fichier régulier exécutable"
+
+#~ msgid ""
+#~ "SKIP values may be followed by the following multiplicative suffixes:\n"
+#~ msgstr ""
+#~ "Les valeurs de SAUT peuvent être suivies par un des facteurs "
+#~ "multiplicatifs suivants:\n"
+
+#~ msgid "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+#~ msgstr "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+
+#~ msgid "GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n"
+#~ msgstr ""
+#~ "GB 1,000,000,000, G 1,073,741,824, et ainsi de suite pour T, P, E, Z, Y.\n"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>.\n"
+#~ msgstr "Rapporter toutes anomalies à <bug-gnu-utils@gnu.org>\n"
+
+#~ msgid "If a FILE is `-', read standard input.\n"
+#~ msgstr "Si FICHIER spécifié est `-', alors lire de l'entrée standard.\n"
+
+#~ msgid ": not found\n"
+#~ msgstr ": introuvable\n"
+
+#~ msgid "-D%s: conflicting #ifdef format"
+#~ msgstr "-D%s: format #ifdef conflictuels"
+
+#~ msgid "%s: conflicting line format"
+#~ msgstr "%s: format de ligne conflictuel"
+
+#~ msgid "conflicting group format"
+#~ msgstr "formats de groupes conflictuels"
+
+#~ msgid "--ignore-initial value must be a nonnegative integer"
+#~ msgstr "La valeur de --ignore-initial doit être un entier non-négatif"
+
+#~ msgid "column width must be a positive integer"
+#~ msgstr "Le nombre de colonnes doit être un entier positif."
+
+#~ msgid "context length must be a nonnegative integer"
+#~ msgstr "La longueur du contexte doit être un entier non négatif."
+
+#~ msgid "horizon must be a nonnegative integer"
+#~ msgstr "L'horizon doit être un entier non négatif."
diff --git a/po/ga.gmo b/po/ga.gmo
new file mode 100644
index 0000000..e6c39f6
--- /dev/null
+++ b/po/ga.gmo
Binary files differ
diff --git a/po/ga.po b/po/ga.po
new file mode 100644
index 0000000..24cf04f
--- /dev/null
+++ b/po/ga.po
@@ -0,0 +1,1644 @@
+# Irish translations for diffutils.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Kevin Patrick Scannell <scannell@SLU.EDU>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 2.8.7\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2004-12-03 13:47-0500\n"
+"Last-Translator: Kevin Patrick Scannell <scannell@SLU.EDU>\n"
+"Language-Team: Irish <ga@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "luach neamhbhail --bytes `%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "luach neamhbhail --bytes `%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "earrid chlir"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "cruach thar maoil"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Earrid chrais anaithnid"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "gnthchomhad folamh"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "gnthchomhad"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "comhadlann"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "nasc siombalach"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "ci teachtaireachta"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "samafr"
+
+# FARF --KPS
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "comhad comhchuimhne"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "comhad cuimhne le cinel"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "comhad speisialta den chinel `bloc'"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "comhad speisialta den chinel `carachtar'"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+# `TITA' ?! -KPS
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "comhad speisialta den chinel `bloc'"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "comhad speisialta den chinel `carachtar'"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "comhad aisteach"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "comhad speisialta den chinel `bloc'"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "soicad"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "comhad aisteach"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: T an rogha `%s' dbhroch\n"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: T an rogha `-W %s' dbhroch\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: n cheadatear argint i ndiaidh na rogha `--%s'\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: n cheadatear argint i ndiaidh na rogha `%c%s'\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: n folir argint don rogha `%s'\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: rogha anaithnid `--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: rogha anaithnid `%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: rogha neamhbhail -- %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: n folir argint don rogha -- %c\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: T an rogha `-W %s' dbhroch\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, 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"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: n folir argint don rogha `%s'\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Bua!"
+
+# #-#-#-#-# findutils-4.2.6.ga.po (findutils 4.2.6) #-#-#-#-#
+# ugh. Not clear what kind of things we're matching -- KPS
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nl a leithid ann"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Slonn ionadaochta neamhbhail"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carachtar cimheasa neamhbhail"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Aicme charachtair neamhbhail"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Clslais ag deireadh"
+
+# #-#-#-#-# sed-4.1.1.ga.po (sed 4.1.1) #-#-#-#-#
+# coinage - KPS
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Cltagairt neamhbhail"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ n [^ corr"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( n \\( corr"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ corr"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "bhar neamhbhail idir \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Deireadh raoin neamhbhail"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Cuimhne dithe"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Is neamhbhail an slonn ionadaochta roimhe seo"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Deireadh le slonn ionadaochta gan choinne"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Slonn ionadaochta rmhr"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") n \\) corr"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Nl aon slonn ionadaochta roimhe seo"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "cuimhne dithe"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr "Earrid chrais anaithnid"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "luach neamhbhail --bytes `%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr ""
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Le %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Le %s agus %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Le %s, %s, agus %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Le %s, %s, %s,\n"
+"agus %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Le %s, %s, %s,\n"
+"%s, agus %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "T difrocht idir na comhaid %s agus %s\n"
+
+#: src/analyze.c:455
+#, fuzzy, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "T difrocht idir na comhaid %s agus %s\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Gan lne nua ag an chomhadchroch"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Bain triail as `%s --help' chun tuilleadh eolais a fhil."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "luach neamhbhail --ignore-initial `%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "Nl na roghanna -l agus -s comhoirinach"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "teipeadh ag scrobh"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "aschur caighdenach"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes Taispein na bearta at difrila."
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i UIMHIR --ignore-initial=UIMHIR Gabh thar an chad UIMHIR beart "
+"ionchurtha."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr " Gabh thar an chad SCIP1 beart as COMHAD1 agus SCIP2 as COMHAD2."
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l --verbose Taispein uimhreacha agus luachanna do bhearta uile difrila."
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n TEOR --bytes=TEOR Cuir TEOR beart i gcomparid, ar a mhad."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Taispein eolas faoin leagan."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "sid: %s [ROGHA]... COMHAD1 [COMHAD2 [SCIPEIL1 [SCIPEIL2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Cuir dh chomhad i gcomparid, beart le beart."
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Is ard at i SCIP1 agus SCIP2 n lonta na mbeart a scipeil i ngach comhad."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Is fidir na hiarmhreanna a leanas a chur i ndiaidh SCIP:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, srl. do T, P, E, Z, Y."
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Mura bhfuil COMHAD ann, n ms `-' , ligh n ionchur caighdenach."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr "Stdas scortha: 0 ms ionann iad, 1 ms difriil, 2 m t fadhb ann."
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "luach neamhbhail --bytes `%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "n folir argint i ndiaidh `%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "oibreann breise `%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s difriil: beart %s, lne %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s difriil: beart %s, lne %s = %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF ar %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "Fad neamhbhail comhthacs `%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "N thacatear leis an uimhri leathanach ar an stromhaire seo"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "an iomarca argint do lipid chomhaid"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "leithead neamhbhail `%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "roghanna leithid contrrtha"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "fad laslne neamhbhail `%s'"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "t an mhid thib `%s' neamhbhail"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "Roghanna tbmhid contrrtha"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "tugadh --from-file agus --to-file lena chile"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal Aschuir diff coitianta."
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief N taispein ach difriil n nach ea."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s --report-identical-files Tuairiscigh nuair at dh chomhad comhionanna."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w UIMH --width=UIMH UIMH coln priontla ar a mhad (ramhshocr=130)."
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed Aschuir script `ed'."
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Aschuir diff i gcruth RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w UIMH --width=UIMH UIMH coln priontla ar a mhad (ramhshocr=130)."
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column N taispein an coln ar dheis ms ionann iad."
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines N taispein lnte at i bpirt acu."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=COMHAD Cuir COMHAD (n comhadlann) i gcomparid le gach oibreann."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs leathnaigh tib go spsanna san aschur."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab Ailnigh tib tr thb a chur in ionad sps tosaigh."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr "--tabsize=UIMH Tbstop gach UIMH coln (ramhshocr=8)."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l --paginate uimhrigh leathanaigh le `pr'."
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r --recursive Cuir fochomhadlanna i gcomparid go hathchrsach."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file Caith le comhad ar iarraidh mar chomhad folamh."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+"--unidirectional-new-file Ms ar iarraidh, caith leis an chad chomhad\n"
+" mar chomhad folamh."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr "--ignore-file-name-case N b csogair le hainmneacha comhaid."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case B csogair maidir le hainmneacha comhaid."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-X SLONN --exclude=SLONN Fg comhaid as m t siad comhoirinacha le SLONN."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X COMHAD --exclude-from=COMHAD Fg comhaid as m t siad comhoirinacha le "
+"haon\n"
+" slonn ionadaochta as an CHOMHAD."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S COMHAD --starting-file=COMHAD Tosaigh le COMHAD agus comhadlanna "
+"gcimheas."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=COMHAD Cuir COMHAD (n comhadlann) i gcomparid le gach oibreann."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=COMHAD Cuir gach oibreann i gcomparid le COMHAD (n comhadlann)."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i --ignore-case N b csogair le hinneachar na gcomhad."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Dan neamhshuim ar athruithe leathn na dtib."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Dan neamhshuim ar sps bn go hiomln."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Dan neamhshuim ar mhid an spis bn."
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space Dan neamhshuim ar sps bn go hiomln."
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B --ignore-blank-lines Dan neamhshuim ar lnte folmha."
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I SI --ignore-matching-lines=RE Dan neamhshuim ar lnte at "
+"comhoirinach\n"
+" leis an slonn SI."
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Caith le gach comhad mar thacschomhad."
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Dealaigh aisfhilleadh carriste gach lne ionchurtha."
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Ligh agus scrobh sonra sa mhd dnrtha."
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D AINM --ifdef=AINM Taispein comhad cumaiscthe chun na diff-a\n"
+" `#ifdef AINM' a liri"
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GCINL-group-format=GFMD Taispein grpa GCINL ionchuir de rir GFMD."
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr "--line-format=LFMD Taispein gach lne ionchuir de rir LFMD."
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--LCINL-line-format=LFMD Taispein lnte LCINL ionchuir de rir LFMD."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr " LCINL = `old', `new', n `unchanged'. GCINL = LCINL n `changed'."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" Is ard at i GFMT n:\n"
+" %< lnte as COMHAD1\n"
+" %> lnte as COMHAD2\n"
+" %= lnte at i gCOMHAD1 agus COMHAD2 araon\n"
+" %[-][LEITHEAD][.[SONR]]{doxX}LITIR sonr do litir mar C `printf'\n"
+" Is LITIR mar a leanas (agus litreacha beaga don ghrpa `old'):\n"
+" F an chad lne-uimhir\n"
+" L an lne-uimhir dheiridh\n"
+" N lon na lnte = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" Is ard at i LFMT n::\n"
+" %L bhar na lne\n"
+" %l bhar na lne, gan aon lne nua\n"
+" %[-][LEITHEAD][.[SONR]]{doxX}n sonr do lne-uimhir mar C `printf'"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Is fidir na teaghrin a leanas a bheith i GLA n LLA:\n"
+" %% %\n"
+" %c'C' an carachtar litriil C\n"
+" %c'\\OOO' an carachtar le cd ochtnrtha OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Obair go crua le haghaidh nos l athruithe."
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=UIMH Coinnigh UIMH lne den rimr/iarmhr choiteann."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"-H --speed-large-files Comhaid mra agus go leor mionathruithe forleata."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal Aschuir diff coitianta."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Taispein eolas faoin leagan."
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"COMHAID = `COMHAD1 COMHAD2' n `COMHADLANN1 COMHADLANN2' n `COMHADLANN "
+"COMHAD...' n `COMHAD... COMHADLANN'."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"M t --from-file n --to-file tugtha, nl a leithid de shrian ar COMHAID."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "Ms '-' an COMHAD, ligh n ionchur caighdenach."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "sid: %s [ROGHA]... COMHAID\n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr "Dan comparid idir na comhaid, lne ar lne."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "luach contrrtha don rogha %s: `%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "roghanna contrrtha le haghaidh na stle aschuir"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "leithead neamhbhail `%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "I %s amhin: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "n fidir `-' a chur i gcomparid le comhadlann"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "Nl an rogha -D ar fil do chomhadlanna"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Fochomhadlanna i gcoitianta: %s agus %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "T comhad %s ina %s ach t comhad %s ina %s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "T difrocht idir na comhaid %s agus %s\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Is comhionann iad na comhaid %s agus %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr ""
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "roghanna neamh-chomhoirinacha"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "bh `-' tugtha le haghaidh nos m n inchomhad amhin"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "theip ar lamh"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A --show-all Taispein gach athr agus cuir coinbhleachta idir libn."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Scrobh i MOCHOMHAD na hathruithe neamhchumaiscthe SEANCHOMHAD "
+"go DOCHOMHAD."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap Taispein na hathruithe neamhchumaiscthe agus cuir "
+"coinbhleachta idir libn."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3 --easy-only Taispein athruithe neamhchumaiscthe forluiteacha."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only Taispein na hathruithe forluiteacha."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Cuir na horduithe `w' agus `q' le scripteanna `ed'."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Caith le gach comhad mar thacschomhad."
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Dealaigh aisfhilleadh carriste gach lne ionchurtha."
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab Ailnigh tib tr thb a chur in ionad sps tosaigh."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+"--diff-program=CLR Bain sid as an CLR chun comhaid a chur i "
+"gcomparid."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Taispein eolas faoin leagan."
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "sid: %s [ROGHA]... MOCHOMHAD SEANCHOMHAD DOCHOMHAD\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Cuir tr chomhad i gcomparid, lne ar lne."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Stdas scortha = 0 (rathil), 1 (coinbhleachta), 2 (trioblid)."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "earrid inmhenach: formid de na bloic diff trna chile"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: theip ar diff: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "earrid inmhenach: cinel neamhbhail diff san fheidhm process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "formid diff neamhbhail; teorantir neamhbhail idir athruithe"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "formid neamhbhail diff; lne deiridh neamhiomln"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "norbh fhidir an fochlr `%s' a rith"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "formid neamhbhail diff; carachtair mhchearta ag tosach na lne"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr ""
+"earrid inmhenach: seachadadh cinel neamhbhail diff go dt an aschur"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "crapadh an t-inchomhad"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr ""
+"n fidir na hainmneacha comhaid `%s' agus `%s' a chur i gcomparid le chile"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr ""
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o COMHAD --output=COMHAD Md idirghnomhach, ag scrobh an aschuir i "
+"gCOMHAD."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case N b csogair."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Dan neamhshuim ar athruithe leathn na dtib."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Dan neamhshuim ar sps bn go hiomln."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Dan neamhshuim ar mhid an spis bn."
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space Dan neamhshuim ar spsanna bn go hiomln."
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B --ignore-blank-lines Dan neamhshuim ar lnte folmha."
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I SI --ignore-matching-lines=RE Dan neamhshuim ar lnte at "
+"comhoirinach\n"
+" leis an slonn SI."
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Dealaigh aisfhilleadh carriste gach lne ionchurtha."
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Caith le gach comhad mar thacschomhad."
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w UIMH --width=UIMH UIMH coln priontla ar a mhad (ramhshocr=130)."
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column N taispein an coln ar dheis ms ionann iad."
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines N taispein lnte at i bpirt acu."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs leathnaigh tib go spsanna san aschur."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr "--tabsize=UIMH Tbstop gach UIMH coln (ramhshocr=8)."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Obair go crua le haghaidh nos l athruithe."
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files Comhaid mra agus go leor mionathruithe forleata."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+"--diff-program=CLR Bain sid as an CLR chun comhaid a chur i "
+"gcomparid."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Taispein eolas faoin leagan."
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "sid: %s [ROGHA]... COMHAD1 COMHAD2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Cumaisc difrochta idir na comhaid, taobh le taobh."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "n fidir an t-ionchur caighdenach a chumasc go hidirghnomhach"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "is comhadlanna iad na comhaid le cur i gcomparid"
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tCuir na leaganacha araon in eagar, agus ceanntsc le gach.\n"
+"eb:\tCuir na leaganacha araon in eagar, agus ansin bain sid astu.\n"
+"el:\tCuir an leagan ar cl in eagar, agus ansin bain sid as.\n"
+"er:\tCuir an leagan ar dheis in eagar, agus ansin bain sid as.\n"
+"e:\tCuir leagan nua in eagar.\n"
+"l:\tBain sid as an leagan ar cl.\n"
+"r:\tBain sid as an leagan ar dheis.\n"
+"s:\tCuir comhlnte san ireamh go balbh.\n"
+"v:\tCuir comhlnte san ireamh go foclach.\n"
+"q:\tScoir.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: rogha anaithnid `--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: rogha neamhcheadaithe -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Is saorbhogearra an romhchlr seo; fach ar an bhunchd le haghaidh\n"
+#~ "coinnollacha cipela. Nl barnta ar bith ann; go fi nl barnta ann\n"
+#~ "d'INDOLTACHT n FEILINACHT DO FHEIDHM AR LEITH.\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SCIP1:SCIP2 --ignore-initial=SCIP1:SCIP2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent N haschuir rud ar bith; gin stdas scortha."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Taispein an chabhair seo.."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Seol tuairisc fabhtanna chuig <bug-gnu-utils@gnu.org>."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "t an rogha `-%ld' as feidhm; bain sid as `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "t an rogha `-%ld' as feidhm; fg ar lr"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C UIMHIR --context[=UIMHIR] Taispein UIMHIR lne de chomhthacs\n"
+#~ " cipeilte (ramhshocr = 3).\n"
+#~ "-u -U UIMHIR --unified[=UIMHIR] Taispein UIMHIR lne de chomhthacs\n"
+#~ " aontaithe (ramhshocr = 3).\n"
+#~ " --label LIPAD Bain sid as LIPAD in ionad ainm comhaid.\n"
+#~ " -p --show-c-function Taispein an fheidhm C do gach difrocht.\n"
+#~ " -F SI --show-function-line=SI Taispein an lne is dana at\n"
+#~ " comhoirinach leis an slonn SI."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Taispein le dh choln.\n"
+#~ " -W UIMH --width=UIMH Taispein UIMH carachtar sa lne ar a mhad,\n"
+#~ " (ramhshocr=130).\n"
+#~ " --left-column N taispein ach an coln ar cl do lnte canna\n"
+#~ " --suppress-common-lines N taispein lnte canna."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Comhaid mra agus go leor mionathruithe forleata."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Taispein na hathruithe forluiteacha, idir libn."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Taispein comhad cumaiscthe in ionad script ed (ramhshocr -"
+#~ "A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L LIPAD --label=LIPAD sid LIPAD in ionad ainm comhaid."
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "fochlr `%s' gan aimsi"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "theip ar an fhochlr `%s'"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "theip ar an fhochlr `%s' (stdas scortha %d)"
diff --git a/po/gl.gmo b/po/gl.gmo
new file mode 100644
index 0000000..e357aeb
--- /dev/null
+++ b/po/gl.gmo
Binary files differ
diff --git a/po/gl.po b/po/gl.po
new file mode 100644
index 0000000..0578477
--- /dev/null
+++ b/po/gl.po
@@ -0,0 +1,1705 @@
+# Galician translation of GNU diffutils
+# Copyright © 2000, 2001, 2002 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Jacobo Tarrío Barreiro <jtarrio@trasno.net>, 2000, 2001, 2002.
+# Miguel Anxo Bouzada <mbouzada@gmail.com>, 2011.
+# Leandro Regueiro <leandro.regueiro@gmail.com>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.2\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2011-10-17 12:43+0100\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: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "o argumento «%s» de %s%s é incorrecto"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "o argumento «%s» de %s%s é incorrecto"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "erro do programa"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "desbordamento da pila"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Produciuse un erro descoñecido do sistema"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "ficheiro regular baleiro"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "ficheiro regular"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "directorio"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "ligazón simbólica"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "cola de mensaxes"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semáforo"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "obxecto de memoria compartida"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "obxecto de memoria con tipo"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "ficheiro especial de bloques"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "ficheiro especial de caracteres"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "ficheiro especial de bloques"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "ficheiro especial de caracteres"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "ficheiro estraño"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "ficheiro especial de bloques"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "ficheiro estraño"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "'%s' está danado. A liña %d na sección Opción é incorrecta"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: a opción «-W %s» é ambigua\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: a opción «--%s» non permite un argumento\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: a opción «%c%s» non permite un argumento\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: a opción «--%s» require un argumento\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: non se recoñece a opción «--%s»\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: non se recoñece a opción «%c%s»\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opción incorrecta -- «%c»\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opción require un argumento -- «%c»\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: a opción «-W %s» é ambigua\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: a opción «-W %s» non permite un argumento\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: a opción «-W %s» require un argumento\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "«"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "»"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Correcto"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Non hai coincidencias"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expresión regular incorrecta"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carácter de ordenamento incorrecto"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nome da clase de caracteres incorrecto"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barra invertida ao final"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referencia cara a atrás incorrecta"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ou [^ non emparellado"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( non emparellado"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ non emparellado"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "O contido entre \\{\\} non é correcto"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Final do rango incorrecto"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoria esgotada"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente incorrecta"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Final prematura da expresión regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expresión regular demasiado grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) non emparellado"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Non hai unha expresión regular anterior"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "esgotouse a memoria"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "entrada estándar"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "saída estándar"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "saída estándar de erro"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "fluxo descoñecido"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "produciuse un erro ao volver abrir %s en modo %s"
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "o argumento «%s» de %s%s é incorrecto"
+
+#: lib/xstrtol-error.c:68
+#, fuzzy, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "sufixo incorrecto %s%s no argumento «%s»"
+
+#: lib/xstrtol-error.c:72
+#, fuzzy, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s argumento «%s» demasiado longo"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Empaquetado por %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Empaquetado por %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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 GPLv3+: GNU GPL versión 3 ou posterior <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Isto é software libre: vostede é libre para modificalo e redistribuílo.\n"
+"NON HAI GARANTÍA, ata o punto permitido pola lei.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Escrito por %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Escrito por %s e %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Escrito por %s, %s e %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Escrito por %s, %s, %s\n"
+"e %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Escrito por %s, %s, %s\n"
+"%s e %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Envíe os informes de erros a: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Envíe %s informes de erros a: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s páxina web: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s páxina web: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+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"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Os ficheiros %s e %s son diferentes\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Os ficheiros binarios %s e %s son diferentes\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Non hai un salto de liña na fin da liña"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Probe «%s --help» para obter máis información."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "valor de --ignore-initial «%s» non válido"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "as opcións -l e -s son incompatíbeis"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "fallou a escritura"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "saída estándar"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "Axustar a resolución de impresión"
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i N --ignore-initial=N Omitir os primeiros N bytes de entrada."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+" Omitir os primeiros N1 bytes de FICH1 e os primeiros N2 bytes de FICH2."
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose Amosar os números e valores dos bytes que difiran."
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n LÍMITE --bytes=LÍMITE Comparar como moito LÍMITE bytes."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Mostrar información da versión e saír"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Uso: %s [OPCIÓN]... FICH1 [FICH2 [N1 [N2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Comparar dous ficheiros byte a byte."
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr "N1 e N2 son o número de bytes a omitir en cada ficheiro."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Os valores N poden estar seguidos polos seguintes sufixos multiplicativos:\n"
+"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n"
+"GB 1.000.000.000, G 1.073.741.824, e así para T, P, E, Z e Y."
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Se un FICHEIRO é «-» ou non se indica, lese da entrada estándar."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"O estado de saída é 0 se as entradas son iguais, 1 se son diferentes, 2 en "
+"caso de problema."
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "valor de --bytes «%s» non válido"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "falta un operando despois de «%s»"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "operando «%s» sobrante"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s son diferentes: byte %s, liña %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s son diferentes: byte %s, liña %s é %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: Fin de ficheiro en %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "lonxitude do contexto «%s» non válida"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "a paxinación non está admitida nesta máquina"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "demasiadas opcións de etiquetas de ficheiro"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "largo «%s» non válido"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "opcións de largura conflitivas"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "lonxitude do horizonte «%s» non válida"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "tamaño de tabulación «%s» non válido"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "opcións de tamaño de tabulación conflitivas"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "Especificáronse --from-file e --to-file ao mesmo tempo"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "Aparencia predefinida no modo normal"
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief Producir unha saída só se os ficheiros teñen diferencias."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s --report-identical-files Informar cando dous ficheiros son o mesmo."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr "-w NÚM --width=NÚM Amosar como moito NÚM columnas (130 por omisión)."
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "Gardar a saída da consola de Script-Fu"
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Producir un diff en formato RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-w NÚM --width=NÚM Amosar como moito NÚM columnas (130 por omisión)."
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column Amosar só a columna da esquerda nas liñas comúns."
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Non amosar as liñas comúns."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=FICH1 Comparar FICH1 con todos os operandos. Pode ser "
+"directorio."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Expandir as tabulacións a espazos na saída."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab Facer que as tabulacións queden aliñadas poñendo outra\n"
+" tabulación ao principio da liña."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr "--tabsize=NÚM Tabulacións de NÚM columnas (8 por omisión)."
+
+#: src/diff.c:910
+#, fuzzy
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+"--suppress-blank-empty Suprime espazos ou tabuladores antes dunha liña "
+"baleira."
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l --paginate Pasar a saída por «pr» para paxinala."
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r --recursive Comparar recursivamente os subdirectorios que se atopen."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file Tratar os ficheiros ausentes como baleiros."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+"--unidirectional-new-file Tratar os ficheiros antigos ausentes como\r\n"
+"a baleiros."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+"--ignore-file-name-case Ignorar maiúsculas/minúsculas no nome do ficheiro."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case Ter en conta as maiúsculas/minúsculas\r\n"
+" ao comparar os nomes dos ficheiros."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x MOD --exclude=MOD Excluír os ficheiros que coinciden co MODelo."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X FICH --exclude-from=FICH Excluír ficheiros que coinciden con algún\r\n"
+" modelo do FICHeiro."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S FICH --starting-file=FICH Comezar no FICHeiro ao comparar directorios."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=FICH1 Comparar FICH1 con todos os operandos. Pode ser "
+"directorio."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=FICH2 Comparar todos os operandos con FICH2. Pode ser un "
+"directorio."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i --ignore-case Ignorar maiúsculas/minúsculas no contido do ficheiro."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Ignorar os cambios pola expansión de tabulacións."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Ignorar todos os espazos en branco."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Ignorar os cambios na cantidade de espazos."
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "Todo visíbel (ignorar patrón)"
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines Ignorar os cambios que teñan todas as liñas en "
+"branco"
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I EXPR-REG --ignore-matching-lines=EXPR-REG Ignorar os cambios nos que "
+"todas as liñas\r\n"
+" conteñan EXPR-REG."
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Tratar todos os ficheiros como texto"
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Eliminar os retornos de carro á fin das liñas de "
+"entrada."
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Ler e escribir datos en modo binario."
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D NOME -ifdef=NOME Amosar o ficheiro mesturado con diffs «#ifdef NOME»."
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GTYPE-group-format=GFMT Similar, mais formatar os grupos de entrada GTYPE"
+"\r\n"
+" con GFMT."
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+"--line-format=LFMT Similar, mais formatar todas as liñas de entrada con "
+"LFMT."
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--LTYPE-line-format=LFMT Similar, mais formatar as liñas de entrada LTYPE"
+"\r\n"
+" con LFMT."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE é «old» (antigo), «new» (novo) ou «unchanged» (sen cambios).\r\n"
+" GTYPE é LTYPE ou «changed» (con cambios)."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT pode conter:\n"
+" %< liñas do FICH1\n"
+" %> liñas do FICH2\n"
+" %= liñas comúns a FICH1 e FICH2\n"
+" %[-][ANCHO][.[PREC]]{doxX}LETRA especificación estilo printf para a "
+"LETRA\n"
+" As LETRAs son como segue para o novo grupo, en minúsculas para o "
+"antigo:\n"
+" F número da primeira liña\n"
+" L número da última liña\n"
+" N número de liñas = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT pode conter:\n"
+" %L contido da liña\n"
+" %l contido da liña, excluíndo os saltos de liña finais\n"
+" %[-][ANCHO][.[PREC]]{doxX}n especif. estilo printf do número da liña"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT e LFMT poden conter:\n"
+" %% %\n"
+" %c«C» o carácter C\n"
+" %c«\\OOO» o carácter de código octal OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Procurar atopar o conxunto de cambios máis pequeno."
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=NUM Manter NUM liñas do prefixo e sufixo comúns."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"-H --speed-large-files Asumir ficheiros longos e pequenos cambios "
+"dispersos."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "Aparencia predefinida no modo normal"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Mostrar información da versión e saír"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"Os FICHEIROS son «FICH1 FICH2», «DIR1 DIR2», «DIR FICH...» ou «FICH... DIR»."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Se se indica --from-file ou --to-file, non hai restricións nos FICHEIROS."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "Se un FICHEIRO é «-», lese da entrada estándar."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Uso: %s [OPCIÓN]... FICHEIROS\n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr "Comparar os ficheiros liña a liña."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "valor «%1$s» da opción %2$s conflitivo"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "opcións de estilo da saída conflitivas"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "largo «%s» non válido"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Só en %s: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "non se pode comparar «-» cun directorio"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "A opción -D non está admitida con directorios"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdirectorios comúns: %s e %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "O ficheiro %s é un %s mentres que o ficheiro %s é un %s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Os ficheiros %s e %s son diferentes\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Os ficheiros %s e %s son idénticos\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "opcións incompatíbeis"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "Especificouse «-» para máis dun ficheiro de entrada"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "fallou a lectura"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-a --show-all Amosar todos os cambios, cos conflitos entre parénteses."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Produce cambios sen mesturar de FICH-ANTIGO a TEU-FICH en MEU-FICH."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap Amosar cambios sen mesturar cos conflitos entre "
+"parénteses."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3 --easy-only Amosar cambios non sobrepostos e non mesturados."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only Amosar los cambios que se superpoñen."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Engadir as ordes «w» e «q» aos scripts en ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Tratar todos os ficheiros como texto"
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Eliminar os retornos de carro á fin das liñas de "
+"entrada."
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab Facer que as tabulacións queden aliñadas poñendo outra\n"
+" tabulación ao principio da liña."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+"--diff-program=PROGRAMA Empregar o PROGRAMA para comparar os ficheiros."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Mostrar información da versión e saír"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Uso: %s [OPCIÓN]... MEU-FICH ANTIGO-FICH TEU-FICH\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Comparar tres ficheiros liña a liña."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"O estado de saída é 0 se é correcto, 1 se hai conflitos, 2 en caso de "
+"problema."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "erro interno: fallo no formato dos bloques diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff fallou: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "erro interno: tipo de diff non válido en process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "formato de diff non válido; separador de cambios non válido"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "formato de diff non válido: última liña incompleta"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "non foi posíbel invocar o programa subsidiario «%s»"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "formato de diff non válido: caracteres a principio de liña incorrectos"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "erro interno_ tipo de diff non válido pasado á saída"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "o ficheiro de entrada minguou"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "non se poden comparar os ficheiros «%s» e «%s»"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: bucle de directorio recursivo"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o FICH --output=FICH Operar interactivamente, enviando a saída ao "
+"FICHeiro."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i --ignore-case Ignorar as diferencias entre maiúsculas e minúsculas."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Ignorar os cambios pola expansión de tabulacións."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Ignorar todos os espazos en branco."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Ignorar os cambios na cantidade de espazos."
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "Todo visíbel (ignorar patrón)"
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines Ignorar os cambios que teñan todas as liñas en "
+"branco"
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I EXPR-REG --ignore-matching-lines=EXPR-REG Ignorar os cambios nos que "
+"todas as liñas\r\n"
+" conteñan EXPR-REG."
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Eliminar os retornos de carro á fin das liñas de "
+"entrada."
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Tratar todos os ficheiros como texto"
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-w NÚM --width=NÚM Amosar como moito NÚM columnas (130 por omisión)."
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column Amosar só a columna da esquerda nas liñas comúns."
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Non amosar as liñas comúns."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Expandir as tabulacións a espazos na saída."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr "--tabsize=NÚM Tabulacións de NÚM columnas (8 por omisión)."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Procurar atopar o conxunto de cambios máis pequeno."
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files Asumir ficheiros longos e pequenos cambios "
+"dispersos."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+"--diff-program=PROGRAMA Empregar o PROGRAMA para comparar os ficheiros."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Mostrar información da versión e saír"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Uso: %s [OPCIÓN]... FICH1 FICH2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Mestura en dúas columnas das diferencias entre os ficheiros."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "non se pode mesturar a entrada estándar interactivamente"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "ámbolos dous ficheiros a ser comparados son directorios"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEdita e usa ambas versións, cada unha decorada cunha cabeceira.\n"
+"eb:\tEdita e usa ambas versións.\n"
+"el ou e1:\tEdita e usa a versión esquerda.\n"
+"er ou e2:\tEdita e usa a versión dereita.\n"
+"e:\tEdita unha nova versión.\n"
+"l ou 1:\tUsa a versión esquerda.\n"
+"r ou 2:\tUsa a versión dereita.\n"
+"s: Inclúe liñas comúns silenciosamente.\n"
+"v: Inclúe liñas comúns de xeito detallado.\n"
+"q: Saír.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: non se recoñece a opción «--%s»\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i N1:N2 --ignore-initial=N1:N2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent Non producir nada; só dar o estado de saída."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Amosar esta axuda."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NÚM --context[=NÚM] Amosar NÚM (3 por omisión) liñas de contexto "
+#~ "copiado.\n"
+#~ "-u -U NÚM --unified[=NÚM] Amosar NÚM (3 por omisión) liñas de contexto "
+#~ "unificado.\n"
+#~ " --label ETIQUETA Usar a ETIQUETA no canto do nome do ficheiro.\n"
+#~ " -p --show-c-function Amosar en que función C está cada cambio.\n"
+#~ " -F EXPR-REG --show-function-line=EXPR-REG Amosar a liña máis recente "
+#~ "que coincide\n"
+#~ " con EXPR-REG."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Producir a saída en dúas columnas.\n"
+#~ " -w NÚM --width=NÚM Amosar como moito NÚM (130 por omisión) columnas "
+#~ "de impresión.\n"
+#~ " --left-column Amosar só a columna da esquerda nas liñas comúns.\n"
+#~ " --suppress-common-lines Non amosar as liñas comúns."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Asumir ficheiros longos e pequenos cambios dispersos."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr ""
+#~ "-X Amosar os cambios que se sobrepoñan, poñéndoos entre parénteses."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Amosar o ficheiro mesturado no canto dun script en ed [-A]."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L ETIQ --label=ETIQ Usar a ETIQueta no canto do nome do ficheiro."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "ón non permitida -- %c\n"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "én SEN GARANTÍA, ata o permitido pola lei.\n"
+#~ "ír copias deste programa baixo os termos\n"
+#~ "ública Xeral de GNU.\n"
+#~ "áis información sobre estas materias, vexa o ficheiro chamado COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "örn Granlund e David MacKenzie."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr ""
+#~ "\n"
+#~ "ón a <proxecto@trasno.net>."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr "\n"
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "ón `-%ld' é obsoleta; empregue `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "ón `-%ld' é obsoleta; omítaa"
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "é executable"
+
+#~ msgid ""
+#~ "SKIP values may be followed by the following multiplicative suffixes:\n"
+#~ msgstr "\n"
+
+#~ msgid "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+#~ msgstr "\n"
+
+#~ msgid "GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n"
+#~ msgstr "í para T, P, E, Z e Y.\n"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>.\n"
+#~ msgstr "\n"
+
+#~ msgid "context length specified twice"
+#~ msgstr "úas veces"
+
+#~ msgid "multiple `--from-file' options"
+#~ msgstr "óns `--from-file' múltiples"
+
+#~ msgid "multiple `--to-file' options"
+#~ msgstr "óns `--to-file' múltiples"
+
+#~ msgid "If a FILE is `-', read standard input.\n"
+#~ msgstr "é `-', lese da entrada estándar.\n"
+
+#~ msgid ": not found\n"
+#~ msgstr "\n"
+
+#~ msgid "conflicting line format"
+#~ msgstr "ña con conflictos"
diff --git a/po/he.gmo b/po/he.gmo
new file mode 100644
index 0000000..02f6c59
--- /dev/null
+++ b/po/he.gmo
Binary files differ
diff --git a/po/he.po b/po/he.po
new file mode 100644
index 0000000..d56d3b8
--- /dev/null
+++ b/po/he.po
@@ -0,0 +1,1599 @@
+# Hebrew messages for GNU Diffutils -*- coding: hebrew-iso-8bit -*-
+# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Eli Zaretskii <eliz@is.elta.co.il>, 2001, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 2.8.3\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2002-06-17 13:03+0300\n"
+"Last-Translator: Eli Zaretskii <eliz@gnu.org>\n"
+"Language-Team: Hebrew <eliz@gnu.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "--bytes `%s' "
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "--bytes `%s' "
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr " "
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr " "
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "- "
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr " "
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr ""
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr ""
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr " "
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr " "
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr ""
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr " "
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr " "
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr " "
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr " "
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo "
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr " "
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr " "
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr " "
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr " "
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr ""
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr " "
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s - `%s' \n"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s - `-W %s' \n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s `--%s' \n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s `%c%s' \n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s `%s' \n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s `--%s' - \n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s `%c%s' - \n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s -- %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: -- %c\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s - `-W %s' \n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s `-W %s' \n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s `%s' \n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr ""
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr " "
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr " "
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "- "
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr " - "
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "`\\' "
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr " - "
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "- [^ ["
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "- \\( ("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "- \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} "
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr " "
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr " "
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr " "
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr " "
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr " "
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "- \\) )"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr " "
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr " "
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr "- "
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "--bytes `%s' "
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr ""
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, fuzzy, c-format
+msgid "Written by %s.\n"
+msgstr ".Thomas Lord \" "
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, fuzzy, c-format
+msgid "Written by %s and %s.\n"
+msgstr ".Randy Smith \" "
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, fuzzy, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ".Randy Smith \" "
+
+#. 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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr " `%s'- `%s' \n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr " `%s'- `%s' \n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr " - "
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr ". `%s --help' "
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "--ignore-initial `%s' "
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr " -s- -l "
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr " "
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr " "
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr " . -b --print-bytes"
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr " . N -i N --ignore-initial=N"
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ". N2 N1 "
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ". ' -l --verbose"
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr " . N -n N --bytes=N"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr " . -v --version"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr " %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]] : \n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr ". "
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr " . SKIP2- SKIP1"
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+" : SKIP \n"
+" ,M 1,048,576, MB 1,000,000 ,K 1024 ,kB 1000,\n"
+" .T, P, E, Z, Y ,G 1,073,741,824 ,GB 1,000,000,000"
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr " . , `-' FILE "
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "--bytes `%s' "
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "`%s' "
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "`%s' "
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s- %s %s ,%s \n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s- %s %s ,%s %3o %s %3o %s \n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: %s \n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "`%s' "
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr " "
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr " -L "
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "`%s' "
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr " "
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "--horizon-lines `%s' "
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "`%s' Tab "
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr " Tab "
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--to-file --from-file "
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr " . --normal"
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr " . -q --brief"
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+" . -s --report-identical-files"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ". (130 \") NUM -w NUM --width=NUM"
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr " .ed -e --ed"
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr " .RCS -n --rcs"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ". (130 \") NUM -w NUM --width=NUM"
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr " . , -l --left-column"
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr ""
+" . -s --suppress-common-lines"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+". FILE1 . FILE1 --from-file=FILE1"
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr " . TAB -t --expand-tabs"
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr " . TAB \" -TAB -T --initial-tab"
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr " .(8 \") NUM Tab --tabsize=NUM"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr " . `pr' -l --paginate"
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr " . - -r --recursive"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr " . -N --new-file"
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" . --unidirectional-new-file"
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ". --ignore-file-name-case"
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" . --no-ignore-file-name-case"
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr " .PAT -x PAT --exclude=PAT"
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"FILE- -X FILE --exclude-from=FILE"
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+" .FILE -S FILE --starting-file=FILE"
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+". FILE1 . FILE1 --from-file=FILE1"
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" . FILE2 .FILE2- --to-file=FILE2"
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ". -i --ignore-case"
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+" . TAB -E --ignore-tab-expansion"
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr " . -w --ignore-all-space"
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr " . -b --ignore-space-change"
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr " . -w --ignore-all-space"
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr " . -B --ignore-blank-lines"
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+".RE -I RE --ignore-matching-lines=RE"
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr " . -a --text"
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " . CR --strip-trailing-cr"
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr " . --binary"
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr "`#ifdef NAME'- , -D NAME --ifdef=NAME"
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"GFMT GTYPE ,\" --GTYPE-group-format=GFMT"
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " .LFMT ,\" --line-format=LFMT"
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+".LFMT LTYPE ,\" --LTYPE-group-format=LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr " .`changed' LTYPE GTYPE .`unchanged' `new' ,`old' LTYPE"
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" : GFMT\n"
+" FILE1- %<\n"
+" FILE2- %>\n"
+" FILE2- FILE1- %=\n"
+" LETTER printf %[-][WIDTH][.[PREC]]{doxX}LETTER\n"
+" :( ) LETTER\n"
+" F\n"
+" L\n"
+" L-F+1 = N\n"
+" F-1 E\n"
+" M+1 M"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" : LFMT\n"
+" %L\n"
+" %l\n"
+" printf %[-][WIDTH][.[PREC]]{doxX}n"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" : LFMT GFMT\n"
+" %% %\n"
+" C %c'C'\n"
+" OOO %c'\\OOO'"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr " . -d --minimal"
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+". NUM --horizon-lines=NUM"
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr " . -H --speed-large-files"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " . --normal"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr " . -v --version"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+".`FILE... DIR' `DIR FILE...' `DIR1 DIR2' `FILE1 FILE2' FILES"
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+" .FILES ,--to-file --from-file "
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr ""
+" . ,`-' FILE "
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "%s [OPTION]... FILES : \n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr ". "
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "%s `%s' "
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr " "
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "`%s' "
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "%s- %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr " `-' "
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr " -D "
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "%s- %s : -\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "%s %s- %s %s \n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr " `%s'- `%s' \n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr " %s- %s \n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+#, fuzzy
+msgid "Randy Smith"
+msgstr ".Randy Smith \" "
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr " "
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr " `-' "
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr " "
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr " . , -A --show-all"
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr "MYFILE YOURFILE- OLDFILE- -e --ed"
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+" . , -E --show-overlap"
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr " . -3 --easy-only"
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+" . -x --overlap-only"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr " .ed `q'- `w' -i"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr " . -a --text"
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " . CR --strip-trailing-cr"
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr " . TAB \" -TAB -T --initial-tab"
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" . PROGRAM --diff-program=PROGRAM"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr " . -v --version"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "%s [OPTION]... MYFILE OLDFILE YOURFILE : \n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr ". "
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "diff : "
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s \" diff :"
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "process_diff : "
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr " : "
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr " : "
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr " `%s' -"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr " : "
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr " : "
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr " "
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "`%s'- `%s' "
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+#, fuzzy
+msgid "Thomas Lord"
+msgstr ".Thomas Lord \" "
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr " .FILE- , -o FILE --output=FILE"
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr " . -i --ignore-case"
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+" . TAB -E --ignore-tab-expansion"
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr " . -w --ignore-all-space"
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr " . -b --ignore-space-change"
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr " . -W --ignore-all-space"
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr " . -B --ignore-blank-lines"
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+".RE -I RE --ignore-matching-lines=RE"
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " . CR --strip-trailing-cr"
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr " . -a --text"
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ". (130 \") NUM -w NUM --width=NUM"
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr " . , -l --left-column"
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr ""
+" . -s --suppress-common-lines"
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr " . TAB -t --expand-tabs"
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr " .(8 \") NUM Tab --tabsize=NUM"
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr " . -d --minimal"
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr " . -H --speed-large-files"
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" . PROGRAM --diff-program=PROGRAM"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr " . -v --version"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "%s [OPTION]... FILE1 FILE2 : \n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr ". "
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr " "
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr " "
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed -- , ,\n"
+"eb -- ,\n"
+"el -- ,\n"
+"er -- ,\n"
+"e -- \n"
+"l -- \n"
+"r -- \n"
+"s -- \n"
+"v -- \n"
+"q -- \n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s `--%s' - \n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: - -- %c\n"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ " . , \n"
+#~ ".GNU General Public License \n"
+#~ " .COPYING , "
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr ".David MacKenzie- Torbjorn Granlund \" "
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr ""
+#~ " -i N1:N2\n"
+#~ " --ignore-initial=N1:N2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr " . ; -s --quiet --silent"
+
+#~ msgid "--help Output this help."
+#~ msgstr " . --help"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr ".<bug-gnu-utils@gnu.org> "
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ " ,David Hayes ,Mike Haertel ,Paul Eggert \" "
+#~ "\n"
+#~ " .Len Tower- ,Richard "
+#~ "Stallman"
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr " `-%ld' `-%c %ld'- "
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr " `-%ld'- "
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ " . (3 :\") NUM -c -C NUM --context[=NUM]\n"
+#~ " . (3 :\") NUM -u -U NUM --unified[=NUM]\n"
+#~ " . LABEL- --label LABEL\n"
+#~ " . C -p --show-c-function\n"
+#~ " .RE -F RE --show-function-"
+#~ "line=RE"
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ " . -y --side-by-side\n"
+#~ " . (130 :\") NUM- -W NUM --width=NUM\n"
+#~ " . , --left-column\n"
+#~ " . --suppress-common-lines"
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ " . --speed-large-files"
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr " . -X"
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr " .(-A \") ed -m --merge"
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ " . LABEL- -L LABEL --"
+#~ "label=LABEL"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "`%s' - "
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr " `%s' -"
diff --git a/po/hr.gmo b/po/hr.gmo
new file mode 100644
index 0000000..435641a
--- /dev/null
+++ b/po/hr.gmo
Binary files differ
diff --git a/po/hr.po b/po/hr.po
new file mode 100644
index 0000000..d9b9dbc
--- /dev/null
+++ b/po/hr.po
@@ -0,0 +1,1410 @@
+# Translation of diffutils to Croatian.
+# Copyright © 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Tomislav Krznar <tomislav.krznar@gmail.com>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-12-21 00:37+0100\n"
+"Last-Translator: Tomislav Krznar <tomislav.krznar@gmail.com>\n"
+"Language-Team: Croatian <lokalizacija@linux.hr>\n"
+"Language: hr\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: Gtranslator 2.91.5\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "neispravan %s%s argument „%s”"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "neispravan %s%s argument „%s”"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programska greška"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "preljev stoga"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Nepoznata greška sustava"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "obična prazna datoteka"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "obična datoteka"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "direktorij"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "simbolička veza"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "red poruka"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "dijeljeni memorijski objekt"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "tipizirani memorijski objekt"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "posebna blokovska datoteka"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "posebna znakovna datoteka"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "posebna blokovska datoteka"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "posebna znakovna datoteka"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "čudna datoteka"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "posebna blokovska datoteka"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "utičnica"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "čudna datoteka"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: opcija „%s” je višeznačna, mogućnosti:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: opcija „-W %s” je višeznačna\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: opcija „--%s” ne dozvoljava argument\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: opcija „%c%s” ne dozvoljava argument\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: opcija „--%s” zahtijeva argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: neprepoznata opcija „--%s”\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: neprepoznata opcija „%c%s”\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: neispravna opcija -- „%c”\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opcija zahtijeva argument -- „%c”\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: opcija „-W %s” je višeznačna\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: opcija „-W %s” ne dozvoljava argument\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: opcija „-W %s” zahtijeva argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "„"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Uspjeh"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nema poklapanja"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Neispravan regularni izraz"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Neispravan znak razvrstavanja"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Neispravno ime razreda znakova"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Obrnuta kosa crta na kraju"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Neispravna povratna referenca"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Neuparena [ ili [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Neuparena ( ili \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Neuparena \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Neispravan sadržaj \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Neispravan kraj raspona"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memorija iscrpljena"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Neispravan prethodni regularni izraz"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Preuranjen kraj regularnog izraza"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regularni izraz je prevelik"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Neuparena ) ili \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Nedostaje prethodni regularni izraz"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memorija iscrpljena"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "standardni ulaz"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "standardni izlaz"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "standardni izlaz za greške"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "nepoznat tok podataka"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "nisam uspio ponovo otvoriti %s s modom %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "neispravan %s%s argument „%s”"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "neispravan sufiks u %s%s argumentu „%s”"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s argument „%s” je prevelik"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Pakirao %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Pakirao %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Licenca GPLv3+: GNU GPL inačica 3 ili novija <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Ovo je slobodan softver: slobodno ga smijete mijenjati i dijeliti.\n"
+"NEMA JAMSTAVA, do krajnje mjere dozvoljene zakonom.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Napisao %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Napisali %s i %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Napisali %s, %s i %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Napisali %s, %s, %s\n"
+"i %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Napisali %s, %s, %s,\n"
+"%s i %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Napisali %s, %s, %s,\n"
+"%s, %s i %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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Napisali %s, %s, %s,\n"
+"%s, %s, %s i %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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Napisali %s, %s, %s,\n"
+"%s, %s, %s, %s\n"
+"i %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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Napisali %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s i %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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Napisali %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s i ostali.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Prijavite greške na %s.\n"
+"Prijavite greške prijevoda na <lokalizacija@linux.hr>.\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Prijavite %s greške na %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s početna stranica: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s početna stranica: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Općenita pomoć za korištenje GNU softvera: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Datoteke %s i %s se razlikuju\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binarne datoteke %s i %s se razlikuju\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Nema novog retka na kraju datoteke"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Pokušajte „%s --help” za više informacija."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "neispravna --ignore-initial vrijednost „%s”"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "opcije -l i -s nisu kompatibilne"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "pisanje nije uspjelo"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standardni izlaz"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes ispiši bajtove koji se razlikuju"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=BROJ preskoči prvih BROJ bajtova oba ulaza"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=BROJ1:BROJ2 preskoči prvih BROJ1 bajtova DATOTEKE1\n"
+" i prvih BROJ2 bajtova DATOTEKE2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose ispiši brojeve i vrijednosti bajtova koji se "
+"razlikuju"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=BROJ usporedi najviše BROJ bajtova"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent izostavi sav normalan izlaz"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help prikaži ovu pomoć i izađi"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version ispiši informacije o inačici i izađi"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Uporaba: %s [OPCIJA]... DATOTEKA1 [DATOTEKA2 [BROJ1 [BROJ2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Usporedi dvije datoteke bajt po bajt."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Obavezni argumenti dugačkih opcija također su obavezni i za kratke opcije.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Ako DATOTEKA nije navedena ili je „-”, čitaj standardni ulaz."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Izlazno stanje je 0 ako su ulazi jednaki, 1 ako se razlikuju, 2 u slučaju "
+"greške."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "neispravna --bytes vrijednost „%s”"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "nedostaje operand nakon „%s”"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "operand viška „%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr ""
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr ""
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "neispravna duljina sadržaja „%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "straničenje nije podržano na ovom računalu"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "previše opcija oznaka datoteka"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "neispravna širina „%s”"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "konfliktne opcije širine"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "neispravna duljina sadržaja „%s”"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "neispravna širina „%s”"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "konfliktne opcije širine"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr ""
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal ispiši normalnu razliku (zadano)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief izvještaj samo kad se datoteke razlikuju"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files izvještaj samo kad su datoteke jednake"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed ispiši ed skriptu"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs ispiši razliku u RCS obliku"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side ispiši u dva stupca"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr ""
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs pretvori tabulatore u praznine u izlazu"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference ne slijedi simboličke veze"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file postupaj s odsutnim datotekama kao s praznim"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case zanemari veličinu slova pri uspoređivanju "
+"imena datoteka"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case ne zanemaruj veličinu slova pri "
+"uspoređivanju imena datoteka"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr ""
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text postupaj sa svim datotekama kao s tekstualnim"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary čitaj i piši podatke u binarnom načinu"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal ispiši normalnu razliku (zadano)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help prikaži ovu pomoć i izađi"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version ispiši informacije o inačici i izađi"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"DATOTEKE su „DATOTEKA1 DATOTEKA2”, „DIR1 DIR2”, „DIR DATOTEKA...” ili "
+"„DATOTEKA... DIR”."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Ako je DATOTEKA „-”, čitaj standardni ulaz."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Uporaba: %s [OPCIJA]... DATOTEKE\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Usporedi DATOTEKE redak po redak."
+
+# Ovdje trebam zamijeniti poredak... Pogledati kako se to radi.
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "konfliktna vrijednost „%s” opcije „%s”"
+
+# Notes:
+# Add Note
+#
+# Format:
+# C
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "konfliktne opcije izlaznog stila"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "neispravna širina „%s”"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Samo u %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "ne mogu usporediti „-” s direktorijem"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "opcija -D nije podržana s direktorijima"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Uobičajeni poddirektoriji: %s i %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Datoteka %s je %s, a datoteka %s je %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Simboličke veze %s i %s se razlikuju\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Datoteke %s i %s su identične\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "nekompatibilne opcije"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "„-” je navedeno za više od jedne ulazne datoteke"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "čitanje nije uspjelo"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text postupaj sa svim datotekama kao s tekstualnim"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help prikaži ovu pomoć i izađi"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version ispiši informacije o inačici i izađi"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr ""
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Usporedi tri datoteke redak po redak."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Izlazno stanje je 0 za uspjeh, 1 za neuspjeh, 2 u slučaju greške."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr ""
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff nije uspio: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "interna greška: neispravna diff vrsta u process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr ""
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "neispravan diff oblik, nepotpun posljednji redak"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "podređeni program „%s” se ne može pozvati"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr ""
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr ""
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "ulazna datoteka se smanjila"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "ne mogu usporediti imena datoteka „%s” i „%s”"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekurzivna petlja direktorija"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr ""
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr ""
+"-a, --text postupaj sa svim datotekama kao s tekstualnim"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr ""
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs pretvori tabulatore u praznine u izlazu"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help prikaži ovu pomoć i izađi"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version ispiši informacije o inačici i izađi"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Uporaba: %s [OPCIJA]... DATOTEKA1 DATOTEKA2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr ""
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "ne mogu interaktivno spojiti standardni ulaz"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "obje datoteke za usporedbu su direktoriji"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: neprepoznata opcija „--%s”\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/hu.gmo b/po/hu.gmo
new file mode 100644
index 0000000..5942c6d
--- /dev/null
+++ b/po/hu.gmo
Binary files differ
diff --git a/po/hu.po b/po/hu.po
new file mode 100644
index 0000000..3cc08c0
--- /dev/null
+++ b/po/hu.po
@@ -0,0 +1,1551 @@
+# Hungarian traslation for diffutils.
+# Copyright (C) 2002, 2014 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+#
+# Gábor István <stive@mezobereny.hu>, 2002.
+# Andras Timar <timar@fsf.hu>, 2004.
+# Balázs Úr <urbalazs@gmail.com>, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2014-07-13 22:01+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-Generator: Lokalize 1.5\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "érvénytelen %s%s argumentum: „%s”"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "érvénytelen %s%s argumentum: „%s”"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programhiba"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "veremtúlcsordulás"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Ismeretlen rendszerhiba"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "szabályos üres fájl"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "szabályos fájl"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "könyvtár"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "szimbolikus link"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "üzenetsor"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "szemafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "osztott memóriaobjektum"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "típusos memóriaobjektum"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "speciális blokkfájl"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "speciális karakterfájl"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "speciális blokkfájl"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "speciális karakterfájl"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "szokatlan fájl"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "speciális blokkfájl"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "foglalat"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "szokatlan fájl"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: a(z) „%s” kapcsoló nem egyértelmű; lehetőségek:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: a „-W %s” kapcsoló nem egyértelmű\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: a(z) „--%s” kapcsoló nem enged meg argumentumot\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: a(z) „%c%s” kapcsoló nem enged meg argumentumot\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: a(z) „--%s” kapcsolóhoz egy argumentum szükséges\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: ismeretlen „--%s” kapcsoló\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: ismeretlen „%c%s” kapcsoló\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: érvénytelen kapcsoló -- „%c”\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a kapcsoló egy argumentumot igényel -- „%c”\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: a „-W %s” kapcsoló nem egyértelmű\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: a „-W %s” kapcsoló nem enged meg argumentumot\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: a „-W %s” kapcsolóhoz egy argumentum szükséges\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "„"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sikerült"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nincs találat"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Érvénytelen reguláris kifejezés"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Érvénytelen egyeztető karakter"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Érvénytelen karakterosztálynév"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Záró visszaper"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Érvénytelen visszahivatkozás"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Pár nélküli [ vagy [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Pár nélküli ( vagy \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Pár nélküli \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "A \\{\\} tartalma érvénytelen"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Érvénytelen tartományvég"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Elfogyott a memória"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Érvénytelen megelőző reguláris kifejezés"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "A reguláris kifejezés túl korán véget ért"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "A reguláris kifejezés túl nagy"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Pár nélküli ) vagy \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Nincs megelőző reguláris kifejezés"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "elfogyott a memória"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "szabványos bemenet"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "szabványos kimenet"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "szabványos hibakimenet"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "ismeretlen adatfolyam"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "%s újranyitása %s móddal meghiúsult"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "érvénytelen %s%s argumentum: „%s”"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "érvénytelen utótag a(z) %s%s argumentumban: „%s”"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s: a(z) „%s” argumentum túl nagy"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Csomagolta: %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Csomagolta: %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Írta: %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Írta: %s és %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Írta: %s, %s és %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Írta: %s, %s, %s\n"
+"és %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Írta: %s, %s, %s,\n"
+"%s és %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"A hibák a(z) %s címen jelenthetők.\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "A(z) %s hibái a(z) %s címen jelenthetők.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "A(z) %s honlapja: <%s>\n"
+
+#: lib/version-etc.c:253
+#, 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"
+
+#: lib/version-etc.c:256
+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"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "A(z) %s és a(z) %s fájlok különböznek\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "A(z) %s és a(z) %s bináris fájlok különböznek\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Nincs új sor a fájl végén"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "További információkért próbálja a(z) „%s --help” parancsot."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "érvénytelen --ignore-initial érték: „%s”"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "a -l és a -s kapcsolók összeférhetetlenek"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "az írás sikertelen"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "szabványos kimenet"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes eltérő bájtok kiírása"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=UGRÁS az első UGRÁS bájt kihagyása mindkét "
+"bemeneten"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=UGRÁS1:UGRÁS2 a FÁJL1 első UGRÁS1 bájtjának és a "
+"FÁJL2\n"
+" első UGRÁS2 bájtjának kihagyása"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose a bájt számok és az eltérő bájt értékek kiírása"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=KORLÁT legfeljebb KORLÁT bájt összehasonlítása"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent minden normál kimenet elfojtása"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help ezen súgó megjelenítése és kilépés"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version verzióinformációk kiírása és kilépés"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Használat: %s [KAPCSOLÓ]… FÁJL1 [FÁJL2 [UGRÁS1 [UGRÁS2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Két fájl összehasonlítása bájtról bájtra."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Az opcionális UGRÁS1 és UGRÁS2 megadja a minden egyes fájl elejéről "
+"kihagyandó bájtok számát (alapértelmezetten nulla)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"A hosszú kapcsolók kötelező argumentumai a rövid kapcsolókhoz is "
+"kötelezőek.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Az UGRÁS értékek után a következő szorzóutótagokat lehet írni:\n"
+"kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n"
+"GB 1.000.000.000, G 1.073.741.824 és így tovább: T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Ha a FÁJL a „-” vagy hiányzik, akkor a szabványos bemenetről olvas."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"A kilépési állapotkód 0, ha a bemenetek azonosak; 1, ha különbözők; 2, ha\n"
+"hiba történt."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "érvénytelen --bytes érték: „%s”"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "hiányzó operandus a(z) „%s” után"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "extra operandus: „%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s eltér: byte: %s, sor: %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s eltér: byte %s, sor %s %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF ennél: %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "érvénytelen környezethossz: „%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "a tördelés nem támogatott ezen a gépen"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "túl sok fájlcímke-beállítás"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "érvénytelen szélesség: „%s”"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "ütköző szélességbeállítások"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "érvénytelen munkaszinthossz: „%s”"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "érvénytelen tabulátorméret: „%s”"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "ütköző tabulátorméret beállítások"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "a --from-file és a --to-file is meg van adva"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+" --normal egy normál diff kimenet (az alapértelmezett)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief csak akkor jelent, ha a fájlok eltérnek"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files jelentés, ha a két fájl ugyanaz"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C SZÁM, --context[=SZÁM] a másolt környezet SZÁM (alapértelmezetten "
+"3)\n"
+" sorának kiírása"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U SZÁM, --unified[=SZÁM] a egységesített környezet SZÁM\n"
+" (alapértelmezetten 3) sorának kiírása"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed egy ed parancsfájl kiírása"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs egy RCS formátumú diff kiírása"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side kimenet két oszlopban"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=SZÁM legfeljebb SZÁM (alapértelmezetten 130)\n"
+" nyomtatási oszlop kiírása"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column a közös soroknak csak a bal oszlopának kiírása"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines ne írja ki a közös sorokat"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function jelenítse meg, mely C függvényben van változás"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RK a legutóbbi RK-ra illeszkedő sor megjelenítése"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label CÍMKE CÍMKE használata fájlnév helyett (ismételhető)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs tabulátorok bővítése szóközökké a kimeneten"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab beigazítja a tabulátorokat egy tabulátor\n"
+" hozzáfűzésével"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=SZÁM a tabulátor megáll minden SZÁMADIK\n"
+" (alapértelmezetten 8) nyomtatási oszlopnál"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty szóköz vagy tabulátor elnyomása az üres "
+"kimeneti\n"
+" sorok előtt"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate kimenet átadása a „pr” parancsnak "
+"lapszámozáshoz"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive a talált alkönyvtár rekurzív összehasonlítása"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference ne kövesse a szimbolikus linkeket"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file a hiányzó fájlokat üresként kezelje"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file a hiányzó első fájlokat üresként kezelje"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case kis- és nagybetűk figyelmen kívül hagyása\n"
+" fájlnevek összehasonlításakor"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case kis- és nagybetűk figyelembe vétele\n"
+" fájlnevek összehasonlításakor"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=MINTA a MINTÁRA illeszkedő fájlok kizárása"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FÁJL a FÁJLBAN lévő bármely mintára illeszkedő\n"
+" fájlok kizárása"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FÁJL a FÁJLLAL kezdjen könyvtárak "
+"összehasonlítását"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FÁJL1 FÁJL1 összehasonlítása minden operandussal;\n"
+" FÁJL1 lehet könyvtár is"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FÁJL2 minden operandus összehasonlítása FÁJL2-"
+"vel;\n"
+" FÁJL2 lehet könyvtár is"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case kis- és nagybetű eltérések figyelmen kívül\n"
+" hagyása a fájlok tartalmában"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion a tabulátorbővítés miatti változások "
+"mellőzése"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space a sorvégi üres helyek mellőzése"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change üres helyek számában lévő változások "
+"mellőzése"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space minden üres hely mellőzése"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines változások mellőzése, ahol a sorok üresek"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RK változások mellőzése, ahol minden sor\n"
+" illeszkedik az RK-ra"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text az összes fájl szövegként kezelése"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr a záró kocsi vissza levágása a bemenetről"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary adatok olvasása és írása bináris módon"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NÉV egyesített fájlkiírás a „#ifdef NÉV” diffs\n"
+" használatával"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT a GTYPE bemeneti csoportok formázása GFMT-vel"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT minden bemeneti sor formázása LFMT-vel"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT az LTYPE bemeneti sorok formázása LFMT-vel"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Ezek a formázási lehetőségek részletes vezérlést biztosítanak a diff\n"
+" kimenetén, általánosítva: -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" Az LTYPE „old”, „new” vagy „unchanged”. A GTYPE értéke LTYPE vagy "
+"„changed”."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" A GFMT (csak) a következőket tartalmazhatja:\n"
+" %< FÁJL1 sorai\n"
+" %> FÁJL2 sorai\n"
+" %= FÁJL1 és FÁJL2 közös sorai\n"
+" %[-][SZÉLESSÉG][.[PONTOSSÁG]]{doxX}BETŰ a BETŰ printf-stílusú megadása\n"
+" a BETŰK a következők lehetnek az új csoporthoz, kisbetűsek a régi\n"
+" csoporthoz:\n"
+" F első sor száma\n"
+" L utolsó sor száma\n"
+" N sorok száma = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) ha A egyenlő B, akkor T, egyébként E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" Az LFMT (csak) a következőket tartalmazhatja:\n"
+" %L a sor tartalma\n"
+" %l a sor tartalma, kivéve bármilyen záró üres karaktert\n"
+" %[-][SZÉLESSÉG][.[PONTOSSÁG]]{doxX}n printf-stílusú megadás a bemeneti\n"
+" sor számához"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" A GFMT és az LFMT is tartalmazhatja:\n"
+" %% %\n"
+" %c'C' az önálló C karakter\n"
+" %c'\\OOO' a OOO oktális kódú karakter\n"
+" C a C karakter (más karakterek saját magukat ábrázolják)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal igyekszik egy kisebb változási halmazt megtalálni"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=SZÁM a közös előtag és utótag SZÁM sorának megtartása"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files nagy fájlokat és sok apró kis változást tételez fel"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr ""
+" --normal egy normál diff kimenet (az alapértelmezett)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help ezen súgó megjelenítése és kilépés"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version verzióinformációk kiírása és kilépés"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"A FÁJLOK az alábbiak lehetnek „FÁJL1 FÁJL2” vagy „KÖNYVTÁR1 KÖNYVTÁR2” vagy\n"
+"„KÖNYVTÁR FÁJL…” vagy „FÁJL… KÖNYVTÁR”."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Ha a --from-file vagy a --to-file meg van adva, akkor nincsenek "
+"megszorítások\n"
+"a FÁJLOKRA."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Ha a FÁJL a „-”, akkor a szabványos bemenetről olvas."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Használat: %s [KAPCSOLÓ]… FÁJLOK\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "FÁJLOK összehasonlítása sorról sorra."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "ütköző %s kapcsoló érték: „%s”"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "ütköző kimeneti stílus kapcsolók"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "érvénytelen szélesség: „%s”"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Csak ebben: %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "a „-” nem hasonlítható össze egy könyvtárral"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "A -D kapcsoló könyvtáraknál nem támogatott"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Közös alkönyvtárak: %s és %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "A(z) %s fájl egy %s, viszont a(z) %s fájl egy %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "A(z) %s és a(z) %s szimbolikus linkek különböznek\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "A(z) %s és a(z) %s fájlok azonosak\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "összeférhetetlen kapcsolók"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "a „-” több mint egy bemeneti fájlhoz lett megadva"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "olvasás sikertelen"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all minden változás kiírása, zárójelbe téve az\n"
+" ütközéseket"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed egy ed parancsfájlt ír ki, amely a SAJÁTFÁJLBAN\n"
+" tartalmazza a RÉGIFÁJL és ÖNFÁJLJA "
+"változásait"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap mint a -e, de zárójelbe teszi az ütközéseket"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only mint a -e, de csak a nem átfedő változásokat\n"
+" tartalmazza"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only mint a -e, de csak az átfedő változásokat\n"
+" tartalmazza"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X mint a -x, de zárójelbe teszi az ütközéseket"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i „w” és „q” parancsok hozzáfűzése az ed\n"
+" parancsfájlokhoz"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge az aktuális egyesített fájl kiírása a -A "
+"szerint,\n"
+" ha más kapcsoló nincs megadva"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text az összes fájl szövegként kezelése"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr a záró kocsi vissza levágása a bemenetről"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab beigazítja a tabulátorokat egy tabulátor\n"
+" hozzáfűzésével"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAM a PROGRAM használata fájlok összehasonlításához"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=CÍMKE CÍMKE használata fájlnév helyett\n"
+" (legfeljebb háromszor ismételhető)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help ezen súgó megjelenítése és kilépés"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version verzióinformációk kiírása és kilépés"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Használat: %s [KAPCSOLÓ]… SAJÁTFÁJL RÉGIFÁJL ÖNFÁJLJA\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Három fájl összehasonlítása sorról sorra."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Az alapértelmezett kimeneti formátum a változásoknak az ember által kevésbé\n"
+"olvasható ábrázolása.\n"
+"\n"
+"A -e, -E, -x, -X (és a megfelelő hosszú) kapcsolók egy ed parancsfájlt "
+"idéznek\n"
+"elő az alapértelmezett kimenet helyett.\n"
+"\n"
+"Végül a -m (--merge) kapcsoló diff3 formátumot hoz létre az egyesítés\n"
+"belsőleg történő elvégzéséhez, és az aktuális egyesített fájlt írja ki.\n"
+"Szokatlan bemenethez ez sokkal erőteljesebb az ed használatánál.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"A kilépési állapotkód 0, ha sikeres; 1, ha ütközés van; 2, ha hiba történt."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "belső hiba: zűrzavar az összehasonlítási blokkok formátumában"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: összehasonlítás sikertelen: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr ""
+"belső hiba: érvénytelen összehasonlítási típus a process_diff függvényben"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "érvénytelen összehasonlítási formátum; érvénytelen változáselválasztó"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "érvénytelen összehasonlítási formátum; befejezetlen utolsó sor"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "a(z) „%s” kisegítő programot nem sikerült meghívni"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "érvénytelen összehasonlítási formátum; helytelen sor eleji karakterek"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "belső hiba: érvénytelen összehasonlítási típus lett átadva kimenetnek"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "a bementi fájl összement"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "nem sikerült a(z) „%s” és a(z) „%s” fájlneveket összehasonlítani"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekurzív könyvtárhurok"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=FÁJL interaktív működés, kimenet küldése FÁJLBA"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case a kis- és nagybetűket azonosnak tekinti"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion a tabulátorbővítés miatti változások mellőzése"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space a sorvégi üres helyek mellőzése"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change üres helyek számában lévő változások mellőzése"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space minden üres hely mellőzése"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines változások mellőzése, ahol a sorok üresek"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RK változások mellőzése, ahol minden sor\n"
+" illeszkedik az RK-ra"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr a záró kocsi vissza levágása a bemenetről"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text az összes fájl szövegként kezelése"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=SZÁM legfeljebb SZÁM (alapértelmezetten 130)\n"
+" nyomtatási oszlop kiírása"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column a közös soroknak csak a bal oszlopának kiírása"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines ne írja ki a közös sorokat"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs tabulátorok bővítése szóközökké a kimeneten"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=SZÁM a tabulátor megáll minden SZÁMADIK\n"
+" (alapértelmezetten 8) nyomtatási oszlopnál"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal igyekszik egy kisebb változási halmazt "
+"megtalálni"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files nagy fájlokat, sok apró kis változást tételez "
+"fel"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAM a PROGRAM használata fájlok összehasonlításához"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help ezen súgó megjelenítése és kilépés"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version verzióinformációk kiírása és kilépés"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Használat: %s [KAPCSOLÓ]… FÁJL1 FÁJL2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "A FÁJL1 és FÁJL2 közötti különbségek egymás melletti egyesítése."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "nem sikerült interaktívan egyesíteni a szabványos bemenetet"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "mindkét összehasonlítandó fájl könyvtár"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tSzerkesztés, majd mindkét változat használata fejlécekkel díszítve.\n"
+"eb:\tSzerkesztés, majd mindkét változat használata.\n"
+"el vagy e1:\tSzerkesztés, majd a bal oldali változat használata.\n"
+"er vagy e2:\tSzerkesztés, majd a jobb oldali változat használata.\n"
+"e:\tMindkét változat eldobása, majd az új szerkesztése.\n"
+"l vagy 1:\tA bal oldali változat használata.\n"
+"r vagy 2:\tA jobb oldali változat használata.\n"
+"s:\tA közös sorok felvétele csendben.\n"
+"v:\tA közös sorok felvétele bőbeszédűen.\n"
+"q:\tKilépés.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: ismeretlen „--%s” kapcsoló\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/id.gmo b/po/id.gmo
new file mode 100644
index 0000000..f1175b1
--- /dev/null
+++ b/po/id.gmo
Binary files differ
diff --git a/po/id.po b/po/id.po
new file mode 100644
index 0000000..e708cce
--- /dev/null
+++ b/po/id.po
@@ -0,0 +1,1585 @@
+# Pesan bahasa indonesia untuk diffutils
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Tedi Heriyanto <tedi_h@gmx.net>, 2002.
+# Arif E. Nugroho <arif_endro@yahoo.com>, 2008, 2009, 2010, 2011, 2012, 2013, 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2014-08-03 08:00+0700\n"
+"Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n"
+"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "argumen %s%s tidak valid '%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "argumen %s%s tidak valid '%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "kesalahan program"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "overflow stack"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Kesalahan sistem tidak dikenal"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "berkas reguler kosong"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "berkas reguler"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "direktori"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "link simbolik"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "antrian pesan"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semaphore"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objek memori bersama"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "tipe objek memori"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "berkas blok spesial"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "berkas karakter spesial"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "berkas blok spesial"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "berkas karakter spesial"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "berkas aneh"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "berkas blok spesial"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "soket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "berkas aneh"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: pilihan '%s' ambigu"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: pilihan '-W %s' ambigu\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: pilihan '--%s' tidak mengijinkan sebuah argumen\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: pilihan '%c%s' tidak mengijinkan sebuah argumen\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: pilihan '--%s' membutuhkan sebuah argumen\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: pilihan '--%s' tidak dikenal\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: pilihan '%c%s' tidak dikenal\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: pilihan -- '%c' tidak valid\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: pilihan -- '%c' membutuhkan sebuah argumen\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: pilihan '-W %s' ambigu\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: pilihan '-W %s' tidak mengijinkan sebuah argumen\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: pilihan '-W %s' membutuhkan sebuah argumen\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sukses"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Tidak cocok"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ekspresi reguler tidak valid"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Karakter kolasi tidak valid"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nama kelas karakter tidak valid"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Akhiran backslash"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referensi balik tidak valid"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Tidak cocok [ atau [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Tidak cocok ( atau \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Tidak cocok \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Isi dari \\{\\} tidak valid"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Batas akhir tidak valid"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Kehabisan memori"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ekspresi reguler yang mengawali tidak valid"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Ekspresi reguler berakhir dengan prematur"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Ekspresi reguler terlalu besar"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Tidak cocok ) atau \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Tidak ada ekspresi reguler sebelumnya"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "kehabisan memori"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "aliran tidak dikenal"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "gagal untuk membuka kembali %s dengan mode %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "argumen %s%s tidak valid '%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "akhiran dalam argumen %s%s tidak valid '%s'"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s argumen '%s' terlalu besar"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Dibungkus oleh %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Dibungkus oleh %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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"
+"Lisensi GPLv3+: GNU GPL versi 3 atau selanjutnya <http://gnu.org/licenses/"
+"gpl.html>.\n"
+"Ini adalah perangkat lunak bebas: anda bebas untuk mengubah dan "
+"mendistribusikannya.\n"
+"Tidak ada JAMINAN APAPUN, sepanjang masih diijinkan oleh hukum yang "
+"berlaku.\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Ditulis oleh %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Ditulis oleh %s dan %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Ditulis oleh %s, %s, dan %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Ditulias oleh %s, %s, %s,\n"
+"dan %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, dan %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, dan %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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, dan %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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"dan %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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, dan %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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, dan yang lainnya.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Laporkan bugs ke: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Laporkan %s bugs ke: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s halaman rumah: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s halaman rumah: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Bantuan umum menggunakan perangkat lunak GNU: <http://www.gnu.org/gethelp>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Berkas %s dan %s berbeda\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "File biner %s dan %s berbeda\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Tidak ada baris-baru di akhir dari berkas"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Coba '%s --help' untuk informasi lebih lanjut."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "tidak valid --ignore-initial nilai '%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "pilihan -l dan -s tidak kompatibel"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "gagal menulis"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standar keluaran"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes Tampilkan byte yang berbeda."
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr "-i, --ignore-initial=SKIP Lewati SKIP byte pertama dari masukan."
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SKIP1:SKIP2 Lewati SKIP1 byte pertama FILE1 dan SKIP2 "
+"byte pertama FILE2.\n"
+" first SKIP2 bytes of FILE2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose Keluarkan jumlah byte dan nilai semua byte yang berbeda."
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMIT Bandingkan paling banyak LIMIT byte."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent suppress all normal output"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help display this help and exit"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version Tampilkan informasi versi."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Penggunaan: %s [PILIHAN]... BERKAS1 [BERKAS2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Bandingkan dua file byte per byte"
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"SKIP1 dan SKIP2 adalah jumlah byte yang harus dilewati di tiap file.\n"
+"at the beginning of each file (zero by default)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Nilai SKIP dapat diikuti oleh suffiks perkalian berikut:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, dan seterusnya untuk T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Jika sebuah FILE adalah '-' atau tidak ada, baca input standar"
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Status keluar adalah 0 jika masukan sama, 1 jika berbeda, 2 jika bermasalah."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "nilai --byte tidak valid '%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "tidak ada operand setelah '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "operand ekstra '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s berbeda: byte %s, baris %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s berbeda: byte %s, baris %s adalah %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF pada %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "panjang context tidak valid '%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "paginasi tidak didukung pada host ini"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "terlalu banyak option label file"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "lebar tidak valid '%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "option lebar konflik"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "panjang horizon tidak valid '%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "tabsize tidak valid '%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "option tabsize konflik"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file dan --to-file keduanya disebutkan"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal Output normal diff."
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief Tampilkan hanya apakah file berbeda."
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files Laporkan ketika dua file sama."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w, NUM --width=NUM Output paling banyak NUM (baku 130) kolom cetakan."
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed Output adalah script ed."
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs Output dalam format RCS diff."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side output in two columns"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-W, --width=NUM Output paling banyak NUM (baku 130) kolom cetakan."
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr " --left-column Hanya tampilkan kolom kiri baris yang sama."
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines Jangan tampilkan baris yang sama."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function show which C function each change is in"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE show the most recent line matching RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label LABEL use LABEL instead of file name\n"
+" (can be repeated)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs Ekspansi tab ke spasi dalam output."
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab Buat tab beraturan dg menambahkan sebuah tab."
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr "--tabsize=NUM Tab stop adalah setiap NUM (default 8) kolom cetakan."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+"--suppress-blank-empty Tekan spasi atau tab sebelum mengeluarkan baris "
+"kosong."
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l, --paginate Berikan output ke `pr' untuk di-paginate."
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r, --recursive Membandingkan subdirektori secara rekursif."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference don't follow symbolic links"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file Perlakukan tiada file sebagai kosong."
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+"--unidirectional-new-file Anggap file tidak ada pertama sebagai kosong."
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr "--ignore-file-name-case Abaikan case saat membandingkan nama file."
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case Pertimbangkan case saat membandingkan nama file."
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=PAT Tanpa file yang cocok dengan PAT."
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FILE Abaikan file yang cocok dengan pola dalam FILE"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FILE Mulai dengan FILE ketika membandingkan direktori."
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=FILE1 Bandingkan FILE1 ke semua operand. FILE1 dapat berupa "
+"direktori.\n"
+" FILE1 can be a directory"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=FILE2 Bandingkan semua operand dengan FILE2. FILE2 dapat berupa "
+"direktori.\n"
+" FILE2 can be a directory"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i, --ignore-case Abaikan beda case dalam isi file."
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion Abaikan perubahan akibat ekspansi tab."
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-all-space Abaikan seluruh white space."
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Abaikan perubahan sejumlah white space."
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space Abaikan seluruh white space."
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B, --ignore-blank-lines Abaikan perubahan baris kosong."
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Abaikan perubahan baris yang cocok dg RE."
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Perlakukan seluruh file sebagai teks."
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Hapus trailing carriage return pada input."
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Baca dan tulis data dalam mode biner."
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAME Output file merge untuk tampilkan `#ifdef NAME' diffs."
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GTYPE-group-format=GFMT Serupa, tapi format input kelompok GTYPE dg GFMT. "
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr "--line-format=LFMT Serupa, tapi format seluruh baris input dg LFMT."
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--LTYPE-line-format=LFMT Serupa, tapi format baris input LTYPE dg LFMT."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE adalah 'old', 'new', atau 'unchanged'. GTYPE adalah LTYPE atau "
+"'changed'."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT dapat berisi:\n"
+" %< baris dari FILE1\n"
+" %> baris dari FILE2\n"
+" %= baris bersama FILE1 dan FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec untuk LETTER\n"
+" LETTERs adalah sebagai berikut untuk grup baru, huruf kecil untuk grup "
+"tua:\n"
+" F nomor baris pertama\n"
+" L nomor baris terakhir\n"
+" N jumlah baris = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT dapat berisi:\n"
+" %L isi baris\n"
+" %l isi baris, tanpa baris baru\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec untuk nomor baris input"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT atau LFMT dapat berisikan:\n"
+" %% %\n"
+" %c'C' karakter tunggal C\n"
+" %c'\\OOO' karakter dengan kode oktal OOO"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal Usahakan mencari perubahan terkecil."
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=NUM Pertahankan NUM baris prefiks dan suffiks umum."
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files Asumsikan file besar dan banyak sebaran perubahan "
+"kecil."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal Output normal diff."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help display this help and exit"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version Tampilkan informasi versi."
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILES adalah 'FILE1 FILE2' atau 'DIR1 DIR2' atau 'DIR FILE...' atau 'FILE... "
+"DIR'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Bila --from-file atau --to-file diberikan, tidak ada batasan untuk FILES."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Jika sebuah file FILE adalah '-', baca standard input."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Penggunaan: %s [OPTION]... FILES\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Bandingkan file baris per baris"
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "Nilai option %s konflik dengan '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "option gaya output konflik"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "lebar tidak valid '%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Hanya dalam %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "tidak dapat membandingkan '-' dg direktori"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D option tidak didukung dg direktori"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdirektori sama: %s dan %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "File %s adalah %s sementara file %s adalah %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Berkas %s dan %s berbeda\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "File %s dan %s identik\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "option tidak kompatibel"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' dispesifikasikan lebih dari satu file input"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "gagal membaca"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A, --show-all Output seluruh perubahan, konflik dalam tanda kurung."
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Output perubahan tanpa dimerge dari OLDFILE ke YOURFILE ke dl "
+"MYFILE."
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap Output perubahan unmerge, konflik dl tanda kurung."
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3, --easy-only Output unmerged perubahan nonoverlap."
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x, --overlap-only Tampilkan perubahan yang overlap."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X like -x, but bracket conflicts"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Tambah perintah 'w' dan 'q' ke script ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Perlakukan seluruh file sebagai teks."
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Hapus trailing carriage return pada input."
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab Buat tab beraturan dg menambahkan sebuah tab."
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM Gunakan PROGRAM untuk membandingkan file."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help display this help and exit"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version Tampilkan informasi versi."
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Pemakaian: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Bandingkan tiga file baris per baris."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Status keluaran adalah 0 jika sukses, 1 jika konflik, 2 jika bermasalah."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "kesalahan internal: kacau dalam format blok diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff gagal: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "kesalahan internal: tipe diff tidak valid dalam process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "format diff tidak valid; separator perubahan tidak valid"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "format diff tidak valid; baris akhir tidak lengkap"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "program subsider '%s' tidak dipanggil"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "format diff tidak valid; karakter leading line tidak tepat"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "kesalahan internal: tipe diff tidak valid dimasukkan ke output"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "file input mengecil"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "tidak dapat membandingkan nama file '%s' dan '%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekursif loop direktori"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o, --output=FILE Operasi secara interaktif, kirim output ke FILE."
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case Abaikan huruf kapital dan huruf kecil."
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion Abaikan perubahan akibat ekspansi tab."
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailling-space Abaikan seluruh white space."
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Abaikan perubahan sejumlah white space."
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space Abaikan seluruh white space."
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines Abaikan perubahan baris kosong."
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE Abaikan perubahan baris yang cocok dg RE."
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Hapus trailing carriage return pada input."
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Perlakukan seluruh file sebagai teks."
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-w, --width=NUM Output paling banyak NUM (baku 130) kolom cetakan."
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l, --left-column Hanya tampilkan kolom kiri baris yang sama."
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines Jangan tampilkan baris yang sama."
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs Ekspansi tab ke spasi dalam output."
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr "--tabsize=NUM Tab stop adalah setiap NUM (default 8) kolom cetakan."
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal Usahakan mencari perubahan terkecil."
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files Asumsikan file besar dan banyak sebaran perubahan "
+"kecil."
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM Gunakan PROGRAM untuk membandingkan file."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help display this help and exit"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version Tampilkan informasi versi."
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Pemakaian: %s [OPTION]... FILE1 FILE2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Merge side-by-side beda file."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "tidak dapat menggabung input standar secara interaktif"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "kedua file yang dibandingkan adalah direktori"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tUbah lalu gunakan kedua versi, dekorasikan dengan header.\n"
+"eb:\tUbah lalu gunakan kedua versi.\n"
+"el atau e1:\tEdit lalu gunakan versi kiri.\n"
+"er atau e2:\tEdit lalu gunakan versi kanan.\n"
+"e:\tEdit versi baru.\n"
+"l atau e1:\tGunakan versi kiri.\n"
+"r atau e2:\tGunakan versi kanan.\n"
+"s:\tSertakan baris bersama secara diam-diam.\n"
+"v:\tSertakan baris bersama secara verbose.\n"
+"q:\tKeluar.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: pilihan '--%s' tidak dikenal\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Tidak mengeluarkan apapun; hanya memberikan status "
+#~ "keluar saja."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Tampilkan bantuan ini."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NUM --context[=NUM] Output NUM (baku 3) baris isi yang disalin.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (baku 3) baris unified context.\n"
+#~ " --label LABEL Gunakan LABEL alih-alih nama file.\n"
+#~ " -p --show-c-function Tampilkan setiap fungsi C yang berubah.\n"
+#~ " -F RE --show-function-line=RE Tampilkan baris paling akhir yang cocok "
+#~ "dengan RE."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Output dalam dua kolom.\n"
+#~ " -W NUM --width=NUM Output paling banyak NUM (baku 130) kolom.\n"
+#~ " --left-column Output hanya kolom kiri baris bersama.\n"
+#~ " --suppress-common-lines Jangan hasilkan baris bersama."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Asumsikan file besar dan banyak perubahan kecil."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Output perubahan overlap, beri tanda kurung."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr "-m --merge Tampilkan file yang dimerge bukan script ed (baku -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L LABEL --label=LABEL Gunakan LABEL bukan nama file."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: pilihan -- %c tidak legal\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Ini adalah aplikasi bebas; lihat kode program untuk persayaraan "
+#~ "penyalinan;\n"
+#~ "TIDAK ADA GARANSI; bahkan untuk DIPERDAGANGKAN atau KECOCOKAN UNTUK "
+#~ "TUJUAN TERTENTU.\n"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Laporkan bug ke <bug-gnu-utils@gnu.org>"
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "`-%ld' option kuno; gunakan `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "`-%ld' option kuno, hilangkan saja"
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "program subsider `%s' tidak ditemukan"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "program subsider `%s' gagal"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "program subsider `%s' gagal (status keluar %d)"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the file named COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Ditulis oleh Torbjorn Granlund dan David MacKenzie."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Ditulis oleh Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, dan Len Tower."
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "program subsider `%s' tidak dapat dieksekusi"
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644
index 0000000..b26de01
--- /dev/null
+++ b/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/po/it.gmo b/po/it.gmo
new file mode 100644
index 0000000..903d6ca
--- /dev/null
+++ b/po/it.gmo
Binary files differ
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 0000000..104a0a4
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,1617 @@
+# Italian messages for diffutils.
+# Copyright (C) 2004, 2005, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Marco Colombo <m.colombo@ed.ac.uk>, 2004, 2005, 2010, 2011, 2015.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2015-08-05 14:57+0100\n"
+"Last-Translator: Marco Colombo <m.colombo@ed.ac.uk>\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"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "argomento '%3$s' di %1$s%2$s non valido"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "argomento '%3$s' di %1$s%2$s non valido"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "errore del programma"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "overflow dello stack"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Errore di sistema sconosciuto"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "file normale vuoto"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "file normale"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "directory"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "link simbolico"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "coda di messaggi"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semaforo"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "oggetto di memoria condivisa"
+
+# La memoria è tipizzata, non l'oggetto.
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "oggetto di memoria tipizzata"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "file speciale a blocchi"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "file speciale a caratteri"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "file speciale a blocchi"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "file speciale a caratteri"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "file strano"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "file speciale a blocchi"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "file strano"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: l'opzione '%s' è ambigua; alternative:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: l'opzione '-W %s' è ambigua\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: l'opzione '--%s' non accetta argomenti\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: l'opzione '%c%s' non accetta argomenti\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: l'opzione '%s' richiede un argomento\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: opzione '--%s' non riconosciuta\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: opzione '%c%s' non riconosciuta\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opzione non valida -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: l'opzione richiede un argomento -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: l'opzione '-W %s' è ambigua\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: l'opzione '-W %s' non accetta argomenti\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: l'opzione '-W %s' richiede un argomento\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "'"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Successo"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nessuna corrispondenza"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Espressione regolare non valida"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carattere di collazione non valido"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nome della classe di caratteri non valido"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Backslash finale"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Riferimento all'indietro non valido"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ o [^ non accoppiata"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( o \\( non accoppiata"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ non accoppiata"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Contenuto di \\{\\} non valido"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Fine dell'intervallo non valida"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoria esaurita"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "L'espressione regolare precedente non è valida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Fine prematura dell'espressione regolare"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "L'espressione regolare è troppo grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") o \\) non accoppiata"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Non c'è una espressione regolare precedente"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria esaurita"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "stream sconosciuto"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "riapertura di %s in modalità %s non riuscita"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "argomento '%3$s' di %1$s%2$s non valido"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "suffisso '%3$s' non valido nell'argomento di %1$s%2$s"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "argomento '%3$s' di %1$s%2$s troppo grande"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Impacchettato da %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Impacchettato da %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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 GPLv3+: GNU GPL versione 3 o successiva <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Questo è software libero: siete liberi di cambiaro e redistribuirlo.\n"
+"Non c'è ALCUNA GARANZIA, nei limiti previsti dalla legge.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Scritto da %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Scritto da %s e %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Scritto da %s, %s, e %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Scritto da %s, %s, %s,\n"
+"e %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Scritto da %s, %s, %s,\n"
+"%s, e %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Segnalare i bug a: %s\n"
+"Segnalare gli errori di traduzione a: <tp@lists.linux.it>\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Segnalare i bug di %s a: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s home page: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s home page: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr "Aiuto sull'uso di software GNU: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "I file %s e %s sono diversi\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "I file binari %s e %s sono diversi\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Manca newline alla fine del file"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Usare '%s --help' per maggiori informazioni."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "Valore '%s' non valido per --ignore-initial"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "le opzioni -l e -s sono incompatibili"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "scrittura non riuscita"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standard output"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes Stampa i byte differenti"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SKIP Salta i primi SKIP byte di entrambi gli input"
+
+# Lo strano allineamento è corretto
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SKIP1:SKIP2 Salta i primi SKIP1 byte di FILE1 e i "
+"primi\n"
+" SKIP2 byte di FILE2"
+
+# Lo strano allineamento della seconda riga è corretto.
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose Mostra i numeri e i valori di tutti i byte\n"
+" differenti"
+
+# Solitamente viene usato NUM quando si vuole specificare un numero.
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=NUM Confronta al massimo NUM byte"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent Sopprime tutto l'output normale"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help Mostra questo aiuto ed esce"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Stampa le informazioni sulla versione ed esce"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Uso: %s [OPZIONE]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Confronta due file byte per byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"I valori opzionali SKIP1 e SKIP2 indicano il numero di byte da saltare\n"
+"all'inizio di ogni file (zero se non indicato)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Gli argomenti obbligatori per le opzioni lunghe lo sono anche per quelle "
+"corte.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"I valori di SKIP possono essere seguiti dai seguenti suffissi "
+"moltiplicativi:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, e così via per T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Se un FILE è '-' o è mancante, legge lo standard input."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Il codice d'uscita è 0 se gli input sono identici, 1 se sono differenti, 2 "
+"quando si riscontrano dei problemi."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "valore '%s' non valido per --bytes"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "operando mancante dopo '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "extra operando '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s differenza: byte %s, riga %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s differenza: byte %s, riga %s è %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF in %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "lunghezza di contesto '%s' non valida"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "paginazione non supportata su questo host"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "troppe opzioni di etichetta"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "larghezza '%s' non valida"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "opzioni di larghezza in conflitto"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "lunghezza di orizzonte '%s' non valida"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "lunghezza di tabulazione '%s' non valida"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "opzioni di lunghezza di tabulazione in conflitto"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file e --to-file specificati entrambi"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal Mostra una diff normale (predefinito)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief Segnala solo se i file sono diversi"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files Segnala quando due file sono identici"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=NUM] Mostra NUM righe di contesto copiato\n"
+" (predefinito 3)"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NUM, --unified[=NUM] Mostra NUM righe di contesto unificato\n"
+" (predefinito 3)"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed Mostra uno script per ed"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs Mostra una diff in formato RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side Output in due colonne"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NUM Mostra al massimo NUM colonne (predefinito 130)"
+
+# Lo strano allineamento della seconda riga è corretto.
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column Mostra solo la colonna di sinistra per le "
+"righe\n"
+" in comune"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines Non mostra le righe in comune"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function Mostra in quale funzione C si trova ogni\n"
+" differenza"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=ER Mostra la riga più recente che corrisponde\n"
+" all'espressione regolare ER"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETICHETTA Usa ETHICHETTA invece del nome del file\n"
+" (può essere ripetuta)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs Espande le tabulazioni in spazi nell'output"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Allinea le tabulazioni usando una tabulazione"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM Stop di tabulazione ogni NUM colonne\n"
+" (predefinito 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty Rimuove spazi e tabulazioni prima di righe\n"
+" di output vuote"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate Passa l'output attraverso 'pr' per impaginarlo"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive Confronta ricorsivamente ogni sottodirectory\n"
+" incontrata"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference Non segue i collegamenti simbolici"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file Considera i file mancanti come vuoti"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file Considera i file mancanti in prima posizione\n"
+" come vuoti"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case Ignora differenze in maiuscole e minuscole\n"
+" confrontando nomi di file"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case Considera differenze in maiuscole e "
+"minuscole\n"
+" confrontando nomi di file"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=MODELLO Esclude i file che corrispondono al MODELLO"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FILE Esclude i file che corrispondono a qualsiasi\n"
+" modello in FILE"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FILE Comincia da FILE quando si confrontano "
+"directory"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FILE1 Confronta FILE1 con tutti gli operandi;\n"
+" FILE1 può essere una directory"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FILE2 Confronta tutti gli operandi con FILE2;\n"
+" FILE2 può essere una directory"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case Ignora differenze in maiuscole e minuscole "
+"nel\n"
+" contenuto del file"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Ignora differenze causate dall'espansione\n"
+" delle tabulazioni"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space Ignora gli spazi a fine riga"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Ignora differenze nel numero di spazi"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space Ignora tutti gli spazi"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B, --ignore-blank-lines Ignora differenze in righe vuote"
+
+# Lo strano allineamento della seconda riga è corretto
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=ER Ignora differenze che corrispondono\n"
+" all'espressione regolare ER"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Considera tutti i file come testo"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Elimina i ritorni a capo a fine riga in input"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary Legge e scrive in modalità binaria"
+
+# Con questa opzione, i due file originali sono uniti in un unico file che
+# viene stampato sullo standard output. Le differenze sono mostrate così:
+#
+# Testo comune.
+# #ifndef NOME
+# Questo è il file 1.
+# #else /* NOME */
+# Questo è il file 2.
+# #endif /* NOME */
+# Testo comune.
+#
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NOME Mostra le differenze in un unico file usando\n"
+" '#ifdef NOME'"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT Simile, ma formatta i gruppi di input GTYPE\n"
+" con GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT Formatta tutte le righe di input con LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT Formatta le righe di input LTYPE con LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Queste opzioni di formato forniscono un controllo preciso dell'output di\n"
+" diff, generalizzando -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr " LTYPE è 'old', 'new', o 'unchanged'. GTYPE è LTYPE o 'changed'."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT può (solo) contenere:\n"
+" %< righe dal FILE1\n"
+" %> righe dal FILE2\n"
+" %= righe comuni a FILE1 e FILE2\n"
+" %[-][LARGHEZZA][.[PREC]]{doxX}LETTERA formato in stile printf per "
+"LETTERA\n"
+" LETTERA può contenere (in maiuscolo per nuovi gruppi o in minuscolo\n"
+" per vecchi):\n"
+" F numero della prima riga\n"
+" L numero dell'ultima riga\n"
+" N numero di righe = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) se A è uguale a B allora T, altrimenti E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT può contenere:\n"
+" %L contenuto della riga\n"
+" %l contenuto della riga, ad esclusione di ogni andata a capo finale\n"
+" %[-][LARGHEZZA][.[PREC]]{doxX}n formato in stile printf del numero\n"
+" di riga di input"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT e LFMT possono contenere:\n"
+" %% %\n"
+" %c'C' il singolo carattere C\n"
+" %c'\\OOO' il carattere con codice ottale OOO\n"
+" C il carattere C (altri caratteri rappresentano se stessi)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal Minimizza il numero di differenze"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=NUM Mantiene NUM righe di prefisso e suffisso comune"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files Assume file grandi e tante piccole differenze"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal Mostra una diff normale (predefinito)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help Mostra questo aiuto ed esce"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Stampa le informazioni sulla versione ed esce"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILES sono 'FILE1 FILE2' o 'DIR1 DIR2' o 'DIR FILE...' o 'FILE... DIR'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Se --from-file o --to-file sono usati, non ci sono restrizioni per FILES."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Se un FILE è '-', legge lo standard input."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Uso: %s [OPZIONE]... FILES\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Confronta i file riga per riga."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "conflitto nell'opzione %s: valore '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "opzioni di stile di output in conflitto"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "larghezza '%s' non valida"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Solo in %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "impossibile confrontare '-' con una directory"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "opzione -D non supportata con directory"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Sottodirectory in comune: %s e %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "File %s è un %s mentre file %s è un %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "I collegamenti simbolici %s e %s sono diversi\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "I file %s e %s sono identici\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "opzioni incompatibili"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' specificato per più di un file di input"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lettura fallita"
+
+# Questa opzione produce:
+#
+# diff3 -A file1 file2 file3
+# 2a
+# ||||||| file2
+# Questo è il file 2.
+# =======
+# Questo è il file 3.
+# >>>>>>> file3
+# .
+# 1a
+# <<<<<<< file1
+# .
+#
+# Lo strano allineamento della seconda riga è corretto.
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all Mostra tutte le differenze, tenendo separati\n"
+" i conflitti"
+
+# Per mostrare i diversi output generati con le varie opzioni di diff3,
+# ho usato i seguenti file:
+#
+# file1: Testo comune.
+# Questo è il file 1.
+# Altro testo comune.
+# file2: Testo comune.
+# Questo è il file 2.
+# Altro testo comune.
+# file3: Testo comune.
+# Questo è il file 3.
+# Altro testo comune.
+#
+# In questo caso mi sembra più corretto usare 'cambiamenti' invece che
+# 'differenze'.
+#
+# Lo strano allineamento della seconda riga è corretto.
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed Mostra uno script ed con i cambiamenti\n"
+" da VECCHIOFILE a TUOFILE in MIOFILE"
+
+# Questa opzione produce:
+#
+# diff3 -E file1 file2 file3
+# 2a
+# =======
+# Questo è il file 3.
+# >>>>>>> file3
+# .
+# 1a
+# <<<<<<< file1
+# .
+#
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap Come -e, tenendo separati i conflitti"
+
+# Questa opzione, per i 3 file considerati, non produce niente.
+#
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3 --easy-only Come -e, ma mostra solo i cambiamenti che non\n"
+" si sovrappongono"
+
+# Questa opzione produce:
+#
+# diff3 -x file1 file2 file3
+# 2c
+# Questo è il file 3.
+# .
+#
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only Come -e, ma mostra solo i cambiamenti che si\n"
+" sovrappongono"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X Come -x, ma tiene separati i conflitti"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i Aggiunge i comandi 'w' e 'q' agli script per ed"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge Mostra il file combinato risultante, secondo -A\n"
+" se non è indicata nessun'altra opzione"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Considera tutti i file come testo"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Elimina i ritorni a capo a fine riga in input"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab Allinea le tabulazioni usando una tabulazione"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAMMA Usa PROGRAMMA per confrontare i file"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETICHETTA Usa ETICHETTA invece del nome del file\n"
+" (può essere repetuta fino a tre volte)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help Mostra questo aiuto ed esce"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Stampa le informazioni sulla versione ed esce"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Uso: %s [OPZIONE]... MIOFILE VECCHIOFILE TUOFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Confronta tre file riga per riga."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Il formato predefinito di output è una rappresentazione più o meno "
+"leggibile\n"
+"dei cambiamenti.\n"
+"\n"
+"Le opzioni -e, -E, -x, -X (e le opzioni lunghe corrispondenti) producono "
+"uno\n"
+"script per ed invece dell'output predefinito.\n"
+"\n"
+"Infine, l'opzione -m (--merge) indica a diff3 di combinare internamente i "
+"file\n"
+"e mostrare il file combinato. Per input non convenzionali, ciò è più "
+"robusto\n"
+"di ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Il codice d'uscita è 0 in caso di successo, 1 in caso di conflitto, 2 se "
+"sono\n"
+"stati riscontrati dei problemi."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "errore interno: problema nel formato dei blocchi di diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff fallita: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "errore interno: tipo di diff non valido in process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "formato di diff non valido; separatore di modifica non valido"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "formato di diff non valido; ultima riga incompleta"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "programma accessorio '%s' non può essere chiamato"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "formato di diff non valido; caratteri incorretti a inizio riga"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "errore interno: il tipo di diff passato all'output non è valido"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "il file di input è rimpicciolito"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "impossibile confrontare i nomi dei file '%s' e '%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: ciclo ricorsivo tra le directory"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+# Lo strano allineamento della seconda riga è corretto.
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=FILE Procede in modo interattivo, scrivendo l'output\n"
+" in FILE"
+
+# Questa traduzione corrisponde a quella usata sopra per diff.
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case Ignora differenze in maiuscole e minuscole"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion Ignora differenze causate dall'espansione\n"
+" delle tabulazioni"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space Ignora gli spazi a fine riga"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change Ignora differenze nel numero di spazi"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space Ignora tutti gli spazi"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines Ignora differenze in righe vuote"
+
+# Lo strano allineamento della seconda riga è corretto
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=ER Ignora differenze che corrispondono\n"
+" all'espressione regolare ER"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Elimina i ritorni a capo a fine riga in input"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text Considera tutti i file come testo"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=NUM Mostra al massimo NUM colonne (predefinito 130)"
+
+# Lo strano allineamento della seconda riga è corretto.
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column Mostra solo la colonna di sinistra per le righe\n"
+" in comune"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines Non mostra le righe in comune"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs Espande le tabulazioni in spazi nell'output"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+"--tabsize=NUM Stop di tabulazione ogni NUM colonne\n"
+" (predefinito 8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal Minimizza il numero di differenze"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files Assume file grandi e tante piccole differenze"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAMMA Usa PROGRAMMA per confrontare i file"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help Mostra questo aiuto ed esce"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version Stampa le informazioni sulla versione ed esce"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Uso: %s [OPZIONE]... FILE1 FILE2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Mostra le differenze tra FILE1 e FILE2 fianco a fianco."
+
+# Tobia Conforto: impossibile combinare in modo interattivo da standard input
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "impossibile combinare in modo interattivo con lo standard input"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "entrambi i file da confrontare sono directory"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tModifica e poi usa entrambe le versioni, ognuna con un'intestazione.\n"
+"eb:\tModifica e poi usa entrambe le versioni.\n"
+"el, e1:\tModifica e poi usa la versione di sinistra.\n"
+"er, e2:\tModifica e poi usa la versione di destra.\n"
+"e:\tScarta entrambe le versioni e modifica una nuova versione.\n"
+"l, 1:\tUsa la versione di sinistra.\n"
+"r, 2:\tUsa la versione di destra.\n"
+"s:\tInclude silenziosamente le righe in comune.\n"
+"v:\tInclude prolissamente le righe in comune.\n"
+"q:\tEsce.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: opzione '--%s' non riconosciuta\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/ja.gmo b/po/ja.gmo
new file mode 100644
index 0000000..2e6e8a8
--- /dev/null
+++ b/po/ja.gmo
Binary files differ
diff --git a/po/ja.po b/po/ja.po
new file mode 100644
index 0000000..8acd341
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,1563 @@
+# Japanese GNU diffutils messages
+# Copyright (C) 2000, 2011 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# IIDA Yosiaki <iida@gnu.org>, 2002.
+# 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: GNU diffutils 3.2\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2011-09-08 14:13+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"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "引数 `%3$s' に対して %1$s%2$s が無効です"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "引数 `%3$s' に対して %1$s%2$s が無効です"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "プログラムエラー"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "スタックオーバーフロー"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "不明なシステムエラー"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "通常の空ファイル"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "通常ファイル"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "ディレクトリー"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "シンボリックリンク"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "メッセージキュー"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "セマフォ"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "共有メモリオブジェクト"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "型付メモリオブジェクト"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "ブロックスペシャルファイル"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "キャラクタスペシャルファイル"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "ブロックスペシャルファイル"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "キャラクタスペシャルファイル"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "不明なファイル"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "ブロックスペシャルファイル"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "ソケット"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "不明なファイル"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: オプション '%s' は曖昧です。次のものが可能です:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: オプション '-W %s' は曖昧です\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: オプション '--%s' は引数を取ることができません\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: オプション '%c%s' は引数を取ることができません\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: オプション '--%s' は引数が必要です\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: オプション '--%s' を認識できません\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: オプション '%c%s' を認識できません\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: 無効なオプション -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: オプションには引数が必要です -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: オプション '-W %s' は曖昧です\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: オプション '-W %s' は引数を取ることができません\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: オプション '-W %s' は引数が必要です\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "成功です"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "一致しません"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "無効な正規表現です"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "無効な照合文字です"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "無効な文字クラス名です"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "終端のバックスラッシュ"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "無効な前方参照です"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ または [^ が不一致です"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( または \\( が不一致です"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ が不一致です"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} の中身が無効です"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "無効な範囲終了です"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "メモリを使い果たしました"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "無効な前方正規表現です"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "正規表現が途中で終了しました"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "正規表現が大きすぎます"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") または \\) が不一致です"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "以前に正規表現がありません"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "メモリを使い果たしました"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "標準入力"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "標準出力"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "標準エラー出力"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "不明なストリーム"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "%s をモード %s で再度開くことに失敗しました"
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "引数 `%3$s' に対して %1$s%2$s が無効です"
+
+#: lib/xstrtol-error.c:68
+#, fuzzy, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "引数 `%3$s' に対して無効な接尾辞 %1$s%2$s です"
+
+#: lib/xstrtol-error.c:72
+#, fuzzy, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "引数 `%3$s' に対する %1$s%2$s が大きすぎます"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "パッケージ作成者: %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "パッケージ作成者: %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "作者 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "作者 %s および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "作者 %s、 %s、および %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"および %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、および %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、 %s、および %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"バグを発見したら <%s> に報告して下さい。\n"
+"翻訳に関するバグは<translation-team-ja@lists.sourceforge.net>に報告してくださ"
+"い。\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "%s のバグは <%s> に報告してください。\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s のホームページ: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s のホームページ: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"GNU ソフトウェアを使用する際の一般的なヘルプ: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "ファイル %s と %s は異なります\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "バイナリーファイル %s と%s は異なります\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "ファイル末尾に改行がありません"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "詳しくは`%s --help'を実行してください。"
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "無効な --ignore-initial の値 `%s' です"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "オプション -l と -s は同時に指定できません"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "書き込みに失敗しました"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "標準出力"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes 異なるバイトを表示する"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SKIP 両方の入力の先頭 SKIP バイトをスキップする"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SKIP1:SKIP2 FILE1 の先頭 SKIP1 バイトと FILE2 の先頭\n"
+" SKIP2 バイトをスキップする"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l, --verbose バイト数および異なるバイトの値を出力する"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMIT 最大 LIMIT バイトを比較する"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent 通常の表示をすべて抑止する"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help このメッセージを表示して終了する"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version バージョン情報を表示して終了する"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "使用法: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "2つのファイルをバイトごとに比較します。"
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"オプションの SKIP1 と SKIP2 はそれぞれのファイルの先頭からスキップする\n"
+"バイト数を指定します(デフォルトは 0)。"
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"長い形式のオプションで必須の引数は、それに対応する短い形式のオプションでも同"
+"様に必須です。\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"SKIP の値には次の倍数を表す接尾辞を付けることも出来ます:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824。また、 T, P, E, Z, Y も同様です。"
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "FILE が `-' または指定しない場合、標準入力から読み込みます。"
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"終了コードは、入力ファイルが同じ場合は 0、入力ファイルが異なる場合は 1、\n"
+"問題が発生したときは 2 になります。"
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "無効な --bytes の値 `%s' です。"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "`%s' の後に被演算子がありません"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "余分な被演算子 `%s' です。"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s 異なります: バイト %s、行 %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s 異なります: バイト %s、行 %s %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: %s でファイル終端 (EOF) に達しました\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "無効な前後の行数 `%s' です"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "このホストではページ割付けをサポートしません"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "ファイル・ラベル・オプションが多すぎます"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "無効な幅 `%s' です"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "幅のオプションが競合しています"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "無効な横幅 `%s' です"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "無効なタブ幅 `%s' です"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "タブ幅のオプションが競合しています"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file および --to-file の両方が指定されています"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal 通常の diff を出力する (デフォルト)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief ファイルが異なるかどうかのみ表示する"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s, --report-identical-files 両方のファイルが同一であるかどうかのみ表示する"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=NUM] コンテキスト diff 形式で前後 NUM (デフォルト: "
+"3) 行を表示する"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NUM, --unified[=NUM] ユニファイド diff 形式で前後 NUM (デフォルト: "
+"3) 行を表示する"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed ed スクリプトを出力する"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs RCS 形式の diff を出力する"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side 出力を2列にする"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NUM 表示する列を最大 NUM (デフォルト: 130) 列にする"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr " --left-column 共通行は左側の列のみ表示する"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines 共通行の出力を抑止する"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function 変更がある C 関数を表示する"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE RE に一致する最も近い行を表示する"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label LABEL ファイル名の代わりに LABEL を使用する\n"
+" (繰り返し指定できます)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs 出力時にタブをスペースに展開する"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab タブで始まる行は、前にタブを置いてそろえる"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM タブ幅を NUM (デフォルト: 8) 列に設定する"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty 空の出力行の前後ではスペースまたはタブを抑止す"
+"る"
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate ページ割り付けを行うために `pr' を通して出力す"
+"る"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r, --recursive サブディレクトリーを再帰的に比較する"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file 存在しないファイルを空ファイルとして扱う"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file 存在しない最初のファイルを空ファイルとして扱"
+"う"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr " --ignore-file-name-case ファイル名の大文字と小文字を区別しない"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr " --no-ignore-file-name-case ファイル名の大文字と小文字を区別する"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=PAT PAT に一致するファイルを除外する"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FILE FILE 内のパターンに一致するファイルを除外する"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FILE ディレクトリーを比較する時に FILE から始める"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FILE1 すべての被演算子と FILE1 を比較する\n"
+" FILE1 はディレクトリーでもよい"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FILE2 すべての被演算子を FILE2 を比較する\n"
+" FILE2 はディレクトリーでもよい"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case ファイル内容の比較時に大文字と小文字を区別し"
+"ない"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion タブ展開によって発生する違いを無視する"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space 行末にあるスペースを無視する"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change スペース数により生じる違いを無視する"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space すべてのスペースを無視する"
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines 空白類文字だけの行により生じる違いを無視する"
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE RE と一致するすべての行の違いを無視する"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text すべてのファイルをテキストとして扱う"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr 入力から CR (キャリッジリターン) を除去する"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary バイナリーモードでデータを読み書きする"
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAME パッチ適用時に `#ifdef NAME' で併合されるよう"
+"に差分を出力する"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT GTYPE の入力グループを GFMT で整形する"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT すべての入力行を LFMT で整形する"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT LTYPE 入力行を LFMT で整形する"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" これらの書式整形オプションは -D/--ifdef に適用される diff の出力をきれい"
+"に\n"
+" 見えるように制御するために提供されます。"
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE は `old'、`new'、または`unchanged'です。GTYPE は LTYPE または "
+"`changed' です。"
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT でのみ指定できる書式:\n"
+" %< FILE1 からの行\n"
+" %> FILE2 からの行\n"
+" %= FILE1 と FILE2 で共通の行\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf 書式の LETTER\n"
+" LETTER は次の通りです。ただし古いグループでは小文字です:\n"
+" F 最初の行番号\n"
+" L 最後の行番号\n"
+" N 行数 = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) A と B が等しい場合は T、等しくない場合は E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT でのみ指定できる書式:\n"
+" %L 行の内容\n"
+" %l 行末にあるすべての種類の改行文字を除いた行の内容\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf 書式の入力行"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT と LFMT の両方で指摘できる書式:\n"
+" %% %\n"
+" %c'C' 単一文字 C\n"
+" %c'\\OOO' 八進数コード OOO\n"
+" C 文字 C (他の文字も同様に表す)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal 差分の大きさが最小となるように違いを検出する"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr " --horizon-lines=NUM 差分の前後にある共通部分を NUM 行保持する"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files 巨大なファイルに小さな差分が分散していると仮定する"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal 通常の diff を出力する (デフォルト)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help このヘルプを表示して終了する"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version バージョン情報を表示して終了する"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILES は `FILE1 FILE2'、`DIR1 DIR2' 、`DIR FILE...'、または `FILE... DIR' で"
+"す。"
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"--from-file または --to-file が与えられた場合、FILE に制限はありません。"
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "FILE が `-' の場合、標準入力から読み込みます。"
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "使用法: %s [OPTION]... FILES\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "FILES を行ごとに比較します。"
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "%s オプションの値 `%s' が競合しています"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "出力形式オプションが競合しています"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "無効な幅 `%s' です"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "%s のみに存在: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "`-' とディレクトリーは比較できません"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D オプションはディレクトリーにはサポートされません"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "共通のサブディレクトリー: %s と %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "ファイル %s は %s です。一方、ファイル %s は %s です\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "ファイル %s と %s は異なります\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "ファイル %s と %s は同一です\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "同時に指定できないオプションです"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "入力ファイルとして `-' が複数回指定されています"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "読み込みに失敗しました"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all 競合をすべて括弧でくくり、変更をすべて出力する"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed OLDFILE、YOURFILE、MYFILE の間の違いを ed\n"
+" スクリプトとして出力する\n"
+" "
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap -e と同様だが、競合を括弧でくくる"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only -e と同様だが、3ファイル競合で無い部分のみ出力す"
+"る"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only -e と同様だが、3ファイル競合の部分のみ出力する"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X -x と同様だが、競合を括弧でくくる"
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i ed スクリプトの後に `w' と `q' コマンドを追加する"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge 他のオプションを指定していない場合、-A 従って\n"
+" 実際に併合されたファイルを出力する"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text すべてのファイルをテキストとして扱う"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr 入力から末尾のキャリッジリターンを除去する"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab タブで始まる行は、前にタブを置いてそろえる"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM ファイル比較に PROGRAM を使用する"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=LABEL ファイル名の代わりに LABEL を使用する\n"
+" (3回まで繰り返し指定できる)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help このヘルプを表示して終了する"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version バージョン情報を表示して終了する"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "3つのファイルを行ごとに比較します。"
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"デフォルトでは違いが人間にとって読みやすい出力形式です。\n"
+"\n"
+"-e、-E、-x、-X (およびその長い形式) オプションを指定した場合はデフォルト\n"
+"の代わりに ed スクリプトを出力します。\n"
+"\n"
+"最後に、-m (--merge) オプションにより diff3 は内部で併合を行い、実際に\n"
+"併合されたファイルを出力します。通常の入力としては、これは ed を使用す\n"
+"るより強固です。\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"終了コードは、成功した場合は 0、競合がある場合は 1、\n"
+"問題が発生したときは 2 になります。"
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "内部エラー: 差分ブロックの形式をうまく処理できませんでした"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff に失敗しました: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "内部エラー: process_diff 内に無効な差分型があります"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "無効な差分形式です。無効な変更区切りです"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "無効な差分形式です。最後の行が不完全です"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "下位プログラム `%s' が起動できません"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "無効な差分形式です。行の先頭文字が誤っています"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "内部エラー: 無効な差分型が出力に渡されました"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "入力ファイルが小さくなりました"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "ファイル `%s' と `%s' を比較できません"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: ディレクトリーが再帰的にループしています"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o, --output=FILE 対話的に操作し、出力を FILE に送る"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case 大文字と小文字を区別しない"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion タブ展開によって発生する違いを無視する"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space 行末にあるスペースを無視する"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change スペース数により生じる違いを無視する"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space すべてのスペースを無視する"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines 空白類文字だけの行により生じる違いを無視する"
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE RE と一致するすべての行の違いを無視する"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr 入力から末尾のキャリッジリターンを除去する"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text すべてのファイルをテキストとして扱う"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=NUM 表示する列を最大 NUM (デフォルト: 130) 列にする"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l, --left-column 共通行は左側の列のみ表示する"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines 共通行の出力を抑止する"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs 出力時にタブをスペースに展開する"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr " --tabsize=NUM タブ幅を NUM (デフォルト: 8) 列に設定する"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal 差分の大きさが最小となるように違いを検出する"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files 巨大なファイルに小さな差分が分散していると仮定す"
+"る"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM ファイル比較に PROGRAM を使用する"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help このヘルプを表示して終了する"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version バージョン情報を表示して終了する"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "使用法: %s [OPTION]... FILE1 FILE2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "FILE1 と FILE2 の差分を2段組で比較しながら併合します。"
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "標準出力は対話的に併合できません"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "比較対象は両方ともディレクトリーです"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed: 両方にヘッダーを付加し、両方の版を編集して使用する。\n"
+"eb: 両方の版を編集して使用する。\n"
+"el または e1: 左側の版を編集して使用する。\n"
+"er または e2: 右側の版を編集して使用する。\n"
+"e: 両方の版を破棄し、新規行を編集する。\n"
+"l または 1: 左側の版を使用する。\n"
+"r または 2: 右側の版を使用する。\n"
+"s: 共通行を暗黙的に含める。\n"
+"v: 共通行を明示して含める。\n"
+"q: 終了する。\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: オプション '--%s' を認識できません\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent 出力なし。終了ステータスのみ。"
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help この説明を出力。"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NUM --context[=NUM] コピーした前後NUM行 (既定は3) を出力。\n"
+#~ "-u -U NUM --unified[=NUM] 統合した前後NUM行 (既定は3) を出力。\n"
+#~ " --label LABEL ファイル名の代わりにLABELを使用。\n"
+#~ " -p --show-c-function 各変更を含むCの関数名を表示。\n"
+#~ " -F RE --show-function-line=RE REと一致する直近の行を表示。"
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side 縦列出力。\n"
+#~ " -W NUM --width=NUM 高々NUM (既定は130) 印字桁で出力。\n"
+#~ " --left-column 共通行は左列だけ出力。\n"
+#~ " --suppress-common-lines 共通行の出力を抑止。"
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr "--speed-large-files 巨大なファイルに分散した変更があると仮定。"
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X 衝突をくくりながら、変更を出力。"
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge edスクリプトの代わりに、併合したファイルを出力 (既定は-A)。"
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L LABEL --label=LABEL ファイル名の代わりにLABELを使用。"
diff --git a/po/lv.gmo b/po/lv.gmo
new file mode 100644
index 0000000..51d7b99
--- /dev/null
+++ b/po/lv.gmo
Binary files differ
diff --git a/po/lv.po b/po/lv.po
new file mode 100644
index 0000000..32b729f
--- /dev/null
+++ b/po/lv.po
@@ -0,0 +1,1601 @@
+# Latvian translation of diffutils.
+# Copyright (C) 2009 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+# Rihards Priedītis <rprieditis@gmail.com>, 2009, 2010.
+# Rūdolfs Mazurs <rudolfs.mazurs@gmail.com>, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils-3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2014-04-20 15:28+0300\n"
+"Last-Translator: Rihards Prieditis <rprieditis@gmail.com>\n"
+"Language-Team: Latvian <translation-team-lv@lists.sourceforge.net>\n"
+"Language: lv\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 != 0 ? 1 : "
+"2);\n"
+"X-Generator: Lokalize 1.5\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "nederīgs %s%s arguments “%s”"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "nederīgs %s%s arguments “%s”"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programmas kļūda"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "steka pārplūšana"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Nezināma sistēmas kļūda"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "parasta tukša datne"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "parasta datne"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "direktorija"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "simboliskā saite"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "ziņojumu rinda"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafors"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "koplietots atmiņas objekts"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "tipa atmiņas objekts"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "īpaša bloka datne"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "īpaša rakstzīmes datne"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "īpaša bloka datne"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "īpaša rakstzīmes datne"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "dīvaina datne"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "īpaša bloka datne"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "sokets"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "dīvaina datne"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: opcija “%s” nav viennozīmīga, iespējas:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: opcija “-W %s” ir divdomīga\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: opcija “--%s” neatļauj argumentu\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: opcija “%c%s” neatļauj argumentu\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: opcijai “--%s” nepieciešams arguments\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: neatpazīta opcija “--%s”\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: neatpazīta opcija “%c%s”\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: nederīga opcija -- “%c”\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opcijai nepieciešams arguments -- “%c”\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: opcija “-W %s” ir divdomīga\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: opcija “-W %s” neatļauj argumentu\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: opcijai “-W %s” nepieciešams arguments\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "“"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Veiksmīgi"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nav atbilstību"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Nederīga regulārā izteiksme"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Nederīga salīdzināmā rakstzīme"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nederīgs rakstzīmju klases nosaukums"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Sekojošās otrādās slīpsvītras"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Nederīga atpakaļ norāde"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Nesakrītošs [ vai [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Nesakrītošs ( vai \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Nesakrītošs \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Nederīgs \\{\\} saturs"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Nederīgas apgabala beigas"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Atmiņa izsmelta"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Nederīga iepriekšējā regulārā izteiksme"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Priekšlaicīgas beigas regulārai izteiksmei"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Pārāk liela regulārā izteiksme"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Nav atbilstoša ) vai \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Nav iepriekšējas regulārās izteiksmes"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "atmiņa izsmelta"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "nezināma straume"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "neizdevās atkārtoti atvērt %s režīmā %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "nederīgs %s%s arguments “%s”"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "nederīgs piedēklis %s%s argumentā “%s”"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s arguments “%s” ir pārāk liels"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Pakoja %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Pakoja %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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 versija 3 vai vēlāka <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Šī ir brīva programmatūra: jums ir brīvība to mainīt un izplatīt.\n"
+"Tai NAV GARANTIJAS, cik to pieļauj likums.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Sarakstīja %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Sarakstīja %s un %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Sarakstīja %s, %s un %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s\n"
+"un %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s,\n"
+"%s un %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s,\n"
+"%s, %s un %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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s,\n"
+"%s, %s, %s un %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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s,\n"
+"%s,%s, %s, %s,\n"
+"un %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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s,\n"
+"%s,%s, %s, %s,\n"
+"%s un %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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Sarakstīja %s, %s, %s,\n"
+"%s,%s, %s, %s,\n"
+"%s, %s un citi.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Ziņojiet par kļūdām uz: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Ziņojiet %s kļūdas uz: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s mājas lapa: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s mājas lapa: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Vispārēja palīdzība, izmantojot GNU programmatūru: <http://www.gnu.org/"
+"gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Datnes %s un %s atšķiras\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binārās datnes %s un %s atšķiras\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Nav jaunu rindu datnes beigās"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Lietojiet “%s --help”, lai uzzinātu vairāk."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "nederīga --ignore-initial vērtība “%s”"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "opcijas -l un -s nav savstarpēji saderīgas"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "rakstīšana neizdevās"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standarta izvade"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes drukāt atšķirīgos baitus"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=IZLAIST izlaists pirmos IZLAIŽAMOS baitus ievadē"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=IZLAIST1:IZLAIST2 izlaist pirmos IZLAIST1 DATNE1 "
+"baitus\n"
+" un pirmos IZLAIST2 DATNE2 baitus"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose izvadīt baitu numurus un atšķirīgo baitu vērtības"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=ROBEŽA salīdzināt līdz ROBEŽAs baitiem"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent nomākt visu parasto izvadi"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help parādīt šo palīdzību un iziet"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version izvada informāciju par versiju un iziet"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Izmantošana: %s [OPCIJAS]... DATNE1 [DATNE2 [IZLAIST1 [IZLAIST2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Salīdzināt divas datnes baitu pa baitam."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Neobligātie IZLAIST1 un IZLAIST2 norāda, cik baitus izlaist\n"
+"katras datnes sākumā (pēc noklusējuma nulle)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Parametri, kas ir obligāti garajām opcijām, ir obligāti arī īsajām opcijām.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"IZLAIST vērtības var sekot vairāki piedēkļi:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, un tā tālāk T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Ja DATNEI ir “-” vai tā nav, tad lasīt standarta ievadi."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Izejas status ir 0, ja ievads ir tāds pats, 1, ja tas ir atšķirīgs, 2, ja ir "
+"nepatikšanas."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "nederīga --bytes vērtība “%s”"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "trūkst operands pēc “%s”"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "papildu operands “%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s atšķiras: baits %s, rinda %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s atšķiras: baits %s, rinda %s ir %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF uz %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "nederīgs konteksta garums “%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "lapošana netiek atbalstīta uz šī resursdatora"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "pārāk daudz datnes etiķešu opciju"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "nederīgs platums “%s”"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "konfliktējošas platuma opcijas"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "nederīgs horizontālais garums “%s”"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "nederīgs tabulācijas izmērs “%s”"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "konfliktējošas tabulācijas izmēru opcijas"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file un --to-file abi norādīti"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal izvada parastu diff (noklusējuma)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief ziņot tikai, ja datnes atšķiras"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files ziņot, ja divas datnes ir vienādas"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=NUM] izvadīt NUM (noklus. 3) kopētā konteksta rindas"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NUM, --unified[=NUM] izvadīt NUM (noklus. 3) vienotā konteksta "
+"rindas"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed izvada ed skriptu"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs izvada RCS formāta diff"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side izvade divās kolonnās"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NUM izvada līdz NUM (noklusējuma 130) drukas "
+"kolonas"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column izvadīt tikai kreiso kolonu no kopējām rindām"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines neizvadīt kopējās rindas"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function rādīt, kurās C funkcijās ir izmaiņas"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE rādīt visnesenāko rindu, kas atbilst RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETIĶETE izmantot ETIĶETI nevis datnes nosaukumu\n"
+" (var atkārtot)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs pārveidot tabulācijas par atstarpēm izvadē"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab pacelt tabulācijas rindu pirms tabulācijas"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM tabulāciju pietura ik NUM drukas "
+"kolonas (noklusējuma ir 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty apspiest atstarpes vai tabulācijas pirms "
+"tukšām\n"
+" izvades rindām."
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l, --paginate izlaist izvadi caur “pr”, lai to lapotu"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive rekursīvi salīdzina atrastās "
+"apakšdirektorijas"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference nerādīt simboliskās saites"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file trūkstošas datnes uzskatīt par tukšām"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file trūkstošas pirmās datnes uzskatīt par tukšām"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case ignorēt reģistru, salīdzinot datņu nosaukumus"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case neignorēt reģistru, salīdzinot datņu "
+"nosaukumus"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=ŠABLONS izslēgt datnes, kuras atbilst ŠABLONAM"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=DATNE izslēgt datnes, kuras atbilst jebkuram\n"
+" šablonam DATNĒ"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=DATNE sākt ar DATNI, kad salīdzina direktorijas"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=DATNE1 salīdzina DANTE1 ar visiem operandiem;\n"
+" DATNE1 var būt direktorija"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FILE2 salīdzina visus operandus ar DANTE2;\n"
+" DATNE2 var būt direktorija"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case ignorē reģistra atšķirības datnes saturā"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorēt izmaiņas dēļ tabulācijas izplešanās"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ignorēt visas atstarpes rindu beigās"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change ignorēt izmaiņas dēļ atstarpēm"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space ignorēt visas atstarpes"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B, --ignore-blank-lines ignorēt izmaiņas tukšajās rindās"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE ignorēt izmaiņas rindās, kuras sakrīt ar RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text uztvert visas datnes kā teksta datnes"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr noņemt atkārtojošos rakstatgriezi ievadē"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary lasīt un rakstīt datus binārajā režīmā"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NOSAUKUMS izvadīt sapludināto datni ar\n"
+" “#ifdef NOSAUKUMS” diff"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT formatēt GTYPE ievades grupas ar GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT formatēt visas ievades rindas ar LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT formatēt LTYPE ievades rindām ar LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Šīs formāta opcijas sniedz detalizētu kontroli pār diff izvadi,\n"
+" vispārinot -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE ir “old”, “new” vai “unchanged”. GTYPE ir LTYPE vai “changed”."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (tikai) var saturēt:\n"
+" %< rindas no DATNE1\n"
+" %> rindas no DATNE2\n"
+" %= rindas kopīgas DATNE1 un DATNE2\n"
+" %[-][PLATUMS][.[PREC]]{doxX}BURTS printf-style specifikācija BURTAM\n"
+" BURTS ir šāds jaunai grupai, mazais reģistrs vecais grupai:\n"
+" F pirmās rindas numurs\n"
+" L pēdējās rindas numurs\n"
+" N rindu skaits = L-F+1\n"
+" E F-1\n"
+" M L+1 %(A=B?T:E) ja A vienāds ar B tad T citādi E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (tikai) var saturēt:\n"
+" %L rindas saturs\n"
+" %l rindas saturs, izņemot sekojošās jaunās rindas rakstzīmes\n"
+" %[-][PLATUMS][.[PREC]]{doxX}n printf-style specifikācija ievades rindu\n"
+" numuriem"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Gan GFMT, gan LFMT var saturēt:\n"
+" %% %\n"
+" %c'C' vienu rakstzīmi C\n"
+" %c'\\OOO' rakstzīmi ar oktālo kodu OOO\n"
+" C rakstzīme C (vai citas rakstzīmes, kas attēlo pašas sevi)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal ļoti censties atrast mazāku izmaiņu kopu"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=NUM uzturēt NUM rindas kopējiem prefiksiem un sufiksiem"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files pieņemt, ka datnes ir lielas ar daudz mazām izmaiņām"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal izvada parastu diff (noklusējuma)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help parādīt šo palīdzību un iziet"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version izvada informāciju par versiju un iziet"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"DATNES ir “DATNE1 DATNE2” vai “DIREKTORIJA1 DIREKTORIJA2” vai\n"
+"“DIREKTORIJA DATNE...” vai “DATNE... DIREKTORIJA”"
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Ja ir doti --from-file vai --to-file, nav nekādu ierobežojumu uz DATNĒM."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Ja DATNE ir “-”, lasīt standarta ievadi."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Lietošana: %s [OPCIJAS]... DATNES\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Salīdzina DATNES rindu pa rindai."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "konfliktējoša %s opcijas vērtība “%s”"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "konfliktējoša izvades stila opcijas"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "nederīgs platums “%s”"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Tikai iekš %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "nevar salīdzināt “-” ar direktoriju"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D opcija nav atbalstīta ar direktorijām"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Kopējās apakšdirektorijas: %s un %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Datne %s ir %s kamēr datne %s ir %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Simboliskās saites %s un %s atšķiras\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Datnes %s un %s ir identiskas\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "savstarpēji nesaderīgas opcijas"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "“-” norādīts vairāk par vienu ievades datni"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lasīšana neizdevās"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all izvada visas izmaņas, ieliekot iekavās konfliktus"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed izvada ed skirpta iekļautās izmaiņas\n"
+" no VECĀSDATNES uz JŪSUDATNI iekš MANUDATNI."
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap tāpat kā -e, bet ieliekot iekavās konfliktus"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only līdzīgs -e, bet iekļauj tikai nepārklājošās "
+"izmaiņas"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only līdzīgs -e, bet iekļauj tikai pārklājošās "
+"izmaiņas"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X līdzīgs -x, bet ieliekot iekavās konfliktus"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i pievieno “w” un “q” komandas ed skriptā"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge izvada pašu sapludināto datni, vadoties pēc -A,\n"
+" ja nav dotu citu opciju"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text uztvert visas datnes kā teksta datnes"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr noņemt atkārtojošos rakstatgriezi ievadē"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab pacelt tabulācijas rindu pirms tabulācijas"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAMMA izmantot PROGRAMMU, lai salīdzinātu divas datnes"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETIĶETE izmantot ETIĶETI nevis datnes nosaukumu\n"
+" (var atkārtot)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help parādīt šo palīdzību un iziet"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version izvada informāciju par versiju un iziet"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Izmantošana: %s [OPCIJAS]... MANADATNE VECĀDATNE JŪSUDATNE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Salīdzināt trīs datnes rindiņu pa rindiņai."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Noklusējuma izvades formāts ir daudz maz cilvēkam lasāma izmaiņu "
+"attēlojums.\n"
+"\n"
+"Opcijas -e, -E, -x, -X (un to garie varianti) liek izvadīt ed skriptu, "
+"nevis\n"
+"noklusējuma.\n"
+"\n"
+"Visbeidzot, -m (--merge) opcija liek iekšēji sapludināt diff3 un izvadīt "
+"pašu\n"
+"sapludināto datni. Netipiskām ievadēm, šis ir vēl spēcīgāks paņēmiens, nekā\n"
+"ed izmantošana.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Izejas statuss ir 0, ja tas ir veiksmīgs, 1, ja ir konflikts, 2, ja ir "
+"nepatikšanas."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "iekšējā kļūda: sagāja grīstē diff bloku formāts"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff neizdevās:"
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "iekšējā kļūda: nederīgs diff veids iekš process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "nederīgs diff formāts; nederīgs izmaiņu atdalītājs"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "nederīgs diff formāts; nepilnīga pēdējā rinda"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "nevarēja izsaukt palīgprogrammu “%s”"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "nederīgs diff formāts; nederīgas rindas ievades rakstzīmes"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "iekšējā kļūda: nederīgs uz izvadi padotais diff veids"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "ievades datne saruka"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "nevar salīdzināt datņu nosaukumus “%s” un “%s”"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekursīvs direktorijas cikls"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=DATNE darboties interaktīvi, izvadot izvadu uz DATNI"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i, --ignore-case uzskatīt ka augšējais un apakšējais reģistrs "
+"ir\n"
+" viens un tas pats"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorēt izmaiņas dēļ tabulācijas izplešanās"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ignorēt visas atstarpes rindu beigās"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change ignorēt izmaiņas dēļ atstarpēm"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space ignorēt visas atstarpes"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines ignorēt izmaiņas tukšajās rindās"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE ignorēt izmaiņas rindās, kuras sakrīt ar RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr noņemt atkārtojošos rakstatgriezi ievadē"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text uztvert visas datnes kā teksta datnes"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=NUM izvada līdz NUM (noklusējuma 130) drukas kolonas"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column izvadīt tikai kreiso kolonu no kopējām rindām"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines neizvadīt kopējās rindas"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs pārveidot tabulācijas par atstarpēm izvadē"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM tabulāciju pietura ik NUM drukas "
+"kolonas (noklusējuma ir 8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal ļoti censties atrast mazāku izmaiņu kopu"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files pieņemt, ka datnes ir lielas, daudz mazu izmaiņu"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAMMA izmantot PROGRAMMU, lai salīdzinātu divas datnes"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help parādīt šo palīdzību un iziet"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version izvada informāciju par versiju un iziet"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Lietošana: %s [OPCIJAS]... DATNE1 DATNE1\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Sānu-pie-sāna datņu DATNE1 un DATNE2 atšķirību sapludināšana."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "nevar interaktīvi sapludināt standarta ievadi"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "abas salīdzināmās datnes ir direktorijas"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tRediģēt tad izmantot abas versijas, katra izrotāta ar virsrakstu.\n"
+"eb:\tRediģēt un tad izmantot abas versijas.\n"
+"el vai e1:\tRediģēt un tad izmantot kreiso versiju.\n"
+"er vai e2:\tRediģēt un tad izmantot labo versiju.\n"
+"e:\tIgnorēt abas versijas, tad rediģēt jauno.\n"
+"l vai 1:\tIzmantot kreiso versiju.\n"
+"r vai 2:\tIzmantot labo versiju.\n"
+"s:\tKlusi iekļaut kopējās rindas.\n"
+"v:\tDetalizēti iekļaut kopējās rindas.\n"
+"q:\tIziet.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: neatpazīta opcija “--%s”\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i IZLAIST1:IZLAIST2 --ignore-initial=IZLAIST1:IZLAIST2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent Izvada neko, izdod tikai izejas stāvokli."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Izvada šo palīdzību."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NUM --context[=NUM] Izvada NUM (noklusētais 3) rinfas no kopētā "
+#~ "konteksta.\n"
+#~ "-u -U NUM --unified[=NUM] Izvada NUM (noklusētais 3) rinfas no "
+#~ "unificēta konteksta.\n"
+#~ " --label ETIĶETE Izmanto ETIĶETES faila nosaukumos.\n"
+#~ " -p --show-c-function Rāda C funkcijas, kurās ir izmaiņas.\n"
+#~ " -F RE --show-function-line=RE Rāda nesenāko skarītošo RE rindu."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Izvada divas kolonas.\n"
+#~ " -W NUM --width=NUM Izvada līdz NUM (noklusētais 130) drukas kolonas.\n"
+#~ " --left-column Izvada tikai kreisās kolonas no kopējām rindām.\n"
+#~ " --suppress-common-lines Neizvada kopējās rindas."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Pieņemt, ka faili ir lieli un satur daudzas mazas "
+#~ "izmaiņas."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Izvada pārklājušas izmaiņas, ieliekot iekavās tās."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Izvada sapludinātu failu nevis ed skriptu (noklusētais ir -"
+#~ "A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L ETIĶETE --label=ETIĶETE Izmantot ETIĶETI nevis faila nosaukumu."
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: neatļauta opcija -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Šī ir brīva programmatūra; apskaties izejas kodu autortiesību "
+#~ "nosacījumiem.\n"
+#~ "NAV nekāda garantijas; pat TIRGOŠANAS vai DERĪBA KONKRĒTAM MĒRĶIM.\n"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Ziņot par kļūdam uz <bug-gnu-utils@gnu.org>."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "`-%ld' opcija ir novecojusi; izmantojiet `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "`-%ld' opcija ir novecojusi; nelietojiet to"
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "netika atrasta palīgprogramma \"%s\""
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "neizdevās izpildīt palīgprogrammu \"%s\""
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "neizdevās izpildīt palīgprogrammu \"%s\" (izejas stauss %d)"
diff --git a/po/ms.gmo b/po/ms.gmo
new file mode 100644
index 0000000..295cafd
--- /dev/null
+++ b/po/ms.gmo
Binary files differ
diff --git a/po/ms.po b/po/ms.po
new file mode 100644
index 0000000..27841ce
--- /dev/null
+++ b/po/ms.po
@@ -0,0 +1,1596 @@
+# diffutils Bahasa Melayu (Malay) (ms).
+# Copyright (C) 2003, 2015 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Sharuzzaman Ahmat Raslan <sharuzzaman@gmail.com>, 2003, 2015.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2015-09-24 17:50+0800\n"
+"Last-Translator: Sharuzzaman Ahmat Raslan <sharuzzaman@gmail.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-Generator: Poedit 1.8.5\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "hujah tidak sah %s untuk %s"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "hujah tidak sah %s untuk %s"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "ralat program"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stack melimpah"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Ralat sistem tidak diketahui"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "fail kosong biasa"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "fail biasa"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "direktori"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "pautan simbolik"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "barisan mesej"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semaphore"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objek ingatan dikongsi"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "objek memori berjenis"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "fail khas blok"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "fail khas aksara"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "fail khas blok"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "fail khas aksara"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "fail pelik"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "fail khas blok"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "soket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "fail pelik"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: pilihan `-W %s' tidak mengizinkan hujah\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: pilihan `-W %s' tidak mengizinkan hujah\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "Pilihan \"%s\" memerlukan hujah"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: -c tidak disokong pada rekabentuk %s\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "Tetapan pilihan lekapan tidak sah: %s\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "Pilihan \"%s\" memerlukan hujah"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: pilihan `-W %s' tidak mengizinkan hujah\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "Pilihan \"%s\" memerlukan hujah"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Berjaya"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Tiada padanan"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Regular expression tidak sah"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Aksara pengumpulsemakan tidak sah"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nama kelas aksara tidak sah"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Slash dibelakang"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Rujukan belakang tidak sah"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ atau [^ tidak sepadan"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( atau \\( tidak sepadan"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ tidak sepadan"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Kandungan \\{\\} tidak sah"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Julat akhir tidak sah"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Kehabisan memori"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Regular expression awalan tidak sah"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Regular expression tamat tiba-tiba"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regular expression terlalu besar"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") atau \\) tidak sepadan"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Tiada regular expression terdahulu"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "kehabisan memori"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr "Tidak dapat mencipta soket aliran."
+
+#: lib/xfreopen.c:39
+#, fuzzy, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "regcomp() gagal pada %s: %s."
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "hujah tidak sah %s untuk %s"
+
+#: lib/xstrtol-error.c:68
+#, fuzzy, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "hujah tidak sah %s untuk %s"
+
+#: lib/xstrtol-error.c:72
+#, fuzzy, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "hujah kabur %s untuk %s"
+
+#: lib/version-etc.c:74
+#, fuzzy, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+"Ditulis oleh by %s, %s, %s,\n"
+"and %s.\n"
+
+#: lib/version-etc.c:77
+#, fuzzy, c-format
+msgid "Packaged by %s\n"
+msgstr "Ditulis oleh %s, %s, and %s.\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+#, 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 ""
+"Lesen GPLv3+: GNU GPL vesri 3 atau selepasnya <http://gnu.org/licenses/gpl."
+"html>\n"
+"Ini adalah perisan bebas: anda bebas untuk mengubah dan mengulangedarnya.\n"
+"TIADA JAMINAN diberikan, sehingga had yang dibenarkan oleh undang-undang.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Ditulis oleh %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Ditulis oleh %s and %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Ditulis oleh %s, %s, and %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Ditulis oleh by %s, %s, %s,\n"
+"and %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, and %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, and %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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, and %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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Ditulis oleh %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, fuzzy, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr "Lapor pepijat ke %s.\n"
+
+#: lib/version-etc.c:247
+#, fuzzy, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+"\n"
+"Lapor pepijat ke <%s>.\n"
+
+#: lib/version-etc.c:251
+#, fuzzy, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+"// Dijana oleh %s.\n"
+"// Lapor pepijat ke <%s>.\n"
+"// Laman utama: <%s>.\n"
+"\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Laman web %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+#, fuzzy
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Bantuan umum menggunakan perisian GNU: <http://www.gnu.org/gethelp/>.\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Fail %s dan %s berbeza\n"
+
+#: src/analyze.c:455
+#, fuzzy, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Fail %s dan %s berbeza\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Tiada baris baru pada penghujung fail"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Cuba `%s --help' untuk maklumat lanjut."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "nilai `%s' --ignore-initial tidak sah"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "pilihan -l dan -s tidak sepadan"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "gagal menulis"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "keluaran piawai"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes Cetak byte berbeza."
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i LANGKAU --ignore-initial=LANGKAU Langkau LANGKAU byte pertama masukan."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+" Langkau LANGKAU1 byte pertama untuk FAIL1 dan LANGKAU2 byte pertama untuk "
+"FAIL2."
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose Keluarkan nombor byte dan nilai semua byte berbeza."
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n HAD --bytes=HAD Banding paling banyak HAD byte."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent sekat semua keluaran normal"
+
+#: src/cmp.c:168
+#, fuzzy
+msgid " --help display this help and exit"
+msgstr "Papar teks bantuan ini"
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Papar maklumat versi dan keluar"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Penggunaan: %s [PILIHAN]... FAIL1 [FAIL2 [LANGKAU1 [LANGKAU2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Banding dua fail setiap byte."
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"LANGKAU1 dan LANGKAU2 adalah jumlah byte untuk dilangkau dalam setiap fail."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+#, fuzzy
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Hujah wajib kepada pilihan panjang adalah wajib untuk pilihan pendek juga.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Nilai LANGKAU boleh diikuti dengan akhiran pekali berikut:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, dan seterusnya untuk T, P, E, Z, Y."
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Jika FAIL adalah `-' atau tiada, baca masukan piawai."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Status keluar adalah 0 jika masukan adalah sama, 1 jika berbeza, 2 jika "
+"bermasalah."
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "nilai --bytes `%s' tidak sah"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "operan hilang selepas `%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "operan tambahan `%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s berbeza: byte %s, baris %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s berbeza: byte %s, baris %s adalah %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF pada %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "panjang konteks `%s' tidak sah"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "pagination tidak disokong pada hos ini"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "terlalu banyak pilihan label fail"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "lebar `%s' tidak sah"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "pilihan lebar berkonflik"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "panjang horizon `%s' tidak sah"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "saiz tab `%s' tidak sah"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "pilihan saiz tab berkonflik"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "--from-file dan --to-file kedua-duanya dinyatakan"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal Keluarkan diff normal."
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief Keluaran hanya jika fail berbeza."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files Lapor apabila dua fail adalah sama."
+
+#: src/diff.c:893
+#, fuzzy
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c -C NOM --context[=NOM] Keluarkan NOM (default 3) baris konteks yang "
+"disalin.\n"
+"-u -U NOM --unified[=NOM] Keluarkan NOM (default 3) baris konteks "
+"tergabung.\n"
+" --label LABEL Guna LABEL selain daripada nama fail.\n"
+" -p --show-c-function Papar fungsi C yang mana dalam setiap perubahan.\n"
+" -F RE --show-function-line=RE Papar baris terbaru sepadan RE."
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-c -C NOM --context[=NOM] Keluarkan NOM (default 3) baris konteks yang "
+"disalin.\n"
+"-u -U NOM --unified[=NOM] Keluarkan NOM (default 3) baris konteks "
+"tergabung.\n"
+" --label LABEL Guna LABEL selain daripada nama fail.\n"
+" -p --show-c-function Papar fungsi C yang mana dalam setiap perubahan.\n"
+" -F RE --show-function-line=RE Papar baris terbaru sepadan RE."
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed Keluarkan skrip ed."
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Keluarkan diff format RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side keluaran dalam dua lajur"
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w NOM --width=NOM Keluarkan paling banyak NOM (default 130) lajur cetakan."
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column Keluarkan hanya lajur kiri baris yang sama."
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Jangan keluarkan baris sama."
+
+#: src/diff.c:902
+#, fuzzy
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-c -C NOM --context[=NOM] Keluarkan NOM (default 3) baris konteks yang "
+"disalin.\n"
+"-u -U NOM --unified[=NOM] Keluarkan NOM (default 3) baris konteks "
+"tergabung.\n"
+" --label LABEL Guna LABEL selain daripada nama fail.\n"
+" -p --show-c-function Papar fungsi C yang mana dalam setiap perubahan.\n"
+" -F RE --show-function-line=RE Papar baris terbaru sepadan RE."
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE papar baris paling terkini sepadan RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr "-L LABEL --label=LABEL Guna LABEL selain daripada nama fail."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Kembang tab kepada ruang dalam keluaran."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab Jadikan tab sebaris dengan menambah awalan tab."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr "--tabsize=NOM Hentian tab setial NOM (default 8) lajur cetakan."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty sekat ruang atau tab sebelum baris keluaran "
+"kosong"
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l --paginate Salur keluaran menerusi `pr' untuk paginate."
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r --recursive Banding berulang-ulang sebarang subdirektori yang dijumpai."
+
+#: src/diff.c:914
+#, fuzzy
+msgid " --no-dereference don't follow symbolic links"
+msgstr "Jangan ikut pautan simbolik, tulisemula"
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file Anggap fail tidak wujud sebagai kosong."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr "--unidirectional-new-file Anggap fail tidak wujud sebagai kosong."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr "--ignore-file-name-case Abai case apabila membanding nama fail."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case Ambil kira case ketika membanding nama fail."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x PAT --exclude=PAT Asing fail yang sepadan PAT."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X FAIL --exclude-from=FAIL Asing fail yang sepadan sebarang corak dalam "
+"FAIL."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S FAIL --starting-file=FAIL Mula dengan FAIL apabila membanding direktori."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=FAIL1 Banding FAIL1 kepada semua operan. FAIL1 boleh jadi "
+"direktori."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=FAIL2 Banding semua operan kepada FAIL2. FAIL2 boleh jadi "
+"direktori."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i --ignore-case Abai perbezaan case dalam kandungan fail."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Abai perubahan diakibatkan oleh pengembangan tab."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Abai semua ruang putih."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Abai perubahan dalam jumlah ruang putih."
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space Abai semua ruang putih."
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines Abai perubahan dimana baris adalah kesemuanya "
+"kosong."
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I RE --ignore-matching-lines=RE Abai perubahan dimana baris semua sepadan "
+"RE."
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Layan semua fail sebagai teks."
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Buang enter penghujung pada masukan."
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Baca dan tulis data dalam mod binari."
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D NAMA --ifdef=NAMA Keluarkan fail tergabung untuk menunjukkan perbezaa "
+"`#ifdef NAMA'."
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GTYPE-group-format=GFMT Hampir sama, tetapi format masukan GTYPE "
+"dikumpulkan dengan GFMT."
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+"--line-format=LFMT Hampir sama, tetapi format semua baris masukan dengan "
+"LFMT."
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--LTYPE-line-format=LFMT Hampir sama, tetapi format baris masukan LTYPE "
+"dengan LFMT."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE adalah `old', `new', atau `unchanged'. GTYPE adalah LTYPE atau "
+"`changed'."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT boleh mengandungi:\n"
+" %< baris dari FAIL1\n"
+" %> baris dari FAIL2\n"
+" %= baris yang sama pada FAIL1 dan FAIL2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER spec gaya-printf untuk LETTER\n"
+" LETTER adalah seperti berikut untuk kumpulan baru, huruf kecil untuk "
+"kumpulan lama:\n"
+" F nombor baris pertama\n"
+" L nombor baris terakhir\n"
+" N jumlah baris = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT boleh mengandungi:\n"
+" %L kandungan baris\n"
+" %l kandungan baris, tidak termasuk baris baru dipenghujung\n"
+" %[-][WIDTH][.[PREC]]{doxX}n spec gaya-printf untuk nombor baris masukan"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Sama ada GFMT atau LFMT boleh mengandungi:\n"
+" %% %\n"
+" %c'C' satu aksara C\n"
+" %c'\\OOO' aksara dengan kod oktal OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Cuba cari dengan tekun set perbezaan yang kecil."
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=NOM Pastikan NOM baris prefix dan suffix sama."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"--speed-large-files Anggap fail besar dan banyak perubahan kecil tersebar."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal Keluarkan diff normal."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+#, fuzzy
+msgid " --help display this help and exit"
+msgstr "Papar teks bantuan ini"
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Papar maklumat versi dan keluar"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FAIL-FAIL adalah `FAIL1 FAIL2' atau `DIR1 DIR2' atau `DIR FAIL...' atau "
+"`FAIL... DIR'."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr "Jika --from-file atau --to-file diberi, tiada sekatan pada FAIL."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "Jika FAIL adalah `-', baca masukan piawai."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Penggunaan: %s [PILIHAN]... FAIL\n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr "Banding fail setiap baris."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "nilai pilihan %s berkonflik `%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "pilihan gaya keluaran berkonflik"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "lebar `%s' tidak sah"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Hanya dalam %s: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "tidak dapat membandingkan `-' kepada direktori"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "pilihan -D tidak disokong dengan direktori"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdirektori umum: %s dan %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Fail %s adalah %s manakala fail %s adalah %s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "%s bukan fail biasa atau pautan simbolik."
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Fail %s dan %s adalah serupa\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "pilihan tidak sepadan"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "`-' dinyatakan untuk lebih daripada satu fail masukan"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "gagal membaca"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A --show-all Keluarkan semua perubahan, kurungkan konflik."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Keluarkan perubahan tidak digabung daripada OLDFILE ke YOURFILE "
+"kedalam MYFILE."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap Keluarkan perubahan tidak digabung, kurungkan konflik."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3 --easy-only Keluarkan perubahan tidak digabung dan tidak bertindih."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only Keluarkan perubahan bertindih."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Tambah arahan `w' dan `q' kepada skrip ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Layan semua fail sebagai teks."
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Buang enter penghujung pada masukan."
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab Jadikan tab sebaris dengan menambah awalan tab."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM Guna PROGRAM untuk membanding fail."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+#, fuzzy
+msgid " --help display this help and exit"
+msgstr "Papar teks bantuan ini"
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Papar maklumat versi dan keluar"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Penggunaan: %s [PILIHAN]... MYFILE OLDFILE YOURFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Banding tiga fail tiap-tiap baris."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Status keluar adalah 0 jika berjaya, 1 jika konflik, 2 jika bermasalah."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "ralat dalaman: kerosakan dalam format blok diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff gagal: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "ralat dalaman: jenis diff tidak sah dalam process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "format diff tidak sah; pengasing perbezaan tidak sah"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "format diff tidak sah; baris akhir tidak lengkap"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "program subsidiari `%s' tidak dapat dilaksanakan"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "format diff tidak sah; aksara awal baris tidak betul"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "ralat dalaman: jenis diff tidak sah diberikan kepada keluaran"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "fail masukan mengecil"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "tidak dapat membandingkan fail bernama `%s' dan `%s'"
+
+#: src/dir.c:225
+#, fuzzy, c-format
+msgid "%s: recursive directory loop"
+msgstr "\"%s\" adalah sebuah direktori"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o FAIL --output=FAIL Operasi secara interaktif, hantar keluaran ke FAIL."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case Anggap huruf besar dan kecil sebagai sama."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Abai perubahan diakibatkan oleh pengembangan tab."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Abai semua ruang putih."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Abai perubahan dalam jumlah ruang putih."
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space Abai semua ruang putih."
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines Abai perubahan dimana baris adalah kesemuanya "
+"kosong."
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I RE --ignore-matching-lines=RE Abai perubahan dimana baris semua sepadan "
+"RE."
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr Buang enter penghujung pada masukan."
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Layan semua fail sebagai teks."
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w NOM --width=NOM Keluarkan paling banyak NOM (default 130) lajur cetakan."
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column Keluarkan hanya lajur kiri baris yang sama."
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Jangan keluarkan baris sama."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Kembang tab kepada ruang dalam keluaran."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr "--tabsize=NOM Hentian tab setial NOM (default 8) lajur cetakan."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal Cuba cari dengan tekun set perbezaan yang kecil."
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files Anggap fail besar dan banyak perubahan kecil "
+"tersebar."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM Guna PROGRAM untuk membanding fail."
+
+#: src/sdiff.c:196
+#, fuzzy
+msgid " --help display this help and exit"
+msgstr "Papar teks bantuan ini"
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "Papar maklumat versi dan keluar"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Penggunaan: %s [PILIHAN]... FAIL1 FAIL2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Gabung bersebelahan perbezaaan fail."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "tidak dapat menggabung masukan piawai secara interaktif"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "kedua-dua fail yang akan dibanding adalah direktori"
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tSunting kemudian guna kedua-dua versi, setiap satu ditambah dengan "
+"header.\n"
+"eb:\tSunting kemudian guna kedua-dua versi.\n"
+"el:\tSunting kemudian guna versi kiri.\n"
+"er:\tSunting kemudian guna versi kanan.\n"
+"e:\tSunting versi baru.\n"
+"l:\tGuna versi kiri.\n"
+"r:\tGuna versi kanan.\n"
+"s:\tSertakan baris sama dengan senyap.\n"
+"v:\tSertakan baris sama dengan berjela.\n"
+"q:\tKeluar.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: pilihan '%s' adalah kabur; kemungkinan:"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/nb.gmo b/po/nb.gmo
new file mode 100644
index 0000000..cb8a9f7
--- /dev/null
+++ b/po/nb.gmo
Binary files differ
diff --git a/po/nb.po b/po/nb.po
new file mode 100644
index 0000000..a65d6cd
--- /dev/null
+++ b/po/nb.po
@@ -0,0 +1,1531 @@
+# Norwegian bokmål translation of GNU diffutils
+# Copyright (C) 2000, 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Åka Sikrom <a4@hush.com>, 2015.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils-3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2015-01-23 18:51+0100\n"
+"Last-Translator: Åka Sikrom <a4@hush.com>\n"
+"Language-Team: Norwegian Bokmaal <i18n-nb@lister.ping.uio.no>\n"
+"Language: nb\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: Poedit 1.5.4\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "%s%s-argumentet «%s» er ugyldig"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "%s%s-argumentet «%s» er ugyldig"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programfeil"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stabel er full"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Ukjent systemfeil"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "vanlig tom fil"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "vanlig fil"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "mappe"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "symbolsk lenke"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "meldingskø"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "delt minneobjekt"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "typebestemt minneobjekt"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "blokk-spesialfil"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "tegn-spesialfil"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "blokk-spesialfil"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "tegn-spesialfil"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "rar fil"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "blokk-spesialfil"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "sokkel"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "rar fil"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: valget «%s» er flertydig, og kan bety følgende:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: valget «-W %s» er flertydig\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: valget «--%s» tillater ikke argumenter\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: valget «%c%s» tillater ikke argumenter\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: krever «--%s» krever et argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: «--%s» er et ukjent valg\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: «%c%s» er et ukjent valg\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: «%c» er et ugyldig valg\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: valget -- «%c» krever et argument\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: valget «-W %s» er flertydig\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: valget «-W %s» tillater ikke argumenter\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: valget «-W %s» krever et argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "«"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "»"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Fullført"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Ingen treff"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ugyldig regulært uttrykk"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ugyldig sorteringstegn"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ugyldig tegnklassenavn"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Etterfølgende omvendt skråstrek"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ugyldig tilbakereferanse"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Ingen treff på «[» eller «[^»"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Ingen treff på «(» eller «\\(»"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Ingen treff på «\\{{»"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ugyldig innhold i «\\{\\}»"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ugyldig slutt på rekkevidde"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Minnet er fullt"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ugyldig foregående regulært uttrykk"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "For tidlig slutt på regulært uttrykk"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regulært uttrykk er for stort"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Ingen treff på «)» eller «\\)»"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Intet tidligere regulært uttrykk"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "minnet er fullt"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "std.innkanal"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "std.utkanal"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "std.feilkanal"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "ukjent strøm"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "klarte ikke å åpne %s på nytt med modus %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "%s%s-argumentet «%s» er ugyldig"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "ugyldig suffiks i %s%s-argument «%s»"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s-argumentet «%s» er for stort"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Pakket av %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Pakket av %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Lisens GPLv3+: GNU GPL versjon 3 eller senere <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Dette er fri programvare. Du kan endre den og dele den videre.\n"
+"Det stilles INGEN GARANTI, i den grad dette tillates av gjeldende lovverk.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Skrevet av %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Skrevet av %s og %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Skrevet av %s, %s og %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Skrevet av %s, %s, %s\n"
+"og %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Skrevet av %s, %s, %s,\n"
+"%s og %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Skrevet av %s, %s, %s,\n"
+"%s, %s og %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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Skrevet av %s, %s, %s,\n"
+"%s, %s, %s og %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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Skrevet av %s, %s, %s,\n"
+"%s, %s, %s, %s\n"
+"og %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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Skrevet av %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s og %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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Skrevet av %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s og andre.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapporter programfeil til: %s\n"
+"Rapporter oversettelsesfeil til: <i18n-no@lister.ping.uio.no>\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Rapporter programfeil i %s til: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Nettside for %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Nettside for %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Generell hjelp til å bruke GNU-programmer: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Filene %s og %s er ulike\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binærfilene %s og %s er ulike\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Intet linjeskift i slutten av fila"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Prøv «%s --help» for ytterligere informasjon."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "«%s» er en ugyldig verdi for «--ignore-initial»"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "valgene «-l» og «-s» kan ikke brukes samtidig"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "skriving mislyktes"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standardutdata"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes skriv ut byte som er ulike"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=ANT hopp over første valgt ANTall byte begge "
+"FILer"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=ANT1:ANT2 hopp over første valgt ANT1 byte i FIL1 og\n"
+" ANT2 byte i FIL2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose skriv ut byte-nummer og avvikende byte-verdier"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=ANT ikke sammenlikn flere enn valgt ANTall byte"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent ikke skriv ut vanlig utdata"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjelpeteksten og avslutt"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version skriv ut versjonsinformasjon og avslutt"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Bruk: %s [VALG] … FIL1 [FIL2 [ANT1 [ANT2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Sammenlikn to filer byte for byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Du kan hoppe over valgfritt ANT1 og ANT2 byte i begynnelsen\n"
+"av henholdsvis første og andre fil (standard er null)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Argumenter som er obligatoriske for lange valg, er også obligatoriske for "
+"korte valg.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"ANT-verdier kan etterfølges av følgende multipliseringsuttrykk:\n"
+"kB (1000), K (1024), MB (1 000 000), M (1 048 576),\n"
+"GB (1 000 000 000), G (1 073 741 824), og så videre (T, P, E, Z, Y)."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Hvis FIL er tom eller «-», leser programmet standard inndata."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Avsluttende status er 0 hvis inndata er like, 1 hvis ulike og 2 hvis det "
+"oppstår problemer."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "«%s» er en ugyldig verdi for «--bytes»"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "operand mangler etter «%s»"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "ekstra operand «%s»"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s er ulike: byte %s, linje %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s er ulike: byte %s, linje %s er %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF ved %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "«%s» er en ugyldig kontekstlengde"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "sidedeling støttes ikke på denne verten"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "for mange filetikett-valg"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "«%s» er en ugyldig bredde"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "breddevalg i konflikt"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "«%s» er en ugyldig horisontlengde"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "«%s» er en ugyldig tabulatorstørrelse"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "tabulatorvalg i konflikt"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "du har valgt både «--from-file» og «--to-file»"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+" --normal skriv ut en normal diff (dette er standard)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief bare rapporter når filer er ulike"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files rapporter når to filer er like"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C ANT, --context[=ANT] skriv ut valgt ANTall linjer med kopiert "
+"kontekst (standard: 3)"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U ANT, --unified[=ANT] skriv ut valgt ANTall linjer med sammenslått "
+"kontekst (standard: 3)"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed skriv ut et ed-skript"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs skriv ut diff i RCS-format"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side skriv ut i to kolonner"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=ANT skriv ut maks valgt ANTall kolonner (standard: "
+"130)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column bare skriv ut venstre kolonne med vanlige "
+"linjer"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines ikke skriv ut vanlige linjer"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function vis hvilken C-funksjon hver endring ligger i"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE vis nyeste linje som samsvarer med RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETIK bruk valgt ETIKett i stedet for filnavn\n"
+" (dette kan gjentas)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs utvid tabulatorer til mellomrom på utskrift"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab still opp tabulatorer ved å legge til en "
+"tabulator først"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM tabulatorer stopper for hvert valgte "
+"utskriftskolonne-NUMmer (standard: 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty ikke skriv ut mellomrom eller tabulator før "
+"tomme linjer"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l, --paginate del utdata i sider via «pr»"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r, --recursive sammenlikn evt. undermapper rekursivt"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference ikke følg symbolske lenker"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file behandle fraværende filer som tomme"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr " --unidirectional-new-file behandle fraværende førstefil som tom"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case skill mellom store og små bokstaver ved "
+"sammenlikning av filnavn"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case skill mellom store og små bokstaver ved "
+"sammenlikning av filnavn"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=MØN utelat filer som samsvarer med valgt MØNster"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FIL utelat filer som samsvarer med mønster(e) i "
+"valgt FIL"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=FIL begynn med valgt FIL ved sammenlikning av "
+"mapper"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FIL1 sammenlikn FIL1 med alle operand-er\n"
+" (FIL1 kan være en mappe)"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FIL2 sammenlikn alle operand-er med FIL2\n"
+" (FIL2 kan være en mappe)"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case ikke skill mellom små og store bokstaver i "
+"fil-innhold"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorer endringer som skyldes tabulator-"
+"utvidelse"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ignorer blanktegn i slutten av linjer"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change ignorer endringer i antall blanktegn"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space ignorer alle blanktegn"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignorer endringer når alle linjer er tomme"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE ignorer endringer når alle linjer samsvarer "
+"med RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandle filer som tekst"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr fjern etterfølgende linjeskift-tegn fra "
+"inndata"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary les og skriv data i binærmodus"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAVN skriv ut sammenslått fil med ulikheter i "
+"«#ifdef NAVN»"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT formater GTYPE-inndatagrupper med GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT formater inndatalinjer med LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT formater LTYPE-inndatalinjer med LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Disse formatvalgene gjør det mulig å detaljstyre utdata\n"
+" fra diff, og generaliserer -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE er enten «old», «new» eller «unchanged». GTYPE er enten LTYPE eller "
+"«changed»."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (alene) kan inneholde følgende:\n"
+" %< linjer fra FIL1\n"
+" %> linjer fra FIL2\n"
+" %= linjer som finnes i både FIL1 og FIL2\n"
+" %[-][BREDDE][.[PREC]]{doxX}BOKST spesifikasjon av BOKSTav i printf-"
+"stil.\n"
+" BOKSTaver kan være som følger for ny gruppe (bruk små bokstaver for "
+"gammel gruppe):\n"
+" F første linjenummer\n"
+" L siste linjenummer\n"
+" N antall linjer = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) hvis A er lik B, så T eller E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (alene) kan inneholde følgende:\n"
+" %L linjeinnhold\n"
+" %l linjeinnhold, unntatt evt. etterfølgende linjeskift\n"
+" %[-][BREDDE][.[PREC]]{doxX}n spesifikasjon av inndata-linjenummer i "
+"printf-stil"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Både GFMT og LFMT kan inneholde følgende:\n"
+" %% %\n"
+" %c'C' enkelttegnet C\n"
+" %c'\\OOO' tegnet med oktalkode OOO\n"
+" C tegnet C (andre tegn representerer seg selv)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal prøv hardt å finne en mindre rekke endringer"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=ANT behold valgt ANTall linjer av vanlig pre- og suffiks"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr " --speed-large-files forvent store filer og små, spredte endringer"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr ""
+" --normal skriv ut en normal diff (dette er standard)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjelpeteksten og avslutt"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versjonsinformasjon og avslutt"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILER er «FIL1 FIL2», «MAPPE1 MAPPE2», «MAPPE FIL …» eller «FIL… MAPPE»."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Programmet bruker ingen restriksjoner på FIL(er) hvis «--from-file» eller «--"
+"to-file» er valgt."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Programmet leser fra standard inndata hvis FIL er «-»."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Bruk: %s [VALG] … FILER\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Sammenlikn FILER linje for linje."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "valget %s er i konflikt med verdien «%s»"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "utdata-stilvalg er i konflikt med hverandre"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "«%s» er en ugyldig bredde"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Bare i %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "du kan ikke sammenlikne «-» med en mappe"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "valget «-D» støttes ikke for mapper"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Vanlige undermapper: %s og %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Fila %s er en %s, og fila %s er en %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "De symbolske lenkene %s og %s er ulike\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Filene %s og %s er identiske\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "gjeldende valg kan ikke brukes samtidig"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "«-» er valgt for flere enn én inndatafil"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lesing mislyktes"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all skriv ut alle endringer, med konflikter i "
+"parentes"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed skriv ut ed-skript med endringer\n"
+" mellom GAMMELFIL og NYFIL til FIL"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap likner «-e», men viser konflikter i parentes"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only likner «-e», men tar ikke med endringer som "
+"overlapper hverandre"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only likner «-e», men tar bare med endringer som "
+"overlapper hverandre"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X likner «-x», men viser også konflikter i parentes"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i legg til kommandoene «w» og «q» i ed-skript"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge skriv ut sammenslått fil ihht. «-A»,\n"
+" med mindre noe annet er valgt"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandle filer som tekst"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr fjern etterfølgende linjeskift-tegn fra inndata"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab still opp tabulatorer på rekke ved å legge til "
+"en ekstra tab foran"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM bruk valgt PROGRAM til å sammenlikne filer"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETIKETT bruk valgt ETIKETT i stedet for filnavn\n"
+" (dette kan gjentas opptil tre ganger)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjelpeteksten og avslutt"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versjonsinformasjon og avslutt"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Usage: %s [VALG] … FIL GAMMELFIL NYFIL\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Sammenlikn tre filer, linje for linje."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Standard utskriftsformat er en nogen lunde menneskevennlig visning\n"
+"av endringene.\n"
+"\n"
+"Valgene «-e», «-E», «-x» og «-X» (samt tilsv. lange valgnavn) fører til\n"
+"utskrift av ed-skript i stedet for standardformatet.\n"
+"\n"
+"Valget «-m» («--merge») lar diff3 utføre sammenslåing internt\n"
+"og skrive ut sammenslått fil. Dette er sikrere for behandling av\n"
+"uvanlig inndata enn å bruke ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Avsluttende status er 0 hvis alt er i orden, 1 ved konflikter og 2 ved "
+"problemer."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "intern feil: rot i diff-blokkformat"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff mislyktes: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "intern feil: ugyldig diff-type i process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "ugyldig diff-format. Ugyldig endringsskilletegn"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "ugyldig diff-format. Siste linje er ufullstendig"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "klarte ikke å starte hjelpeprogrammet «%s»"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "ugyldig diff-format. Feil ledende linjetegn"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "intern feil: ugyldig diff-type sendt til utdata"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "inndata-fila er krympet"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "klarte ikke å sammenlikne filnavn «%s» med «%s»"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekursiv mappesløyfe"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o, --output=FIL jobb interaktivt, og send utdata til FIL"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case ikke skill mellom store og små bokstaver"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ikke regn tabulator-forskjeller som endringer"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ignorer blanktegn i slutten av linjer"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change ikke regn ulikt antall blanktegn som endringer"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space ignorer alle blanktegn"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignorer endringer hvis linjer er fullstendig "
+"tomme"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE ignorer endringer hvis linjer samsvarer med "
+"RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr fjern etterfølgende linjeskift-tegn fra inndata"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandle filer som tekst"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=ANT ikke skriv ut flere enn valgt ANTall kolonner "
+"(standard: 130)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column bare skriv ut venstre kolonne med vanlige linjer"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines ikke skriv ut vanlige linjer"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs utvid tabulatorer til mellomrom i utdata"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NUM tabulatorer slutter ved hvert valgte "
+"kolonneNUMmer (standard: 8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal prøv hardt å finne små endringer"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files forvent store filer med små, spredte endringer"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROGRAM bruk valgt PROGRAM til å sammenlikne filer"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help vis denne hjelpeteksten og avslutt"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version vis versjonsinformasjon og avslutt"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Bruk: %s [VALG] … FIL1 FIL2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Sammenslåing av forskjeller mellom FIL1 og FIL2, side ved side."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "du kan ikke slå sammen standard inndata interaktivt"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "begge filer som skal sammenliknes er mapper"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tRediger og bruk begge versjoner, og dekorer hver av dem med "
+"overskrift.\n"
+"eb:\tRediger og bruk deretter begge versjoner.\n"
+"el or e1:\tRediger og bruk deretter venstre versjon.\n"
+"er or e2:\tRediger og bruk deretter høyre versjon.\n"
+"e:\tForkast begge versjon, og rediger en ny versjon.\n"
+"l or 1:\tBruk venstre versjon.\n"
+"r or 2:\tBruk høyre versjon.\n"
+"s:\tInkluder kommandolinjer uten å nevne noe om det.\n"
+"v:\tInkluder kommandolinjer i detaljert modus.\n"
+"q:\tAvslutt.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: «--%s» er et ukjent valg\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/nl.gmo b/po/nl.gmo
new file mode 100644
index 0000000..76a9329
--- /dev/null
+++ b/po/nl.gmo
Binary files differ
diff --git a/po/nl.po b/po/nl.po
new file mode 100644
index 0000000..d207c06
--- /dev/null
+++ b/po/nl.po
@@ -0,0 +1,1634 @@
+# Dutch translations for GNU diffutils.
+# Copyright (C) 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+# Would she be called Adinda...
+#
+# Benno Schulenberg <benno@vertaalt.nl>, 2007, 2008, 2010, 2011, 2012.
+# Elros Cyriatan <cyriatan@fastmail.fm>, 2004.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils-3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-10-31 21:04+0100\n"
+"Last-Translator: Benno Schulenberg <benno@vertaalt.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-Generator: Lokalize 1.0\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "ongeldig argument '%3$s' van %1$s%2$s"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "ongeldig argument '%3$s' van %1$s%2$s"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programmafout"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stack-overloop"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Onbekende systeemfout"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "leeg normaal bestand"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "normaal bestand"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "map"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "symbolische koppeling"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "berichtenwachtrij"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafoor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "gedeeld geheugenobject"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "zelfstandig geheugenobject"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "blok-apparaat"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "byte-apparaat"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "blok-apparaat"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "byte-apparaat"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "merkwaardig bestand"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "blok-apparaat"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "merkwaardig bestand"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: optie '%s' is niet eenduidig; mogelijkheden zijn:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: optie '-W %s' is niet eenduidig\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: optie '--%s' staat geen argument toe\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: optie '%c%s' staat geen argument toe\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: optie '--%s' vereist een argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: onbekende optie '--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: onbekende optie '%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ongeldige optie -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: optie vereist een argument -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: optie '-W %s' is niet eenduidig\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: optie '-W %s' staat geen argument toe\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: optie '-W %s' vereist een argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "‘"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "’"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Gelukt"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Geen overeenkomsten"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ongeldige reguliere expressie"
+
+# Zie http://mailman.vrijschrift.org/pipermail/vertaling/2005-August/004670.html
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ongeldig samengesteld teken"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ongeldige tekenklassenaam"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Backslash aan het eind"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ongeldige terugverwijzing"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Ongepaarde [ of [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Ongepaarde ( of \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Ongepaarde \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ongeldige inhoud van \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ongeldig bereikeinde"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Onvoldoende geheugen beschikbaar"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ongeldige voorafgaande reguliere expressie"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Voortijdig einde van reguliere expressie"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Reguliere expressie is te groot"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Ongepaarde ) of \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Geen eerdere reguliere expressie"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "onvoldoende geheugen beschikbaar"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "standaardinvoer"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "standaarduitvoer"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "standaardfoutuitvoer"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "onbekende gegevensstroom"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "opnieuw openen van '%s' met modus %s is mislukt"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "ongeldig argument '%3$s' van %1$s%2$s"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "ongeldig achtervoegsel in argument '%3$s' van %1$s%2$s"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "argument '%3$s' van %1$s%2$s is te groot"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "In pakketvorm gebracht door %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "In pakketvorm gebracht door %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"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 http://gnu.org/licenses/gpl.html voor de volledige (Engelse) tekst.\n"
+"Deze software kent GEEN GARANTIE, voor zover de wet dit toestaat.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Geschreven door %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Geschreven door %s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Geschreven door %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s\n"
+"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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapporteer gebreken in het programma aan <%s>;\n"
+"meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#: lib/version-etc.c:247
+#, 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"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Webpagina van %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Webpagina van %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Algemene hulp bij gebruik van GNU-software: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Bestanden %s en %s zijn verschillend\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binaire bestanden %s en %s zijn verschillend\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Geen regeleindeteken (LF) aan einde van bestand"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Typ '%s --help' voor meer informatie."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "ongeldige waarde '%s' voor '--ignore-initial'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "opties '-l' en '-s' gaan niet samen"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "schrijven is mislukt"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standaarduitvoer"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes de bytes tonen die verschillen"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=OVERSLAAN de eerste OVERSLAAN bytes van\n"
+" beide invoeren overslaan"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=OVS1:OVS2 de eerste OVS1 bytes van BESTAND1 en de\n"
+" eerste OVS2 bytes van BESTAND2 overslaan"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose bytenummers en -waarden tonen van bytes die "
+"verschillen"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=AANTAL maximaal dit AANTAL bytes vergelijken"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent alle gewone uitvoer onderdrukken"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help deze hulptekst tonen en stoppen"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version programmaversie tonen en stoppen"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr ""
+"Gebruik: %s [OPTIE...] BESTAND1 [BESTAND2 [OVERSLAAN1 [OVERSLAAN2]]]\n"
+"\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Twee bestanden byte-voor-byte vergelijken."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"De optionele waarden OVERSLAAN1 en OVERSLAAN2 geven het aantal bytes aan "
+"dat\n"
+"aan het begin van elk bestand moet worden overgeslagen (standaard nul)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"(Een verplicht argument bij een lange optie geldt ook voor de korte vorm.)\n"
+"\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"De waarden voor OVERSLAAN mogen worden gevolgd door de volgende\n"
+"vermenigvuldigende achtervoegsels:\n"
+" kB 1000, K 1024, MB 1.000.000, M 1.048.576,\n"
+" GB 1.000.000.000, G 1.073.741.824, enzovoort voor T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr ""
+"Als een BESTAND ontbreekt of '-' is, wordt er van standaardinvoer gelezen."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"De afsluitwaarde is 0 als de invoeren gelijk zijn, 1 als ze verschillen,\n"
+"en 2 bij problemen."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "ongeldige waarde '%s' voor '--bytes'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "ontbrekend argument na '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "overtollig argument '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s verschillen: byte %s, regel %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s verschillen: byte %s, regel %s, is %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: einde-van-bestand op %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "ongeldige contextlengte '%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "het in pagina's indelen is op deze computer niet mogelijk"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "te veel bestandslabel-opties"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "ongeldige breedte '%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "conflicterende breedte-opties"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "ongeldige horizonlengte '%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "ongeldige tabgrootte '%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "conflicterende tabgrootte-opties"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "zowel '--from-file' als '--to-file' zijn opgegeven"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal een gewone diff produceren (standaard)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief alleen aangeven of bestanden verschillen"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s, --report-identical-files vermelden of twee bestanden hetzelfde zijn"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C AANTAL, --context[=AANTAL] dit AANTAL regels (standaard 3) van\n"
+" gekopieerde context tonen"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U AANTAL, --unified[=AANTAL] dit AANTAL regels (standaard 3) van\n"
+" geünificeerde context tonen"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed een ed-script produceren"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs een diff in RCS-opmaak produceren"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side het resultaat weergeven in twee kolommen"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=AANTAL maximaal dit AANTAL kolommen tonen (standaard 130)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column bij gelijke regels alleen de linkerkolom tonen"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines de gelijke regels onderdrukken"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function vermelden in welke C-functie elke wijziging is"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RE recentste regel overeenkomend met RE tonen"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label LABEL dit LABEL gebruiken in plaats van bestandsnaam\n"
+" (mag herhaald worden)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs tabs uitschrijven naar spaties in uitvoer"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab tabs uitlijnen door invoegen van tab aan het begin"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=AANTAL tab-stops op elke AANTAL posities (standaard 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty spatie of tab onderdrukken voor lege uitregels"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate de uitvoer door 'pr' halen om deze in pagina's\n"
+" in te delen"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r, --recursive recursief elke gevonden submap vergelijken"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference symbolische koppelingen niet volgen"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file afwezige bestanden als leeg behandelen"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file alleen bestanden die afwezig zijn in de\n"
+" eerste map als leeg behandelen"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case verschil tussen hoofd- en kleine letters "
+"negeren\n"
+" bij vergelijken van bestandsnamen"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case onderscheid maken tussen hoofd- en kleine\n"
+" letters bij vergelijken van bestandsnamen"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=PATROON bestanden uitsluiten als ze overeenkomen met "
+"PATROON"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=BESTAND bestanden uitsluiten die overeenkomen met\n"
+" een patroon in BESTAND"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=BESTAND beginnen met BESTAND bij vergelijken van "
+"mappen"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=BESTAND1 BESTAND1 met alle argumenten vergelijken;\n"
+" BESTAND1 mag een map zijn"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=BESTAND2 alle argumenten met BESTAND2 vergelijken;\n"
+" BESTAND2 mag een map zijn"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case verschil tussen hoofd- en kleine letters\n"
+" negeren in bestandsinhoud"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion omzettingen van tabs in spaties negeren"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space witruimte aan einde van regel negeren"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change wijzigingen in hoeveelheid witruimte negeren"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space alle witruimte negeren"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines wijzigingen waarvan alle regels leeg zijn "
+"negeren"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE wijzigingen waarvan alle regels "
+"overeenkomen\n"
+" met reguliere expressie RE negeren"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text alle bestanden als tekst behandelen"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Enter-tekens (CR's) aan einde van regels weglaten"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+" --binary gegevens in binaire modus lezen en schrijven"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAAM samengevoegd bestand tonen om verschillen in\n"
+" '#ifdef NAAM' te laten zien"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GSOORT-group-format=GOPMAAK iets dergelijks, maar dan invoergroepen "
+"van\n"
+" soort GSOORT opmaken met GOPMAAK"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LOPMAAK iets dergelijks, maar dan alle invoerregels "
+"opmaken\n"
+" met LOPMAAK"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LSOORT-line-format=LOPMAAK iets dergelijks, maar dan invoerregels "
+"van\n"
+" soort LSOORT opmaken met LOPMAAK"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Deze opmaakopties bieden een fijnafregeling van de uitvoer aan,\n"
+" een generalisatie van de optie '-d/--ifdef'."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LSOORT is 'old' (oud), 'new' (nieuw), of 'unchanged' (ongewijzigd);\n"
+" GSOORT is LSOORT of 'changed' (gewijzigd)."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GOPMAAK mag bevatten:\n"
+" %< regels van BESTAND1\n"
+" %> regels van BESTAND2\n"
+" %= regels overeenkomend in BESTAND1 en BESTAND2\n"
+" %[-][BREEDTE][.[PREC]]{doxX}LETTER printf-stijl specificatie voor "
+"LETTER\n"
+" LETTERs zijn als volgt voor nieuwe groep, kleine letter voor oude "
+"groep:\n"
+" F eerste regelnummer\n"
+" L laatste regelnummer\n"
+" N het aantal regels (L-F+1)\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?Z:V) als A gelijk is aan B, dan Z anders V"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LOPMAAK mag bevatten:\n"
+" %L inhoud van regel\n"
+" %l inhoud van regel, behalve eventuele witregel aan einde\n"
+" %[-][BREEDTE][.[PREC]]{doxX}n specificatie in printf-stijl voor\n"
+" invoerregelnummer"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GOPMAAK en LOPMAAK mogen bevatten:\n"
+" %% een %-teken\n"
+" %c'C' het enkele teken C\n"
+" %c'\\OOO' het teken met octaalcode OOO\n"
+" C het teken C (andere tekens representeren zichzelf)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal moeite doen om een kleinere verzameling "
+"wijzigingen\n"
+" te vinden"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=AANTAL dit AANTAL regels met identieke kop en staart\n"
+" bij vergelijkingsproces meenemen"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files aannemen dat bestanden groot zijn met veel "
+"verspreide\n"
+" kleine wijzigingen"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal een gewone diff produceren (standaard)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help deze hulptekst tonen en stoppen"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version programmaversie tonen en stoppen"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"BESTANDEN is 'BESTAND1 BESTAND2' of 'MAP1 MAP2' of\n"
+" 'MAP BESTAND...' of 'BESTAND... MAP'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Als '--from-file' of '--to-file' gegeven is, mag BESTANDEN van alles zijn."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Als een BESTAND '-' is, wordt er van standaardinvoer gelezen."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr ""
+"Gebruik: %s [OPTIE...] BESTANDEN\n"
+"\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Bestanden regel-voor-regel vergelijken."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "conflicterende waarde '%2$s' van optie %1$s"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "conflicterende uitvoerstijl-opties"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "ongeldige breedte '%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Alleen in %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "kan '-' niet met een map vergelijken"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "optie '-D' is niet mogelijk bij mappen"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Gemeenschappelijke submappen: %s en %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Bestand %s is een %s terwijl bestand %s een %s is\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Symbolische koppelingen %s en %s zijn verschillend\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Bestanden %s en %s zijn identiek\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "niet-samengaande opties"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' opgegeven voor meer dan één invoerbestand"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "lezen is mislukt"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all alle wijzigingen tonen, met rechte haken om de "
+"conflicten"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed een ed-script produceren die de wijzigingen van\n"
+" OUDBESTAND naar UWBESTAND in MIJNBESTAND maakt"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap als '-e' maar met rechte haken om de conflicten"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only als '-e' maar alleen met niet-overlappende "
+"wijzigingen"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only als '-e' maar met alleen de overlappende "
+"wijzigingen"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X als '-x' maar met rechte haken om de conflicten"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i opdrachten 'w' en 'q' toevoegen aan einde van ed-"
+"scripts"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge het feitelijk samengevoegde bestand tonen\n"
+" volgens '-A' zonder andere opties"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text alle bestanden als tekst behandelen"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Enter-tekens (CR's) aan einde van regels weglaten"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab tabs uitlijnen door invoegen van tab aan het begin"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PROG dit programma gebruiken om bestanden te "
+"vergelijken"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=LABEL dit LABEL gebruiken in plaats van bestandsnaam\n"
+" (mag maximaal driemaal herhaald worden)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help deze hulptekst tonen en stoppen"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version programmaversie tonen en stoppen"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr ""
+"Gebruik: %s [OPTIE]... MIJNBESTAND OUDBESTAND UWBESTAND\n"
+"\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Drie bestanden regel-voor-regel vergelijken."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"De standaard uitvoeropmaak is een enigszins leesbare representatie van\n"
+"de wijzigingen.\n"
+"\n"
+"De opties '-e', '-E', '-x', en '-X' (en hun equivalente lange versies)\n"
+"produceren een ed-script in plaats van de standaard uitvoer.\n"
+"\n"
+"De optie '-m' ('--merge') maakt dat 'diff3' de samenvoeging intern "
+"produceert\n"
+"en het samengevoegde bestand uitvoert. Voor ongewone invoer is dit "
+"robuuster\n"
+"dan het gebruik van 'ed'.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"De afsluitwaarde is 0 bij succes, 1 bij conflicten, en 2 bij problemen."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "*interne programmafout*: opmaak van diff-blokken is verhaspeld"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff is mislukt: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "*interne programmmafout*: ongeldig soort diff in process_diff()"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "ongeldige diff-opmaak: ongeldig scheidingsteken voor veranderingen"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "ongeldige diff-opmaak: incomplete laatste regel"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "hulpprogramma '%s' kan niet worden aangeroepen"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "ongeldige diff-opmaak: onjuiste tekens aan begin van regel"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "*interne programmafout*: ongeldig soort diff naar uitvoer gestuurd"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "invoerbestand is gekrompen"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "kan bestandsnamen '%s' en '%s' niet vergelijken"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: oneindige lus in de mappen"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=BESTAND interactief werken; het resultaat opslaan in "
+"BESTAND"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i, --ignore-case hoofd- en kleine letters als hetzelfde zien"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion omzettingen van tabs in spaties negeren"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space witruimte aan einde van regel negeren"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change wijzigingen in hoeveelheid witruimte negeren"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space alle witruimte negeren"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines wijzigingen waarvan alle regels leeg zijn "
+"negeren"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE wijzigingen waarvan alle regels "
+"overeenkomen\n"
+" met reguliere expressie RE negeren"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr Enter-tekens (CR's) aan einde van regels weglaten"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text alle bestanden als tekst behandelen"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=AANTAL maximaal dit AANTAL kolommen tonen (standaard 130)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column bij gelijke regels alleen de linkerkolom tonen"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines de gelijke regels onderdrukken"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs tabs uitschrijven naar spaties in uitvoer"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=AANTAL tab-stops op elke AANTAL posities (standaard 8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal moeite doen om een kleinere verzameling "
+"wijzigingen\n"
+" te vinden"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files aannemen dat bestanden groot zijn met veel "
+"verspreide\n"
+" kleine wijzigingen"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=PRGRM dit programma gebruiken om bestanden te "
+"vergelijken"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help deze hulptekst tonen en stoppen"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version programmaversie tonen en stoppen"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr ""
+"Gebruik: %s [OPTIE...] BESTAND1 BESTAND2\n"
+"\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Twee bestanden naast elkaar weergeven."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "kan standaardinvoer niet interactief samenvoegen"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "de te vergelijken bestanden zijn allebei mappen"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed: Bewerken en daarna beide versies gebruiken, beide met een kop.\n"
+"eb: Bewerken en daarna beide versies gebruiken.\n"
+"el / e1: Bewerken en daarna de linker versie gebruiken.\n"
+"er / e2: Bewerken en daarna de rechter versie gebruiken.\n"
+"e: Een nieuwe versie bewerken.\n"
+"l / 1: De linker versie gebruiken.\n"
+"r / 2: De rechter versie gebruiken.\n"
+"s: Overeenkomende regels stilzwijgend invoegen.\n"
+"v: Overeenkomende regels invoegen en tonen.\n"
+"q: Afsluiten.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: onbekende optie '--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i OVERSLAAN1:OVERSLAAN2 --ignore-initial=OVERSLAAN1:OVERSLAAN2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Niets tonen; alleen een afsluitwaarde leveren."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Deze hulptekst tonen."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C AANTAL --context[=AANTAL] AANTAL (standaard 3) regels van\n"
+#~ " gekopieerde context tonen.\n"
+#~ "-u -U AANTAL --unified[=AANTAL] AANTAL (standaard 3) regels van\n"
+#~ " geünificeerde context tonen.\n"
+#~ "--label LABEL Dit LABEL gebruiken in plaats van bestandsnaam.\n"
+#~ "-p --show-c-function Vermelden in welke C-functie elke wijziging is.\n"
+#~ "-F RE --show-function-line=RE Recentste regel overeenkomend met RE "
+#~ "tonen."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Resultaat weergeven in twee kolommen.\n"
+#~ "-W AANTAL --width=AANTAL Maximaal AANTAL (standaard 130) kolommen "
+#~ "tonen.\n"
+#~ "--left-column Van overeenkomende regels alleen de linker kolom tonen.\n"
+#~ "--suppress-common-lines Overeenkomende regels niet tonen."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Aannemen dat bestanden groot zijn en veel kleine,\n"
+#~ " verspreide wijzigingen hebben."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Overlappende wijzigingen tonen, tussen rechte haken."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Samengevoegd bestand tonen (standaard met -A) i.p.v. ed-"
+#~ "script."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L LABEL --label=LABEL Dit LABEL gebruiken in plaats van bestandsnaam."
diff --git a/po/pl.gmo b/po/pl.gmo
new file mode 100644
index 0000000..e141bb0
--- /dev/null
+++ b/po/pl.gmo
Binary files differ
diff --git a/po/pl.po b/po/pl.po
new file mode 100644
index 0000000..7821c6e
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,1521 @@
+# Polish translations for the GNU diffutils messages
+# Copyright (C) 1996, 2002, 2004, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Rafał Maszkowski <rzm@icm.edu.pl>„ 1996, 2002, 2004, 2009-2012
+# Contributions:
+# Paweł Krawczyk <kravietz@pipeta.chemia.pk.edu.pl>, 1996.
+# 23 corrections - Jakub Bogusz <qboosh@pld-linux.org>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-10-31 17:30+0100\n"
+"Last-Translator: Rafał Maszkowski <rzm@icm.edu.pl>\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: 8-bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "błędny argument %s%s: '%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "błędny argument %s%s: '%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "błąd programu"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "przepełnienie stosu"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Nieznany błąd systemu"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "zwykły pusty plik"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "zwykły plik"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "katalog"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "dowiązanie symboliczne"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "kolejka komunikatów"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "obiekt w pamięci dzielonej"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "obiekt w pamięci z określeniem typu"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "specjalny plik blokowy"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "specjalny plik znakowy"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "specjalny plik blokowy"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "specjalny plik znakowy"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "dziwny plik"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "specjalny plik blokowy"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "gniazdo"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "dziwny plik"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: opcja '%s' jest niejednoznaczna; możliwości:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: opcja '-W %s' jest niejednoznaczna\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: opcja '--%s' nie może mieć argumentu\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: opcja '%c%s' nie może mieć argumentu\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: opcja '--%s' wymaga argumentu\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: nierozpoznana opcja '--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: nierozpoznana opcja '%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: błędna opcja -- '%c'\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opcja wymaga argumentu -- '%c'\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: opcja '-W %s' jest niejednoznaczna\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: opcja '-W %s' nie może mieć argumentu\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: opcja -W '%s' wymaga argumentu\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "„"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Powodzenie"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nie pasuje"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Błędne wyrażenie regularne"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Znak błędny dla bieżącego uporządkowania"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Błędne nazwa klasy znaków"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Końcowy ukośnik odwrotny"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Błędny odnośnik wstecz"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Nie sparowany [ lub [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Nie sparowany ( lub \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Nie sparowany \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Błędna zawartość \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Błędny koniec zakresu"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Brak pamięci"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Błędne poprzedzające wyrażenie regularne"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Przedwczesny koniec wyrażenia regularnego"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Wyrażenia regularne jest za duże"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Nie sparowany ) lub \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Brak poprzedniego wyrażenia regularnego"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "brak pamięci"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "standardowe wejście"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "standardowe wyjście"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "standardowe wyjście błędu"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "nieznany strumień"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "nie udało się ponownie otworzyć %s z uprawnieniami %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "błędny argument %s%s: '%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "błędny przyrostek argumentu %s%s: '%s'"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "argument %s%s '%s' jest za duży"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Pakowane przez %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Pakowane przez %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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"
+"Licencja GPLv3+: GNU GPL wersja 3 albo późniejsza http://gnu.org/licenses/"
+"gpl.html\n"
+"To jest wolne oprogramowanie: masz prawo je zmieniać i rozpowszechniać.\n"
+"Autorzy nie dają ŻADNYCH GWARANCJI w granicach dozwolonych prawem.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Autor: %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Autorzy: %s i %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Autorzy: %s, %s i %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Autorzy: %s, %s, %s\n"
+"i %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Autorzy: %s, %s, %s,\n"
+"%s i %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"O błędach programu poinformuj %s\n"
+"O błędach tłumaczenia poinformuj translation-team-pl@lists.sourceforge.net\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Raporty o błędach %s wysyłaj do %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "strona domowa %s: %s\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "strona domowa %s: http://www.gnu.org/software/%s/\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr "Pomoc w używaniu oprogramowania GNU: http://www.gnu.org/gethelp/\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Pliki %s i %s różnią się\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Binarne pliki %s i %s różnią się\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Brak znaku nowej linii na końcu pliku"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Napisz '%s --help' żeby dowiedzieć się więcej."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "błędna wartość --ignore-initial '%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "sprzeczne opcje -l i -s"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "zapis nieudany"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standardowe wyjście"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes wypisanie różniących się bajtów"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr "-i, --ignore-initial=OMIŃ przeskoczenie pierwszych OMIŃ bajtów"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"--ignore-initial=OMIŃ1:OMIŃ2 przeskoczenie pierwszych OMIŃ1 bajtów\n"
+" PLIKU1 i OMIŃ2 bajtów PLIKU2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-I --verbose wypisanie położeń i kodów wszystkich różniących "
+"się bajtów"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n , --bytes=LIMIT porównanie najwyżej LIMIT bajtów"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent wyłączenie wszystkich zwykłych komunikatów"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help wypisanie tej pomocy i zakończenie"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v --version wypisanie informacji o wersji i zakończenie"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Składnia: %s [OPCJA]... PLIK1 [PLIK2 [OMIŃ1 [OMIŃ2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Porównanie plików bajt po bajcie."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Opcjonalne argumenty OMIŃ1 i OMIŃ2 to liczby bajtów do pominięcia na\n"
+"początku każdego z plików (domyślnie zero)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr "Obowiązkowe argumenty długich opcji są obowiązkowe też dla krótkich.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Po wartości do OMINIĘCIA mogą być dodane następujące przyrostki:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, i tak dalej dla T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Jeżeli PLIK to '-' lub go brak, czytane jest standardowe wejście."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Status wyjściowy ma wartość 0 gdy pliki wejściowe są takie same, 1 - jeżeli\n"
+"różne, 2 - jeżeli są problemy."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "błędna wartość --bytes '%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "brakujący argument po '%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "nadmiarowy argument '%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s różnią się: bajt %s, linia %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s różnią się: bajt %s, linia %s zawiera %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF przy %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "błędna długość kontekstu '%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "stronicowanie nie jest możliwe na tej maszynie"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "za dużo opcji etykietowania plików"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "błędna szerokość '%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "sprzeczne opcje szerokości"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "błędna długość horyzontu '%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "błędny rozmiar tabulacji '%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "sprzeczne opcje rozmiarów TAB-a"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "równocześnie podane --from-file i --to-file"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+"--normal wynik w postaci zwykłego diff-a (domyślnie)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+"-q --brief wypisanie wyniku tylko gdy pliki się różnią"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files informowanie gdy dwa pliki są takie same"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NUM, --context[=ILE] wypisanie ILU (domyślnie 3) linii kontekstu"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"--u, -U ILE, --unified=ILE wypisanie najwyżej ILE (domyślnie 3)\n"
+" linii kontekstu w trybie unified"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed wynik w postaci poleceń ed-a"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs wynik w postaci diff-a z RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side wyniki w dwóch kolumnach"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=ILE wypisanie najwyżej ILE (domyślnie 130) kolumn"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column wypisanie tylko lewej kolumny dla wspólnych "
+"linii"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines bez wypisania wspólnych linii"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function podanie w jakiej funkcji C są zmiany"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=WYRREG wypisanie ostatniej linii pasującej do "
+"WYRREG"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETYKIETA użycie ETYKIETY zamiast nazwy pliku\n"
+" (może być powtarzane)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs rozwinięcie TAB-ów w spacje w wyniku"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab wyrównanie linii przez użycie TAB-ów"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr " --tabsize=ILE TAB-y co ILE (domyślnie 8) kolumn"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty bez wypisywania spacji i znaków TAB przed\n"
+" pustymi liniami"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-I --paginate przepuszczenie wyniku przez 'pr' żeby go "
+"stronnicować"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r --recursive porównanie podkatalogów rekurencyjnie"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+" --no-dereference bez podążania za dowiązaniami symbolicznymi"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N --new-file traktowanie brakujących plików jak pustych"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file traktowanie brakujących pierwszych plików\n"
+" w pierwszym zestawie jako pustych"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-space-change zignorowanie wielkości liter przy\n"
+" porównywaniu nazw plików"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case uwzględnianie wielkości liter przy\n"
+" porównywaniu nazw plików"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=WZÓR wykluczenie plików pasujących do WZORU"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=PLIK pominięcie plików pasujących do wzorców w "
+"PLIKU"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=PLIK zacznij od PLIKU przy porównywaniu katalogów"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=PLIK1 porównanie PLIKU1 z wszystkimi\n"
+" argumentami; PLIK1 może być katalogiem"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=PLIK2 porównanie wszystkich argumentów\n"
+" z PLIKIEM2; PLIK2 może być katalogiem"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i --ignore-case ignorowanie różnic między wielkimi i małymi "
+"literami"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion zignorowanie zmian spowodowanych\n"
+" rozwinięciem TAB-ów"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z --ignore-trailing-space ignorowanie znaków odstępu na końcu linii"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change Zignorowanie zmian ilości znaków odstępu"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space zignorowanie znaków odstępu"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines zignorowanie zmian liczby pustych linii"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE zignorowanie zmian w liniach pasujących\n"
+" do RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a --text traktowanie plików jako tekstowych"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr pominięcie znaków nowej linii na wejściu"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr "--binary czytanie i zapisywanie danych binarnie"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAZWA wypisanie połączonego pliku dla pokazania\n"
+" różnic w '#ifdef NAZWA'"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=FMTG użyciem FMTF do sformatowania grup\n"
+" wejściowych typu GTYPE"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT podobnie, ale z użyciem LFMT do\n"
+" sformatowania linii wejściowych"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=FMTL użycie FMTL do sformatowania linii\n"
+" wejściowych typu LTYPE"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Te opcje formatowania dają dokładną kontrolę nad wynikami diff-a,\n"
+" są uogólnieniem -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr "TYPL to 'old', 'new' albo 'unchanged'. TYPG to TYPL albo 'changed'."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" (Tylko) FMTG może zawierać:\n"
+" %< linie z PLIKU1\n"
+" %> linie z PLIKU2\n"
+" %= linie wspólne dla PLIKU1 i PLIKU2\n"
+" %[-][SZER][.[DOKŁ]]{doxX}LITERA specyfikacja w stylu printf dla "
+"LITERY\n"
+" LITERY są następujące dla nowej grupy (małe dla starej grupy):\n"
+" F numer pierwszej linii\n"
+" L numer ostatniej linii\n"
+" N ilość linii = L-F+1\n"
+" E F-1\n"
+" M L+1 %(A=B?T:E) jeżeli A równa się B, to T, jeżeli nie, to E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" (Tylko) LFMT może zawierać:\n"
+" %L zawartość linii\n"
+" %l zawartość linii z wyłączeniem znaku nowej linii\n"
+" %[-][SZER][.[DOKŁ]]{doxX}n specyfikację numeru linii w stylu printf"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Zarówno FMTG jak FMTL mogą zawierać:\n"
+" %% %\n"
+" %c'Z' pojedynczy znak Z\n"
+" %c'\\OOO' znak o kodzie ósemkowym OOO Z znak Z (inne znaki "
+"reprezentują same siebie)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d --minimal usiłowanie znalezienia mniejszego zbioru zmian"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=ILE zostawienie ILE linii wspólnego przedrostka i "
+"przyrostka"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files założenie: duże pliki i rozrzucone małe zmiany"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr ""
+"--normal wynik w postaci zwykłego diff-a (domyślnie)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help wypisanie tej pomocy i zakończenie"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v --version wypisanie informacji o wersji i zakończenie"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"PLIKI to 'PLIK1 PLIK2' albo 'KATALOG1 KATALOG2' albo 'KATALOG PLIK...' albo\n"
+"'PLIK... KATALOG'."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Jeżeli użyta jest opcja --from-file albo --to-file, nie ma ograniczeń co do\n"
+"PLIKU/ÓW."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Jeżeli PLIK to '-', czytane jest standardowe wejście."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Składnia: %s [OPCJA]... PLIKI\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Porównanie PLIKÓW kolejnymi liniami."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "sprzeczna wartość opcji %s: '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "sprzeczne opcje stylu wyniku"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "błędna szerokość '%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Tylko w %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "nie można porównać '-' z katalogiem"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "opcja -D nie działa dla katalogów"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Wspólne podkatalogi: %s i %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Plik %s jest %s, podczas gdy plik %s jest %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Dowiązania symboliczne %s i %s różnią się\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Pliki %s i %s są identyczne\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "niezgodne opcje"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' podany dla więcej niż jednego pliku wejściowego"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "nieudany odczyt"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A --show-all wypisanie wszystkich zmian, konflikty w nawiasach"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed wypisanie niezłączonych zmian między\n"
+" STARY_PLIK a NOWY_PLIK do MÓJ_PLIK"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E --show-overlap jak -e, ale z konfliktami w nawiasach"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3 --easy-only jak -e, ale z tylko z nienachodzącymi zmianami"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only jak -e, ale tylko z nachodzącymi zmianami"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X jak -x, ale z konfliktami w nawiasach"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i dodanie poleceń 'w' i 'q' do skryptu ed-a"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge wypisanie połączonego pliku zgodnie z -A,\n"
+" jeżeli nie było innych opcji"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a --text traktowanie plików jako tekstowych"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr pominięcie znaków nowej linii na wejściu"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab wyrównanie linii przez użycie TAB-ów"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM użycie PROGRAMU do porównania plików"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETYKIETA użycie ETYKIETY zamiast nazwy pliku\n"
+" (może być powtarzane do trzech razy)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help wypisanie tej pomocy i zakończenie"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v --version wypisanie informacji o wersji i zakończenie"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Składnia: %s [OPCJA]... MÓJ_PLIK STARY_PLIK TWÓJ_PLIK\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Porównanie trzech plików linia po linii."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Domyśly format wyjściowy jest stosunkowo czytelną dla człowieka\n"
+"reprezentacją zmian.\n"
+"\n"
+"Opcje -e, -E, -x, -X (i odpowiednie długie) powodują, że na wyjściu\n"
+"pojawia się skrypt ed-a zamiast formatu domyślnego.\n"
+"\n"
+"Wreszcie opcja -m (--merge) powoduje, że diff3 wewnętrznie łączy\n"
+"różnice i wypisuje połączony plik. Przy nietypowych danych wejściowych\n"
+"jest to bardziej elastyczne niż użycie ed-a.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Status wyjściowy ma wartość 0 gdy polecenie wykonało się z prawidłowym\n"
+"wynikiem, 1 - jeżeli są konflikty, 2 - jeżeli są problemy."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "bład wewnętrzny: spieprzony format bloków diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff nie zadziałał: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "błąd wewnętrzny: błędny typ diff w process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "błędny format diff; błędny separator zmian"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "błędny format diff; niekompletna ostatnia linia"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "nie mógł być wywołany program pomocniczy '%s'"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "błędny format diff; nieprawidłowe znaki na początku linii"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "błąd wenwętrzny: błędny typ diff-a przekazany na wyjście"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "plik wejściowy się zmniejszył"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "nie można porównać nazw plików '%s' i '%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekurencyjne zapętlenie katalogów"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=PLIK tryb interakcyjny, wyniki wysyłane do PLIKU"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i --ignore-case traktowanie małych i wielkich liter tak samo"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion zignorowanie zmian spowodowanych rozwinięciem\n"
+" TAB-ów"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z --ignore-trailing-space ignorowanie znaków odstępu na końcu linii"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change zignorowanie zmian ilości znaków odstępu"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space ignorowanie wszystkich znaków odstępu"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B --ignore-blank-lines zignorowanie zmian liczby pustych linii"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE zignorowanie zmian w liniach pasujących\n"
+" do RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr pominięcie znaków nowej linii na wejściu"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a --text traktowanie plików jako tekstowych"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w ILE --width=ILE wypisanie najwyżej ILE (domyślnie 130) kolumn"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-I --left-column wypisanie tylko lewej kolumny dla wspólnych "
+"linii"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines bez wypisania wspólnych linii"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs rozwinięcie TAB-ów w spacje w wyniku"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr " --tabsize=ILE TAB-y co ILE (domyślnie 8) kolumn"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d --minimal usiłowanie znalezienia mniejszego zbioru zmian"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files założenie: duże pliki i rozrzucone małe zmiany"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM użycie PROGRAMU do porównania plików"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help wypisanie tej pomocy i zakończenie"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v --version wypisanie informacji o wersji i zakończenie"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Składnia: %s [OPCJA]... PLIK1 PLIK2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Interaktywne łączenie różnic między PLIKIEM1 a PLIKIEM2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "nie mogę interakcyjnie łączyć standardowego wejścia"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "oba mające być porównane pliki to katalogi"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEdycja i użycie obu wersji, każdej z nagłówkiem.\n"
+"eb:\tEdycja i użycie obu wersji.\n"
+"el albo e1:\tiUżycie wersji po lewej.\n"
+"er albo e2:\tEdycja i użycie wersji po prawej.\n"
+"e:\tUsunięcie obu wersji i edycja nowej.\n"
+"l albo 1:\tUżycie wersji po lewej.\n"
+"r albo 2:\tUżycie wersji po prawej.\n"
+"s:\tDołączenie wspólnych linii bez informowania o tym.\n"
+"v:\tDołączenie wspólnych linii z podaniem informacji.\n"
+"q:\tZakończenie.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: nierozpoznana opcja '--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo
new file mode 100644
index 0000000..e8ae7ac
--- /dev/null
+++ b/po/pt_BR.gmo
Binary files differ
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644
index 0000000..cc560a7
--- /dev/null
+++ b/po/pt_BR.po
@@ -0,0 +1,1674 @@
+# Brazilian Portuguese translation for diffutis.
+# Copyright © 2016 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Halley Pacheco de Oliveira <halleypo@ig.com.br>, 2002.
+# Rafael Fontenelle <rffontenelle@gmail.com>, 2016.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2016-05-06 21:25-0200\n"
+"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>\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 0.7.1\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "argumento inválido para %s%s: \"%s\""
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "argumento inválido para %s%s: \"%s\""
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "erro do programa"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "estouro da pilha"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Erro de sistema desconhecido"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "arquivo regular vazio"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "arquivo regular"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "diretório"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "link simbólico"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "fila de mensagem"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semáforo"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "objeto em memória compartilhada"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "objeto de memória tipificada"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "arquivo do tipo especial de bloco"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "arquivo do tipo especial de caracter"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fila"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "arquivo do tipo especial de bloco"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "arquivo do tipo especial de caracter"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "arquivo estranho"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "arquivo do tipo especial de bloco"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "arquivo estranho"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: a opção \"%s\" está ambígua; possibilidades:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: a opção \"-W %s\" é ambígua\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: a opção \"--%s\" não admite argumentos\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: a opção \"%c%s\" não admite argumentos\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: a opção \"--%s\" exige um argumento\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: opção não reconhecida \"--%s\"\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: opção não reconhecida \"%c%s\"\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opção inválida -- \"%c\"\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opção requer um argumento -- \"%c\"\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: a opção \"-W %s\" é ambígua\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: a opção \"-W %s\" não admite argumentos\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: a opção \"-W %s\" requer um argumentos\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "“"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sucesso"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Sem correspondente"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expressão regular inválida"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "caractere de classificação inválido"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nome da classe de caracteres inválido"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barra invertida ao final"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referência retroativa inválida"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ou [^ sem correspondente"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( sem correspondente"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ sem correspondente"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Conteúdo de \\{\\} inválido"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Fim do intervalo inválido"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memória esgotada"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expressão regular precedente inválida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Fim prematuro da expressão regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expressão regular muito grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) sem correspondente"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Sem expressão regular prévia"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memória esgotada"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "entrada padrão (stdin)"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "saída padrão (stdout)"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "erro padrão (stderr)"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "fluxo desconhecido"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "falha ao reabrir %s com modo %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "argumento inválido para %s%s: \"%s\""
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "sufixo inválido no argumento para %s%s: \"%s\""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "argumento de %s%s \"%s\" é grande demais"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Empacotado por %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Empacotado por %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Licença GPLv3+: GNU GPL versão 3 ou posterior <http://gnu.org/licenses/gpl."
+"html>\n"
+"Este é um software livre: você é livre para alterá-lo e redistribuí-lo.\n"
+"NÃO HÁ GARANTIA, na máxima extensão permitida pela lei.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Escrito por %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Escrito por %s e %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Escrito por %s, %s e %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Escrito por %s, %s, %s\n"
+"e %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Escrito por %s, %s, %s\n"
+"%s e %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Relate os erros para: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Relate os erros de %s para: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Página do %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Página do %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr "Ajuda geral sobre uso de software GNU: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Os arquivos %s e %s são diferentes\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Os arquivos binários %s e %s são diferentes\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Nenhum caractere de nova linha no final do arquivo"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Tente \"%s --help\" para mais informações."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "valor inválido --ignore-initial \"%s\""
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "as opções -l e -s são incompatíveis"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "erro de escrita"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "saída padrão"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes imprime os bytes diferentes"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SALTO ignora os primeiros SALTO bytes da entrada"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SALTO1:SALTO2\n"
+" ignora os primeiros SALTO1 bytes do "
+"ARQUIVO1\n"
+" e os primeiros SALTO2 bytes do ARQUIVO2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose emite os números de bytes e os valores de\n"
+" todos os bytes diferentes"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LIMITE compara no máximo LIMITE bytes"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent suprime todas saídas normais"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help mostra esta ajuda e sai"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version mostra informação sobre a versão e sai"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Uso: %s [OPÇÃO]... ARQUIVO1 [ARQUIVO2 [SALTO1 [SALTO2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Compara dois arquivos byte por byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Os argumentos opcionais SALTO1 e SALTO2 especificam o número de\n"
+"bytes para ignorar no começo de cada arquivo (zero por padrão)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Argumentos obrigatórios para opções longas também o são para opções curtas.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Os valores do SALTO podem ser seguidos por sufixos multiplicativos a "
+"seguir:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824,\n"
+"e assim por diante para T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Se ARQUIVO for igual a \"-\" ou for omitido, ler da entrada padrão."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Status de saída é 0 se as entradas forem iguais, 1 se diferente e 2 se "
+"problema."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "valor inválido --bytes \"%s\""
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "faltando operando após \"%s\""
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "operando extra \"%s\""
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s e %s são diferentes: byte %s, linha %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s e %s são diferentes: byte %s, linha %s é %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: Fim de arquivo (EOF) em %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "o comprimento do contexto não é válido \"%s\""
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "sem suporte a paginação neste computador"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "número excessivo de opções de rótulo de arquivo"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "largura inválida \"%s\""
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "opções de largura conflitantes"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "comprimento do horizonte inválido \"%s\""
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "tamanho de tabulação inválido \"%s\""
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "opções de tamanho de tabulação conflitantes"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "ambos --from-file e --to-file especificados"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal cria um diff no formato normal (padrão)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+"-q, --brief indica apenas se os arquivos forem diferentes"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s, --report-identical-files indica quando dois arquivos forem o idênticos"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C NÚM, --context[=NÚM] cria em NÚM linhas (padrão 3) de contexto "
+"copiado"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U NÚM, --unified[=NÚM] cria em NÚM linhas (padrão 3) de contexto "
+"unificado"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed cria um script para o editor ed"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs cria um diff no formato RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side cria em duas colunas"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=NÚM limita a saída a NÚM colunas por linha (padrão "
+"130)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column emite apenas a coluna da esquerda das linhas\n"
+" idênticas"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines não exibe as linhas idênticas"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function mostra em qual função C está cada alteração"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=ER mostra a linha mais recente correspondendo à ER"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label RÓTULO usa RÓTULO ao invés do nome do arquivo\n"
+" (pode ser repetido)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs expande as tabulações para espaços na saída"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab alinha tabulações introduzindo uma\n"
+" tabulação no início"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NÚM paradas de tabulação a cada NÚM colunas\n"
+" (padrão=8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty suprime espaço ou tabulação antes de linhas\n"
+" vazias na saída"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate passa a saída por meio de \"pr\" para paginá-la"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive compara recursivamente os subdiretórios\n"
+" encontrados"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference não interpreta links simbólicos"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr ""
+"-N, --new-file considera os arquivos ausentes como vazios"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file considera os primeiros arquivos ausentes\n"
+" como vazios"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case não faz distinção entre letras maiúsculas e\n"
+" minúsculas nos nomes dos arquivos"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case faz distinção entre letras maiúsculas e\n"
+" minúsculas nos nomes dos arquivos"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=PADRÃO exclui arquivos correspondendo a PADRÃO"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=ARQUIVO exclui arquivos com correspondam a qualquer\n"
+" padrão contido em ARQUIVO"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=ARQUIVO inicia por ARQUIVO ao comparar diretórios"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=ARQUIVO1 compara ARQUIVO1 com todos os operandos;\n"
+" ARQUIVO1 pode ser um diretório"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=ARQUIVO2 compara todos os operandos com ARQUIVO2;\n"
+" ARQUIVO2 pode ser um diretório"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case não faz distinção entre letras maiúsculas e\n"
+" minúsculas no conteúdo do arquivo"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignora as diferenças causadas pela expansão\n"
+" da tabulação"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignora espaços em branco no fim das linhas"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change ignora as diferenças na quantidade de "
+"espaços\n"
+" em branco"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space ignora todos os espaços em branco"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignora diferenças onde as linhas estão vazias"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=ER ignora as diferenças nas linhas que "
+"correspondem\n"
+" à Expressão Regular"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text trata todos os arquivos como texto"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr remove o caractere de retorno de carro\n"
+" (CR) ao final da linha na entrada"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary lê e escreve os dados em modo binário"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NOME exibe o arquivo mesclado incluindo\n"
+" \"#ifndef NOME\" nas diferenças"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT formata grupos de entrada GTYPE com GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT formata todas as linhas de entrada com LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT formata todas as linhas de entrada LTYPE com "
+"LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Essa opções de formatação fornece um controle refinado sobre a saída\n"
+" das diferenças, generalizando -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE pode ser \"old\", \"new\" ou \"unchanged\". GTYPE é LTYPE ou "
+"\"changed\"."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT pode conter (apenas):\n"
+" %< linhas do ARQUIVO1\n"
+" %> linhas do ARQUIVO2\n"
+" %= linhas idênticas em ARQUIVO1 e ARQUIVO2\n"
+" %[-][LARGURA][.[PREC]]{doxX}LETRA especificação para LETRA\n"
+" utilizando a mesma notação do comando printf(). \n"
+" Os códigos permitidos para LETRA são,\n"
+" em maiúsculas para grupos novos,\n"
+" em minúsculas para grupos antigos:\n"
+" F número da primeira linha\n"
+" L número da última linha\n"
+" N número de linhas = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) se A igual B, então T; senão E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT pode conter (apenas):\n"
+" %L conteúdo da linha\n"
+" %l conteúdo da linha, excluindo o caractere final de nova linha\n"
+" %[-][LARGURA][.[PREC]]{doxX}n especificação estilo printf() do número\n"
+" da linha da utilizando"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT ou LFMT pode conter:\n"
+" %% %\n"
+" %c'C' o caractere C\n"
+" %c'\\OOO' o caractere com código octal OOO\n"
+" C o caractere C (outros caracteres representam a si próprios)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal se esforça para localizar o menor conjunto\n"
+" de diferenças"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=NÚM mantém NÚM linhas de prefixo e sufixo idênticos"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files assume arquivos grandes e muitas alterações\n"
+" pequenas espalhadas"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal cria um diff no formato normal (padrão)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help mostra esta ajuda e sai"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version mostra as informações da versão e sai"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"ARQUIVOS são \"ARQUIVO1 ARQUIVO2\" ou \"DIR1 DIR2\" ou \"DIR ARQUIVO...\" "
+"ou\n"
+"\"ARQUIVO... DIR\"."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Se --from-file ou --to-file for especificado, não há restrição em ARQUIVO(s)."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Se um ARQUIVO for igual a \"-\", lê da entrada padrão."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Uso: %s [OPÇÃO]... ARQUIVOS\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Compara ARQUIVOS linha por linha."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "opção %s com valor conflitante \"%s\""
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "opções conflitantes de estilo de saída"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "largura inválida \"%s\""
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Somente em %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "não é possível comparar \"-\" com um diretório"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "Sem suporte à opção -D com diretórios"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdiretórios idênticos: %s e %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "O arquivo %s é %s, enquanto o arquivo %s é %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Os links simbólicos %s e %s são diferentes\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Os aquivos %s e %s são idênticos\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "opções incompatíveis"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "\"-\" especificado para mais de um arquivo de entrada"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "falha de leitura"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all exibe todas as diferenças, com os conflitos\n"
+" entre parênteses"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed cria um script de ed para incorporar as\n"
+" diferenças entre ARQUIVO1 e ARQUIVO2\n"
+" em ARQUIVO3"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap similar a -e, mas exibe conflitos entre "
+"parênteses"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only similar a -e, mas incorpora apenas as "
+"alterações\n"
+" que não se sobreponham"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only similar a -e, mas incorpora apenas as "
+"alterações\n"
+" que se sobrepõem"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X similar a -x, mas exibe conflitos entre parentes"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i anexa os comandos \"w\" e \"q\" aos scripts de ed"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge emite arquivo mesclado atual, conforme\n"
+" -A se nenhuma outra opções for fornecida"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text trata todos os arquivos como texto"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr remove o caractere de retorno de carro\n"
+" (CR) ao final da linha na entrada"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab alinha tabulações introduzindo uma\n"
+" tabulação no início."
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAMA usa o PROGRAMA para comparar os arquivos"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label RÓTULO usa RÓTULO ao invés do nome do arquivo\n"
+" (pode ser repetido até três vezes)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help mostra esta ajuda e sai"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version mostra informação da versão e sai"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Uso: %s [OPÇÃO]... ARQUIVO1 ARQUIVO2 ARQUIVO3\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Compara três arquivos linha por linha."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"O formato padrão de saída é uma forma legível por humanos de representação\n"
+"das alterações.\n"
+"\n"
+"As opções -e, -E, -x, -X (e opções extensas correspondentes) fazem com que\n"
+"um script de ed seja criado, ao invés do padrão.\n"
+"\n"
+"Finalmente, a opção -m (--merge) faz com que diff3 faça a mesclagem\n"
+"internalmente e emite o arquivo mesclado atual. Para entradas incomuns,\n"
+"isto é mais robusto do que usar o ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Status de saída é 0 se houver sucesso, 1 se conflitos e 2 se problema."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "erro interno: confusão no formato dos blocos diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff falhou: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "erro interno: tipo de diff inválido em process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "formato de diff inválido; separador de diferença inválido"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "formato de diff inválido; última linha incompleta"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "o programa subsidiário \"%s\" não pôde ser invocado"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "formato de diff inválido; caracteres incorretos na linha de início"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "erro interno: tipo de diff inválido passado para a saída"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "o arquivo de entrada diminuiu"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "não foi possível comparar os nomes dos arquivos \"%s\" e \"%s\""
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: loop de diretório recursivo"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=ARQUIVO age interativamente, enviando a saída para "
+"ARQUIVO"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i, --ignore-case não faz distinção entre letras maiúsculas\n"
+" e minúsculas"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorar as diferenças causadas pela expansão\n"
+" da tabulação"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignora espaços em branco no fim das linhas"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change ignora as diferenças na quantidade de espaços\n"
+" em branco"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space ignora todos os espaços em branco"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignora diferenças onde as linhas estão vazias"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=ER ignora as diferenças em linhas que "
+"correspondem\n"
+" à Expressão Regular"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr remove o caractere de retorno de carro\n"
+" (CR) ao final da linha na entrada"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text trata todos os arquivos como texto"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=NÚM limita a saída a NÚM colunas por linha (padrão "
+"130)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column emite apenas a coluna da esquerda das linhas\n"
+" idênticas"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines não emite as linhas idênticas"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs expande as tabulações para espaços na saída"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=NÚM paradas de tabulação a cada NÚM colunas\n"
+" (padrão=8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal se esforça para localizar o menor conjunto\n"
+" de diferenças"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files assume arquivos grandes e muitas alterações\n"
+" pequenas espalhadas"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAMA usa o PROGRAMA para comparar os arquivos"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help mostra esta ajuda e sai"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version mostra informação da versão e sai"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Uso: %s [OPÇÃO]... ARQUIVO1 ARQUIVO2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Mesclagem lado a lado das diferenças entre ARQUIVO1 e ARQUIVO2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "não foi possível mesclar interativamente a entrada padrão"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "os dois arquivos a serem comparados são diretórios"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEdita e, então, usa ambas as versões, cada uma com seu cabeçalho.\n"
+"eb:\tEdita e, então, usa ambas as versões.\n"
+"el ou e1:\tEdita e, então, usa a versão da esquerda.\n"
+"er ou e2:\tEdita e, então, usa a versão da direita.\n"
+"e:\tEdita uma nova versão.\n"
+"l ou 1:\tUsa a versão da esquerda.\n"
+"r ou 2:\tUsa a versão da direita.\n"
+"s:\tInclui silenciosamente as linhas idênticas.\n"
+"v:\tInclui verbosamente as linhas idênticas.\n"
+"q:\tSai.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: opção não reconhecida \"--%s\"\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: a opção -- %c é ilegal\n"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "Este programa não tem nenhum tipo de garantia, o tanto quanto\n"
+#~ "é permitido por lei. Você pode redistribuir cópias deste\n"
+#~ "programa sob os termos da Licença Pública Geral GNU. Para\n"
+#~ "mais informações a este respeito, leia o arquivo COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Escrito por Torbjörn Granlund e David MacKenzie."
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SALTO1:SALTO2 --ignore-initial=SALTO1:SALTO2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Não exibir nada; retornar apenas o status de "
+#~ "fim."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Exibir esta ajuda."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Relatar os problemas para <bug-gnu-utils@gnu.org>."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Escrito por Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, e Len Tower."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "a opção `-%ld' está obsoleta; usar `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "a opção `-%ld' está obsoleta; omita-a"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C N --context[=N] Exibir o contexto regular das diferenças\n"
+#~ " usando N linhas de contexto (N=3 por "
+#~ "padrão).\n"
+#~ "-u -U N --unified[=N] Exibir o contexto unificado das diferenças\n"
+#~ " usando N linhas de contexto (N=3 por "
+#~ "padrão).\n"
+#~ " --label RÓTULO Usar RÓTULO em vez do nome do arquivo.\n"
+#~ " -p --show-c-function Mostrar em qual função C (ed) está cada "
+#~ "diferença.\n"
+#~ " -F EXPREG --show-function-line=EXPREG\n"
+#~ " Exibir a linha mais recente que corresponde\n"
+#~ " à EXPressão REGular."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Exibir em duas colunas.\n"
+#~ " -W N --width=N Exibir no máximo N colunas. (N=130 por "
+#~ "padrão)\n"
+#~ " --left-column Exibir apenas a coluna da esquerda nas "
+#~ "linhas\n"
+#~ " idênticas.\n"
+#~ " --suppress-common-lines Não exibir as linhas idênticas."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Assumir arquivos grandes e muitas alterações\n"
+#~ " pequenas espalhadas."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr ""
+#~ "-X Exibir as diferenças que se sobrepõem,\n"
+#~ " entre parênteses."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Exibir o arquivo mesclado em vez do script do "
+#~ "ed\n"
+#~ " (implica -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L RÓTULO --label=RÓTULO Usar RÓTULO em vez do nome do arquivo."
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "o programa auxiliar `%s' falhou"
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "o programa auxiliar `%s' não é executável"
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100644
index 0000000..0122c46
--- /dev/null
+++ b/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/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/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/po/ro.gmo b/po/ro.gmo
new file mode 100644
index 0000000..55e3cce
--- /dev/null
+++ b/po/ro.gmo
Binary files differ
diff --git a/po/ro.po b/po/ro.po
new file mode 100644
index 0000000..5e96cba
--- /dev/null
+++ b/po/ro.po
@@ -0,0 +1,1660 @@
+# Mesajele n limba romn pentru diffutils-2.8.3
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Acest fi?ier este distribuit sub aceea?i licen?? ca ?i pachetul diffutils
+# Eugen Hoanca <eugenh@urban-grafx.ro>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 2.8.3\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2003-08-22 08:43+0300\n"
+"Last-Translator: Eugen Hoanca <eugenh@urban-grafx.ro>\n"
+"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "valoare --bytes invalid `%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "valoare --bytes invalid `%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "eroare de program"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stiv plin(overflow)"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Eroare de sistem necunoscut"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "fiier obinuit(regular) vid"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "fiier obinuit"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "director"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "legtur simbolic"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "coad(queue) de mesaje"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "obiect memorie global(shared memory)"
+
+#: lib/file-type.c:61
+#, fuzzy
+msgid "typed memory object"
+msgstr "obiect memorie global(shared memory)"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "fiier bloc special"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "fiier caracter special"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "fiier bloc special"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "fiier caracter special"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "fiier ciudat"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "fiier bloc special"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "fiier ciudat"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: opiunea `%s' este ambigu\n"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: opiunea `-W %s' este ambigu\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: opiunea `--%s' nu permite parametri\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: opiunea `%c%s' nu permite parametri\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: opiunea `%s' necesit un parametru\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: opiune necunoscut `--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: opiune necunoscut `%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opiune invalid -- %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opiunea necesit un parametru -- %c\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: opiunea `-W %s' este ambigu\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: opiunea `-W %s' nu permite parametri\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: opiunea `%s' necesit un parametru\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succes"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nici o potrivire"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expresie normal(regular) invalid"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Caracter de comparare invalid"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nume clas caracter invalid"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Backslash de sfrit de linie(trailing)"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referin precedent invalid"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ sau [^ nenchise"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( or \\( nenchise"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ nenchis"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Coninut invalid al \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Sfrit de domeniu invalid"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memorie plin"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expresie normal de preceden invalid"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Sfrit prematur de expresie normal"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expresie normal prea mare"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") or \\) nedeschise"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Nu a existat nici o expresie normal antecedent"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memorie plin"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr "Eroare de sistem necunoscut"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "valoare --bytes invalid `%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, fuzzy, c-format
+msgid "Written by %s.\n"
+msgstr "Scris de Thomas Lord."
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, fuzzy, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Scris de Randy Smith."
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, fuzzy, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Scris de Randy Smith."
+
+#. 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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:147
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:156
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. 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.
+#: lib/version-etc.c:167
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Fiierele %s i %s difer\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Fiierele binare %s i %s difer\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Nici un element de linie nou la sfritul fiierului"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "ncercai `%s --help' pentru mai multe informaii."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "invalid --se ignor valoarea iniial `%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "opiunile -l i -s sunt incompatibile"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "scriere euat"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "ieire(output) standard"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes Tiprete octeii diferii."
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i OMIS --ignore-initial=OMIS Omite primii octei OMISi din intrare(input)."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+" Omite primii OMIS1 octei din FIIER1 i primii OMIS2 octei din FIIER2"
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l --verbose Tiprete numerele octeilor i valorile octeilor diferii."
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n LIMIT --bytes=LIMIT Compar cel mult LIMIT octei."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Tiprete informaii despre versiune."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Folosire: %s [OPIUNE]... FIIER1 [FIIER2 [OMIS1 [OMIS2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Compar dou fiiere octet cu octet."
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"OMIS1 i OMIS2 sunt numerele de octei care s fie omii din fiecare fiier."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Valorile OMIS pot fi urmate de urmtoarele sufixe multiplicative:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, i aa mai departe pentru T, P, E, Z, Y."
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr ""
+"Dac un FIIER este `-' sau lipsete, se citete intrarea(input) standard."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "valoare --bytes invalid `%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "lipsete operandul dup `%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "operand n plus(extra) `%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s difer: octetul %s, linia %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s difer: octetul %s, linia %s este %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF n %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "lungime invalid de context `%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "paginaie nesuportat de acest host"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "prea multe opiuni de etichete fiier"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "lungime invalid `%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "opiuni de lungime n conflict"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "lungime de orizont invalid `%s'"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "mrime tab invalid `%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "opiuni mrime tab n conflict"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr " --from-file i --to-file sunt specificate mpreun"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal Afieaz un diff normal."
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief Afieaz doar dac fiierele difer."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s --report-identical-files Raporteaz cnd dou fiiere sunt asemntoare."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane tiprite."
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed Afieaz un script ed."
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs Afieaz un diff n format RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane tiprite."
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column Afieaz doar coloana din stnga a liniilor comune."
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Nu afia liniile comune."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=FIIER1 Compar FIIER1 cu toi operanzii. FIIER1 poate fi "
+"director."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Schimb tab-urile n spaii la ieire(output)."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab Aliniaz tab-urile adugnd n fa un tab."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+"--tabsize=NUM Opririle tab-ului vor fi la fiecare NUM (implicit 8) coloane "
+"tiprite."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l --paginate Trimite ieirea(output) prin `pr' pentru a fi paginat."
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r --recursive Compar recursiv orice subdirector ntlnit."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file Trateaz fiierele lips ca vide."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr "--unidirectional-new-file Trateaz primele fiiere lips ca vide."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+"--ignore-file-name-case Ignor cazul cnd se compar numele de fiiere."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+"--no-ignore-file-name-case Ia n calcul cazul atunci cnd se compar numele "
+"de fiiere."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x TIP --exclude=TIP Exclude fiierele care se potrivesc TIParului."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X FIIER --exclude-from=FIIER Exclude fiierele care se potrivesc "
+"oricrui tipar din FIIER."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S FIIER --starting-file=FIIER ncepe cu FIIER n compararea "
+"directoarelor."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=FIIER1 Compar FIIER1 cu toi operanzii. FIIER1 poate fi "
+"director."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=FIIER2 Compar toi operanzii cu FIIER2. FIIER2 poate fi "
+"director."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i --ignore-case Ignor diferenele de caz din coninutul fiierului."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Ignor schimbrile produse de modificarea tab-"
+"ului."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Ignor tot spaiul vid."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Ignor schimbrile din spaiul vid."
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space Ignor tot spaiul vid."
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines Ignor schimbrile unde toate liniile sunt "
+"goale(blank)."
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I RE --ignore-matching-lines=RE Ignor schimbrile la toate liniile care "
+"se potrivesc RE-ului."
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Trateaz toate fiierele ca text."
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Elimin returul de car(carriage return) final la "
+"intrare(input)."
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary Citete i scrie date n mod binar."
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D NUME --ifdef=NUME Afieaz fiierul rezultat(merged) pentru a arta "
+"diff-urile`#ifdef NAME'."
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GTYPE-group-format=GFMT Similar, dar formatul de intrare GTYPE se "
+"grupeaz cu GFMT."
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr "--line-format=LFMT Similar, dar formateaz toate liniile cu LFMT."
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--LTYPE-line-format=LFMT Similar, dar formateaz liniile de intrare LTYPE "
+"cu LFMT."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE este `old', `new', sau `unchanged'. GTYPE este LTYPE sau `changed'."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT poate conine:\n"
+" %< linii din FIIER1\n"
+" %> linii din FIIER2\n"
+" %= linii comune lui FIIER1 si FIIER2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER specificaii stil printf pentru "
+"LETTER\n"
+" LETTERs sunt dup cum urmeaz pentru grup nou, liter mic pentru grup "
+"vechi:\n"
+" F primul numr de linie\n"
+" L ultimul numr de linie\n"
+" N numere de linii = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT poate conine:\n"
+" %L coninut de linie\n"
+" %l coninut de linie, excluznd orice caracter de linie nou final\n"
+" %[-][WIDTH][.[PREC]]{doxX}n specificaii stil printf-pentru "
+"introducerea numrului de linie"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Una din GFMT sau LFMT poate conine:\n"
+" %% %\n"
+" %c'C' caracterul singular C\n"
+" %c'\\OOO' caracterul cu codul octal OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d --minimal ncearc din greu s gseti un set mai mic de schimbri"
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=NUM Reine NUM linii de prefix i sufix comun."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"-H --speed-large-files Presupune fiiere mari i multe modificri mici "
+"mprtiate."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal Afieaz un diff normal."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Tiprete informaii despre versiune."
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FIIEREle sunt `FIIER1 FIIER2' sau `DIR1 DIR2' sau `DIR FIIER...' or "
+"`FIIER... DIR'."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Dac --from-file sau --to-file sunt precizate, nu exist restricii pe "
+"FIIERE."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "Dac FIIER este `-', se citete intrarea(input) standard."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Folosire: %s [OPIUNE]... FIIERE\n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr "Compar fiierele linie cu linie."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "Exist un conflict cu %s n valoarea opiunii `%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "Conflict n opiunile stilului de afiare(output)"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "lungime invalid `%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Doar n %s: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "nu se poate compara `-' cu un director"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "opiunea -D nu este compatibil cu directoarele"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Subdirectoare comune: %s i %s.\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Fiierul %s este un %s pe cnd fiierul %s este un %s.\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Fiierele %s i %s difer\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Fiierele %s i %s sunt identice\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+#, fuzzy
+msgid "Randy Smith"
+msgstr "Scris de Randy Smith."
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "opiuni incompatibile"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "`-' specificat pentru mai mult de un fiier de intrare(input)"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "citire euat"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A --show-all Afieaz toate modificrile, conflictele de paranteze."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed Trimite(output) modificrile nerezultate(unmerged) de la "
+"FIIER_VECHI la FIIERUL_VOSTRU n FIIERUL_MEU.."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap Afieaz modificrile nerezultate(unmerged), conflictele "
+"de paranteze."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3 --easy-only Afieaz schimbrile nesuprapuse(nonoverlapping) i "
+"nerezultate(unmerged)."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only Afieaz toate schimbrile de suprapunere."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i Adaug comenzile `w' i `q' la scripturile ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Trateaz toate fiierele ca text."
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Elimin returul de car(carriage return) final la "
+"intrare(input)."
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab Aliniaz tab-urile adugnd n fa un tab."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM Folosete PROGRAM pentru a compara fiierele."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Tiprete informaii despre versiune."
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Folosire: %s [OPIUNE]... FIIERUL_MEU FIIER_VECHI FIIERUL_TU\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Compar trei fiiere linie cu linie"
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "eroare intern: zpceal n formatul blocurilor diff"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff euat: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "eroare intern: tip diff invalid n process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "format diff invalid; separator de modificare invalid"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "format diff invalid; ultim-linie incomplet"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "programul subsidiar `%s' nu a fost gsit"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "format diff invalid; caractere precedente liniei incorecte"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "eroare intern: tip invalid de diff trimis spre ieire(output)"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "fiier de intrare(input) micorat"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "nu se pot compara numele de fiiere `%s' i `%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+#, fuzzy
+msgid "Thomas Lord"
+msgstr "Scris de Thomas Lord."
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o FIIER --output=FIIER Opereaz interactiv, trimind outputul spre "
+"FIIER."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr ""
+"-i --ignore-case Consider majusculele i minusculele ca fiind aceleai."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion Ignor schimbrile produse de modificarea tab-"
+"ului."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space Ignor tot spaiul vid."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change Ignor schimbrile din spaiul vid."
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space Ignor tot spaiul gol."
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines Ignor schimbrile unde toate liniile sunt "
+"goale(blank)."
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I RE --ignore-matching-lines=RE Ignor schimbrile la toate liniile care "
+"se potrivesc RE-ului."
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+"--strip-trailing-cr Elimin returul de car(carriage return) final la "
+"intrare(input)."
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text Trateaz toate fiierele ca text."
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane tiprite."
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column Afieaz doar coloana din stnga a liniilor comune."
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines Nu afia liniile comune."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs Schimb tab-urile n spaii la ieire(output)."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+"--tabsize=NUM Opririle tab-ului vor fi la fiecare NUM (implicit 8) coloane "
+"tiprite."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d --minimal ncearc din greu s gseti un set mai mic de schimbri"
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files Presupune fiiere mari i multe modificri mici "
+"mprtiate."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=PROGRAM Folosete PROGRAM pentru a compara fiierele."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version Tiprete informaii despre versiune."
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Folosire: %s [OPIUNE]... FIIER1 FIIER2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Analiz pas cu pas a diferenelor de fiiere."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "nu poate rezulta(merge) interactiv intrarea(input) standard"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "ambele fiiere de comparat sunt directoare"
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tEditeaz apoi folosete ambele versiuni, fiecare decorat cu un cap de "
+"tabel.\n"
+"eb:\tEditeaz apoi folosete ambele versiuni.\n"
+"el:\tEditeaz apoi folosete versiunea din stnga.\n"
+"er:\tEditeaz apoi folosete versiunea din dreapta.\n"
+"e:\tEditeaz o versiune nou.\n"
+"l:\tFolosete versiunea din stnga.\n"
+"r:\tFolosete versiunea din dreapta.\n"
+"s:\tInclude silenios liniile comune.\n"
+"v:\tInclude detaliat liniile comune.\n"
+"q:\tIeire.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: opiune necunoscut `--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opiune ilegal -- %c\n"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "Acest program NU vine cu NICI O GARANIE, n msura permis de lege.\n"
+#~ "Putei redistribui copii ale acestui program\n"
+#~ "sub termenii Licenei Publice Generale GNU.\n"
+#~ "Pentru mai multe informaii despre aceste chestiuni, citii fiierul "
+#~ "numit COPYING."
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "Scris de Torbjorn Granlund i David MacKenzie."
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i OMIS1:OMIS2 --ignore-initial=OMIS1:OMIS2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Nu tiprete nimic; anun(yield) doar starea de "
+#~ "ieire."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Tiprete acest ajutor."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "Raportai erorile(bugs)la <bug-gnu-utils@gnu.org>."
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "Scris de Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, i Len Tower."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "`-%ld' opiunea este nvechit; folosii `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "`-%ld' opiunea este nvechit; omitei-o"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C NUM --context[=NUM] Tiprete NUM (implicit 3) linii de "
+#~ "contextcopiat.\n"
+#~ "-u -U NUM --unified[=NUM] Tiprete NUM (implicit 3) linii de "
+#~ "contextunificat.\n"
+#~ " --label ETICHET Folosete ETICHET n loc de nume fiier.\n"
+#~ " -p --show-c-function Afieaz fiecare schimbare din fiecare funcie "
+#~ "C.\n"
+#~ " -F RE --show-function-line=RE Afieaz cele mai recente linii care se "
+#~ "potrivesc RE."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side Afieaz pe dou coloane.\n"
+#~ " -W NUM --width=NUM Afieaz cel mult NUM (implicit 130) coloane "
+#~ "tiprite.\n"
+#~ " --left-column Afieaz doar coloana din stnga a liniilor comune.\n"
+#~ " --suppress-common-lines Nu afia liniile comune."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Presupune fiiere mari i multe modificri mici "
+#~ "mprtiate."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X Afieaz schimbrile de suprapunere, punndu-le n paranteze."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Afieaz fiierul rezultat(merged) n loc de scriputl ed "
+#~ "(implicit -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr ""
+#~ "-L ETICHET --label=ETICHET Folosete ETICHET n loc de numele "
+#~ "fiierului."
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "programul subsidiar `%s' euat"
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "programul subsidiar `%s' nu este executabil"
diff --git a/po/ru.gmo b/po/ru.gmo
new file mode 100644
index 0000000..26f658d
--- /dev/null
+++ b/po/ru.gmo
Binary files differ
diff --git a/po/ru.po b/po/ru.po
new file mode 100644
index 0000000..4931d0e
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,1654 @@
+# diffutils
+# Copyright (C) 1998 Free Software Foundation, Inc.
+# Oleg S. Tihonov <ost@tatnipi.ru>, 1998, 2001, 2002, 2005, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 2.8.7\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2007-02-13 07:13+0300\n"
+"Last-Translator: Oleg S. Tihonov <ost@tatnipi.ru>\n"
+"Language-Team: Russian <ru@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=koi8-r\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr " --bytes `%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr " --bytes `%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr " "
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr " "
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr " "
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr " "
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr " "
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr ""
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr " "
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr " "
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr ""
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr " "
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr " "
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr " "
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr " "
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr ""
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr " "
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr " "
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr " "
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr " "
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr ""
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr " "
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: `%s'\n"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: `-W %s'\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: `--%s' \n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: `%c%s' \n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: `%s' c \n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: `--%s'\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: `%c%s'\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: -- %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: %c c \n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: `-W %s'\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: `-W %s' \n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: `%s' c \n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr ""
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr " "
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr " "
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr " "
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr " "
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr " "
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr " "
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr " [ [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr " ( \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr " \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr " \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr " "
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr " "
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr " "
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr " "
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr " "
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr " ) \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr " "
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr " "
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr " "
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr " --bytes `%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr ""
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr " -- %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr " -- %s %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr " -- %s, %s %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+" -- %s, %s, %s\n"
+" %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+" -- %s, %s, %s,\n"
+"%s %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+" -- %s, %s, %s,\n"
+"%s, %s %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr " %s %s \n"
+
+#: src/analyze.c:455
+#, fuzzy, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr " %s %s \n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr " "
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "أ "
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr " `%s --help' ."
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr " --ignore-initial `%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr " -l -s "
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr " "
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr " "
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes ."
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i --ignore-initial= ."
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr " 1 1 2 2."
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose ."
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n --bytes= ."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version ."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr ": %s []... 1 [2 [1 [2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr " ."
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr "1 2 -- , ."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+" :\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, T, P, E, Z, Y."
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr " `-', ."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+" 0, , 1 -- \n"
+", 2 ."
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr " --bytes `%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr " `%s'"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr " `%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s : %s, %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s : %s, %s %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr " `%s'"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr " "
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr " "
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr " `%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr " "
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr " `%s'"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr " `%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr " "
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr " --from-file, --to-file"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal diff."
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief ."
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files ."
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w --width= .\n"
+" ( 130)"
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed ed."
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs RCS."
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w --width= .\n"
+" ( 130)"
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column ."
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines ."
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=1 1 .\n"
+" 1 ."
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs ."
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab ."
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+"--tabsize= ( 8)."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l --paginate `pr' ."
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r --recursive ."
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file ."
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+"--unidirectional-new-file "
+"."
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr "--ignore-file-name-case ."
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr "--no-ignore-file-name-case ."
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x --exclude= , "
+"."
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X --exclude-from= , -"
+"\n"
+" ."
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr "-S --starting-file= ."
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=1 1 .\n"
+" 1 ."
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=2 2. 2 "
+"."
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i --ignore-case ."
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion , "
+"."
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space ."
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change ."
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space ."
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B --ignore-blank-lines ."
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I --ignore-matching-lines= , \n"
+" "
+""
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text ."
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr ."
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary ."
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D --ifdef= , `#ifdef '."
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"---group-format= , "
+"\n"
+" ."
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+"--line-format= , ."
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"---group-format= , "
+"\n"
+" ."
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" `old', `new', `unchanged', -- `changed'."
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" :\n"
+" %< 1\n"
+" %> 2\n"
+" %= , 1 2\n"
+" %[-][][.[]]{doxX} printf\n"
+" , "
+":\n"
+" F \n"
+" L \n"
+" N = L-F+1\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" :\n"
+" %L \n"
+" %l , \n"
+" %[-][][.[]]{doxX}n printf"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" :\n"
+" %% %\n"
+" %c'' \n"
+" %c'\\OOO' OOO"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal ."
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+"--horizon-lines= ."
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+"-H --speed-large-files , \n"
+" ."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal diff."
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version ."
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+" `1 2', `1 2', ` ...',\n"
+" `... '."
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr " --from-file --to-file, ."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr " `-', ."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr ": %s []... \n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr " ."
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr " %s `%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr " "
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr " `%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr " %s: %s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr " `-' "
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D option not supported with directories"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr " : %s %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr " %s %s, %s -- %s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr " %s %s \n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr " %s %s \n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr ""
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr " "
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "`-' "
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr " "
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A --show-all , ."
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed - -\n"
+" -."
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap ,\n"
+" ."
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3 --easy-only ."
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only ."
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i `w' `q' ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text ."
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr ."
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab ."
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+"--diff-program= "
+"."
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version ."
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr ": %s []... - - -\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr " ."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+" 0 , 1 2 \n"
+" ."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr " : "
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: : "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr " : `process_diff'"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr " ; "
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr " ; "
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr " `%s'"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr " ; "
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr " : "
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr " "
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr " `%s' `%s'"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr ""
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o --output= , ."
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case ."
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion , "
+"."
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space ."
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change ."
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space ."
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B --ignore-blank-lines ."
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I --ignore-matching-lines= , \n"
+" "
+""
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr ."
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text ."
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w --width= .\n"
+" ( 130)"
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column ."
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines ."
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs ."
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+"--tabsize= ( 8)."
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal ."
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files , \n"
+" ."
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+"--diff-program= "
+"."
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version ."
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr ": %s []... 1 2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr " ."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr " "
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr " -- "
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\t , .\n"
+"eb:\t .\n"
+"el:\t .\n"
+"er:\t .\n"
+"e:\t .\n"
+"l:\t .\n"
+"r:\t .\n"
+"s:\t , .\n"
+"v:\t , .\n"
+"q:\t.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: `--%s'\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ " ; \n"
+#~ " . ; \n"
+#~ " - .\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i 1:2 --ignore-initial=1:2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent , ."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help ."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr " <bug-gnu-utils@gnu.org>."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr " `-%ld' ; `-%c %ld'"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr " `-%ld' ; "
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C --context[=] ( 3) "
+#~ ".\n"
+#~ "-u -U --unified[=] ( 3) \n"
+#~ " .\n"
+#~ " -L --label .\n"
+#~ " -p --show-c-function C-, .\n"
+#~ " -F --show-function-line= , "
+#~ "\n"
+#~ " ."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side .\n"
+#~ " -W --width= "
+#~ ".\n"
+#~ " ( 130)\n"
+#~ " --left-column .\n"
+#~ " --suppress-common-lines ."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files , \n"
+#~ " ."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X , ."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge ed ( -"
+#~ "A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L --label= ."
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr " `%s'"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr " `%s' "
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr ""
+#~ " `%s' ( %d) "
diff --git a/po/sr.gmo b/po/sr.gmo
new file mode 100644
index 0000000..81732f7
--- /dev/null
+++ b/po/sr.gmo
Binary files differ
diff --git a/po/sr.po b/po/sr.po
new file mode 100644
index 0000000..7eabd35
--- /dev/null
+++ b/po/sr.po
@@ -0,0 +1,1500 @@
+# Serbian translation of `diffutils'.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Aleksandar Jelenak <jelenak@netlinkplus.net>, 2004.
+# Мирослав Николић <miroslavnikolic@rocketmail.com>, 2013.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2013-10-07 11:40+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"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "неисправан %s%s аргумент „%s“"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "неисправан %s%s аргумент „%s“"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "грешка програма"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "стек препуњен"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Непозната системска грешка"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "обична празна датотека"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "обична датотека"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "директоријум"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "симболичка веза"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "ред порука"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "семафор"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "заједнички меморијски објекат"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "типски меморијски објекат"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "датотека блоковског уређаја"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "датотека знаковног уређаја"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "пупи"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "датотека блоковског уређаја"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "датотека знаковног уређаја"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "чудна датотека"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "датотека блоковског уређаја"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "прикључница"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "чудна датотека"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: опција „%s“ је нејасна; могућности:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: опција „-W %s“ је нејасна\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: опција „--%s“ не дозвољава аргумент\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: опција „%c%s“ не дозвољава аргумент\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: опција „%s“ захтева аргумент\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: непозната опција „--%s“\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: непозната опција „%c%s“\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: неисправна опција -- „%c“\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: опција захтева аргумент -- „%c“\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: опција „-W %s“ је нејасна\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: опција „-W %s“ не дозвољава аргумент\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: опција „-W %s“ захтева аргумент\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "„"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "“"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Успешно"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Нема поклапања"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Неисправан регуларни израз"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Неисправан знак слагања"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Неправилан назив разреда знака"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Пратећа обрнута коса црта"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Неисправна повратна упута"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Неупарено [ или [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Неупарено ( или \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Неупарено \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Неисправан садржај у \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Неисправан крај опсега"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Меморија је исцрпљена"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Неисправан претходећи регуларни израз"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Преран завршетак регуларног израза"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Регуларан израз је исувише велики"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Неупарено ) или \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Нема претходног регуларног израза"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "меморија је исцрпљена"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "стдулаз"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "стдизлаз"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "стдгрешка"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "непознат ток"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "нисам успео да поново отворим „%s“ са режимом %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "неисправан %s%s аргумент „%s“"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "неисправан суфикс у %s%s аргументу „%s“"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s аргумент „%s“ је превелик"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Запаковао је %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Запаковао је %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Дозвола ОЈЛв3+: Гнуова ОЈЛ издање 3 или касније <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Ово је слободан софтвер: слободни сте да га мењате и расподељујете.\n"
+"Нема НИКАКВЕ ГАРАНЦИЈЕ, у обиму допуштеном законом.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Написао: %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Написали: %s и %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Написали: %s, %s и %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Написали: %s, %s, %s,\n"
+"и %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Написали: %s, %s, %s,\n"
+"%s, и %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Написали: %s, %s, %s,\n"
+"%s, %s, и %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Грешке пријавите на: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Грешке програма „%s“ пријавите на: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s матична страница: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s матична страница: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr "Општа помоћ користећи ГНУ софтвер: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Датотеке „%s“ и „%s“ су различите\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Бинарне датотеке %s и %s различите\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Без новог реда на крају датотеке"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Торбјорн Гранлунд"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "Дејвид Мек Кензи"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Покушајте „%s --help“ за више информација."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "неисправна „--ignore-initial“ вредност „%s“"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "опције -l и -s не иду заједно"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "записивање није успело"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "стандардни излаз"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr ""
+"-b --print-bytes исписује бајтове који се разликују."
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i БРОЈ --ignore-initial=БРОЈ изоставља првих БРОЈ бајтова улаза."
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+" изоставља првих БРОЈ1 бајтова ДАТОТЕКЕ1 и првих БРОЈ2 бајтова ДАТОТЕКЕ2."
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l --verbose исписује редни број и вредност бајтова "
+"који се разликују."
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr ""
+"-n ОГРАНИЧЕЊЕ --bytes=ОГРАНИЧЕЊЕ пореди до највише ОГРАНИЧЕЊЕ бајтова."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent потискује све обичне излазе"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help приказује ову помоћ и излази"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v --version исписује податке о издању."
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Употреба: %s [ОПЦИЈА]... ДАТОТЕКА1 [ДАТОТЕКА2 [БРОЈ1 [БРОЈ2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Поредите две датотеке бајт по бајт."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Изборни БРОЈ1 и БРОЈ2 су бројеви бајтова за изостављање на почетку\n"
+"сваке датотеке (подразумева се нула)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Обавезни аргументи за дуге опције су обавезни и за кратке опције такође.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"Уз БРОЈ могу ићи и следећи умножавајући суфикси:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576, GB 1,000,000,000, G "
+"1,073,741,824,\n"
+"итд. за T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Чита стандардни улаз ако ДАТОТЕКА недостаје или је „-“."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr "Излазно стање је 0 ако су улази исти, 1 за различите, 2 за грешку."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "неисправна --bytes вредност „%s“"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "недостаје оператор после „%s“"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "вишак оператор „%s“"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s се разликују: бајт %s, ред %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s се разликују: бајт %s, ред %s је %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: крај датотеке на %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Пол Егерт"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Мајк Хартел"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "Дејвид Хејес"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Ричард Столман"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Лен Тауер"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "неисправна дужина склопа „%s“"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "прелом страна није подржан на овом рачунару"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "исувише опција за ознаку датотеке"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "неисправна дужина „%s“"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "сукобљене опције ширине"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "неисправна дужина видокруга „%s“"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "неисправна величина табулатора „%s“"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "сукобљене опције величине табулатора"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "„--from-file“ и „--to-file“ су наведени оба"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal исписује обичне разлике (основно)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief исписује само када се датотеке разликују"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files извештава када су две датотеке исте"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C БРОЈ, --context[=БРОЈ] исписује БРОЈ (почетно 3) редова умноженог "
+"склопа"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-w БРОЈ --width=БРОЈ исписује БРОЈ (почетно 3) редова обједињеног "
+"склопа"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed исписује ед спис"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs исписује РЦС запис разлика"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side исписује у две колоне"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w БРЈ --width=БРЈ исписује на највише БРЈ (почетно 130) колона"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+"-l --left-column исписује само леву колону заједничких редова"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines не приказује заједничке редове"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function приказује у којој Ц функцији је свака промена"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=РИ приказује најскорији ред који одговара РИ"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ОЗНАКА користи ОЗНАКУ уместо назива датотеке\n"
+" (може да се понавља)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs развија табулаторе у размаке за излаз"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab поравнава табулаторе додајући један табулатор."
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+"--tabsize=БРЈ величина табулатора је БРЈ (почетно 8) колона"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+"--suppress-blank-empty потискује размак или табулатор пре празних "
+"редова излаза"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l --paginate пропушта излаз кроз „pr“ за прелом"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r --recursive дубински упоређује све пронађене "
+"поддиректоријуме"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference не прати симболичке везе"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file сматра празним недостајуће датотеке"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file сматра празним прве недостајуће датотеке"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case занемарује словну величину поређујући назива "
+"датотека"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case урачунава словну величину поређујући називе "
+"датотека"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=ОБР искључује датотеке које поклапају ОБР"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=ТЕКА искључује датотеке које поклапа било који "
+"образац у ТЕКА"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=ТЕКА почиње од ТЕКА при поређењу директоријума"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=ТЕКА1 упоређује ТЕКУ1 са свим оперантима. ТЕКА1 "
+"може бити директоријум"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=ТЕКА2 упоређује све операнте са ТЕКОМ2. ТЕКА2 може "
+"бити директоријум"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i --ignore-case занемарује словну величину у склопу датотека"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion занемарује промене услед развијања табулатора"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space занемарује размак на крају реда"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change занемарује промене због количине празног "
+"простора"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space занемарује све празне просторе"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines занемарује промене услед празних редова"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=РИ занемарује промене чији редови поклапају РИ"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a --text сматра све датотеке као текст"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr огољава пратеће <CR> на улазу"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary чита и пише податке у бинарном режиму"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=НАЗИВ исписује стопљену датотеку да прикаже "
+"„#ifdef НАЗИВ“ разлике"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=ГОБЛ обликује GTYPE улазне групе са ГОБЛ"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=РОБЛ обликује све улазне редове са РОБЛ"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=РОБЛ обликује LTYPE улазне редове са РОБЛ"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Ове опције записа обезбеђује фино подешено управљање преко излаза\n"
+" различника, генерализујући -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE је „old“, „new“, или „unchanged“. GTYPE је LTYPE или „changed“."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" ГОБЛ (само) може садржати:\n"
+" %< редове из ДАТОТЕКЕ1\n"
+" %> редове из ДАТОТЕКЕ2\n"
+" %= редове заједничке у ДАТОТЕЦИ1 и ДАТОТЕЦИ2\n"
+" %[-][ШИРН][.[ТАЧН]]{doxX}СЛОВО printf-стил за СЛОВО\n"
+" СЛОВО за нову групу, мала слова за стару групу:\n"
+" F број првог реда\n"
+" L број последњег реда\n"
+" N број редова = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) ако је А исто као Б онда Т супротно Е"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" РОБЛ (само) може садржати:\n"
+" %L садржај реда\n"
+" %l садржај реда, изузев пратећих знакова за нови ред\n"
+" %[-][ШИРН][.[ТАЧН]]{doxX}n printf-стил за улазни број реда"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Било ГОБЛ или РОБЛ могу садржати:\n"
+" %% %\n"
+" %c'З' само један знак „З“\n"
+" %c'\\OOO' знак са окталним кодом OOO\n"
+" З знак З (други знаци представљају сами себе)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal труди се да нађе мањи скуп промена"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=БРЈ чува БРЈ редова заједничког префикса и суфикса"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files за велике датотеке са много раштрканих малих измена"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal исписује обичне разлике (основно)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help приказује ову помоћ и излази"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v --version исписује податке о издању"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"ДАТОТЕКЕ су „ТЕКА1 ТЕКА2“ или „ДИР1 ДИР2“ или „ДИР ТЕКА...“ или „ТЕКА... "
+"ДИР“."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Нема ограничења за ДАТОТЕКЕ ако је задато „--from-file“ или „--to-file“."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Ако је ДАТОТЕКА „-“, чита стандардни улаз."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Употреба: %s [ОПЦИЈА]... ДАТОТЕКЕ\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Поредите ДАТОТЕКЕ ред по ред."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "сукоб вредности „%s“ опције „%s“"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "сукобљене опције излазног стила"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "неисправна дужина „%s“"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Само у %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "не могу поредити „-“ са директоријумом"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "опција „-D“ није подржана за директоријуме"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Заједнички поддиректоријуми: %s и %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Датотека „%s“ је „%s“ док је датотека „%s“ „%s“\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Симболичке везе „%s“ и „%s“ су различите\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Датотеке „%s“ и „%s“ се истоветне\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Ренди Смит"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "несагласне опције"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "„-“ је наведено за више од једне улазне датотеке"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "читање није успело"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A --show-all исписује све промене, означавајући сукобе "
+"заградама"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed исписује неспојене промене између СТАРАТЕКА и "
+"ТВОЈАТЕКА у МОЈАТЕКА"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E --show-overlap као -e, означавајући сукобе заградама"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3 --easy-only као -e, али обједињује непреклопљене промене"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x, --overlap-only као -e, али обједињује преклопљене промене"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X као -x, означавајући сукобе заградама"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i придодаје „w“ и „q“ наредбе ед списима"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge исписује тренутну стопљену датотеку, у складу\n"
+" са -A ако нису дате друге опције"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a --text сматра све датотеке као текст"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr огољава пратеће <CR> на улазу"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab поравнава табулаторе додајући један табулатор"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=ПРОГРАМ користи ПРОГРАМ за поређење датотека"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ОЗНАКА користи ОЗНАКУ уместо назива датотеке\n"
+" (може да се понови до три пута)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help приказује ову помоћ и излази"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version исписује податке о издању и излази"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Употреба: %s [ОПЦИЈА]... МОЈАТЕКА СТАРАТЕКА ТВОЈАТЕКА\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Поредите три датотеке ред по ред."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Основни запис излаза је некако људима разумљиво представљање промена.\n"
+"\n"
+"Опције „-e, -E, -x, -X“ (и одговарајуће дуге) доводе до тога да ед спис\n"
+"буде излаз уместо подразумеваног.\n"
+"\n"
+"На крају, опција „-m“ (--merge) доводи до тога да „diff3“ изнутра стопи\n"
+"и да испише тренутно стопљену датотеку. За необичан улаз, ово је много\n"
+"рогпадније него употреба еда.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Излазно стање је 0 за успех, 1 за сукобе, 2 за грешку."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "унутрашња грешка: зез у запису блокова разлика"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: разлике нису успеле: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "унутрашња грешка: неисправна врста разлика у „process_diff“"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "неисправан запис разлика; неисправан раздвојник измена"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "неисправан облик разлика; непотпун задњи ред"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "помоћни програм „%s“ не може бити покренут"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "неисправан запис разлика; нетачни водећи знакови реда"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "унутрашња грешка: неисправна врста разлика прослеђена излазу"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "улазна датотека се скупила"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "не могу поредити називе датотека „%s“ и „%s“"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: дубинска петља кроз директоријуме"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Томас Лорд"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o, --output=ТЕКА ради међудејствено, шаљући излаз у ТЕКА"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case сматра истим велика и мала слова"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion занемарује промене услед развијања табулатора"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space занемарује размак на крају реда"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b --ignore-space-change занемарује промене због количине празног "
+"простора"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space занемарује све размаке"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B --ignore-blank-lines занемарује промене услед празних редова"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=РИ занемарује промене чији редови поклапају РИ"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr огољава пратеће <CR> на улазу"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a --text сматра све датотеке као текст"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=БРОЈ исписује на највише БРОЈ (почетно 130) колона"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l --left-column исписује само леву колону заједничких редова"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines не приказује заједничке редове"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs развија табулаторе у размаке за излаз"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=БРОЈ величина табулатора је БРОЈ (почетно 8) колона"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal труди се да нађе мањи скуп промена"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H --speed-large-files за велике датотеке са много раштрканих малих "
+"измена"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=ПРОГРАМ користи ПРОГРАМ за поређење датотека"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help приказује ову помоћ и излази"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v --version исписује податке о издању"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Употреба: %s [ОПЦИЈА]... ДАТОТЕКА1 ДАТОТЕКА2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Упоредно стапање разлика између ДАТОТЕКЕ1 и ДАТОТЕКЕ2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "не могу интерактивно уклопити стандардни улаз"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "обе датотеке за поређење су директоријуми"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed: Уређује па користи оба издања, свако украшено заглављем.\n"
+"eb:\t Уређије па користи оба издања.\n"
+"el или e1: Уређује па користи издање лево.\n"
+"er или e2: Уређује па користи издање десно.\n"
+"e: Уређује ново издање.\n"
+"l: Користи издање лево.\n"
+"r: Користи издање десно.\n"
+"s: Умеће заједничке редове тихо.\n"
+"v: Умеће заједничке редове бучно.\n"
+"q: Завршава.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: непозната опција „--%s“\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/stamp-po b/po/stamp-po
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/po/stamp-po
@@ -0,0 +1 @@
+timestamp
diff --git a/po/sv.gmo b/po/sv.gmo
new file mode 100644
index 0000000..87261d0
--- /dev/null
+++ b/po/sv.gmo
Binary files differ
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 0000000..264fbeb
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,1515 @@
+# Swedish messages for diffutils.
+# Copyright © 1996, 2001, 2002, 2004, 2006, 2010, 2011, 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Göran Uddeborg <goeran@uddeborg.se>, 1996, 2001, 2002, 2004, 2006, 2010, 2011, 2012.
+#
+# $Revision: 1.43 $
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-10-31 21:15+0100\n"
+"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "ogiltigt argument till %s%s ”%s”"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "ogiltigt argument till %s%s ”%s”"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "programfel"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stackspill"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Okänt systemfel"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "en tom normal fil"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "en normal fil"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "en katalog"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "en symbolisk länk"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "en meddelandekö"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "en semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "ett objekt av delat minne"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "ett objekt av typat minne"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "en blockspecialfil"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "en teckenspecialfil"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "en fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "en blockspecialfil"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "en teckenspecialfil"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "en konstig fil"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "en blockspecialfil"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "ett uttag (socket)"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "en konstig fil"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: flaggan \"%s\" är tvetydig; möjligheter:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: flaggan \"-W %s\" är tvetydig\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: flaggan \"--%s\" tar inget argument\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: flaggan \"%c%s\" tar inget argument\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: flaggan \"%s\" behöver ett argument\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: okänd flagga \"--%s\"\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: okänd flagga \"%c%s\"\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ogiltig flagga -- \"%c\"\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: flaggan behöver ett argument -- \"%c\"\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: flaggan \"-W %s\" är tvetydig\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: flaggan \"-W %s\" tar inget argument\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: flaggan \"-W %s\" behöver ett argument\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "”"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Lyckades"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Ingen match"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ogiltigt reguljäruttryck"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ogiltigt sorteringstecken"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ogiltigt namn på teckenklass"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Avslutande omvänt snedstreck"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ogiltig bakåtreferens"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Oparad [ eller [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Oparad ( eller \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Oparad \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ogiltigt innehåll i \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ogiltigt intervallslut"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Minnet slut"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Föregående reguljäruttryck ogiltigt"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Förtida slut på reguljäruttryck"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "För stort reguljäruttryck"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Oparad ) eller \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Inget föregående reguljäruttryck"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "minnet slut"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "standard in"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "standard ut"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "standard fel"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "okänd ström"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "kunde inte öppna om %s i läge %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "ogiltigt argument till %s%s ”%s”"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "ogiltigt suffix i argument till %s%s ”%s”"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "argument till %s%s ”%s” är för stort"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Paketerat av %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Paketerat av %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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 senare <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Detta är fri programvaraL: du får fritt ändra och vidaredistribuera den.\n"
+"Det finns INGEN GARANTI, så långt lagen tillåter.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Skrivet av %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Skrivet av %s och %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Skrivet av %s, %s och %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Skrivet av %s, %s, %s\n"
+"och %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Skrivet av %s, %s, %s,\n"
+"%s och %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.
+#: lib/version-etc.c:131
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapportera fel till %s\n"
+"Rapportera synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Rapportera %s-fel till: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s hemsida: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s hemsida: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Allmän hjälp med att använda GNU-program: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Filerna %s och %s skiljer\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "De binära filerna %s och %s skiljer\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Ingen nyrad vid filslut"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjörn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Försök med ”%s --help” för mer information."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "ogiltigt --ignore-initial-värde ”%s”"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "flaggorna -l och -s är motstridiga"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "skrivning misslyckades"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standard ut"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes skriv ut byte som skiljer"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=HOPP hoppa över de första HOPP byte indata"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=HOPP1:HOPP2 hoppa över de HOPP1 första byten i FIL1 "
+"och\n"
+" de HOPP2 första byten i FIL2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose skriv ut bytenummer och värde för alla skiljande "
+"byte"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=GRÄNS jämför högst GRÄNS byte"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent undertryck all normal utskrift"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help visa denna hjälp och avsluta"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v --version visa versionsinformation och avsluta"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Användning: %s [FLAGGA]... FIL1 [FIL2 [HOPP1 [HOPP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Jämför två filer byte för byte."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"De valfria HOPP1 och HOPP2 anger antalet antalet byte att hoppa över\n"
+"i början varje fil (noll som standard)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Obligatoriska argument till långa flaggor är obligatoriska även för de "
+"korta.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"HOPP-värden kan följas av följande multiplikativa suffix:\n"
+"kB 1000, K 1024, MB 1 000 000, M 1 048 576\n"
+"GB 1 000 000 000, G 1 073 741 824, och så vidare för T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Om FIL är ”-” eller utelämnats, läs standard in."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr "Slutsstatus är 0 om indata är lika, 1 om olika, 2 vid problem."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "ogiltigt --bytes-värde ”%s”"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "saknad operand efter ”%s”"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "extra operand ”%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s skiljer: byte %s, rad %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s skiljer: byte %s, rad %s är %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: EOF i %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "ogiltig omgivningslängd ”%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "sidvisning stödjs ej på denna värd"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "för många etikettflaggor"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "ogiltig bredd ”%s”"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "konflikt mellan breddflaggor"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "ogiltig horisontlängd ”%s”"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "ogiltigt tabulatorsteg ”%s”"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "konflikt mellan tabulatorflaggor"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "både --from-file och --to-file angavs"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal skriv ut en normal diff (standard)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief rapportera endast när filer skiljer sig"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files rapportera om två filer är lika"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C ANT, --context[=ANT] skriv ANT (3 som standard) rader kopia av "
+"sammanhang"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U ANT, --unified[=ANT] skriv ut ANT (3 som standard) rader med\n"
+" sammanslagen omgivning"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed skriv ut ett ed-skript"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs skriv ut skillnader i RCS-format"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side skriv ut i två kolumner"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=ANT skriv ut högst ANT (130 som standard) kolumner"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column skriv ut endast vänstra kolumnen av gemensamma "
+"rader"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines skriv inte ut gemensamma rader"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function visa vilken C-funktion varje rad finns i"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RU visa dn senaste raden som matchar RU"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETIKETT använd ETIKETT istället för filnamn\n"
+" (kan upprepas)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs expandera tabulatorer till blanksteg i utdata"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab justera tabulatorer genom att skjuta in en"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=N tabulatorstopp var N:e (8 som standard) kolumn"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty undertryck blanka eller tabulatorer före "
+"tomma\n"
+" utrader"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l, --paginate skicka utdata till ”pr” för paginering"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive jämför underkataloger som hittas rekursivt"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference följ inte symboliska länkar"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file behandla saknade filer som tomma"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr " --unidirectional-new-file behandla saknade förstafiler som tomma"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case bortse från skiftläge när filnamn jämförs"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case ta hänsyn till skiftläge när filnamn jämförs"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=MNS ta inte med filer som matchar MNS"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=FIL uteslut filer som matchar något mönster i FIL"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr "-S, --starting-file=FIL börja med FIL när kataloger jämförs"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=FIL1 jämför FIL1 med alla operander;\n"
+" FIL1 kan vara en katalog"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=FIL2 jämför alla operander med FIL2;\n"
+" FIL2 kan vara en katalog"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case bortse från skillnader i skiftläge i "
+"filinnehåll"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion bortse från ändringar på grund av tab-"
+"expansion"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignorera alla blanktecken i slutet av raden"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change bortse från ändringar i antalet blanka"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space bortse från alla blanktecken"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines bortse från ändringar där raderna är helt "
+"blanka"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RU bortse från ändringar där alla rader matchar "
+"RU"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandla alla filer som text"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr tag bort avslutande vagnreturer i indata"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary läs och skriv data binärt"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=NAMN skriv sammanslagen fil med skillnader inom\n"
+" ”#ifdef NAMN”"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYP-group-format=GFMT formatera GTYP-ingrupper med GFMT"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=RFMT formatera alla inrader med RFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --RTYP-line-format=RFMT formatera RTYP-inrader med RFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Dessa formatflagger gör det möjligt att finjustera utskriften från\n"
+" diff, generaliserande -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYP är ”old”, ”new” eller ”unchanged”. GTYP är LTYP eller ”changed”."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (endast) kan innehålla:\n"
+" %< rader från FIL1\n"
+" %> rader från FIL2\n"
+" %= gemensamma rader i FIL1 och FIL2\n"
+" %[-][BREDD][.[PREC]]{doxX}BOKSTAV printf-lik spec. för BOKSTAV\n"
+" BOKSTÄVER är enligt följande för ny grupp, gemen för gammal grupp:\n"
+" F första radnumret\n"
+" L sista radnumret\n"
+" N antal rader = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) om A är lika med B då T annars E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" RFMT (endast) kan innehålla:\n"
+" %L radinnehåll\n"
+" %l radinnehåll exklusive avslutande nyrad\n"
+" %[-][BREDD][.[PREC]]{doxX}n printf-stil spec. för inradnummer"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Både GFMT och RFMT kan innehålla:\n"
+" %% %\n"
+" %c'T' det ensamma tecknet C\n"
+" %c'\\OOO' tecknet med oktalkod OOO\n"
+" T tecknet T (övriga tecken representerar sig själva)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal arbeta hårt för att hitta en mindre mängd av "
+"ändringar"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=ANT spara ANT rader av gemensamt prefix och suffix"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr " --speed-large-files antag stora filer och små spridda ändringar"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal skriv ut en normal diff (standard)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help visa denna hjälp och avsluta"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version visa versionsinformation och avsluta"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILER är ”FIL1 FIL2” eller ”KAT1 KAT2” eller \"KAT FIL…” eller ”FIL… KAT”."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Om --from-file eller --to-file är angivet finns det inga begränsningar\n"
+"på FILER."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Om en FIL är ”-”, läs standard in."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Användning: %s [FLAGGA]... FILER\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Jämför FILER rad för rad."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "motstridigt %s-flaggsvärde ”%s”"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "motstridig utmatningsstilsflagga"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "ogiltig bredd ”%s”"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Endast i %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "kan inte jämföra ”-” med en katalog"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D flaggan stödjs ej för kataloger"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Lika underkataloger: %s och %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Filen %s är %s medan filen %s är %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "De symboliska länkarna %s och %s skiljer\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Filerna %s och %s är lika\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "oförenliga flaggor"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "”-” angivet för mer än en infil"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "läsning misslyckades"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all skriv alla ändringar med markering runt "
+"konflikter"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed skriv ut ett ed-skript som innehåller ändringar\n"
+" från GAMMALFIL till DINFIL i MINFIL"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap som -e, men med markeringar runt konflikter"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only som -e, men tag endast med ej överlappande "
+"ändringar"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only som -e, men tag endast med överlappande ändringar"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X som -x, men skriv klamrar om konflikter"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i lägg till ”w”- och ”q”-kommandon till ed-skript"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge skriv ut en faktiskt sammanslagen fil, enligt\n"
+" -A om inga andra flaggor ges"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text betrakta alla filer som text"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr tag bort avslutande vagnreturer i indata"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab justera tabulatorer genom att skjuta in en "
+"tabulator"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM använd PROGRAM för att jämföra filer"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETIKETT använd ETIKETT istället för filnamn\n"
+" (kan upprepas upp till tre gånger)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help visa denna hjälp och avsluta"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version visa versionsinformation och avsluta"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Användning: %s [FLAGGA]... MINFIL GAMMALFIL DINFIL\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Jämför tre filer rad för rad."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Standardformatet för utskrift är en något så när mänskligt läsbar "
+"representation\n"
+"av ändringarna.\n"
+"\n"
+"Flaggorna -e, -E, -x, -X (och motsvarande långa) gör att ett ed-skript "
+"skrivs\n"
+"ut istället för standardtext.\n"
+"\n"
+"Slutligen får flaggan -m (--merge) diff3 att göra sammanslagningen internt\n"
+"och skriva ut den faktiskt sammanslagna filen. För ovanlig indata är detta\n"
+"mer robust än att använda ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "Slutstatus är 0 om allt bra, 1 vid konflikt, 2 vid problem."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "internt fel: trasigt format i diff-block"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff misslyckades: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "internt fel: ogiltig diff-typ i process_diff"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "ogiltigt diff-format; ogiltig ändringsseparator"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "ogiltigt diff-format; ofullständig sista rad"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "underprogram ”%s” kunde inte startas"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "ogiltigt diff-format; felaktiga starttecken på rad"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "internt fel: ogiltig diff-typ utskickad"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "infilen krympte"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "kan inte jämföra filnamnen ”%s” och ”%s”"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: rekursiv katalogslinga"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o, --output=FIL kör interaktivt, med utdata till FIL"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case betrakta versaler och gemena som lika"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion ignorera ändringar på grund av "
+"tabulatorexpansion"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr ""
+"-Z, --ignore-trailing-space ignorera alla blanktecken i slutet av raden"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change ignorera ändringar i antalet blanka"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space ignorera alla blanktecken"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines ignorera ändringar i form av enbart blanka rader"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RU bortse från ändringar vars alla rader "
+"matchar RU"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr tag bort avslutande vagnreturer i indata"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text behandla alla filer som text"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=ANT skriv ut högst ANT (130 som standard) kolumner"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column skriv ut endast ut gemensamma raders vänstra "
+"kolumn"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines skriv inte ut gemensamma rader"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs expandera tabulatorer till blanksteg i utdata"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=N tabulatorstopp var N:e (8 som standard) kolumn"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr ""
+"-d, --minimal arbeta hårt för att hitta en mindre mängd "
+"ändringar"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files antag stora filer och små spridda ändringar"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=PROGRAM använd PROGRAM för att jämföra filer"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help visa denna hjälp och avsluta"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version visa versionsinformation och avsluta"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Användning: %s [FLAGGA]... FIL1 FIL2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Sammanslagning sida-vid-sida av skillnader mellan FIL1 och FIL2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "kan inte slå samman standard in interaktivt"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "båda filerna som skall jämföras är kataloger"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tRedigera och använd sedan båda versioner, dekorerade med huvuden.\n"
+"eb:\tRedigera och använd sedan båda versioner.\n"
+"el eller e1:\tRedigera och använd sedan vänstra versionen.\n"
+"er eller e2:\tRedigera och använd sedan högra versionen.\n"
+"e:\tKasta båda versionerna, och redigera sedan en ny.\n"
+"l eller 1:\tAnvänd vänstra versionen.\n"
+"r eller 2:\tAnvänd högra versionen.\n"
+"s:\tInkludera tyst gemensamma rader.\n"
+"v:\tInkludera och tillkännage gemensamma rader.\n"
+"q:\tAvsluta.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: okänd flagga \"--%s\"\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/tr.gmo b/po/tr.gmo
new file mode 100644
index 0000000..ac38900
--- /dev/null
+++ b/po/tr.gmo
Binary files differ
diff --git a/po/tr.po b/po/tr.po
new file mode 100644
index 0000000..27b9828
--- /dev/null
+++ b/po/tr.po
@@ -0,0 +1,1662 @@
+# translation of diffutils-3.3-pre1.tr.po to Turkish
+# Diffutils Turkish translation
+# Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+#
+# This file is distributed under the same license as the diffutils package.
+# Deniz Akkus Kanca <deniz@arayan.com>, 2001.
+# Volkan Gezer <vlkngzr@gmail.com>, 2013.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2013-03-09 15:49+0100\n"
+"Last-Translator: Volkan Gezer <vlkngzr@gmail.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-Generator: Lokalize 1.5\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "Geçersiz %s%s argümanı '%s'"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "Geçersiz %s%s argümanı '%s'"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "yazılım hatası"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "yığıt taşması"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Bilinmeyen sistem hatası"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "normal boş dosya"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "normal dosya"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "dizin"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "sembolik bağ"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "ileti kuyruğu"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semafor"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "ortak bellek nesnesi"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "türlenmiş bellek nesnesi"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "blok özel dosyası"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "karakter özel dosyası"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "blok özel dosyası"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "karakter özel dosyası"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "dosya garip"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "blok özel dosyası"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "soket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "dosya garip"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: `%s' seçeneği belirsiz; kullanılabilecekler:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: `-W %s' seçeneği belirsiz\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, 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"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: seçenek `%c%s' argümansız kullanılır\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: `%s' seçeneği bir argümanla kullanılır\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: `--%s' seçeneği bilinmiyor\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: `%c%s' seçeneği bilinmiyor\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: geçersiz seçenek -- %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: seçenek bir argümanla kullanılır -- %c\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: `-W %s' seçeneği belirsiz\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, 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"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: `%s' seçeneği bir argümanla kullanılır\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Başarılı"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Eşleme yok"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Düzenli ifade geçersiz"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Harmanlama karakteri geçersiz"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Karakter sınıf ismi geçersiz"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "İzleyen ters kesme"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Geriye başvuru geçersiz"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ya da [^ eşleşmiyor"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ya da \\( eşleşmiyor"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ eşleşmiyor"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} içeriği geçersiz"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Kapsam sonu geçersiz"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Bellek tükendi"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Önceki düzenli ifade geçersiz"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Düzenli ifadenin sonu eksik kalmış"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Düzenli ifade çok büyük"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ya da \\) eşleşmiyor"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Daha önce düzenli ifade yok"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "bellek tükendi"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "bilinmeyen akış"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "%s, %s kipinde yeniden açılamadı"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "Geçersiz %s%s argümanı '%s'"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "%s%s içinde '%s' argümanı için geçersiz son ek"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s argümanı '%s' çok uzun"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "%s (%s) tarafından paketlenmiş\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "%s tarafından paketlenmiş\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "(C)"
+
+#: lib/version-etc.c:86
+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"
+"Lisans GPLv3+: GNU GPL sürüm 3 veya sonrası <http://gnu.org/licenses/gpl."
+"html>.\n"
+"Bu ücretsiz bir yazılımdır: değiştirmekte ve tekrar dağıtmakta özgürsünüz.\n"
+"İzin verilen yasalar kapsamında hiçbir GARANTİSİ BULUNMAMAKTADIR.\n"
+"\n"
+
+# TRANSLATORS: %s denotes an author name.
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "%s tarafından yazılmıştır.\n"
+
+# TRANSLATORS: Each %s denotes an author name.
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "%s ve %s tarafından yazılmıştır.\n"
+
+# TRANSLATORS: Each %s denotes an author name.
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "%s, %s ve %s tarafından yazılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"%s, %s, %s, ve\n"
+"%s tarafından yazılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"%s, %s, %s,\n"
+"%s ve %s tarafından yazılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"%s, %s, %s,\n"
+"%s, %s ve %s\n"
+"tarafından yazılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:139
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"%s, %s, %s, \n"
+"%s, %s, %s ve\n"
+"%s tarafından yazılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:147
+#, 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ılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:156
+#, 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 ve %s tarafından yazılmıştır.\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.
+#. 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.
+#: lib/version-etc.c:167
+#, 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 ve başkaları\n"
+"tarafından yazılmıştır.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Hataları şuraya bildirin: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "%s hatalarını şuraya bildirin: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s ana sayfası: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s ana sayfası: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"GNU yazılımı kullanımı hakkında genel yardım: <http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "%s ve %s dosyaları birbirinden farklı\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "İkili %s ve %s birbirinden farklı\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Dosya sonunda yenisatır yok."
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Daha fazla bilgi için `%s --help' komutunu deneyin."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "geçersiz --ignore-initial değeri '%s'"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "-l ve -s seçenekleri beraber kullanılamaz"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "yazma başarısız oldu"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "standart çıktı"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes bayt farklarını çıktılar"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=ATLA İki girdinin de ilk ATLA baytını atlar."
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=ATLA1:ATLA2 DOSYA1'in ilk ATLA1 baytını ve\n"
+" DOSYA2'nin ilk ATLA2 baytını atlar"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose bütün farklı baytların numaralarını ve "
+"değerlerini göster"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=LİMİT en fazla LİMİT baytı karşılaştırır"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent tüm normal çıktıları gizle"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help bu yardım metnini göster ve çık"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version sürüm bilgisini gösterir"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Kullanım: %s [SEÇENEK]... DOSYA1 [DOSYA2 [ATLA1 [ATLA2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "İki dosyayı bayt bayt karşılaştırır."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"İsteğe bağlı ATLA1 ve ATLA2, her dosyanın başından atlanacak\n"
+"(öntanımlı olarak sıfır) bayt sayısını belirtir."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Uzun seçenekler için zorunlu olan argümanlar, kısa seçenekler için de "
+"zorunludur.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"ATLA değerleri aşağıdaki çarpanlarla sonlanabilir:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, ve T, P, E, Z, Y için devam eder."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Eğer DOSYA `-' ise veya yoksa, standart girdi okunur."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr "Girdiler aynı ise çıkış durumu 0, farklı ise 1, sorun var ise 2 olur."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "geçersiz --bytes değeri `%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "`%s'den sonra işlenen eksik"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "fazla işlenen `%s'"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s farklı: bayt %s, satır %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s farklı: bayt %s, satır %s: %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: %s'da EOF (dosyasonu)\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "`%s' bağlam uzunluğu geçersiz"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "sayfalama bu makina üzerinde desteklenmiyor"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "çok fazla dosya etiket seçeneği"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "geçersiz genişlik `%s'"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "çelişkili genişlik seçenekleri"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "geçersiz ufuk uzunluğu `%s'"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "geçersiz sekme genişliği `%s'"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "çelişkili genişlik seçenekleri"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "hem --from-file hem de --to-file belirtilmiş"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal normal bir diff çıktılar (öntanımlı)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief yalnızca dosyalar farklı ise göster"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr ""
+"-s, --report-identical-files iki dosyanın birbirinin aynısı ise göster"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C SAYI, --context[=SAYI] kopyalanan bağlamı SAYI satırınca (öntanımlı "
+"3) bastırır"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U SAYI, --unified[=SAYI] birleşik bağlamın SAYI (öntanımlı 3) "
+"satırınca çıktı gösterir"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed bir ed betiği çıktılar"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs RCS biçeminde diff çıktılar"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side iki sütunda çıktı göster"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=SAYI satır başına en fazla SAYI kadar karakter "
+"çıktılar (öntanımlı 130)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column ortak satırları yalnızca sol sütunda çıktılar"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines ortak satırlayı gösterme"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr "-p, --show-c-function içinde değişen her C işlevini göster"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=DÜZİF DÜZİF ile eşleşen en yakın satırı göster"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label ETİKET dosya adı yerine ETİKET kullan\n"
+" (tekrarlanabilir)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs çıktıda sekmeleri boşluk haline getir"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab başlarına bir sekme ilave ederek sekmelerin "
+"hizalanmasını sağla"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=SAYI sekmeler SAYI sütun genişliğine (öntanımlı 8) "
+"ayarlanır."
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty boş çıktı satırlarından önce boşluk veya "
+"sekmeyi gözardı et"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate çıktıyı 'pr' komutundan geçirerek sayfala"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive çevrimli olarak bulunan bütün alt dizinleri "
+"karşılaştır"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference sembolik bağlantıları takip etme"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file var olmayan dosyaları boş varsay"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr " --unidirectional-new-file var olmayan birinci dosyayı boş varsay"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case dosya isimlerinde büyük/küçük harf "
+"farklarını yoksay"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case dosya isimlerinde büyük/küçük harf farkını "
+"göz önüne al"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x, --exclude=KALIP KALIP'a uyan dosyaları işleme dahil etme"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=DOSYA DOSYA'da bulunan kalıplara uyan dosyaları "
+"işlem dışı tut"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=DOSYA dizinleri karşılaştırırken DOSYA'dan başla"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=DOSYA1 DOSYA1'i bütün işlenenlerle karşılaştır;\n"
+" DOSYA1 bir dizin olabilir"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=DOSYA2 DOSYA2'yi bütün işlenenlerle karşılaştır;\n"
+" DOSYA2 bir dizin olabilir"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case dosya içeriğinde büyük/küçük harf farklarını "
+"yoksay"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion sekmelerin açılmasından doğan farkları yoksay"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space bütün satır sonu boşluklarını yoksay"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change boşluk miktarındaki değişiklikleri yoksay"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space bütün boşlukları yoksay"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines satırları boş olan değişiklikleri dikkate "
+"alma"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=DÜZİF satırları DÜZİF kalıbına uyan farkları "
+"yok say"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text bütün dosyaları metin olarak işle"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr girdiden en sonda sarkan satır başını soy"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary veriyi ikilik kipte yaz ve oku"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=İSİM '#ifdef İSİM' farklarını gösteren "
+"harmanlanmış dosya çıktıla."
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --GTYPE-group-format=GFMT GTYPE girdi gruplarını GFMT ile biçimlendir"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT tüm girdi satırlarını LFMT ile biçimlendir"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --LTYPE-line-format=LFMT tüm LTYPE girdi satırlarını LFMT ile "
+"biçimlendir"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Bu biçimlendirme seçenekleri çıktı veya fark üzerinde iyileştirilmiş fine-"
+"grained control over the output\n"
+" tanecik denetimi sağlar. -D/--ifdef genelleştirmesi yapar."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE 'old', 'new' veya 'unchanged' olabilir. GTYPE, LTYPE veya "
+"'changed'dir."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT (sadece) aşağıdakileri içerebilir:\n"
+" %< DOSYA1'den satırlar\n"
+" %> DOSYA2'den satırlar\n"
+" %= DOSYA1 ve DOSYA2'de ortak olan satırlar\n"
+" %[-][GENİŞLİK][.[KESİNLİK]]{doxX}HARF HARF için printf tarzı biçem\n"
+" HARF'ler yeni grup için aşağıdaki gibi, eski grup için ise\n"
+" küçük harf olurlar:\n"
+" F ilk satır numarası\n"
+" L son satır numarası\n"
+" N satır sayısı = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) eğer A eşittir B ise T değilse E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT (sadece) aşağıdakileri içerebilir:\n"
+" %L satırın içeriği\n"
+" %l sonlayan yenisatır karakteri hariç, satırın içeriği\n"
+" %[-][GENİŞLİK][.[KESİNLİK]]{doxX}n girdi satır sayısı için printf tarzı "
+"biçem"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT ve LFMT aşağıdakileri içerebilir:\n"
+" %% %\n"
+" %c'C' tekli karakter C\n"
+" %c'\\OOO' Sekizlik kodu OOO olan karakter\n"
+" C C karakteri (diğer karakterler kendilerini temsil eder)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal daha küçük bir fark kümesi bulmaya çalış"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr " --horizon-lines=SAYI ortak ön ek ve son eklerin SAYI satırını tut"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files büyük dosyalar ve çok sayıda dağınık küçük farklar "
+"olduğunu varsay"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal normal bir diff çıktılar (öntanımlı)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help bu yardım metnini göster ve çık"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version sürüm bilgisini göster ve çık"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"DOSYAlar: `DOSYA1 DOSYA2' veya `DİZİN1 DİZİN2' veya `DİZİN DOSYA...' veya "
+"`DOSYA...DİZİN' olabilir."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Eğer --from-file veya --to-file kullanılmışsa, DOSYAlar üzerinde kısıtlama "
+"yoktur."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Eğer bir DOSYA `-' ise, standart girdi okunur."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Kullanım: %s [SEÇENEK]... DOSYAlar\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "DOSYAları satır satır karşılaştırır."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "çelişkili %s seçeneği değeri: '%s'"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "çelişkili çıktı tarz seçenekleri"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "geçersiz genişlik `%s'"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Yalnızca %s'da: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "'-', bir dizinle karşılaştırılamaz"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D seçenek dizinler için kullanılamaz."
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Ortak alt dizinler: %s ve %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "%s dosyası, bir %s, halbuki %s dosyası bir %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "%s ve %s sembolik bağlantıları birbirinden farklı\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "%s ve %s dosyaları birbirinin aynı\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "uyumsuz seçenekler"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "'-' birden fazla girdi dosyası için belirtilmiş"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "okuma başarısız oldu"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all bütün değişiklikleri çıktıla, çakışmaları köşeli "
+"parantez içine al"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed ESKİDOSYA ile SİZİNDOSYA arasındaki "
+"harmanlanmamış\n"
+" ed betiklerini BENİMDOSYA'ya çıktıla"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap -e'ye benzer, fakat çakışmaları parantez içine "
+"alır"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only -e gibi, fakat sadece örtüşmeyen değişiklikleri "
+"birleştir"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only -e gibi, fakat sadece örtüşen değişiklikleri "
+"birleştir"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X -x gibi ancak çakışmaları parantez içine alır"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i ed betiklerinin sonuna `w' ve `q' komutlarını "
+"ekle"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge asıl birleştirilmiş dosyayı, başka bir seçenek\n"
+" verilmediyse -A ya göre gösterir"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text bütün dosyaları metin olarak işle"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr girdiden en sonda sarkan satır başını soy"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab başlarına bir sekme ilave ederek sekmelerin "
+"hizalanmasını sağla"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=YAZILIM dosyaları karşılaştırmak için YAZILIM'ı kullan"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=ETİKET dosya adı yerine ETİKET kullan\n"
+" (üç defaya kadar tekrarlanabilir)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help bu yardım metnini göster ve çık"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version sürüm bilgisini göster ve çık"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Kullanım: %s [SEÇENEK]... BENİMDOSYA ESKİDOSYA SİZİNDOSYA\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Üç dosyayı satır satır karşılaştırır."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Öntanımlı çıktı biçimi, değişikliklerin kişi-okunabilir gösterimidir.\n"
+"\n"
+"-e, -E, -x, -X (ve ilgili uzun) seçenekler, öntanımlı yerine bir ed betiği\n"
+"çıktı vermesine sebep olurlar.\n"
+"\n"
+"Son olarak, -m (--merge) seçeneği, diff3'ün dahili olarak birleştirme\n"
+"yapmasına neden olur ve asıl birleştirilen dosya çıkarılır. Alışılmadık\n"
+"girdiler için, bu ed kullanımından daha dayanıklıdır.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Eğer işleme başarılı ise çıkış durumu 0, çelişkiler var ise 1,\n"
+"sorun var ise 2 olur."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "iç hata: diff blokları biçemlemesinde hata oluştu"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff başarısız oldu: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "iç hata: process_diff işlevi içinde geçersiz diff türü"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "geçersiz diff biçemi; geçersiz fark ayracı"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "geçersiz diff biçemi; tamamlanmamış son satır"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "alt yazılım '%s' çalıştırılamadı"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "geçersiz diff biçemi; geçersiz satır başı karakterleri"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "iç hata: çıktıya geçersiz diff türü geçirildi"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "girdi dosyası küçüldü"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "dosya isimleri '%s' ve '%s' karşılaştırılamıyor"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: iç dizin döngüsü"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=DOSYA etkileşimli olarak çalış, çıktıyı DOSYA'ya "
+"yönlendir"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case büyük harf/küçük harf farkı gözetme"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E, --ignore-tab-expansion sekmelerin açılmasından doğan farkları yoksay"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space bütün satır sonu boşluklarını yoksay"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change boşluk miktarındaki değişiklikleri yoksay"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space bütün boşlukları yoksay"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B, --ignore-blank-lines satırları boş olan değişiklikleri dikkate alma"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=DÜZİF satırları DÜZİF kalıbına uyan farkları "
+"yoksay"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr girdiden en sonda sarkan satır başını soy"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text bütün dosyaları metin olarak işle"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=SAYI satır başına en fazla SAYI kadar karakter "
+"çıktılar (öntanımlı 130)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-W, --width=SAYI satır başına en fazla SAYI kadar karakter "
+"çıktılar (öntanımlı 130)"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines ortak satırlayı gösterme"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs çıktıda sekmeleri boşluk haline getir"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=SAYI sekmeleri SAYI sütun genişliğine (öntanımlı 8) "
+"ayarla"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal daha küçük bir fark kümesi bulmaya çalış"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files büyük dosyalar ve çok sayıda dağınık küçük "
+"farklar olduğunu varsay"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=YAZILIM dosyaları karşılaştırmak için YAZILIM'ı kullan"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help bu yardım metnini göster ve çık"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version sürüm bilgisini göster ve çık"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Kullanım: %s [SEÇENEK]... DOSYA1 DOSYA2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "DOSYA1 vey DOSYA2 arasındaki farkları yan yana birleştir."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "interaktif olarak standart girdi harmanlanamaz"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "karşılaştırılacak her iki dosya da dizin"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tDüzenler, sonra iki tarafı da kullanır, bir başlıkla süsler.\n"
+"eb:\tDüzenler, sonra iki tarafı da kullanır.\n"
+"el:\tDüzenler, sonra sol tarafı kullanır.\n"
+"er:\tDüzenler, sonra sağ tarafı kullanır.\n"
+"e:\tYeni bir sürüm düzenler, iki sürümü de ihmal eder.\n"
+"l veya 1:\tSol tarafı kullanır.\n"
+"r veya 2:\tSağ tarafı kullanır.\n"
+"s:\tOrtak satırları sessizce dahil eder.\n"
+"v:\tOrtak satırları bilgi vererek dahil eder.\n"
+"q:\tÇıkar.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: `--%s' seçeneği bilinmiyor\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: kuraldışı seçenek -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "Bu, özgür yazılımdır; kaynak koduna bakarak kopyalama şartlarını\n"
+#~ "görebilirsiniz. SATILABİLİRLİĞİ veya HERHANGİ BİR AMACA UYGUNLUĞU için "
+#~ "dahi\n"
+#~ "GARANTİ YOKTUR.\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i ATLA1:ATLA2 --ignore-initial=ATLA1:ATLA2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Hiç bir şey çıktılamaz, yalnızca çıkış durumunu "
+#~ "bildirir."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Bu yardımı gösterir."
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr ""
+#~ "Yazılım hatalarını <bug-gnu-utils@gnu.org> adresine, \n"
+#~ "çeviri hatalarını <gnu-tr@belgeler.org> adresine bildirin."
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "`-%ld' seçeneği kullanımdan kalktı; `-%c %ld' kullanın"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "`-%ld' seçeneği kullanımdan kalktı; kullanmayın"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C SAYI --context[=SAYI] SAYI kadar bağlam satırı kopyalar "
+#~ "(öntanımlı 3)\n"
+#~ "-u -U SAYI --unified[=SAYI] SAYI kadar birleşmiş bağlam satırı "
+#~ "kopyalar\n"
+#~ " (öntanımlı 3)\n"
+#~ " --label ETİKET Dosya adı yerine ETİKET'i kullanır.\n"
+#~ " -p --show-c-function Her farkın hangi C işlevi içinde olduğunu "
+#~ "gösterir.\n"
+#~ " -F DÜZİF --show-function-line=DÜZİF DÜZİF düzenli ifade kalıbına "
+#~ "uygun olan\n"
+#~ " en son satırı gösterir."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side İki sütun halinde çıktı verir.\n"
+#~ " -w SAYI --width=SAYI Satır başına en fazla SAYI kadar karakter "
+#~ "çıktılar\n"
+#~ " (öntanımlı 130).\n"
+#~ " --left-column Ortak satırlarda yalnız sol sütunu gösterir.\n"
+#~ " --suppress-common-lines Ortak satırları göstermez."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Büyük dosyalar ve çok sayıda dağınık küçük \n"
+#~ " farklar olduğunu farzeder."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr ""
+#~ "-X Birbiriyle örtüşen farkları köşeli parantez içinde göstererek "
+#~ "çıktılar."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Ed betiği yerine harmanlanmış dosya çıktılar. (öntanımlı -A)"
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L ETİKET --label=ETİKET Dosya adı yerine ETİKET'i kullanır."
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "alt yazılım `%s' bulunamadı"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "alt yazılım `%s' başarısız oldu"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "alt yazılım `%s' başarısız oldu (çıkış durumu %d)"
diff --git a/po/uk.gmo b/po/uk.gmo
new file mode 100644
index 0000000..d37560c
--- /dev/null
+++ b/po/uk.gmo
Binary files differ
diff --git a/po/uk.po b/po/uk.po
new file mode 100644
index 0000000..562ae4a
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,1569 @@
+# Ukrainian translation to diffutils.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+#
+# Maxim V. Dziumanenko <dziumanenko@gmail.com>, 2006.
+# Yuri Chornoivan <yurchor@ukr.net>, 2011, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-10-31 08:58+0200\n"
+"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
+"Language-Team: Ukrainian <translation-team-uk@lists.sourceforge.net>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.5\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "некоректний аргумент %s%s — «%s»"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "некоректний аргумент %s%s — «%s»"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "помилка програми"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "переповнення стеку"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Невідома системна помилка"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "звичайний порожній файл"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "звичайний файл"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "каталог"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "символьне посилання"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "черга повідомлень"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "семафор"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "об’єкт у спільній пам'яті"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "об’єкт пам'яті з типами"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "спеціальний файл з блоковим доступом"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "спеціальний файл з символьним доступом"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "черга"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "спеціальний файл з блоковим доступом"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "спеціальний файл з символьним доступом"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "дивний файл"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "спеціальний файл з блоковим доступом"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "сокет"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "дивний файл"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: неоднозначний параметр «%s»; можливі варіанти:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: параметр «-W %s» не є однозначним\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s: додавання аргументів до параметра «--%s» не передбачено\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: додавання аргументів до параметра «%c%s» не передбачено\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: до параметра «--%s» слід додати аргумент\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: невідомий параметр «--%s»\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: невідомий параметр «%c%s»\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: некоректний параметр — «%c»\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: до параметра слід додати аргумент — «%c»\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: параметр «-W %s» не є однозначним\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s: додавання аргументів до параметра «-W %s» не передбачено\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: до параметра «-W %s» слід додати аргумент\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Успішно"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Немає відповідностей"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Неправильний регулярний вираз"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Некоректний символ для сортування"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Неправильна назва класу символу"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Зворотна коса риска стоїть останньою"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Неправильне посилання"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Непарна [ чи [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Непарна ( чи \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Непарна \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Неправильний вміст \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Неправильна нижня межа"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Оперативну пам'ять вичерпано"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Неправильний попередній регулярний вираз"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Передчасний кінець регулярного виразу"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Регулярний вираз надто великий"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Непарна ) чи \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Регулярний вираз не було вказано раніше"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "пам’ять вичерпано"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "stdin"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "stdout"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "stderr"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "невідомий потік даних"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "не вдалося повторно відкрити %s у режимі %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "некоректний аргумент %s%s — «%s»"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "некоректний суфікс у аргументі %s%s «%s»"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s, аргумент «%s» є занадто об'ємним"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Пакування виконано %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Пакування виконано %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Автор програми -- %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Автори програми -- %s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Автори програми -- %s, %s та %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Автори програми -- %s, %s, %s\n"
+"та %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Автори програми -- %s, %s, %s,\n"
+"%s та %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Автори програми -- %s, %s, %s,\n"
+"%s, %s та %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Про вади повідомляйте за такою адресою: %s\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Про вади у %s повідомляйте за такою адресою: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Домашня сторінка %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Домашня сторінка %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+"Загальна довідка з програмного забезпечення GNU: <http://www.gnu.org/gethelp/"
+">\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Файли %s та %s відрізняються\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Двійкові файли %s та %s відрізняються\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Наприкінці файлу немає нового рядка"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Спробуйте «%s --help» для отримання докладнішого опису."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "неприпустиме значення --ignore-initial «%s»"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "параметри -l та -s несумісні"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "запис невдалий"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "стандартний вивід"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes вивести байти, що відрізняються."
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=Н пропустити перші Н байтів у обох потоках "
+"вхідних даних"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=Н1:Н2 пропустити перші Н1 байтів у ФАЙЛ1 і\n"
+" перші Н2 байтів у ФАЙЛ2"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l --verbose вивести номери та значення усіх різних байтів"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr ""
+"-n, --bytes=МЕЖА порівнювати не більше вказаної кількості байтів."
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent не показувати всі звичайні повідомлення"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+" --help показати це довідкове повідомлення і завершити "
+"роботу"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version показати дані щодо версії і завершити роботу"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Використання: %s [ПАРАМЕТР]... ФАЙЛ1 [ФАЙЛ2 [Н1 [Н2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "Порівнює два файли по байтах."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Додаткові аргументи Н1 та Н2 визначають кількість байтів, які слід\n"
+"пропустити на початку кожного файла (типово байти не пропускаються)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Обов’язкові аргументи для довгих форм запису параметрів є обов’язковими і "
+"для скорочених форм.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"До значень Н можна приписувати один з наступних суфіксів множення:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, і так далі для T, P, E, Z, Y."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr ""
+"Якщо ФАЙЛ не вказано або вказано як «-», дані буде прочитано зі стандартного "
+"потоку введення."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Код завершення дорівнює 0, якщо вхідні файли ідентичні, 1 -- якщо\n"
+"відрізняються, та 2 при виникненні помилок."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "некоректне значення --bytes «%s»"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "пропущено операнд після «%s»"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "зайвий операнд «%s»"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s відрізняються: байт %s, рядок %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s відрізняються: байт %s, рядок %s дорівнює %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: кінець файлу у %s\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "некоректна довжина контексту «%s»"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "розбиття на сторінки не підтримується на цій машині"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "надто багато параметрів, що вказують позначки файлів"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "некоректна ширина «%s»"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "суперечливі параметри визначення ширини"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "некоректна довжина горизонту «%s»"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "неприпустима ширина табуляції «%s»"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "суперечливі параметри визначення ширини табуляції"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "необхідно вказати як --from-file, так і --to-file"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+" --normal вивести дані у форматі звичайного diff (типово)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief сповіщати лише про різні файли"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files сповіщати про однакові файли"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C КТЬ, --context[=КТЬ] вивести КТЬ (типово 3) рядки скопійованого "
+"контексту"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U ЧИСЛО, --unified[=ЧИСЛО] вивести ЧИСЛО (типово 3) рядків спільного "
+"контексту"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed вивести дані у форматі запису ed"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr ""
+"-n, --rcs виводити у форматі diff систем керування "
+"версіями"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side вивести дані у два стовпчики"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=ЧИСЛО виводити текст не більше ніж у ЧИСЛО (типово "
+"130) позицій у рядок"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column виводити спільні рядки лише у ліву колонку"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines не виводити однакові рядки"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function показати дані щодо функцій C у яких виявлено "
+"кожну зі змін"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+"-F, --show-function-line=RE показати останній рядок, що відповідає "
+"формальному виразу RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label МІТКА використати МІТКУ замість назви файла\n"
+" (можна використовувати декілька разів)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t --expand-tabs замінювати символи табуляції пробілами у виводі"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab вирівнювати табуляцію символами табуляції"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ЧИСЛО табуляція кожні ЧИСЛО позицій виведення "
+"(типово 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty не показувати пробіли або табуляції перед "
+"порожніми рядками"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l --paginate спрямувати дані до «pr» для розбиття на "
+"сторінки."
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive рекурсивно порівняти всі знайдені підкаталоги"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+" --no-dereference не переходити за символічними посиланнями"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file вважати незнайдені файли порожніми"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr ""
+" --unidirectional-new-file вважати незнайдені у першому джерелі файли "
+"порожніми"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case ігнорувати регістр назв файлів під час "
+"порівняння"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case враховувати регістр символів назв файлів"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr ""
+"-x --exclude=ЗРАЗОК виключити файли, назви яких відповідають "
+"ЗРАЗКУ"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=ФАЙЛ виключити файли, назви яких відповідають "
+"зразкам\n"
+" з файла."
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=ФАЙЛ починати порівняння каталогів на файлі ФАЙЛ"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=ФАЙЛ1 порівняти ФАЙЛ1 з усіма операндами;\n"
+" ФАЙЛ1 може бути каталогом"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=ФАЙЛ2 порівняти всі операнди з ФАЙЛОМ "
+"2; ФАЙЛ2 може бути каталогом."
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i --ignore-case ігнорувати регістр літер у вмісті файлів"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion ігнорувати зміни, викликані заміною "
+"табуляції пробілами"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ігнорувати пробіли наприкінці рядка"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change ігнорувати зміни у кількості пробілів"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space ігнорувати усі пробіли"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines ігнорувати зміни кількості порожніх рядків"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE ігнорувати зміни, які відповідають "
+"формальному виразу RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text вважати всі файли текстовими"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr вилучити з виведених даних всі завершальні "
+"символи нового рядка"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+" --binary читати та записувати файли у двійковій формі"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=НАЗВА виводити diff-блоки, що використовують "
+"конструкцію «#ifdef НАЗВА»."
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+" --ГТИП-group-format=ГФМТ форматувати вхідні групи типу ГТИП\n"
+" у відповідності до формату ГФМТ."
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=СФМТ форматувати всі вхідні рядки за допомогою "
+"СФМТ."
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+" --CТИП-group-format=СФМТ форматувати вхідні рядки типу СТИП\n"
+" у відповідності до формату СФМТ"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" За допомогою цих параметрів форматування можна точно налаштувати\n"
+" вивід diff, з узагальненням -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" СТИП може бути «old», «new» чи «unchanged», ГТИП — те саме або «changed»."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" ГФМТ може містити:\n"
+" %< рядки з ФАЙЛА1\n"
+" %> рядки з ФАЙЛА2\n"
+" %= рядки, спільні для ФАЙЛА1 та ФАЙЛА2\n"
+" %[-][ШИРИНА][.[ТОЧН]]{doxX}ЛІТЕРА формат для ЛІТЕРА у стилі printf\n"
+" ЛІТЕРА має наступні значення для нових груп, маленькі для старих:\n"
+" F номер першого рядка\n"
+" L номер останнього рядка\n"
+" N кількість рядків = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) якщо A дорівнює B, T, інакше E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" СФМТ може містити:\n"
+" %L вміст рядка\n"
+" %l вміст рядка без символу нового рядка наприкінці\n"
+" %[-][ШИРИНА][.[ТОЧН]]{doxX}n формат номеру вхідного рядка у стилі printf"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Обидва ГФМТ та СФМТ можуть містити:\n"
+" %% %\n"
+" %c'С' один символ С\n"
+" %c'\\OOO' один символ з вісімковим кодом OOO\n"
+" C символ C (інші символи не оброблятимуться)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal намагатись знайти найменший набір змін"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr ""
+" --horizon-lines=ЧИСЛО зберегти ЧИСЛО спільних рядків, до та після різних"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files вважати файли великими з багатьма розкиданими\n"
+" дрібними змінами."
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr ""
+" --normal вивести дані у форматі звичайного diff (типово)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+" --help показати це довідкове повідомлення і завершити "
+"роботу"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version показати дані щодо версії і завершити роботу"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"ФАЙЛИ — це «ФАЙЛ1 ФАЙЛ2», чи «КАТАЛОГ1 КАТАЛОГ2», чи «КАТАЛОГ ФАЙЛ...»,\n"
+"чи «ФАЙЛ... КАТАЛОГ»."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr "Якщо вказано --from-file чи --to-file, на ФАЙЛИ обмежень немає."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr ""
+"Якщо ФАЙЛ вказано як «-», дані буде прочитано зі стандартного потоку "
+"введення."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Використання: %s [КЛЮЧ]... ФАЙЛИ\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "Порівнює два файли за рядками."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "суперечливі значення %s для ключа «%s»"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "суперечливі ключі визначення стилю виводу"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "некоректна ширина «%s»"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Лише у %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "не можна порівнювати «-» з каталогом"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D параметр не підтримується для каталогів"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Спільні підкаталоги: %s та %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Файл %s це %s, тоді як файл %s -- %s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Символічні посилання %s і %s є різними\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Файли %s та %s ідентичні\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "несумісні ключі"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "«-» вказано для більш ніж одного вхідного файла"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "помилка читання"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A --show-all вивести всі зміни, беручи конфліктні місця у "
+"дужки."
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed вивести необ'єднані зміни у СТАРОМУ-ФАЙЛІ\n"
+" порівняно з ВАШИМ-ФАЙЛОМ до МОГО-ФАЙЛА."
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E --show-overlap подібно до -e, але з взяттям конфліктних місць у "
+"дужки"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only подібно до -e, але включити лише зміни без "
+"перекриття"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only подібно до -e, але включати лише зміни з "
+"перекриттям"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X подібно до -x, але з взяттям розбіжностей у дужки"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i дописувати команди «w» і «q» в кінець сценарію "
+"ed."
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge вивести дані до об'єднаного файла, відповідно "
+"до\n"
+" -A, якщо не вказано інших параметрів"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text вважати всі файли текстовими"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr вилучити з виведених даних всі завершальні "
+"символи нового рядка"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T --initial-tab вирівнювати табуляцію додаючи на початок символ "
+"табуляції"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=ПРОГРАМА використовувати для порівняння вказану ПРОГРАМУ"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=МІТКА використовувати МІТКУ замість назви файла\n"
+" (можна використовувати не більше трьох разів)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+" --help показати це довідкове повідомлення і завершити "
+"роботу"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version показати дані щодо версії і завершити роботу"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Використання: %s [КЛЮЧ]... МІЙ-ФАЙЛ СТАРИЙ-ФАЙЛ ВАШ-ФАЙЛ\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "Порівняння трьох файлів рядками."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Типовим форматом виведених даних є щось подібне до зручного для читання\n"
+"представлення змін.\n"
+"\n"
+"Параметри -e, -E, -x, -X (та відповідні розширені версії) призводять до\n"
+"виведення даних у форматі запису ed замість типового.\n"
+"\n"
+"Нарешті, параметр -m (--merge) призводить до об’єднання даних за допомогою\n"
+"diff3 з виводом їх до об’єднаного файла. Для нетипових вхідних даних\n"
+"такий варіант працює краще за варіант з використанням ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Код завершення дорівнює 0 при нормальному завершенні, 1 при конфліктах\n"
+" та 2 при несправностях."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "внутрішня помилка: пошкоджений формат diff-блоків"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: помилка при пошуку відмінностей: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr ""
+"внутрішня помилка: неправильний тип diff-блоку у функції `process_diff'"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "неправильний формат diff-файлу; неправильний розділювач змін"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "неправильний формат diff-файлу; неповний останній рядок"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "не вдається запустити допоміжну програму «%s»"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "неправильний diff-формат; неправильні перші символи рядка"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "внутрішня помилка: на вхід подано неправильний тип diff-файлу"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "вхідний файл зменшився"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "неможливо порівняти назви файлів «%s» та «%s»"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: зациклення рекурсивного проходу каталогів"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=ФАЙЛ інтерактивний режим із записом виводу до ФАЙЛА"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case ігнорувати регістр літер"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr ""
+"-E --ignore-tab-expansion ігнорувати зміни, викликані заміною табуляції "
+"пробілами"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space ігнорувати пробіли наприкінці рядка"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change ігнорувати зміни у кількості пробілів"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space ігнорувати усі пробіли"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr ""
+"-B --ignore-blank-lines ігнорувати зміни кількості порожніх рядків"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE ігнорувати зміни, які відповідають "
+"формальному виразу RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr вилучити з виведених даних всі завершальні "
+"символи нового рядка"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text вважати всі файли текстовими"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=ЧИСЛО виводити текст не більше ніж у ЧИСЛО (типово "
+"130) позицій у рядок"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, -left-column виводити спільні рядки лише у ліву колонку"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines не виводити спільні рядки"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t --expand-tabs замінювати символи табуляції пробілами у виводі"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=ЧИСЛО табуляція кожні ЧИСЛО позицій виведення (типово "
+"8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal намагатись знайти найменший набір змін"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, -speed-large-files вважати файли великими з багатьма розкиданими\n"
+" дрібними змінами."
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=ПРОГРАМА використовувати для порівняння вказану ПРОГРАМУ"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+" --help показати це довідкове повідомлення і завершити "
+"роботу"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr ""
+"-v, --version показати дані щодо версії і завершити роботу"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Використання: %s [КЛЮЧ]... ФАЙЛ1 ФАЙЛ2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Паралельне об’єднання файлів ФАЙЛ1 і ФАЙЛ2."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "не можна інтерактивно об'єднувати стандартний потік вводу"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "обидва файли, що порівнюються є каталогами"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tРедагувати та використовувати обидві версії, кожну із заголовком.\n"
+"eb:\tРедагувати та використовувати обидві версії.\n"
+"el або e1:\tРедагувати та використовувати ліву версію.\n"
+"er або e2:\tРедагувати та використовувати праву версію.\n"
+"e:\tВикористовувати нову версію.\n"
+"l або 1:\tВикористовувати ліву версію.\n"
+"r або 2:\tВикористовувати праву версію.\n"
+"s:\tВключати спільні рядки, без виводу повідомлень.\n"
+"v:\tВключати спільні рядки, виводячи повідомлення.\n"
+"q:\tВийти.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: невідомий параметр «--%s»\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
diff --git a/po/vi.gmo b/po/vi.gmo
new file mode 100644
index 0000000..7bd758c
--- /dev/null
+++ b/po/vi.gmo
Binary files differ
diff --git a/po/vi.po b/po/vi.po
new file mode 100644
index 0000000..b27d497
--- /dev/null
+++ b/po/vi.po
@@ -0,0 +1,1610 @@
+# Vietnamese translation for Diff Utils.
+# Copyright © 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Clytie Siddall <clytie@riverland.net.au>, 2005-2010.
+# Trần Ngọc Quân <vnwildman@gmail.com>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils-3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2012-11-01 13:51+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"
+"Team-Website: <http://translationproject.org/team/vi.html>\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: LocFactoryEditor 1.8\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "đối số %s%s không hợp lệ “%s”"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "đối số %s%s không hợp lệ “%s”"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "lỗi chương trình"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "stack bị tràn"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "Không biết lỗi hệ thống"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "tập tin trống thông thường"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "tập tin thường"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "thư mục"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "liên kết mềm"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "hàng đợi thông điệp"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "cờ hiệu"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "đối tượng bộ nhớ dùng chung"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "đối tượng bộ nhớ đánh loại"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "tập tin đặc biệt khối"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "tập tin đặc biệt ký tự"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo (vào trước, ra trước)"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "tập tin đặc biệt khối"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "tập tin đặc biệt ký tự"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "tập tin lạ"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "tập tin đặc biệt khối"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "tập tin lạ"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: tùy chọn “%s” chưa rõ ràng; khả năng là:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s: tùy chọn “-W %s” chưa rõ ràng\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, 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"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s: tùy chọn “%c%s” không cho phép đối số\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: tùy chọn “--%s” yêu cầu một đối số\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s: không nhận ra tùy chọn “--%s”\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s: không nhận ra tùy chọn “%c%s”\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: tùy chọn không hợp lệ -- “%c”\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, 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"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s: tùy chọn “-W %s” chưa rõ ràng\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, 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"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, 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"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "“"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Thành công"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Không có gì khớp"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Biểu thức chính quy không hợp lệ"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ký tự đối chiếu không hợp lệ"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Tên hạng ký tự không hợp lệ"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Có gạch ngược theo sau"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Tham chiếu trở lại không hợp lệ"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Chưa khớp [ hay [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Chưa khớp ( hay \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Chưa khớp \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Nội dung của \\{\\} không hợp lệ"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Kết thúc vùng không hợp lệ"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Hết bộ nhớ"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Biểu thức chính quy đi trước không hợp lệ"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Kết thức quá sớm của biểu thức chính quy"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Biểu thức chính quy quá lớn"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Chưa khớp ) hay \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "Không có biểu thức chính quy đi trước"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "hết bộ nhớ rồi"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "đầu vào tiêu chuẩn"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "đầu ra tiêu chuẩn"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "đầu lỗi tiêu chuẩn"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "không nhận ra luồng"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "lỗi mở lại %s với chế độ %s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "đối số %s%s không hợp lệ “%s”"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "gặp hậu tố không hợp lệ trong %s%s đối số “%s”"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s%s nhận đối số “%s” là quá lớn"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Gói đóng bởi %s (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Gói đóng bởi %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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"
+"Giấy phép GPL pb3+: Giấy phép Công cộng GNU phiên bản 3 hay sau\n"
+"<http://gnu.org/licenses/gpl.html>\n"
+"Đây là phần mềm tự do: bạn có quyền sửa đổ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"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Tác giả: %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Tác giả: %s và %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Tác giả: %s, %s, và %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Tác giả: %s, %s, %s,\n"
+"và %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.
+#: lib/version-etc.c:124
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Tác giả: %s, %s, %s,\n"
+"%s, %s, và %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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à người khác.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Thông báo lỗi nào cho: %s\n"
+"Thông báo lỗi dịch nào cho: <http://translationproject.org/team/vi.html>\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Thông báo lỗi %s nào cho: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Trang chủ %s: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "Trang chủ %s: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+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"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "Hai tập tin %s và %s là khác nhau.\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "Hai tập tin nhị phân %s và %s khác nhau\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "Không có ký tự dòng mới tại kêt thức tập tin."
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr "David MacKenzie"
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "Hãy chạy lệnh “%s --help” để xem thông tin thêm."
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr ""
+"giá trị của tùy chọn --ignore-initial (bỏ qua giá trị đầu) “%s” không hợp lệ"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "hai tùy chọn -l và -s không tương thích với nhau"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "không ghi được"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "thiết bị xuất chuẩn"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b, --print-bytes in ra những byte khác nhau."
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr ""
+"-i, --ignore-initial=SỐ bỏ qua SỐ byte khởi đầu của dữ liệu nhập"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=SỐ1:SỐ2 bỏ qua SỐ1 byte đầu của TỆP-TIN1 và\n"
+" SỐ2 byte đầu của TỆP-TIN2."
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr ""
+"-l, --verbose xuất số byte và giá trị của tất cả byte khác nhau"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=SỐ so sánh tối đa SỐ byte"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr "-s, --quiet, --silent loại bỏ tất cả các kết xuất thông thường"
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help hiển thị trợ giúp này rồi thoát"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "Cách dùng: %s [TÙY_CHỌN]... TẬP_TIN1 [TẬP_TIN2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "So sánh mỗi byte trong hai tập tin."
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr ""
+"Tùy chọn SKIP1 và SKIP2 chỉ định số byte sẽ được bỏ qua\n"
+"tại vị trí bắt đầu của mỗi tập tin (số không là mặc định)."
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr "Tùy chọn dài yêu cầu đối số thì tùy chọn ngắn cũng vậy.\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"SKIP có thể sử dụng một của những chữ theo đây để làm hệ số nhân:\n"
+"kB x 1000\t\tK x 1024\n"
+"MB x 1,000,000\t\tM x 1,048,576\n"
+"GB x 1,000,000,000\tG x 1,073,741,824\n"
+"tương tự với T, P, E, Z, Y v.v."
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "Nếu TẬP-TIN là “-”, hay bỏ trống, thì đọc từ đầu vào tiêu chuẩn."
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr ""
+"Trạng thái thoát là số 0 nếu hai đầu vào bằng nhau, số 1 nếu là khác nhau và "
+"số 2 nếu gặp lỗi."
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "giá trị cho tùy chọn --bytes “%s” không hợp lệ"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "thiếu toán hạng sau “%s”"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "toán hạng bổ xung “%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s có khác nhau: byte %s, dòng %s\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s có khác nhau: byte %s, dòng %s là %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp: gặp kết thức tập tin tại %s\n"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr "Paul Eggert"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr "Mike Haertel"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr "David Hayes"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "Richard Stallman"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr "Len Tower"
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "độ dài ngữ cảnh không hợp lệ “%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "máy chủ này không hỗ trợ dàn trang"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "quá nhiều tùy chọn nhãn tập tin"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "độ rộng không hợp lệ “%s”"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "nhiều tùy chọn độ rộng xung đột với nhau"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "độ dài chiều đứng không hợp lệ “%s”"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "cỡ ký tự tab không hợp lệ “%s”"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "nhiều tùy chọn cỡ ký tự tab xung đột với nhau"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr ""
+"ghi rõ cả hai tùy chọn --from-file (từ tập tin) và --to-file (vào tập tin) "
+"đều"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr ""
+" --normal xuất ra định dạng diff thông thường (mặc định)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr ""
+"-q, --brief chỉ báo cáo nếu những tập tin khác với nhau"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files báo cáo khi có hai tập tin bằng nhau"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+"-c, -C SỐ, --context[=SỐ] xuất ra SỐ (mặc định là 3) dòng của ngữ cảnh"
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr ""
+"-u, -U SỐ, --unified[=SỐ] xuất ra SỐ (mặc định là 3) dòng của ngữ cảnh "
+"hợp nhất"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed xuất tập lệnh loại ed"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr ""
+"-n, --rcs xuất dữ liệu khác biệt sử dụng định dạng RCS"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr "-y, --side-by-side xuất ra theo đinh dạng hai cột"
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-W, --width=SỐ xuất tối đa SỐ cột đã in ra (mặc định là 130)"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr ""
+" --left-column kết xuất chỉ cột bên trái của các dòng chung "
+"nhau"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines không kết xuất các dòng chung nhau"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+"-p, --show-c-function hiển thị cái mà từng hàm C thay đổi ở trong"
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr "-F, --show-function-line=RE hiển thị những dòng gần nhất khớp với RE"
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --label NHÃN sử dụng NHÃN thay vì tên tập tin\n"
+" (có thể được lặp lại)"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs mở rộng ký tự tab ra ký tự khoảng cách khi kết "
+"xuất"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab sắp xếp tất cả ký tự tab bằng cách thêm\n"
+" một tab vào trước"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=SỐ định khoảng cách tab sau mỗi SỐ cột đã in ra\n"
+" (mặc định là 8)"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+" --suppress-blank-empty thu hồi khoảng cách hay cột tab đằng trước "
+"dòng kết xuất trống"
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr ""
+"-l, --paginate chuyển dữ liệu kết xuất qua “pr” để dàn trang "
+"nó"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr ""
+"-r, --recursive so sánh đệ qui mọi thư mục con đã tìm thấy"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr " --no-dereference không theo liên kết mềm"
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file coi tập tin vắng mặt là trống"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr " --unidirectional-new-file coi tập tin đầu mà vắng mặt là trống"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr ""
+" --ignore-file-name-case bỏ qua chữ HOA/thường khi so sánh nhiều tên tập "
+"tin"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr ""
+" --no-ignore-file-name-case so sánh chữ HOA/thường khi so sánh tên tập "
+"tin"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=MẪU loại trừ các tập tin khớp với MẪU ấy"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr ""
+"-X, --exclude-from=TẬP_TIN loại trừ mọi tập tin khớp với bất cứ mẫu nào "
+"trong TẬP TIN ấy"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr ""
+"-S, --starting-file=TẬP_TIN bắt đầu với TẬP TIN khi so sánh nhiều thư mục"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=TẬP_TIN1 so TẬP TIN 1 với tất cả toán hạng;\n"
+" TẬP TIN 1 có thể là thư mục"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=TẬP_TIN2 So tất cả toán hạng với TẬP TIN 2;\n"
+" TẬP TIN 2 có thể là thư mục"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr ""
+"-i, --ignore-case không phân biệt chữ HOA/thường trong nội "
+"dung tập tin"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion bỏ qua mọi thay đổi do mở rộng tab"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space bỏ qua tất cả dấu cách ở cuối dòng"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr ""
+"-b, --ignore-space-change bỏ qua thay đổi gây ra bởi nhóm dấu cách"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space bỏ qua tất cả dấu cách"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B, --ignore-blank-lines bỏ qua thay đổi do dòng trống"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE bỏ qua thay đổi do mà mọi dòng khớp với RE"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text xử lý mọi tập tin là văn bản thường"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr cắt bỏ ký tự về đầu dòng (cr) theo sau khi gõ"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr ""
+" --binary đọc và ghi dữ liệu trong chế độ nhị phân"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=TÊN kết xuất tập tin đã trộn với khác biệt "
+"“#ifdef TÊN”"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT định dạng nhập GTYPE với GFMT "
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr ""
+" --line-format=LFMT định dạng tất cảc các dòng vào với LFMT"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT định dạng nhập LTYPE với LFMT"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+" Nhưng tùy chọn đó điểu khiển kết xuất ra định dạng diff\n"
+" đẹp hơn, khái quát hóa -D/--ifdef."
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE là “cũ”, “mới”, hoặc “chưa thay đổi”. GTYPE là LTYPE hoặc “thay đổi "
+"rồi”."
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT chỉ có thể chứa:\n"
+" %< dòng từ TẬP_TIN1\n"
+" %> dòng từ TẬP_TIN2\n"
+" %= dòng chung của TẬP_TIN1 và TẬP_TIN2\n"
+" %[-][ĐỘ_RỘNG][.[PREC]]{doxX}CHỮ dạng printf cho CHỮ ấy\n"
+" CHỮ HOA cho nhóm mới, chữ thường cho nhóm cũ:\n"
+" F số dòng đầu\n"
+" L số dòng cuối cùng\n"
+" N tổng số dòng = L-F+1\n"
+" E F-1\n"
+" M L+1 %(A=B?T:E) nếu A bằng B thì T nếu không thì E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT chỉ có thể chứa:\n"
+" %L nội dung của dòng\n"
+" %l nội dung của dòng, loại trừ ký tự dòng mới nào đi theo\n"
+" %[-][Đ_RỘNG][.[PREC]]{doxX}n đặc tả dạng printf cho số dòng đầu vào"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" Cả GFMT và LFMT có thể chứa:\n"
+" %% %\n"
+" %c'C' ký tự riêng lẻ C\n"
+" %c'\\OOO' ký tự có mã bát phân OOO\n"
+" C ký tự C (các ký tự khác đại diện cho chính chúng)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal cố tìm một thay đổi nhỏ"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr " --horizon-lines=SỐ giữ SỐ dòng của tiền tố và hậu tố chung"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr ""
+" --speed-large-files giả định tập tin lớn và nhiều thay đổi nhỏ rải rác"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr ""
+" --normal xuất ra định dạng diff thông thường (mặc định)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help hiển thị trợ giúp này rồi thoát"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"(CÁC) TẬP TIN là “TẬP_TIN1 TẬP_TIN2” hoặc “THƯ_MỤC1 THƯ_MỤC2” hoặc “THƯ_MỤC "
+"TẬP_TIN...” hay “TẬP_TIN... THƯ_MỤC”."
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr ""
+"Nếu đưa ra tùy chọn --from-file (từ tập tin) hay --to-file (vào tập tin) thì "
+"không có giới hạn TẬP TIN."
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "Nếu TẬP-TIN là “-”, thì đọc từ đầu vào tiêu chuẩn."
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "Cách dùng: %s [TÙY_CHỌN]... CÁC_TẬP_TIN\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "So sánh các TẬP-TIN theo từng dòng."
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "tùy chọn %s xung đột, giá trị “%s”"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "nhiều tùy chọn điều khiển định dạng xuất xung đột với nhau"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "độ rộng không hợp lệ “%s”"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "Chỉ trong %s: %s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "không thể so sánh “-” với một thư mục"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "không hỗ trợ tùy chọn -D với thư mục"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "Thư mục con chung: %s và %s\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "Tập tin %s là một %s trong khi tập tin %s là một %s.\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "Hai liên kết mềm %s và %s là khác nhau\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "Cả %s và %s là cùng một tập tin\n"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr "Randy Smith"
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "nhiều tùy chọn không tương thích với nhau"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "đã chỉ ra “-” cho nhiều hơn một tập tin đầu vào"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "đọc gặp lỗi"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr ""
+"-A, --show-all kết xuất tất cả thay đổi, đặt mọi xung đột trong "
+"ngoặc đơn"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed kết xuất script ed những thay đổi hợp nhất\n"
+" từ TẬP_TIN_CŨ thành TẬP_TIN_CỦA_BẠN vào "
+"TẬP_TIN_TÔI."
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr ""
+"-E, --show-overlap giống -e, nhưng đặt xung đột trong ngoặc đơn"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only giống -e, nhưng chỉ sát nhập những thay đổi "
+"không chồng lấp"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr ""
+"-x, --overlap-only giống -e, nhưng chỉ sát nhập những thay đổi bị "
+"chồng lấp"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+"-X giống -x, nhưng đặt xung đột trong ngoặc đơn"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr ""
+"-i nối thêm hai lệnh “w” và “q” vào văn lệnh ed"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+"-m, --merge kết xuất tập tin đã thực tế được hòa trộn, tuân "
+"theo\n"
+" tùy chọn -A nếu như không có tùy chọn khác "
+"được chỉ ra"
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text coi mọi tập tin là văn bản thường"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr cắt bỏ ký tự về đầu dòng (cr) theo sau khi nhập"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr ""
+"-T, --initial-tab tạo khoảng tab cho dòng bằng cách thêm một tab "
+"vào trước"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=CHƯƠNG_TRÌNH dùng CHƯƠNG_TRÌNH để so sánh các tập tin"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+"-L, --label=NHÃN sử dụng NHÃN thay vì tên tập tin\n"
+" (có thể lặp lại đến ba lần)"
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help hiển thị trợ giúp này rồi thoát"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "Cách dùng: %s [TÙY_CHỌN]... TẬP_TIN_TÔI TẬP_TIN_CŨ TẬP_TIN_BẠN\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "So sánh ba tập tin từng dòng một."
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+"\n"
+"Định dạng kết xuất mặc định là hơi khó để con người có thể đọc được\n"
+"các thay đổi là gì.\n"
+"\n"
+"Tùy chọn -e, -E, -x, -X (tương ứng với dạng dài) là căn nguyên kết xuất "
+"dạng\n"
+"bó lệnh ed thay vì kiểu mặc định.\n"
+"\n"
+"Cuối cùng, tùy chọn -m (--merge) là căn nguyên diff3 thực hiện việc trộn từ "
+"nội tại\n"
+"và kết xuất là tập tin đã được trộn. Với kiểu đầu vào ít dùng, đây là cách\n"
+"hợp lý hơn sử dụng ed.\n"
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr ""
+"Trạng thái thoát là số 0 nếu thành công, số 1 nếu có xung đột nào và số 2 "
+"nếu gặp lỗi."
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "gặp lỗi nội bộ: không định dạng khối khác biệt được."
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s: diff gặp lỗi: "
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr ""
+"gặp lỗi nội bộ: loại khác biệt không hợp lệ trong process_diff (xử lý khác "
+"biệt)"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "khuôn dạng diff không hợp lệ; ký tự ngăn cách thay đổi không hợp lê"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "khuôn dạng diff không hợp lệ; chưa xong dòng cuối cùng"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "không gọi được chương trình phụ trợ “%s”"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "khuôn dạng khác biệt không hợp lệ; ký tự đi trước dòng là không đúng"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "gặp lỗi nội bộ: kiểu diff không hợp lệ được chuyển qua cho kết xuất"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "tập tin đầu vào co lại"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "không so sánh được hai tập tin “%s” và “%s”"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s: vòng lặp thư mục đệ quy"
+
+# Tên họ
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr "Thomas Lord"
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr ""
+"-o, --output=TẬP_TIN Thực hiện một cách tương tác, gửi kết xuất ra "
+"TẬP-TIN"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case coi chữ HOA và thường là như nhau"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion bỏ qua mọi thay đổi do mở rộng tab"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space bỏ qua tất cả dấu cách ở cuối dòng"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change bỏ qua thay đổi gây ra bởi nhóm dấu cách"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space bỏ qua tất cả dấu cách"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines bỏ qua thay đổi do đó là dòng trống"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=RE bỏ qua thay đổi do mà mọi dòng khớp với RE"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr ""
+" --strip-trailing-cr cắt bỏ ký tự về đầu dòng (cr) theo sau khi gõ"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text coi mọi tập tin là văn bản thường"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr ""
+"-w, --width=SỐ kết xuất tối đa SỐ cột đã in ra (mặc định là "
+"130)"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr ""
+"-l, --left-column kết xuất chỉ cột bên trái của các dòng chung "
+"nhau"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines không kết xuất các dòng chung nhau"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr ""
+"-t, --expand-tabs mở rộng ký tự tab ra ký tự khoảng trắng khi kết "
+"xuất"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr ""
+" --tabsize=SỐ điểm đừng tab sau mỗi SỐ cột đã in ra (mặc định "
+"là 8)"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal cố tìm một thay đổi nhỏ"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files giả sử tập tin lớn, nhiều thay đổi nhỏ rải rác"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr ""
+" --diff-program=CHƯƠNG_TRÌNH sử dụng CHƯƠNG_TRÌNH ấy để so sánh các tập "
+"tin"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help hiển thị trợ giúp này rồi thoát"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version đưa ra thông tin phiên bản rồi thoát"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "Cách dùng: %s [TÙY_CHỌN]... TẬP_TIN1 TẬP_TIN2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "Hòa trộn những khác biệt TỆP_TIN1 VÀ TỆP_TIN2 cạnh nhau."
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "không hợp nhất được dữ liệu gõ chuẩn một cách tương tác"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "cả hai tập tin dùng để so sánh đều là thư mục"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\tSửa rồi sử dụng cả hai phiên bản; mỗi cái gắn thêm phần đầu.\n"
+"eb:\tSửa rồi sử dụng cả hai phiên bản.\n"
+"el hay e1:\tSửa rồi sử dụng phiên bản bên trái.\n"
+"er hay e2:\tSửa rồi sử dụng phiên bản bên phải.\n"
+"e:\tHủy cả hai phiên bản rồi sửa một phiên bản mới.\n"
+"l hay 1:\tSử dụng phiên bản bên trái.\n"
+"r hay 2:\tSử dụng phiên bản bên phải.\n"
+"s:\tBao gồm dòng chung nhưng không xuất chi tiết.\n"
+"v:\tBao gồm dòng chung xuất một cách chi tiết.\n"
+"q:\tThoát.\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s: không nhận ra tùy chọn “--%s”\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SỐ1:SỐ2 --ignore-initial=SỐ1:SỐ2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr ""
+#~ "-s --quiet --silent Không xuất gì; chỉ hiển thị tính trạng thoát thôi "
+#~ "(_im_)."
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help Xuất _trợ giúp_ này."
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ " -c -C SỐ \t--context[=SỐ] \tXuất SỐ dòng của _ngữ cảnh_ đã sao "
+#~ "chép.\n"
+#~ " -u -U SỐ \t--unified[=SỐ] \tXuất SỐ dòng của ngữ cảnh _đã thống "
+#~ "nhất_.\n"
+#~ " \t\t\t--label NHÃN \tSử dụng NHÃN thay thế tên tập tin.\n"
+#~ " -p \t\t--show-c-function \t_Hiển thị chức năng C_ của mỗi thay đổi.\n"
+#~ " -F RE --show-function-line=RE \n"
+#~ "\t\t\t_Hiển thị dòng_ gần đây nhất mà khớp với RE (_chức năng_)."
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ " -y \t--side-by-side \tXuất hai cột (_cạnh nhau_).\n"
+#~ " -W SỐ \t--width=SỐ \t\tXuất tối đa SỐ cột dữ liệu đã in ra (mặc định "
+#~ "là 130)\n"
+#~ "\t\t\t\t\t\t\t\t(_độ rộng_).\n"
+#~ " \t\t--left-column \tXuất chỉ _cột bên trái_ của dòng chung.\n"
+#~ " \t\t--suppress-common-lines \tKhông xuất dòng chung."
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr ""
+#~ "--speed-large-files Giả định _tập tin lớn_ và nhiều thay đổi nhỏ rải rác "
+#~ "(_tốc độ_)."
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr ""
+#~ "-X Xuất những thay đổi chồng lấp, cũng đặt mọi điều xung đột trong ngoặc "
+#~ "đơn."
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge Xuất tập tin đã _hợp nhất_ thay thế tập lệnh loại ed (mặc "
+#~ "định là -A)."
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L NHÃN --label=NHÃN Sử dụng NHÃN thay thế tên tập tin."
diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo
new file mode 100644
index 0000000..db269e4
--- /dev/null
+++ b/po/zh_CN.gmo
Binary files differ
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644
index 0000000..f3b5066
--- /dev/null
+++ b/po/zh_CN.po
@@ -0,0 +1,1526 @@
+# Chinese (simplified) translation for diffutils
+# Copyright (C) 2004, 2013 Free Software Foundation, Inc.
+# This file is distributed under the same license as the diffutils package.
+# Yingxin Zhou <eerd003@dlut.edu.cn>, 2004.
+# Anthony Fok <foka@debian.org>, 2013.
+# Mingye Wang (Arthur2e5) <arthur200126@gmail.com>, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 3.3-pre1\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2016-02-17 19:23+0100\n"
+"Last-Translator: Mingye Wang (Arthur2e5) <arthur200126@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-Generator: Poedit 1.8.7\n"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "无效的 %s%s 参数 “%s”"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "无效的 %s%s 参数 “%s”"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "程序错误"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "栈溢出"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "未知的系统错误"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "常规空文件"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "常规文件"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "目录"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "符号链接"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "消息队列"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "信号量"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "共享内存目标"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "分类内存目标"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "特殊块文件"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "特殊字符文件"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "有名管道"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "特殊块文件"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "特殊字符文件"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "奇怪的文件"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "特殊块文件"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "套接字"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "奇怪的文件"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s:选项 “%s” 意义不明确;可能性如下:"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s:选项 “-W %s” 意义不明确\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s:选项 “--%s” 不接受参数\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s:选项 “%c%s” 不接受参数\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s:选项 “%s” 需要一个参数\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s:选项 “--%s” 无法识别\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s:选项 “%c%s” 无法识别\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s:无效选项 -- “%c”\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s:选项需要一个参数 -- “%c”\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s:选项 “-W %s” 意义不明确\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s:选项 “-W %s” 不接受参数\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s:选项 “%s” 需要一个参数\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr "“"
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr "”"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "成功"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "没有匹配"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "无效的正则表达式"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "无效的对照字符"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "无效的字符种类名称"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "末端有多余的反斜号"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "无效的向后引用"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "没有匹配的 [ 或 [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "没有匹配的 ( 或 \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "没有匹配的 \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} 中的内容无效"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "范围末端字符无效"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "内存耗尽"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "无效的前导正则表达式"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "正则表达式过旱结束"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "正则表达式过大"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "没有匹配的 ) 或 \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "之前没有任何正则表达式"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "内存耗尽"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr "标准输入"
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr "标准输出"
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr "标准错误"
+
+#: lib/xfreopen.c:38
+msgid "unknown stream"
+msgstr "未知流"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr "未能以模式 %2$s 重打开 %1$s"
+
+#: lib/xstrtol-error.c:63
+#, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "无效的 %s%s 参数 “%s”"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr "在 %s%s 的参数 “%s” 中有无效的后缀"
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr "%s %s 参数 “%s” 太大"
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "由 %s 打包 (%s)\n"
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "由 %s 打包\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr "©"
+
+#: lib/version-etc.c:86
+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 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/"
+"gpl.html>。\n"
+"本软件是自由软件:您可以自由修改和重新发布它。\n"
+"在法律允许的范围内没有其他保证。\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "作者:%s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "作者:%s 和 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "作者:%s、%s 和 %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"作者:%s、%s、%s\n"
+"   和 %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"作者:%s、%s、%s、\n"
+"   %s 和 %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"作者:%s、%s、%s、\n"
+"   %s、%s 和 %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+"\n"
+"报告程序错误到: %s\n"
+"报告翻译错误到: https://translationproject.org/teams/zh_CN.html\n"
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+"报告 %1$s 程序错误到: %2$s\n"
+"报告 %1$s 翻译错误到: https://translationproject.org/teams/zh_CN.html\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s 主页: <%s>\n"
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr "%s 主页: <http://www.gnu.org/software/%s/>\n"
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr "使用 GNU 软件的通用帮助:<http://www.gnu.org/gethelp/>\n"
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "文件 %s 和 %s 不同\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "二进制文件 %s 和 %s 不同\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "文件尾没有换行符"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, c-format
+msgid "Try '%s --help' for more information."
+msgstr "请尝试 “%s --help”,以获得更多信息。"
+
+#: src/cmp.c:137
+#, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "无效的 --ignore-initial 值 “%s”"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "选项 -l 和 -s 不兼容"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "写入失败"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "标准输出"
+
+#: src/cmp.c:161
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes 打印出内容相异的字节"
+
+#: src/cmp.c:162
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr "-i, --ignore-initial=SKIP 两个输入内容都略过前 SKIP 字节"
+
+#: src/cmp.c:163
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr ""
+"-i, --ignore-initial=跳1:跳2 略过 <文件1> 的前 <跳1> 个字节和文件 <文件"
+"2>\n"
+" 的前 <跳2> 个字节。"
+
+#: src/cmp.c:165
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l, --verbose 输出所有相异字节的字节数和内容"
+
+#: src/cmp.c:166
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n, --bytes=限制 最多比较 <限制> 个字节"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr " --help 显示此帮助信息并退出"
+
+#: src/cmp.c:169
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version 输出版本信息并退出"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "用法: %s [选项]... 文件1 [文件2 [跳1 [跳2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "逐字节比较两个文件。"
+
+#: src/cmp.c:182
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr "<跳1> 和 <跳2> 分别是每个文件要略过的字节数。"
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr "长选项的必需参数也是相应短选项的必需参数。\n"
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"<跳> 值可以加上以下的单位:\n"
+"kB=1,000、K=1,024、MB=1,000,000、M=1,048,576、GB=1,000,000,000、"
+"G=107,374,182,\n"
+"还有 T、P、E、Z、Y,如此类推。"
+
+#: src/cmp.c:194
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "如果文件是 “-” 或没给出,则从标准输入读入内容。"
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr "如果输入相同,则退出状态为 0;1 表示输入不同;2 表示有错误产生。"
+
+#: src/cmp.c:240
+#, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "无效的 --bytes 值 `%s'"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, c-format
+msgid "missing operand after '%s'"
+msgstr "操作数 “%s” 后缺少参数"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, c-format
+msgid "extra operand '%s'"
+msgstr "多余的操作数 “%s”"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s 不同:第 %s 字节,第 %s 行\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%1$s %2$s 不同:第 %4$s 行,第 %3$s 字节为 %5$3o %6$s %7$3o %8$s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp:%s 已结束\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr "理查德·斯托曼"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, c-format
+msgid "invalid context length '%s'"
+msgstr "无效的上下文行数 “%s”"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "此系统不支持分页"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "过多的文件标号选项"
+
+#: src/diff.c:526
+#, c-format
+msgid "invalid width '%s'"
+msgstr "无效的宽度 “%s”"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "宽度选项冲突"
+
+#: src/diff.c:555
+#, c-format
+msgid "invalid horizon length '%s'"
+msgstr "无效的水平长度 “%s”"
+
+#: src/diff.c:611
+#, c-format
+msgid "invalid tabsize '%s'"
+msgstr "无效的制表符宽度 “%s”"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "的制表符选项冲突"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "同时指定了选项 --from-file 和 --to-file"
+
+#: src/diff.c:890
+msgid " --normal output a normal diff (the default)"
+msgstr " --normal 以正常的 diff 方式输出 (默认)"
+
+#: src/diff.c:891
+msgid "-q, --brief report only when files differ"
+msgstr "-q, --brief 只有在文件不同时报告"
+
+#: src/diff.c:892
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s, --report-identical-files 当两个一样时仍然显示结果"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr "-u, -U 数量, --unified[=数量] 输出 <数量>(默认为 3)行一致化上下文"
+
+#: src/diff.c:895
+msgid "-e, --ed output an ed script"
+msgstr "-e, --ed 以 ed script 方式输出"
+
+#: src/diff.c:896
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n, --rcs 以 RCS diff 格式输出"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-W, --width=数量 每行显示最多 <数量>(默认 130)个字符"
+
+#: src/diff.c:899
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr " --left-column 当有两行相同时只显示左边栏的一行"
+
+#: src/diff.c:900
+msgid " --suppress-common-lines do not output common lines"
+msgstr " --suppress-common-lines 当有两行相同时不显示"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+" --from-file=文件1 将<文件1>和操作数中的所有文件/目录作比较;\n"
+" <文件1>可以是目录"
+
+#: src/diff.c:907
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs 将输出中的 tab 转换成空格"
+
+#: src/diff.c:908
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T, --initial-tab 每行先加上 tab 字符,使 tab 字符可以对齐"
+
+#: src/diff.c:909
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr " --tabsize=数字 TAB 格的宽度,默认为 8 个打印列宽"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l, --paginate 将输出送至 “pr” 指令来分页"
+
+#: src/diff.c:913
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r, --recursive 连同所有子目录一起比较"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N, --new-file 不存在的文件以空文件方式处理"
+
+#: src/diff.c:916
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr " --unidirectional-new-file 若第一文件不存在,以空文件处理"
+
+#: src/diff.c:917
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr " --ignore-file-name-case 忽略文件名大小写的区别"
+
+#: src/diff.c:918
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr " --no-ignore-file-name-case 不忽略文件名大小写的区别"
+
+#: src/diff.c:919
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x, --exclude=模式 排除匹配 <模式> 的文件"
+
+#: src/diff.c:920
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr "-X, --exclude-from=文件 排除所有匹配在<文件>中列出的模式的文件"
+
+#: src/diff.c:921
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr "-S, --starting-file=文件 当比较目录時,由<文件>开始比较"
+
+#: src/diff.c:922
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+" --from-file=文件1 将<文件1>和操作数中的所有文件/目录作比较;\n"
+" <文件1>可以是目录"
+
+#: src/diff.c:924
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+" --to-file=文件2 将操作数中的所有文件/目录和<文件2>作比较;\n"
+" <文件2>可以是目录"
+
+#: src/diff.c:927
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i, --ignore-case 忽略文件内容大小写的区别"
+
+#: src/diff.c:928
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion 忽略由制表符宽度造成的差异"
+
+#: src/diff.c:929
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space 忽略每行末端的空格"
+
+#: src/diff.c:930
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change 忽略由空格数不同造成的差异"
+
+#: src/diff.c:931
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w, --ignore-all-space 忽略所有空格"
+
+#: src/diff.c:932
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B, --ignore-blank-lines 忽略任何因空行而造成的差异"
+
+#: src/diff.c:933
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=正则 若某行完全匹配 <正则>,则忽略由该行造成的差"
+"异"
+
+#: src/diff.c:935
+msgid "-a, --text treat all files as text"
+msgstr "-a, --text 所有文件都以文本方式处理"
+
+#: src/diff.c:936
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr 去除输入内容每行末端的回车(CR)字符"
+
+#: src/diff.c:938
+msgid " --binary read and write data in binary mode"
+msgstr " --binary 以二进制方式读写数据"
+
+#: src/diff.c:941
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr ""
+"-D, --ifdef=名称 输出的内容以 ‘#ifdef <名称>’ 方式标明差异"
+
+#: src/diff.c:942
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr " --GTYPE-group-format=GFMT 以 GFMT 格式处理 GTYPE 输入行组"
+
+#: src/diff.c:943
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr " --line-format=LFMT 以 LFMT 格式处理每一行资料"
+
+#: src/diff.c:944
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr " --LTYPE-line-format=LFMT 以 LFMT 格式处理 LTYPE 输入的行"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE 可以是 “old”、“new” 或 “unchanged”。GTYPE 可以是 LTYPE 的选择\n"
+" 或是 “changed”。"
+
+#: src/diff.c:948
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+"(仅)GFMT 可包括:\n"
+" %< 该组中每行属于<文件1>的差异\n"
+" %> 该组中每行属于<文件2>的差异\n"
+" %= 该组中同时在<文件1>和<文件2>出现的每一行\n"
+" %[-][宽度][.[精确度]]{doxX}字符 以 printf 格式表示该<字符>代表的内容\n"
+" 大写<字符>表示属于新的文件,小写表示属于旧的文件。<字符>的意义如下:\n"
+" F 行组中第一行的行号\n"
+" L 行组中最后一行的行号\n"
+" N 行数 ( =L-F+1 )\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) 如果 A 等于 B 那么 T 否则 E"
+
+#: src/diff.c:960
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+"(仅)LFMT 可包括:\n"
+" %L 该行的内容\n"
+" %l 该行的内容,但不包括结束的换行符\n"
+" %[-][宽度][.[精确度]]{doxX}n 以 printf 格式表示的输入行号"
+
+#: src/diff.c:964
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT 或 LFMT 都可包括:\n"
+" %% %\n"
+" %c'C' 单个字符 C\n"
+" %c'\\OOO' 八进制码 OOO 所代表的字符\n"
+" C 字符 C(处上述转义外的其他字符代表它们自身)"
+
+#: src/diff.c:970
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal 尽可能找出最小的差异。"
+
+#: src/diff.c:971
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr " --horizon-lines=数量 保持<数量>行的一致前后缀"
+
+#: src/diff.c:972
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr " --speed-large-files 假设文件十分大而且文件中含有许多微小的差异"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr " --normal 以正常的 diff 方式输出 (默认)"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr " --help 显示此帮助信息并退出"
+
+#: src/diff.c:979
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version 输出版本信息并退出"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"<文件们> 的格式可以是‘文件1 文件2’、‘目录1 目录2’、‘目录 文件...’或\n"
+" ‘文件... 目录’。"
+
+#: src/diff.c:982
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr "如果使用 --from-file 或 --to-file 选项,<文件名> 的格式则不受限制。"
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+msgid "If a FILE is '-', read standard input."
+msgstr "如果 FILE 是 “-”,则由标准输入读取内容。"
+
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "用法:%s [选项]... 文件们\n"
+
+#: src/diff.c:994
+msgid "Compare FILES line by line."
+msgstr "逐行比较<文件们>。"
+
+#: src/diff.c:1028
+#, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "互相冲突的 %s 选项,参数值为 “%s”"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "互相冲突的输出风格选项。"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "无效的宽度 “%s”"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "只在 %s 存在:%s\n"
+
+#: src/diff.c:1247
+msgid "cannot compare '-' to a directory"
+msgstr "“-” 无法与目录作比较"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D 选项不支持目录使用"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "%s 和 %s 有共同的子目录\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "文件 %s 是%s而文件 %s 是%s\n"
+
+#: src/diff.c:1369
+#, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "软链接 %s 和 %s 不同\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "檔案 %s 和 %s 相同\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr ""
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "不兼容的选项"
+
+#: src/diff3.c:388
+msgid "'-' specified for more than one input file"
+msgstr "“-”作输入文件不可多于一处"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "读取时失败"
+
+#: src/diff3.c:473
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A, --show-all 输出所有要更改的部份,并括上互相冲突的地方"
+
+#: src/diff3.c:475
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e, --ed 取出由 <旧文件> 至 <你的文件> 的更改部份,并输出"
+"可将此\n"
+" 改变应用至 <我的文件> 的 ed 脚本"
+
+#: src/diff3.c:477
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E, --show-overlap 类似 -e,但括上互相冲突的地方"
+
+#: src/diff3.c:478
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr ""
+"-3, --easy-only 类似 -e,但只输出未合并而且不重叠的更改部份"
+
+#: src/diff3.c:479
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x, --overlap-only 类似 -e,但只输出重叠的更改部份"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr "-X 类似 -x,但括上互相冲突的地方"
+
+#: src/diff3.c:481
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i 在 ed script 中附加‘w’和‘q’命令"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+msgid "-a, --text treat all files as text"
+msgstr "-a --text 所有文件都以文本方式处理"
+
+#: src/diff3.c:487
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr 去除输入内容每行末端的回车(CR)字符"
+
+#: src/diff3.c:488
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab 每行先加上 tab 字符,使 tab 字符可以对齐"
+
+#: src/diff3.c:489
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=程序 用<程序>来比较文件"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr " --help 显示此帮助信息并退出"
+
+#: src/diff3.c:494
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version 输出版本信息并退出"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "用法:%s [选项]... 我的文件 旧文件 你的文件\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "逐行比较三个文件。"
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "退出状态为 0 表示成功,1 表示冲突,2 表示有错误发生。"
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "内部错误:diff 区段的格式出错"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s:diff 失败:"
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "内部错误:process_diff 中的 diff 类型无效"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "无效的 diff 格式;表示内容改变的分隔字符串无效"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "无效的 diff 格式;最后一行不完整"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "无法调用辅助程序 “%s”"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "无效的 diff 格式;错误的行前导字符"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "内部错误:传递给输出的 diff 类型无效"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "输入文件缩小"
+
+#: src/dir.c:156
+#, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "无法比较文件名 “%s” 和 “%s”"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr "%s:递归目录循环"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr ""
+
+#: src/sdiff.c:173
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o, --output=文件 交互式操作,并将结果写入至<文件>"
+
+#: src/sdiff.c:175
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i, --ignore-case 忽略大小写的区别。"
+
+#: src/sdiff.c:176
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E, --ignore-tab-expansion 忽略由制表符宽度造成的差异"
+
+#: src/sdiff.c:177
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-Z, --ignore-trailing-space 忽略行末的空格字符"
+
+#: src/sdiff.c:178
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b, --ignore-space-change 忽略由空格数不同造成的差异"
+
+#: src/sdiff.c:179
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W, --ignore-all-space 忽略所有空白字符"
+
+#: src/sdiff.c:180
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B, --ignore-blank-lines 忽略任何因空行而造成的差异"
+
+#: src/sdiff.c:181
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I, --ignore-matching-lines=正则 若某行完全匹配 <正则>,则忽略由该行造成的差"
+"异"
+
+#: src/sdiff.c:182
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr " --strip-trailing-cr 去除输入内容每行末端的回车(CR)字符"
+
+#: src/sdiff.c:183
+msgid "-a, --text treat all files as text"
+msgstr "-a --text 所有文件都以文本方式处理"
+
+#: src/sdiff.c:185
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-W, --width=数量 每行显示最多 <数量>(默认 130)个字符"
+
+#: src/sdiff.c:186
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l, --left-column 当有两行相同时只显示左栏的一行"
+
+#: src/sdiff.c:187
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s, --suppress-common-lines 当有两行相同时不显示"
+
+#: src/sdiff.c:189
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t, --expand-tabs 将输出中的 tab 转换成空格"
+
+#: src/sdiff.c:190
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr " --tabsize=数字 TAB 格的宽度,默认为 8 个打印列宽"
+
+#: src/sdiff.c:192
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d, --minimal 尽可能找出最小的差异集"
+
+#: src/sdiff.c:193
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr ""
+"-H, --speed-large-files 假设文件十分大而且文件中含有许多微小的差异"
+
+#: src/sdiff.c:194
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr " --diff-program=程序 用<程序>来比较文件"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr " --help 显示此帮助信息并退出"
+
+#: src/sdiff.c:197
+msgid "-v, --version output version information and exit"
+msgstr "-v, --version 输出版本信息并退出"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "用法:%s [选项]... 文件1 文件2\n"
+
+#: src/sdiff.c:208
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "以并排方式合并文件之间的差异。"
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "不允许以交互方式合并标准输入的内容"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "两个要被比较的文件都是目录"
+
+#: src/sdiff.c:818
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:编辑然后同时使用两边的版本,各版本分别加上标头以识别。\n"
+"eb:编辑然后同时使用两边的版本。\n"
+"el 或 e1:编辑然后使用左边的版本。\n"
+"er 或 e2:编辑然后使用右边的版本。\n"
+"e :丢弃两者然后编辑新的版本。\n"
+"l 或 1:使用左边的版本。\n"
+"r 或 2:使用右边的版本。\n"
+"s :加上两边一样的行时不在输出上显示。\n"
+"v :加上两边一样的行时会在输出上显示。\n"
+"q :退出。\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s:选项 “--%s” 无法识别\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:非法选项 -- %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "本程序是自由软件;请参看源代码的版权声明。本软件不提供任何保证;\n"
+#~ "即使是商业的或为某一专用目的适用性保证也没有。\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent 无任何输出;只产生退出状态。"
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help 输入本帮助。"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "请向 <bug-gnu-utils@gnu.org> 报告错误。"
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "“-%ld” 选项已过时;请使用 “-%c %ld”"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "“-%ld” 选项已过时;忽略之"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C 行数 --context[=行数] 显示指定<行数>(默认 3 行)copied 格式的上下"
+#~ "文\n"
+#~ "-u -U 行数 --unified[=行数] 显示指定<行数>(默认 3 行)unified 格式的上下"
+#~ "文\n"
+#~ " --label 标识 使用<标识>代替文件名称。\n"
+#~ " -p --show-c-function 显示和每个差异有关的 C 函数名称。\n"
+#~ " -F RE --show-function-line=RE 显示最接近而符合<正则表示式>的一行。"
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side 以两列并排的方式显示。\n"
+#~ " -W NUM --width=NUM 每行显示最多 NUM (默认 130) 个字符。\n"
+#~ " --left-column 当有两行相同时只显示左边的一行。\n"
+#~ " --suppress-common-lines 当有两行相同时不会显示。"
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr "--speed-large-files 假设文件十分大而且其中含有许多微小的差异。"
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X 输出重叠的更改部份,并加上括号。"
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr "-m --merge 显示合并后的文件而不是 ed script (默认加上 -A)。"
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L 标识 --label=标识 以<标识>代替文件名称。"
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "找不到辅助程序 “%s”"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "辅助程序 “%s” 调用失败"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "辅助程序 “%s” 调用失败(退出状态:%d)"
diff --git a/po/zh_TW.gmo b/po/zh_TW.gmo
new file mode 100644
index 0000000..c41f67f
--- /dev/null
+++ b/po/zh_TW.gmo
Binary files differ
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100644
index 0000000..61b5dc2
--- /dev/null
+++ b/po/zh_TW.po
@@ -0,0 +1,1639 @@
+# traditional Chinese translation of diffutils.
+# Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+# Abel Cheung <maddog@linux.org.hk>, 2002, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: diffutils 2.8.7\n"
+"Report-Msgid-Bugs-To: bug-diffutils@gnu.org\n"
+"POT-Creation-Date: 2016-08-20 22:22-0700\n"
+"PO-Revision-Date: 2005-04-01 14:31+0800\n"
+"Last-Translator: Abel Cheung <maddog@linux.org.hk>\n"
+"Language-Team: Chinese (traditional) <zh-l10n@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"
+
+#: lib/argmatch.c:133
+#, fuzzy, c-format
+msgid "invalid argument %s for %s"
+msgstr "無效的 --bytes 值 ‘%s’"
+
+#: lib/argmatch.c:134
+#, c-format
+msgid "ambiguous argument %s for %s"
+msgstr ""
+
+#: lib/argmatch.c:153
+#, fuzzy
+msgid "Valid arguments are:"
+msgstr "無效的 --bytes 值 ‘%s’"
+
+#: lib/c-stack.c:204 lib/c-stack.c:297
+msgid "program error"
+msgstr "程式錯誤"
+
+#: lib/c-stack.c:205 lib/c-stack.c:298
+msgid "stack overflow"
+msgstr "堆疊溢位"
+
+#: lib/error.c:191
+msgid "Unknown system error"
+msgstr "不明的系統錯誤"
+
+#: lib/file-type.c:40
+msgid "regular empty file"
+msgstr "普通空白檔案"
+
+#: lib/file-type.c:40
+msgid "regular file"
+msgstr "普通檔案"
+
+#: lib/file-type.c:43
+msgid "directory"
+msgstr "目錄"
+
+#: lib/file-type.c:46
+msgid "symbolic link"
+msgstr "符號連結"
+
+#: lib/file-type.c:52
+msgid "message queue"
+msgstr "訊息佇列"
+
+#: lib/file-type.c:55
+msgid "semaphore"
+msgstr "semaphore"
+
+#: lib/file-type.c:58
+msgid "shared memory object"
+msgstr "分享記憶物件"
+
+#: lib/file-type.c:61
+msgid "typed memory object"
+msgstr "分類記憶物件"
+
+#: lib/file-type.c:66
+msgid "block special file"
+msgstr "區塊特殊檔案"
+
+#: lib/file-type.c:69
+msgid "character special file"
+msgstr "字元特殊檔案"
+
+#: lib/file-type.c:72
+msgid "contiguous data"
+msgstr ""
+
+#: lib/file-type.c:75
+msgid "fifo"
+msgstr "fifo"
+
+#: lib/file-type.c:78
+msgid "door"
+msgstr ""
+
+#: lib/file-type.c:81
+#, fuzzy
+msgid "multiplexed block special file"
+msgstr "區塊特殊檔案"
+
+#: lib/file-type.c:84
+#, fuzzy
+msgid "multiplexed character special file"
+msgstr "字元特殊檔案"
+
+#: lib/file-type.c:87
+msgid "multiplexed file"
+msgstr ""
+
+#: lib/file-type.c:90
+#, fuzzy
+msgid "named file"
+msgstr "不尋常的檔案"
+
+#: lib/file-type.c:93
+#, fuzzy
+msgid "network special file"
+msgstr "區塊特殊檔案"
+
+#: lib/file-type.c:96
+msgid "migrated file with data"
+msgstr ""
+
+#: lib/file-type.c:99
+msgid "migrated file without data"
+msgstr ""
+
+#: lib/file-type.c:102
+msgid "port"
+msgstr ""
+
+#: lib/file-type.c:105
+msgid "socket"
+msgstr "socket"
+
+#: lib/file-type.c:108
+msgid "whiteout"
+msgstr ""
+
+#: lib/file-type.c:110
+msgid "weird file"
+msgstr "不尋常的檔案"
+
+#: lib/getopt.c:575 lib/getopt.c:604
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s:選項‘%s’是不明確的\n"
+
+#: lib/getopt.c:619
+#, fuzzy, c-format
+msgid "%s: option '%s' is ambiguous\n"
+msgstr "%s:選項‘-W %s’是不明確的\n"
+
+#: lib/getopt.c:654 lib/getopt.c:658
+#, fuzzy, c-format
+msgid "%s: option '--%s' doesn't allow an argument\n"
+msgstr "%s:選項‘--%s’不可配合參數使用\n"
+
+#: lib/getopt.c:667 lib/getopt.c:672
+#, fuzzy, c-format
+msgid "%s: option '%c%s' doesn't allow an argument\n"
+msgstr "%s:選項‘%c%s’不可配合參數使用\n"
+
+#: lib/getopt.c:715 lib/getopt.c:734
+#, fuzzy, c-format
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s:選項‘%s’需要參數\n"
+
+#: lib/getopt.c:772 lib/getopt.c:775
+#, fuzzy, c-format
+msgid "%s: unrecognized option '--%s'\n"
+msgstr "%s:無法識別的選項‘--%s’\n"
+
+#: lib/getopt.c:783 lib/getopt.c:786
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%c%s'\n"
+msgstr "%s:無法識別的選項‘%c%s’\n"
+
+#: lib/getopt.c:835 lib/getopt.c:838
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s:無效的選項 ─ %c\n"
+
+#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s:選項需要參數 ─ %c\n"
+
+#: lib/getopt.c:964 lib/getopt.c:980
+#, fuzzy, c-format
+msgid "%s: option '-W %s' is ambiguous\n"
+msgstr "%s:選項‘-W %s’是不明確的\n"
+
+#: lib/getopt.c:1004 lib/getopt.c:1022
+#, fuzzy, c-format
+msgid "%s: option '-W %s' doesn't allow an argument\n"
+msgstr "%s:選項‘-W %s’不可配合參數使用\n"
+
+#: lib/getopt.c:1043 lib/getopt.c:1061
+#, fuzzy, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s:選項‘%s’需要參數\n"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'". For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this". You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:347
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:348
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "成功"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "沒有符合的字串"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "不正確的正規表示式"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "無效的 collation 字元"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "無效的字元種類名稱"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "末端有多餘的反斜號"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "無效的 back reference"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "沒有對應的 [ 或 [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "沒有對應的 ( 或 \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "沒有對應的 \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} 中的內容無效"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "範圍末端字元無效"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "記憶體耗盡"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "之前的正規表示式無效"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "正規表示式過早結束"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "正規表示式過長"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "沒有對應的 ) 或 \\)"
+
+#: lib/regcomp.c:687
+msgid "No previous regular expression"
+msgstr "之前沒有任何正規表示式"
+
+#: lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "記憶體耗盡"
+
+#: lib/xfreopen.c:35
+msgid "stdin"
+msgstr ""
+
+#: lib/xfreopen.c:36
+msgid "stdout"
+msgstr ""
+
+#: lib/xfreopen.c:37
+msgid "stderr"
+msgstr ""
+
+#: lib/xfreopen.c:38
+#, fuzzy
+msgid "unknown stream"
+msgstr "不明的系統錯誤"
+
+#: lib/xfreopen.c:39
+#, c-format
+msgid "failed to reopen %s with mode %s"
+msgstr ""
+
+#: lib/xstrtol-error.c:63
+#, fuzzy, c-format
+msgid "invalid %s%s argument '%s'"
+msgstr "無效的 --bytes 值 ‘%s’"
+
+#: lib/xstrtol-error.c:68
+#, c-format
+msgid "invalid suffix in %s%s argument '%s'"
+msgstr ""
+
+#: lib/xstrtol-error.c:72
+#, c-format
+msgid "%s%s argument '%s' too large"
+msgstr ""
+
+#: lib/version-etc.c:74
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:77
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale. Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:84
+msgid "(C)"
+msgstr ""
+
+#: lib/version-etc.c:86
+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 ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:102
+#, c-format
+msgid "Written by %s.\n"
+msgstr "由 %s 編寫。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:106
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "由 %s 和 %s 編寫。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:110
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "由 %s, %s 和 %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.
+#: lib/version-etc.c:117
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"由 %s, %s, %s\n"
+"和 %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.
+#: lib/version-etc.c:124
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"由 %s, %s, %s,\n"
+"%s 和 %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.
+#: lib/version-etc.c:131
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"由 %s, %s, %s,\n"
+"%s, %s 和 %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.
+#: lib/version-etc.c:139
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:147
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:156
+#, 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"
+
+#. 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.
+#: lib/version-etc.c:167
+#, 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"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package. Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:245
+#, c-format
+msgid ""
+"\n"
+"Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:247
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:253
+#, c-format
+msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+msgstr ""
+
+#: lib/version-etc.c:256
+msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+msgstr ""
+
+#: src/analyze.c:454 src/diff.c:1400
+#, c-format
+msgid "Files %s and %s differ\n"
+msgstr "檔案 %s 與 %s 不同\n"
+
+#: src/analyze.c:455
+#, c-format
+msgid "Binary files %s and %s differ\n"
+msgstr "二元碼檔 %s 與 %s 不同\n"
+
+#: src/analyze.c:697 src/diff3.c:1463 src/util.c:1255
+msgid "No newline at end of file"
+msgstr "檔案末沒有 newline 字元"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:43
+msgid "Torbjorn Granlund"
+msgstr "Torbjorn Granlund"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/cmp.c:44
+msgid "David MacKenzie"
+msgstr ""
+
+#: src/cmp.c:118 src/diff.c:875 src/diff3.c:459 src/sdiff.c:158
+#, fuzzy, c-format
+msgid "Try '%s --help' for more information."
+msgstr "請嘗試‘%s --help’來獲取更多資訊。"
+
+#: src/cmp.c:137
+#, fuzzy, c-format
+msgid "invalid --ignore-initial value '%s'"
+msgstr "無效的 --ignore-initial 值 ‘%s’"
+
+#: src/cmp.c:147
+#, c-format
+msgid "options -l and -s are incompatible"
+msgstr "-l 和 -s 選項不兼容"
+
+#: src/cmp.c:155 src/diff.c:884 src/diff3.c:467 src/sdiff.c:167 src/sdiff.c:315
+#: src/sdiff.c:322 src/sdiff.c:874 src/util.c:853 src/util.c:953 src/util.c:960
+msgid "write failed"
+msgstr "寫入失敗"
+
+#: src/cmp.c:157 src/diff.c:886 src/diff.c:1465 src/diff3.c:469 src/sdiff.c:169
+msgid "standard output"
+msgstr "標準輸出"
+
+#: src/cmp.c:161
+#, fuzzy
+msgid "-b, --print-bytes print differing bytes"
+msgstr "-b --print-bytes 印出相異位置的位元組。"
+
+#: src/cmp.c:162
+#, fuzzy
+msgid "-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"
+msgstr "-i SKIP --ignore-initial=SKIP 略過輸入資料的最初 SKIP 個位元組。"
+
+#: src/cmp.c:163
+#, fuzzy
+msgid ""
+"-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+" first SKIP2 bytes of FILE2"
+msgstr " 略過 FILE1 的最初 SKIP1 個位元組和 FILE2 的最初 SKIP2 個位元組。"
+
+#: src/cmp.c:165
+#, fuzzy
+msgid ""
+"-l, --verbose output byte numbers and differing byte values"
+msgstr "-l --verbose 顯示兩者所有相異的位置和它們的位元組數值。"
+
+#: src/cmp.c:166
+#, fuzzy
+msgid "-n, --bytes=LIMIT compare at most LIMIT bytes"
+msgstr "-n LIMIT --bytes=LIMIT 最多比較 LIMIT 個位元組。"
+
+#: src/cmp.c:167
+msgid "-s, --quiet, --silent suppress all normal output"
+msgstr ""
+
+#: src/cmp.c:168
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/cmp.c:169
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version 顯示版本資訊。"
+
+#: src/cmp.c:178
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"
+msgstr "用法:%s [選項]... 檔案1 [檔案2 [SKIP1 [SKIP2]]]\n"
+
+#: src/cmp.c:180
+msgid "Compare two files byte by byte."
+msgstr "比較兩個檔案的每一個位元組。"
+
+#: src/cmp.c:182
+#, fuzzy
+msgid ""
+"The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+"at the beginning of each file (zero by default)."
+msgstr "SKIP1 和 SKIP2 是每個檔案會略過的位元組數目。"
+
+#: src/cmp.c:185 src/diff.c:996 src/diff3.c:507 src/sdiff.c:210
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+
+#: src/cmp.c:191
+msgid ""
+"SKIP values may be followed by the following multiplicative suffixes:\n"
+"kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+"GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."
+msgstr ""
+"SKIP 值可以加上以下的單位:\n"
+"kB=1000、K=1024、MB=1000000、M=1048576、GB=1000000000、G=1073741824,\n"
+"還有 T、P、E、Z、Y 如此類推。"
+
+#: src/cmp.c:194
+#, fuzzy
+msgid "If a FILE is '-' or missing, read standard input."
+msgstr "如果檔案是‘-’或沒有指定,則由標準輸入讀入資料。"
+
+#: src/cmp.c:195 src/diff.c:984 src/sdiff.c:220
+msgid "Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."
+msgstr "如果兩邊內容一樣,回傳值是 0;1 代表兩邊內容不相同,2 代表有錯誤。"
+
+#: src/cmp.c:240
+#, fuzzy, c-format
+msgid "invalid --bytes value '%s'"
+msgstr "無效的 --bytes 值 ‘%s’"
+
+#: src/cmp.c:266 src/diff.c:793 src/diff3.c:353 src/sdiff.c:565
+#, fuzzy, c-format
+msgid "missing operand after '%s'"
+msgstr "‘%s’後缺少了參數"
+
+#: src/cmp.c:278 src/diff.c:795 src/diff3.c:355 src/sdiff.c:567
+#, fuzzy, c-format
+msgid "extra operand '%s'"
+msgstr "多餘的參數‘%s’"
+
+#: src/cmp.c:494
+#, c-format
+msgid "%s %s differ: byte %s, line %s\n"
+msgstr "%s %s 不同:第 %s 位元組,第 %s 行\n"
+
+#: src/cmp.c:510
+#, c-format
+msgid "%s %s differ: byte %s, line %s is %3o %s %3o %s\n"
+msgstr "%s %s 不同:第 %s 行,第 %s 位元組為 %3o %s %3o %s\n"
+
+#: src/cmp.c:562
+#, c-format
+msgid "cmp: EOF on %s\n"
+msgstr "cmp:%s 已結束\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:49
+msgid "Paul Eggert"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:50
+msgid "Mike Haertel"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:51
+msgid "David Hayes"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:52
+msgid "Richard Stallman"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff.c:53
+msgid "Len Tower"
+msgstr ""
+
+#: src/diff.c:351
+#, fuzzy, c-format
+msgid "invalid context length '%s'"
+msgstr "無效的上下文行數‘%s’"
+
+#: src/diff.c:434
+#, c-format
+msgid "pagination not supported on this host"
+msgstr "此系統不支援分頁"
+
+#: src/diff.c:449 src/diff3.c:335
+#, c-format
+msgid "too many file label options"
+msgstr "太多有關檔案標籤的選項"
+
+#: src/diff.c:526
+#, fuzzy, c-format
+msgid "invalid width '%s'"
+msgstr "無效的寬度‘%s’"
+
+#: src/diff.c:530
+msgid "conflicting width options"
+msgstr "出現互相抵觸的寬度選項"
+
+#: src/diff.c:555
+#, fuzzy, c-format
+msgid "invalid horizon length '%s'"
+msgstr "無效的水平長度 ‘%s’"
+
+#: src/diff.c:611
+#, fuzzy, c-format
+msgid "invalid tabsize '%s'"
+msgstr "無效的定位字元寬度 ‘%s’"
+
+#: src/diff.c:615
+msgid "conflicting tabsize options"
+msgstr "出現互相抵觸的定位字元寬度選項"
+
+#: src/diff.c:770
+msgid "--from-file and --to-file both specified"
+msgstr "同時指定了 --from-file 及 --to-file 選項"
+
+#: src/diff.c:890
+#, fuzzy
+msgid " --normal output a normal diff (the default)"
+msgstr "--normal 以正常的 diff 方式輸出。"
+
+#: src/diff.c:891
+#, fuzzy
+msgid "-q, --brief report only when files differ"
+msgstr "-q --brief 只顯示檔案是否不同。"
+
+#: src/diff.c:892
+#, fuzzy
+msgid "-s, --report-identical-files report when two files are the same"
+msgstr "-s --report-identical-files 當兩個檔案一樣時仍然顯示結果。"
+
+#: src/diff.c:893
+msgid ""
+"-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"
+msgstr ""
+
+#: src/diff.c:894
+#, fuzzy
+msgid ""
+"-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"
+msgstr "-w NUM --width=NUM 每行顯示最多 NUM(預設 130)個字元。"
+
+#: src/diff.c:895
+#, fuzzy
+msgid "-e, --ed output an ed script"
+msgstr "-e --ed 以 ed script 方式輸出。"
+
+#: src/diff.c:896
+#, fuzzy
+msgid "-n, --rcs output an RCS format diff"
+msgstr "-n --rcs 以 RCS diff 格式輸出。"
+
+#: src/diff.c:897
+msgid "-y, --side-by-side output in two columns"
+msgstr ""
+
+#: src/diff.c:898
+#, fuzzy
+msgid ""
+"-W, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-w NUM --width=NUM 每行顯示最多 NUM(預設 130)個字元。"
+
+#: src/diff.c:899
+#, fuzzy
+msgid ""
+" --left-column output only the left column of common lines"
+msgstr "-l --left-column 當有兩行相同時只顯示左邊的一行。"
+
+#: src/diff.c:900
+#, fuzzy
+msgid " --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines 當有兩行相同時不會顯示。"
+
+#: src/diff.c:902
+msgid "-p, --show-c-function show which C function each change is in"
+msgstr ""
+
+#: src/diff.c:903
+msgid "-F, --show-function-line=RE show the most recent line matching RE"
+msgstr ""
+
+#: src/diff.c:904
+#, fuzzy
+msgid ""
+" --label LABEL use LABEL instead of file name and timestamp\n"
+" (can be repeated)"
+msgstr ""
+"--from-file=FILE1 將 FILE1 和參數中的所有檔案/目錄作比較。FILE1 可以是目錄。"
+
+#: src/diff.c:907
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs 將輸出中的 tab 換成空格。"
+
+#: src/diff.c:908
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab 每行先加上 tab 字元,使 tab 字元可以對齊。"
+
+#: src/diff.c:909
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops every NUM (default 8) print columns"
+msgstr "--tabsize=NUM 定位字元 (tab) 的寬度,預設為 8 個空格。"
+
+#: src/diff.c:910
+msgid ""
+" --suppress-blank-empty suppress space or tab before empty output lines"
+msgstr ""
+
+#: src/diff.c:911
+#, fuzzy
+msgid "-l, --paginate pass output through 'pr' to paginate it"
+msgstr "-l --paginate 將輸出送至‘pr’指令來分頁。"
+
+#: src/diff.c:913
+#, fuzzy
+msgid ""
+"-r, --recursive recursively compare any subdirectories found"
+msgstr "-r --recursive 連同所有副目錄一起比較。"
+
+#: src/diff.c:914
+msgid " --no-dereference don't follow symbolic links"
+msgstr ""
+
+#: src/diff.c:915
+#, fuzzy
+msgid "-N, --new-file treat absent files as empty"
+msgstr "-N --new-file 不存在的檔案以空白檔案方式處理。"
+
+#: src/diff.c:916
+#, fuzzy
+msgid " --unidirectional-new-file treat absent first files as empty"
+msgstr "--unidirectional-new-file 若第一個檔案不存在,以空白檔案處理。"
+
+#: src/diff.c:917
+#, fuzzy
+msgid " --ignore-file-name-case ignore case when comparing file names"
+msgstr "--ignore-file-name-case 當比較檔案名稱時不分辨大小寫。"
+
+#: src/diff.c:918
+#, fuzzy
+msgid " --no-ignore-file-name-case consider case when comparing file names"
+msgstr "--no-ignore-file-name-case 當比較檔案名稱時會分辨大小寫。"
+
+#: src/diff.c:919
+#, fuzzy
+msgid "-x, --exclude=PAT exclude files that match PAT"
+msgstr "-x PAT --exclude=PAT 排除樣式為 PAT 的檔案。"
+
+#: src/diff.c:920
+#, fuzzy
+msgid ""
+"-X, --exclude-from=FILE exclude files that match any pattern in FILE"
+msgstr "-X FILE --exclude-from=FILE 排除所有在 FILE 中列出的樣式的檔案。"
+
+#: src/diff.c:921
+#, fuzzy
+msgid ""
+"-S, --starting-file=FILE start with FILE when comparing directories"
+msgstr "-S FILE --starting-file=FILE 當比較目錄時,由 FILE 開始比較。"
+
+#: src/diff.c:922
+#, fuzzy
+msgid ""
+" --from-file=FILE1 compare FILE1 to all operands;\n"
+" FILE1 can be a directory"
+msgstr ""
+"--from-file=FILE1 將 FILE1 和參數中的所有檔案/目錄作比較。FILE1 可以是目錄。"
+
+#: src/diff.c:924
+#, fuzzy
+msgid ""
+" --to-file=FILE2 compare all operands to FILE2;\n"
+" FILE2 can be a directory"
+msgstr ""
+"--to-file=FILE2 將參數中的所有檔案/目錄和 FILE2 作比較。FILE2 可以是目錄。"
+
+#: src/diff.c:927
+#, fuzzy
+msgid ""
+"-i, --ignore-case ignore case differences in file contents"
+msgstr "-i --ignore-case 不分辨檔案內容中的大小寫。"
+
+#: src/diff.c:928
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E --ignore-tab-expansion 忽略因將 tab 轉換為空格而造成的差異。"
+
+#: src/diff.c:929
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space 忽略所有空白字元。"
+
+#: src/diff.c:930
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change 忽略因空白字元數目不同而造成的差異。"
+
+#: src/diff.c:931
+#, fuzzy
+msgid "-w, --ignore-all-space ignore all white space"
+msgstr "-w --ignore-all-space 忽略所有空白字元。"
+
+#: src/diff.c:932
+#, fuzzy
+msgid ""
+"-B, --ignore-blank-lines ignore changes where lines are all blank"
+msgstr "-B --ignore-blank-lines 忽略任何因空行而造成的差異。"
+
+#: src/diff.c:933
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes where all lines match RE"
+msgstr ""
+"-I RE --ignore-matching-lines=RE 忽略任何符合指定的<正規表示式>的地方。"
+
+#: src/diff.c:935
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text 所有檔案都以文字檔方式處理。"
+
+#: src/diff.c:936
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr 去除輸入資料每行末端的 carriage return 字元。"
+
+#: src/diff.c:938
+#, fuzzy
+msgid " --binary read and write data in binary mode"
+msgstr "--binary 以二元碼檔模式讀寫資料。"
+
+#: src/diff.c:941
+#, fuzzy
+msgid ""
+"-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"
+msgstr "-D NAME --ifdef=NAME 輸出的資料以‘#ifdef NAME’方式標明差異。"
+
+#: src/diff.c:942
+#, fuzzy
+msgid " --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"
+msgstr ""
+"--GTYPE-group-format=GFMT 效果類似,但會以 GFMT 格式處理 GTYPE 輸入行組。"
+
+#: src/diff.c:943
+#, fuzzy
+msgid " --line-format=LFMT format all input lines with LFMT"
+msgstr "--line-format=LFMT 效果類似,但會以 LFMT 格式處理每一行資料。"
+
+#: src/diff.c:944
+#, fuzzy
+msgid " --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"
+msgstr ""
+"--LTYPE-line-format=LFMT 效果類似,但會以 LFMT 格式處理 LTYPE 輸入行組。"
+
+#: src/diff.c:945
+msgid ""
+" These format options provide fine-grained control over the output\n"
+" of diff, generalizing -D/--ifdef."
+msgstr ""
+
+#: src/diff.c:947
+#, fuzzy
+msgid " LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."
+msgstr ""
+" LTYPE 可以是‘old’、‘new’或‘unchanged’。GTYPE 可以是 LTYPE 的選擇\n"
+" 或是‘changed’。"
+
+#: src/diff.c:948
+#, fuzzy
+msgid ""
+" GFMT (only) may contain:\n"
+" %< lines from FILE1\n"
+" %> lines from FILE2\n"
+" %= lines common to FILE1 and FILE2\n"
+" %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n"
+" LETTERs are as follows for new group, lower case for old group:\n"
+" F first line number\n"
+" L last line number\n"
+" N number of lines = L-F+1\n"
+" E F-1\n"
+" M L+1\n"
+" %(A=B?T:E) if A equals B then T else E"
+msgstr ""
+" GFMT 可包括:\n"
+" %< 該組中每行屬於 FILE1 的差異\n"
+" %> 該組中每行屬於 FILE2 的差異\n"
+" %= 該組中同時在 FILE1 和 FILE2 出現的每一行\n"
+" %[-][寬度][.[精確度]]{doxX}字元 以 printf 格式表示該<字元>代表的資料\n"
+" 大寫<字元>表示屬於新的檔案,小寫表示屬於舊的檔案。<字元>的意義如下:\n"
+" F 行組中第一行的行號\n"
+" L 行組中最後一行的行號\n"
+" N 行數 ( =L-F+1 )\n"
+" E F-1\n"
+" M L+1"
+
+#: src/diff.c:960
+#, fuzzy
+msgid ""
+" LFMT (only) may contain:\n"
+" %L contents of line\n"
+" %l contents of line, excluding any trailing newline\n"
+" %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"
+msgstr ""
+" LFMT 可包括:\n"
+" %L 該行的內容\n"
+" %l 該行的內容,但不包括結束的 newline 字元\n"
+" %[-][寬度][.[精確度]]{doxX}n 以 printf 格式表示的輸入資料行號"
+
+#: src/diff.c:964
+#, fuzzy
+msgid ""
+" Both GFMT and LFMT may contain:\n"
+" %% %\n"
+" %c'C' the single character C\n"
+" %c'\\OOO' the character with octal code OOO\n"
+" C the character C (other characters represent themselves)"
+msgstr ""
+" GFMT 或 LFMT 可包括:\n"
+" %% %\n"
+" %c'C' 字元 C\n"
+" %c'\\OOO' 八進位數字 OOO 所代表的字元"
+
+#: src/diff.c:970
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal 盡可能找出最小的差異。"
+
+#: src/diff.c:971
+#, fuzzy
+msgid " --horizon-lines=NUM keep NUM lines of the common prefix and suffix"
+msgstr "--horizon-lines=NUM (此選項不作處理)"
+
+#: src/diff.c:972
+#, fuzzy
+msgid ""
+" --speed-large-files assume large files and many scattered small changes"
+msgstr "-H --speed-large-files 假設檔案十分大而且當中含有許多些微的差異。"
+
+#: src/diff.c:973
+msgid ""
+" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"
+msgstr ""
+
+#: src/diff.c:974
+#, fuzzy
+msgid " or 'auto' (the default)"
+msgstr "--normal 以正常的 diff 方式輸出。"
+
+#: src/diff.c:975
+msgid ""
+" --palette=PALETTE specify the colors to use when --color is active"
+msgstr ""
+
+#: src/diff.c:976
+msgid ""
+" PALETTE is a colon-separated list terminfo "
+"capabilities"
+msgstr ""
+
+#: src/diff.c:978
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff.c:979
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version 顯示版本資訊。"
+
+#: src/diff.c:981
+#, fuzzy
+msgid "FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."
+msgstr ""
+"FILES 的格式可以是‘FILE1 FILE2’、‘DIR1 DIR2’、‘DIR FILE...’或\n"
+" ‘FILE... DIR’。"
+
+#: src/diff.c:982
+#, fuzzy
+msgid ""
+"If --from-file or --to-file is given, there are no restrictions on FILE(s)."
+msgstr "如果使用 --from-file 或 --to-file 選項,FILES 的格式則不受限制。"
+
+#: src/diff.c:983 src/diff3.c:526 src/sdiff.c:219
+#, fuzzy
+msgid "If a FILE is '-', read standard input."
+msgstr "如果 FILE 是‘-’,則由標準輸入讀取資料。"
+
+# It is intentional *not* to translate FILES -- maddog
+#: src/diff.c:993
+#, c-format
+msgid "Usage: %s [OPTION]... FILES\n"
+msgstr "用法:%s [選項]... FILES\n"
+
+#: src/diff.c:994
+#, fuzzy
+msgid "Compare FILES line by line."
+msgstr "比較兩個檔案的每一行。"
+
+#: src/diff.c:1028
+#, fuzzy, c-format
+msgid "conflicting %s option value '%s'"
+msgstr "互相矛盾的 %s 選項,參數值為‘%s’"
+
+#: src/diff.c:1041
+#, c-format
+msgid "conflicting output style options"
+msgstr "互相矛盾的輸出模式選項"
+
+#: src/diff.c:1057
+#, fuzzy, c-format
+msgid "invalid color '%s'"
+msgstr "無效的寬度‘%s’"
+
+#: src/diff.c:1113 src/diff.c:1323
+#, c-format
+msgid "Only in %s: %s\n"
+msgstr "只在 %s 存在:%s\n"
+
+#: src/diff.c:1247
+#, fuzzy
+msgid "cannot compare '-' to a directory"
+msgstr "‘-’無法與目錄作比較"
+
+#: src/diff.c:1282
+msgid "-D option not supported with directories"
+msgstr "-D 選項不可配合目錄使用"
+
+#: src/diff.c:1291
+#, c-format
+msgid "Common subdirectories: %s and %s\n"
+msgstr "%s 和 %s 有共同的副目錄\n"
+
+#: src/diff.c:1333 src/diff.c:1383
+#, c-format
+msgid "File %s is a %s while file %s is a %s\n"
+msgstr "檔案 %s 是%s而檔案 %s 是%s\n"
+
+#: src/diff.c:1369
+#, fuzzy, c-format
+msgid "Symbolic links %s and %s differ\n"
+msgstr "檔案 %s 與 %s 不同\n"
+
+#: src/diff.c:1456
+#, c-format
+msgid "Files %s and %s are identical\n"
+msgstr "檔案 %s 和 %s 相同\n"
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/diff3.c:41
+msgid "Randy Smith"
+msgstr ""
+
+#: src/diff3.c:348
+#, c-format
+msgid "incompatible options"
+msgstr "不兼容的選項"
+
+#: src/diff3.c:388
+#, fuzzy
+msgid "'-' specified for more than one input file"
+msgstr "輸入檔‘-’不可多於一個"
+
+#: src/diff3.c:439 src/diff3.c:1288 src/diff3.c:1692 src/diff3.c:1747
+#: src/sdiff.c:307 src/sdiff.c:844 src/sdiff.c:855
+msgid "read failed"
+msgstr "讀取資料失敗"
+
+#: src/diff3.c:473
+#, fuzzy
+msgid "-A, --show-all output all changes, bracketing conflicts"
+msgstr "-A --show-all 顯示所有要更改的部份,並括上互相抵觸的地方。"
+
+#: src/diff3.c:475
+#, fuzzy
+msgid ""
+"-e, --ed output ed script incorporating changes\n"
+" from OLDFILE to YOURFILE into MYFILE"
+msgstr ""
+"-e --ed 取出由 OLDFILE 至 YOURFILE 的更改部份,並顯示可將此\n"
+" 部份套用至 MYFILE 的 ed script。"
+
+#: src/diff3.c:477
+#, fuzzy
+msgid "-E, --show-overlap like -e, but bracket conflicts"
+msgstr "-E --show-overlap 顯示未合併的更改部份,並括上互相抵觸的地方。"
+
+#: src/diff3.c:478
+#, fuzzy
+msgid ""
+"-3, --easy-only like -e, but incorporate only nonoverlapping "
+"changes"
+msgstr "-3 --easy-only 顯示未合併而且不重疊的更改部份。"
+
+#: src/diff3.c:479
+#, fuzzy
+msgid ""
+"-x, --overlap-only like -e, but incorporate only overlapping changes"
+msgstr "-x --overlap-only 只顯示重疊的更改部份。"
+
+#: src/diff3.c:480
+msgid "-X like -x, but bracket conflicts"
+msgstr ""
+
+#: src/diff3.c:481
+#, fuzzy
+msgid "-i append 'w' and 'q' commands to ed scripts"
+msgstr "-i 在 ed script 中附加‘w’和‘q’指令。"
+
+#: src/diff3.c:483
+msgid ""
+"-m, --merge output actual merged file, according to\n"
+" -A if no other options are given"
+msgstr ""
+
+#: src/diff3.c:486
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text 所有檔案都以文字檔方式處理。"
+
+#: src/diff3.c:487
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr 去除輸入資料每行末端的 carriage return 字元。"
+
+#: src/diff3.c:488
+#, fuzzy
+msgid "-T, --initial-tab make tabs line up by prepending a tab"
+msgstr "-T --initial-tab 每行先加上 tab 字元,使 tab 字元可以對齊。"
+
+#: src/diff3.c:489
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=程式 使用<程式>來比較檔案。"
+
+#: src/diff3.c:490
+msgid ""
+"-L, --label=LABEL use LABEL instead of file name\n"
+" (can be repeated up to three times)"
+msgstr ""
+
+#: src/diff3.c:493
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/diff3.c:494
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version 顯示版本資訊。"
+
+#: src/diff3.c:503
+#, c-format
+msgid "Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"
+msgstr "用法:%s [選項]... MYFILE OLDFILE YOURFILE\n"
+
+#: src/diff3.c:505
+msgid "Compare three files line by line."
+msgstr "比較三個檔案的每一行。"
+
+#: src/diff3.c:515
+msgid ""
+"\n"
+"The default output format is a somewhat human-readable representation of\n"
+"the changes.\n"
+"\n"
+"The -e, -E, -x, -X (and corresponding long) options cause an ed script\n"
+"to be output instead of the default.\n"
+"\n"
+"Finally, the -m (--merge) option causes diff3 to do the merge internally\n"
+"and output the actual merged file. For unusual input, this is more\n"
+"robust than using ed.\n"
+msgstr ""
+
+#: src/diff3.c:527
+msgid "Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
+msgstr "回傳值是 0 的話代表指令成功執行,1 代表內容有衝突,2 代表有錯誤。"
+
+#: src/diff3.c:720
+msgid "internal error: screwup in format of diff blocks"
+msgstr "內部錯誤:diff 區段的格式出錯"
+
+#: src/diff3.c:1015
+#, c-format
+msgid "%s: diff failed: "
+msgstr "%s:diff 失敗:"
+
+#: src/diff3.c:1037
+msgid "internal error: invalid diff type in process_diff"
+msgstr "內部錯誤:process_diff 中的 diff 類型無效"
+
+#: src/diff3.c:1062
+msgid "invalid diff format; invalid change separator"
+msgstr "無效的 diff 格式;表示資料變更的分隔字串無效"
+
+#: src/diff3.c:1298
+msgid "invalid diff format; incomplete last line"
+msgstr "無效的 diff 格式;最後一行不完整"
+
+#: src/diff3.c:1322 src/sdiff.c:275 src/util.c:970
+#, fuzzy, c-format
+msgid "subsidiary program '%s' could not be invoked"
+msgstr "子程式 ‘%s’ 無法執行"
+
+#: src/diff3.c:1347
+msgid "invalid diff format; incorrect leading line chars"
+msgstr "diff 格式無效;某行的第一個字元不正確"
+
+#: src/diff3.c:1420
+msgid "internal error: invalid diff type passed to output"
+msgstr "內部錯誤:準備輸出的 diff 資料類型無效"
+
+#: src/diff3.c:1694 src/diff3.c:1751
+msgid "input file shrank"
+msgstr "輸入檔縮小"
+
+#: src/dir.c:156
+#, fuzzy, c-format
+msgid "cannot compare file names '%s' and '%s'"
+msgstr "無法比較檔案 ‘%s’ 和 ‘%s’"
+
+#: src/dir.c:225
+#, c-format
+msgid "%s: recursive directory loop"
+msgstr ""
+
+#. This is a proper name. See the gettext manual, section Names.
+#: src/sdiff.c:42
+msgid "Thomas Lord"
+msgstr ""
+
+#: src/sdiff.c:173
+#, fuzzy
+msgid ""
+"-o, --output=FILE operate interactively, sending output to FILE"
+msgstr "-o 檔案 --output=檔案 互動式操作,並將結果寫入至<檔案>。"
+
+#: src/sdiff.c:175
+#, fuzzy
+msgid ""
+"-i, --ignore-case consider upper- and lower-case to be the same"
+msgstr "-i --ignore-case 不分辨檔案內容中的大小寫。"
+
+#: src/sdiff.c:176
+#, fuzzy
+msgid "-E, --ignore-tab-expansion ignore changes due to tab expansion"
+msgstr "-E --ignore-tab-expansion 忽略因將 tab 轉換為空格而造成的差異。"
+
+#: src/sdiff.c:177
+#, fuzzy
+msgid "-Z, --ignore-trailing-space ignore white space at line end"
+msgstr "-w --ignore-all-space 忽略所有空白字元。"
+
+#: src/sdiff.c:178
+#, fuzzy
+msgid ""
+"-b, --ignore-space-change ignore changes in the amount of white space"
+msgstr "-b --ignore-space-change 忽略因空白字元數目不同而造成的差異。"
+
+#: src/sdiff.c:179
+#, fuzzy
+msgid "-W, --ignore-all-space ignore all white space"
+msgstr "-W --ignore-all-space 忽略所有空白字元。"
+
+#: src/sdiff.c:180
+#, fuzzy
+msgid "-B, --ignore-blank-lines ignore changes whose lines are all blank"
+msgstr "-B --ignore-blank-lines 忽略任何因空行而造成的差異。"
+
+#: src/sdiff.c:181
+#, fuzzy
+msgid "-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"
+msgstr ""
+"-I RE --ignore-matching-lines=RE 忽略任何符合指定的<正規表示式>的地方。"
+
+#: src/sdiff.c:182
+#, fuzzy
+msgid " --strip-trailing-cr strip trailing carriage return on input"
+msgstr "--strip-trailing-cr 去除輸入資料每行末端的 carriage return 字元。"
+
+#: src/sdiff.c:183
+#, fuzzy
+msgid "-a, --text treat all files as text"
+msgstr "-a --text 所有檔案都以文字檔方式處理。"
+
+#: src/sdiff.c:185
+#, fuzzy
+msgid ""
+"-w, --width=NUM output at most NUM (default 130) print columns"
+msgstr "-w NUM --width=NUM 每行顯示最多 NUM(預設 130)個字元。"
+
+#: src/sdiff.c:186
+#, fuzzy
+msgid ""
+"-l, --left-column output only the left column of common lines"
+msgstr "-l --left-column 當有兩行相同時只顯示左邊的一行。"
+
+#: src/sdiff.c:187
+#, fuzzy
+msgid "-s, --suppress-common-lines do not output common lines"
+msgstr "-s --suppress-common-lines 當有兩行相同時不會顯示。"
+
+#: src/sdiff.c:189
+#, fuzzy
+msgid "-t, --expand-tabs expand tabs to spaces in output"
+msgstr "-t --expand-tabs 將輸出中的 tab 換成空格。"
+
+#: src/sdiff.c:190
+#, fuzzy
+msgid ""
+" --tabsize=NUM tab stops at every NUM (default 8) print columns"
+msgstr "--tabsize=NUM 定位字元 (tab) 的寬度,預設為 8 個空格。"
+
+#: src/sdiff.c:192
+#, fuzzy
+msgid "-d, --minimal try hard to find a smaller set of changes"
+msgstr "-d --minimal 盡可能找出最小的差異。"
+
+#: src/sdiff.c:193
+#, fuzzy
+msgid ""
+"-H, --speed-large-files assume large files, many scattered small changes"
+msgstr "-H --speed-large-files 假設檔案十分大而且當中含有許多些微的差異。"
+
+#: src/sdiff.c:194
+#, fuzzy
+msgid " --diff-program=PROGRAM use PROGRAM to compare files"
+msgstr "--diff-program=程式 使用<程式>來比較檔案。"
+
+#: src/sdiff.c:196
+msgid " --help display this help and exit"
+msgstr ""
+
+#: src/sdiff.c:197
+#, fuzzy
+msgid "-v, --version output version information and exit"
+msgstr "-v --version 顯示版本資訊。"
+
+#: src/sdiff.c:206
+#, c-format
+msgid "Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr "用法:%s [選項]... 檔案1 檔案2\n"
+
+#: src/sdiff.c:208
+#, fuzzy
+msgid "Side-by-side merge of differences between FILE1 and FILE2."
+msgstr "以並排方式合併檔案之間的差異。"
+
+#: src/sdiff.c:329
+msgid "cannot interactively merge standard input"
+msgstr "不允許以互動方式合併標準輸入的資料"
+
+#: src/sdiff.c:595
+msgid "both files to be compared are directories"
+msgstr "兩個要比較的都是目錄"
+
+#: src/sdiff.c:818
+#, fuzzy
+msgid ""
+"ed:\tEdit then use both versions, each decorated with a header.\n"
+"eb:\tEdit then use both versions.\n"
+"el or e1:\tEdit then use the left version.\n"
+"er or e2:\tEdit then use the right version.\n"
+"e:\tDiscard both versions then edit a new one.\n"
+"l or 1:\tUse the left version.\n"
+"r or 2:\tUse the right version.\n"
+"s:\tSilently include common lines.\n"
+"v:\tVerbosely include common lines.\n"
+"q:\tQuit.\n"
+msgstr ""
+"ed:\t編輯兩邊的版本合併後的資料,各版本分別加上標頭以資識別。\n"
+"eb:\t編輯兩邊的版本合併後的資料。\n"
+"el:\t使用左邊的版本來進行編輯。\n"
+"er:\t使用右邊的版本來進行編輯。\n"
+"e :\t編輯新的版本。\n"
+"l :\t使用左邊的版本。\n"
+"r :\t使用右邊的版本。\n"
+"s :\t加上兩邊一樣的行組時不在畫面顯示。\n"
+"v :\t加上兩邊一樣的行組時會在畫面顯示。\n"
+"q :\t離開。\n"
+
+#: src/util.c:663
+#, fuzzy, c-format
+msgid "unrecognized prefix: %s"
+msgstr "%s:無法識別的選項‘--%s’\n"
+
+#: src/util.c:693
+#, c-format
+msgid "unparsable value for --palette"
+msgstr ""
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:不合法的選項 ─ %c\n"
+
+#~ msgid ""
+#~ "This is free software; see the source for copying conditions. There is "
+#~ "NO\n"
+#~ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
+#~ "PURPOSE.\n"
+#~ msgstr ""
+#~ "本程式是自由軟體;請參考源代碼中的版權聲明。本軟體不提供任何保證,甚至不"
+#~ "會\n"
+#~ "包括可售性或適用於任何特定目的的保證。\n"
+
+#~ msgid "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+#~ msgstr "-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"
+
+#~ msgid "-s --quiet --silent Output nothing; yield exit status only."
+#~ msgstr "-s --quiet --silent 不輸出任何資訊;只產生回傳值。"
+
+#~ msgid "--help Output this help."
+#~ msgstr "--help 顯示此求助說明。"
+
+#~ msgid "Report bugs to <bug-gnu-utils@gnu.org>."
+#~ msgstr "請向 <bug-gnu-utils@gnu.org> 回報錯誤。"
+
+#~ msgid "`-%ld' option is obsolete; use `-%c %ld'"
+#~ msgstr "‘-%ld’ 選項已過時;請使用 ‘-%c %ld’"
+
+#~ msgid "`-%ld' option is obsolete; omit it"
+#~ msgstr "‘-%ld’ 選項已過時;會忽略此選項"
+
+#~ msgid ""
+#~ "-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied "
+#~ "context.\n"
+#~ "-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified "
+#~ "context.\n"
+#~ " --label LABEL Use LABEL instead of file name.\n"
+#~ " -p --show-c-function Show which C function each change is in.\n"
+#~ " -F RE --show-function-line=RE Show the most recent line matching RE."
+#~ msgstr ""
+#~ "-c -C 行數 --context[=行數] 顯示指定<行數>(預設 3 行)copied 格式的上下"
+#~ "文\n"
+#~ "-u -U 行數 --unified[=行數] 顯示指定<行數>(預設 3 行)unified 格式的上下"
+#~ "文\n"
+#~ " --label 標籤 使用<標籤>代替檔案名稱。\n"
+#~ " -p --show-c-function 顯示和每個差異有關的 C 函式名稱。\n"
+#~ " -F RE --show-function-line=RE 顯示最接近而符合<正規表示式>的一行。"
+
+#~ msgid ""
+#~ "-y --side-by-side Output in two columns.\n"
+#~ " -W NUM --width=NUM Output at most NUM (default 130) print columns.\n"
+#~ " --left-column Output only the left column of common lines.\n"
+#~ " --suppress-common-lines Do not output common lines."
+#~ msgstr ""
+#~ "-y --side-by-side 以兩列並排的方式顯示。\n"
+#~ " -W NUM --width=NUM 每行顯示最多 NUM (預設 130) 個字元。\n"
+#~ " --left-column 當有兩行相同時只顯示左邊的一行。\n"
+#~ " --suppress-common-lines 當有兩行相同時不會顯示。"
+
+#~ msgid ""
+#~ "--speed-large-files Assume large files and many scattered small changes."
+#~ msgstr "--speed-large-files 假設檔案十分大而且當中含有許多些微的差異。"
+
+#~ msgid "-X Output overlapping changes, bracketing them."
+#~ msgstr "-X 顯示重疊的更改部份,並括上記號。"
+
+#~ msgid "-m --merge Output merged file instead of ed script (default -A)."
+#~ msgstr ""
+#~ "-m --merge 顯示合併後的檔案而不是 ed script (預設加上 -A)。"
+
+#~ msgid "-L LABEL --label=LABEL Use LABEL instead of file name."
+#~ msgstr "-L 標籤 --label=標籤 以<標籤>代替檔案名稱。"
+
+#~ msgid "subsidiary program `%s' not found"
+#~ msgstr "找不到子程式 ‘%s’"
+
+#~ msgid "subsidiary program `%s' failed"
+#~ msgstr "程式 ‘%s’ 回傳錯誤"
+
+#~ msgid "subsidiary program `%s' failed (exit status %d)"
+#~ msgstr "子程式 ‘%s’ 發生錯誤 (回傳值為 %d)"
+
+#~ msgid ""
+#~ "This program comes with NO WARRANTY, to the extent permitted by law.\n"
+#~ "You may redistribute copies of this program\n"
+#~ "under the terms of the GNU General Public License.\n"
+#~ "For more information about these matters, see the files named COPYING."
+#~ msgstr ""
+#~ "此軟體在法律允許的限度之下不附帶任何保證。你可以根據 GNU General Public\n"
+#~ "License 中的條款重新散佈此軟體。詳情請參考檔案 COPYING。"
+
+#~ msgid "Written by Torbjorn Granlund and David MacKenzie."
+#~ msgstr "由 Torbjorn Granlund 及 David MacKenzie 編寫。"
+
+#~ msgid ""
+#~ "Written by Paul Eggert, Mike Haertel, David Hayes,\n"
+#~ "Richard Stallman, and Len Tower."
+#~ msgstr ""
+#~ "由 Paul Eggert、Mike Haertel、David Hayes、\n"
+#~ "Richard Stallman 和 Len Tower 編寫。"
+
+#~ msgid "subsidiary program `%s' not executable"
+#~ msgstr "所需的程式‘%s’無法執行"
+
+#~ msgid "--inhibit-hunk-merge Do not merge hunks."
+#~ msgstr "--inhibit-hunk-merge (此選項不作處理)"
+
+#~ msgid ""
+#~ "SKIP values may be followed by the following multiplicative suffixes:\n"
+#~ msgstr "SKIP 值可以加上以下的單位:\n"
+
+#~ msgid "kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n"
+#~ msgstr "kB 1000、K 1024、MB 1,000,000、M 1,048,576、\n"
+
+#~ msgid "GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n"
+#~ msgstr "GB 1,000,000,000、G 1,073,741,824、還有 T、P、E、Z、Y 如此類推。\n"
+
+#~ msgid "multiple `--from-file' options"
+#~ msgstr "‘--from-file’選項不可使用多於一次"
+
+#~ msgid "multiple `--to-file' options"
+#~ msgstr "‘--to-file’選項不可使用多於一次"
+
+#~ msgid "regular executable file"
+#~ msgstr "正常可執行檔"
+
+#~ msgid "If a FILE is `-', read standard input.\n"
+#~ msgstr "如果檔案是‘-’,則由標準輸入讀入資料。\n"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..167f7fd
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,77 @@
+# Automakefile for GNU diffutils programs.
+
+# Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2016 Free Software Foundation,
+# Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+bin_PROGRAMS = cmp diff diff3 sdiff
+
+localedir = $(datadir)/locale
+
+AM_CPPFLAGS = -I../lib -I$(top_srcdir)/lib
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
+LDADD = \
+ libver.a \
+ ../lib/libdiffutils.a \
+ $(LIBCSTACK) \
+ $(LIBINTL) \
+ $(LIBICONV) \
+ $(LIBSIGSEGV) \
+ $(LIB_CLOCK_GETTIME)
+
+diff_LDADD = $(LDADD)
+cmp_LDADD = $(LDADD)
+sdiff_LDADD = $(LDADD)
+diff3_LDADD = $(LDADD)
+
+cmp_SOURCES = cmp.c
+diff3_SOURCES = diff3.c
+sdiff_SOURCES = sdiff.c
+diff_SOURCES = \
+ analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
+ normal.c side.c util.c
+noinst_HEADERS = diff.h system.h
+
+MOSTLYCLEANFILES = paths.h paths.ht
+
+cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h
+
+gdiff = `echo diff|sed '$(transform)'`
+BUILT_SOURCES = paths.h
+paths.h: Makefile.am
+ $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \
+ echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@
+
+noinst_LIBRARIES = libver.a
+nodist_libver_a_SOURCES = version.c version.h
+
+BUILT_SOURCES += version.c
+version.c: Makefile
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)printf '#include <config.h>\n' > $@t
+ $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+
+BUILT_SOURCES += version.h
+version.h: Makefile
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)printf 'extern char const *Version;\n' > $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+
+DISTCLEANFILES = version.c version.h
+MAINTAINERCLEANFILES = $(BUILT_SOURCES)
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..a0f1c99
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1680 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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@
+
+# Automakefile for GNU diffutils programs.
+
+# Copyright (C) 2001-2002, 2006, 2009-2013, 2015-2016 Free Software Foundation,
+# Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+
+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@
+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@
+bin_PROGRAMS = cmp$(EXEEXT) diff$(EXEEXT) diff3$(EXEEXT) \
+ sdiff$(EXEEXT)
+subdir = src
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.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)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libver_a_AR = $(AR) $(ARFLAGS)
+libver_a_LIBADD =
+nodist_libver_a_OBJECTS = version.$(OBJEXT)
+libver_a_OBJECTS = $(nodist_libver_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_cmp_OBJECTS = cmp.$(OBJEXT)
+cmp_OBJECTS = $(am_cmp_OBJECTS)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = libver.a ../lib/libdiffutils.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+cmp_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_diff_OBJECTS = analyze.$(OBJEXT) context.$(OBJEXT) diff.$(OBJEXT) \
+ dir.$(OBJEXT) ed.$(OBJEXT) ifdef.$(OBJEXT) io.$(OBJEXT) \
+ normal.$(OBJEXT) side.$(OBJEXT) util.$(OBJEXT)
+diff_OBJECTS = $(am_diff_OBJECTS)
+diff_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_diff3_OBJECTS = diff3.$(OBJEXT)
+diff3_OBJECTS = $(am_diff3_OBJECTS)
+diff3_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_sdiff_OBJECTS = sdiff.$(OBJEXT)
+sdiff_OBJECTS = $(am_sdiff_OBJECTS)
+sdiff_DEPENDENCIES = $(am__DEPENDENCIES_2)
+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)/lib
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/analyze.Po ./$(DEPDIR)/cmp.Po \
+ ./$(DEPDIR)/context.Po ./$(DEPDIR)/diff.Po \
+ ./$(DEPDIR)/diff3.Po ./$(DEPDIR)/dir.Po ./$(DEPDIR)/ed.Po \
+ ./$(DEPDIR)/ifdef.Po ./$(DEPDIR)/io.Po ./$(DEPDIR)/normal.Po \
+ ./$(DEPDIR)/sdiff.Po ./$(DEPDIR)/side.Po ./$(DEPDIR)/util.Po \
+ ./$(DEPDIR)/version.Po
+am__mv = mv -f
+am__set_depbase = depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
+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 = $(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 = $(nodist_libver_a_SOURCES) $(cmp_SOURCES) $(diff_SOURCES) \
+ $(diff3_SOURCES) $(sdiff_SOURCES)
+DIST_SOURCES = $(cmp_SOURCES) $(diff_SOURCES) $(diff3_SOURCES) \
+ $(sdiff_SOURCES)
+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)
+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)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = $(datadir)/locale
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = -I../lib -I$(top_srcdir)/lib
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+LDADD = \
+ libver.a \
+ ../lib/libdiffutils.a \
+ $(LIBCSTACK) \
+ $(LIBINTL) \
+ $(LIBICONV) \
+ $(LIBSIGSEGV) \
+ $(LIB_CLOCK_GETTIME)
+
+diff_LDADD = $(LDADD)
+cmp_LDADD = $(LDADD)
+sdiff_LDADD = $(LDADD)
+diff3_LDADD = $(LDADD)
+cmp_SOURCES = cmp.c
+diff3_SOURCES = diff3.c
+sdiff_SOURCES = sdiff.c
+diff_SOURCES = \
+ analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
+ normal.c side.c util.c
+
+noinst_HEADERS = diff.h system.h
+MOSTLYCLEANFILES = paths.h paths.ht
+gdiff = `echo diff|sed '$(transform)'`
+BUILT_SOURCES = paths.h version.c version.h
+noinst_LIBRARIES = libver.a
+nodist_libver_a_SOURCES = version.c version.h
+DISTCLEANFILES = version.c version.h
+MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .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) --gnu src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/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)
+
+libver.a: $(libver_a_OBJECTS) $(libver_a_DEPENDENCIES) $(EXTRA_libver_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libver.a
+ $(AM_V_AR)$(libver_a_AR) libver.a $(libver_a_OBJECTS) $(libver_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libver.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+cmp$(EXEEXT): $(cmp_OBJECTS) $(cmp_DEPENDENCIES) $(EXTRA_cmp_DEPENDENCIES)
+ @rm -f cmp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(cmp_OBJECTS) $(cmp_LDADD) $(LIBS)
+
+diff$(EXEEXT): $(diff_OBJECTS) $(diff_DEPENDENCIES) $(EXTRA_diff_DEPENDENCIES)
+ @rm -f diff$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(diff_OBJECTS) $(diff_LDADD) $(LIBS)
+
+diff3$(EXEEXT): $(diff3_OBJECTS) $(diff3_DEPENDENCIES) $(EXTRA_diff3_DEPENDENCIES)
+ @rm -f diff3$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(diff3_OBJECTS) $(diff3_LDADD) $(LIBS)
+
+sdiff$(EXEEXT): $(sdiff_OBJECTS) $(sdiff_DEPENDENCIES) $(EXTRA_sdiff_DEPENDENCIES)
+ @rm -f sdiff$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(sdiff_OBJECTS) $(sdiff_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/analyze.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diff3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ed.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifdef.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/side.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@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)$(am__set_depbase) && \
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $<; \
+@am__fastdepCC_TRUE@ if test $$? = 0; then $(am__mv) $$depbase.Tpo $$depbase.Po; \
+@am__fastdepCC_TRUE@ else rm -f $$depbase.Tpo; false; fi
+@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)$(am__set_depbase) && \
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $$($(CYGPATH_W) $<); \
+@am__fastdepCC_TRUE@ if test $$? = 0; then $(am__mv) $$depbase.Tpo $$depbase.Po; \
+@am__fastdepCC_TRUE@ else rm -f $$depbase.Tpo; false; fi
+@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) $<)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(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-am
+
+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-am
+
+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: $(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
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+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:
+
+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)
+ -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-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/analyze.Po
+ -rm -f ./$(DEPDIR)/cmp.Po
+ -rm -f ./$(DEPDIR)/context.Po
+ -rm -f ./$(DEPDIR)/diff.Po
+ -rm -f ./$(DEPDIR)/diff3.Po
+ -rm -f ./$(DEPDIR)/dir.Po
+ -rm -f ./$(DEPDIR)/ed.Po
+ -rm -f ./$(DEPDIR)/ifdef.Po
+ -rm -f ./$(DEPDIR)/io.Po
+ -rm -f ./$(DEPDIR)/normal.Po
+ -rm -f ./$(DEPDIR)/sdiff.Po
+ -rm -f ./$(DEPDIR)/side.Po
+ -rm -f ./$(DEPDIR)/util.Po
+ -rm -f ./$(DEPDIR)/version.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/analyze.Po
+ -rm -f ./$(DEPDIR)/cmp.Po
+ -rm -f ./$(DEPDIR)/context.Po
+ -rm -f ./$(DEPDIR)/diff.Po
+ -rm -f ./$(DEPDIR)/diff3.Po
+ -rm -f ./$(DEPDIR)/dir.Po
+ -rm -f ./$(DEPDIR)/ed.Po
+ -rm -f ./$(DEPDIR)/ifdef.Po
+ -rm -f ./$(DEPDIR)/io.Po
+ -rm -f ./$(DEPDIR)/normal.Po
+ -rm -f ./$(DEPDIR)/sdiff.Po
+ -rm -f ./$(DEPDIR)/side.Po
+ -rm -f ./$(DEPDIR)/util.Po
+ -rm -f ./$(DEPDIR)/version.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ 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 maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h
+paths.h: Makefile.am
+ $(AM_V_GEN)(echo '#define DEFAULT_DIFF_PROGRAM "'$(gdiff)'"' && \
+ echo '#define LOCALEDIR "$(localedir)"') >$@t && mv $@t $@
+version.c: Makefile
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)printf '#include <config.h>\n' > $@t
+ $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+version.h: Makefile
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)printf 'extern char const *Version;\n' > $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+
+# 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/src/analyze.c b/src/analyze.c
new file mode 100644
index 0000000..3981872
--- /dev/null
+++ b/src/analyze.c
@@ -0,0 +1,707 @@
+/* Analyze file differences for GNU DIFF.
+
+ Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006-2007,
+ 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+#include <cmpbuf.h>
+#include <error.h>
+#include <file-type.h>
+#include <xalloc.h>
+
+/* The core of the Diff algorithm. */
+#define ELEMENT lin
+#define EQUAL(x,y) ((x) == (y))
+#define OFFSET lin
+#define EXTRA_CONTEXT_FIELDS /* none */
+#define NOTE_DELETE(c, xoff) (files[0].changed[files[0].realindexes[xoff]] = 1)
+#define NOTE_INSERT(c, yoff) (files[1].changed[files[1].realindexes[yoff]] = 1)
+#define USE_HEURISTIC 1
+#include <diffseq.h>
+
+/* Discard lines from one file that have no matches in the other file.
+
+ A line which is discarded will not be considered by the actual
+ comparison algorithm; it will be as if that line were not in the file.
+ The file's 'realindexes' table maps virtual line numbers
+ (which don't count the discarded lines) into real line numbers;
+ this is how the actual comparison algorithm produces results
+ that are comprehensible when the discarded lines are counted.
+
+ When we discard a line, we also mark it as a deletion or insertion
+ so that it will be printed in the output. */
+
+static void
+discard_confusing_lines (struct file_data filevec[])
+{
+ int f;
+ lin i;
+ char *discarded[2];
+ lin *equiv_count[2];
+ lin *p;
+
+ /* Allocate our results. */
+ p = xmalloc ((filevec[0].buffered_lines + filevec[1].buffered_lines)
+ * (2 * sizeof *p));
+ for (f = 0; f < 2; f++)
+ {
+ filevec[f].undiscarded = p; p += filevec[f].buffered_lines;
+ filevec[f].realindexes = p; p += filevec[f].buffered_lines;
+ }
+
+ /* Set up equiv_count[F][I] as the number of lines in file F
+ that fall in equivalence class I. */
+
+ p = zalloc (filevec[0].equiv_max * (2 * sizeof *p));
+ equiv_count[0] = p;
+ equiv_count[1] = p + filevec[0].equiv_max;
+
+ for (i = 0; i < filevec[0].buffered_lines; ++i)
+ ++equiv_count[0][filevec[0].equivs[i]];
+ for (i = 0; i < filevec[1].buffered_lines; ++i)
+ ++equiv_count[1][filevec[1].equivs[i]];
+
+ /* Set up tables of which lines are going to be discarded. */
+
+ discarded[0] = zalloc (filevec[0].buffered_lines
+ + filevec[1].buffered_lines);
+ discarded[1] = discarded[0] + filevec[0].buffered_lines;
+
+ /* Mark to be discarded each line that matches no line of the other file.
+ If a line matches many lines, mark it as provisionally discardable. */
+
+ for (f = 0; f < 2; f++)
+ {
+ size_t end = filevec[f].buffered_lines;
+ char *discards = discarded[f];
+ lin *counts = equiv_count[1 - f];
+ lin *equivs = filevec[f].equivs;
+ size_t many = 5;
+ size_t tem = end / 64;
+
+ /* Multiply MANY by approximate square root of number of lines.
+ That is the threshold for provisionally discardable lines. */
+ while ((tem = tem >> 2) > 0)
+ many *= 2;
+
+ for (i = 0; i < end; i++)
+ {
+ lin nmatch;
+ if (equivs[i] == 0)
+ continue;
+ nmatch = counts[equivs[i]];
+ if (nmatch == 0)
+ discards[i] = 1;
+ else if (nmatch > many)
+ discards[i] = 2;
+ }
+ }
+
+ /* Don't really discard the provisional lines except when they occur
+ in a run of discardables, with nonprovisionals at the beginning
+ and end. */
+
+ for (f = 0; f < 2; f++)
+ {
+ lin end = filevec[f].buffered_lines;
+ register char *discards = discarded[f];
+
+ for (i = 0; i < end; i++)
+ {
+ /* Cancel provisional discards not in middle of run of discards. */
+ if (discards[i] == 2)
+ discards[i] = 0;
+ else if (discards[i] != 0)
+ {
+ /* We have found a nonprovisional discard. */
+ register lin j;
+ lin length;
+ lin provisional = 0;
+
+ /* Find end of this run of discardable lines.
+ Count how many are provisionally discardable. */
+ for (j = i; j < end; j++)
+ {
+ if (discards[j] == 0)
+ break;
+ if (discards[j] == 2)
+ ++provisional;
+ }
+
+ /* Cancel provisional discards at end, and shrink the run. */
+ while (j > i && discards[j - 1] == 2)
+ discards[--j] = 0, --provisional;
+
+ /* Now we have the length of a run of discardable lines
+ whose first and last are not provisional. */
+ length = j - i;
+
+ /* If 1/4 of the lines in the run are provisional,
+ cancel discarding of all provisional lines in the run. */
+ if (provisional * 4 > length)
+ {
+ while (j > i)
+ if (discards[--j] == 2)
+ discards[j] = 0;
+ }
+ else
+ {
+ register lin consec;
+ lin minimum = 1;
+ lin tem = length >> 2;
+
+ /* MINIMUM is approximate square root of LENGTH/4.
+ A subrun of two or more provisionals can stand
+ when LENGTH is at least 16.
+ A subrun of 4 or more can stand when LENGTH >= 64. */
+ while (0 < (tem >>= 2))
+ minimum <<= 1;
+ minimum++;
+
+ /* Cancel any subrun of MINIMUM or more provisionals
+ within the larger run. */
+ for (j = 0, consec = 0; j < length; j++)
+ if (discards[i + j] != 2)
+ consec = 0;
+ else if (minimum == ++consec)
+ /* Back up to start of subrun, to cancel it all. */
+ j -= consec;
+ else if (minimum < consec)
+ discards[i + j] = 0;
+
+ /* Scan from beginning of run
+ until we find 3 or more nonprovisionals in a row
+ or until the first nonprovisional at least 8 lines in.
+ Until that point, cancel any provisionals. */
+ for (j = 0, consec = 0; j < length; j++)
+ {
+ if (j >= 8 && discards[i + j] == 1)
+ break;
+ if (discards[i + j] == 2)
+ consec = 0, discards[i + j] = 0;
+ else if (discards[i + j] == 0)
+ consec = 0;
+ else
+ consec++;
+ if (consec == 3)
+ break;
+ }
+
+ /* I advances to the last line of the run. */
+ i += length - 1;
+
+ /* Same thing, from end. */
+ for (j = 0, consec = 0; j < length; j++)
+ {
+ if (j >= 8 && discards[i - j] == 1)
+ break;
+ if (discards[i - j] == 2)
+ consec = 0, discards[i - j] = 0;
+ else if (discards[i - j] == 0)
+ consec = 0;
+ else
+ consec++;
+ if (consec == 3)
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /* Actually discard the lines. */
+ for (f = 0; f < 2; f++)
+ {
+ char *discards = discarded[f];
+ lin end = filevec[f].buffered_lines;
+ lin j = 0;
+ for (i = 0; i < end; ++i)
+ if (minimal || discards[i] == 0)
+ {
+ filevec[f].undiscarded[j] = filevec[f].equivs[i];
+ filevec[f].realindexes[j++] = i;
+ }
+ else
+ filevec[f].changed[i] = 1;
+ filevec[f].nondiscarded_lines = j;
+ }
+
+ free (discarded[0]);
+ free (equiv_count[0]);
+}
+
+/* Adjust inserts/deletes of identical lines to join changes
+ as much as possible.
+
+ We do something when a run of changed lines include a
+ line at one end and have an excluded, identical line at the other.
+ We are free to choose which identical line is included.
+ 'compareseq' usually chooses the one at the beginning,
+ but usually it is cleaner to consider the following identical line
+ to be the "change". */
+
+static void
+shift_boundaries (struct file_data filevec[])
+{
+ int f;
+
+ for (f = 0; f < 2; f++)
+ {
+ char *changed = filevec[f].changed;
+ char *other_changed = filevec[1 - f].changed;
+ lin const *equivs = filevec[f].equivs;
+ lin i = 0;
+ lin j = 0;
+ lin i_end = filevec[f].buffered_lines;
+
+ while (1)
+ {
+ lin runlength, start, corresponding;
+
+ /* Scan forwards to find beginning of another run of changes.
+ Also keep track of the corresponding point in the other file. */
+
+ while (i < i_end && !changed[i])
+ {
+ while (other_changed[j++])
+ continue;
+ i++;
+ }
+
+ if (i == i_end)
+ break;
+
+ start = i;
+
+ /* Find the end of this run of changes. */
+
+ while (changed[++i])
+ continue;
+ while (other_changed[j])
+ j++;
+
+ do
+ {
+ /* Record the length of this run of changes, so that
+ we can later determine whether the run has grown. */
+ runlength = i - start;
+
+ /* Move the changed region back, so long as the
+ previous unchanged line matches the last changed one.
+ This merges with previous changed regions. */
+
+ while (start && equivs[start - 1] == equivs[i - 1])
+ {
+ changed[--start] = 1;
+ changed[--i] = 0;
+ while (changed[start - 1])
+ start--;
+ while (other_changed[--j])
+ continue;
+ }
+
+ /* Set CORRESPONDING to the end of the changed run, at the last
+ point where it corresponds to a changed run in the other file.
+ CORRESPONDING == I_END means no such point has been found. */
+ corresponding = other_changed[j - 1] ? i : i_end;
+
+ /* Move the changed region forward, so long as the
+ first changed line matches the following unchanged one.
+ This merges with following changed regions.
+ Do this second, so that if there are no merges,
+ the changed region is moved forward as far as possible. */
+
+ while (i != i_end && equivs[start] == equivs[i])
+ {
+ changed[start++] = 0;
+ changed[i++] = 1;
+ while (changed[i])
+ i++;
+ while (other_changed[++j])
+ corresponding = i;
+ }
+ }
+ while (runlength != i - start);
+
+ /* If possible, move the fully-merged run of changes
+ back to a corresponding run in the other file. */
+
+ while (corresponding < i)
+ {
+ changed[--start] = 1;
+ changed[--i] = 0;
+ while (other_changed[--j])
+ continue;
+ }
+ }
+ }
+}
+
+/* Cons an additional entry onto the front of an edit script OLD.
+ LINE0 and LINE1 are the first affected lines in the two files (origin 0).
+ DELETED is the number of lines deleted here from file 0.
+ INSERTED is the number of lines inserted here in file 1.
+
+ If DELETED is 0 then LINE0 is the number of the line before
+ which the insertion was done; vice versa for INSERTED and LINE1. */
+
+static struct change *
+add_change (lin line0, lin line1, lin deleted, lin inserted,
+ struct change *old)
+{
+ struct change *new = xmalloc (sizeof *new);
+
+ new->line0 = line0;
+ new->line1 = line1;
+ new->inserted = inserted;
+ new->deleted = deleted;
+ new->link = old;
+ return new;
+}
+
+/* Scan the tables of which lines are inserted and deleted,
+ producing an edit script in reverse order. */
+
+static struct change *
+build_reverse_script (struct file_data const filevec[])
+{
+ struct change *script = 0;
+ char *changed0 = filevec[0].changed;
+ char *changed1 = filevec[1].changed;
+ lin len0 = filevec[0].buffered_lines;
+ lin len1 = filevec[1].buffered_lines;
+
+ /* Note that changedN[lenN] does exist, and is 0. */
+
+ lin i0 = 0, i1 = 0;
+
+ while (i0 < len0 || i1 < len1)
+ {
+ if (changed0[i0] | changed1[i1])
+ {
+ lin line0 = i0, line1 = i1;
+
+ /* Find # lines changed here in each file. */
+ while (changed0[i0]) ++i0;
+ while (changed1[i1]) ++i1;
+
+ /* Record this change. */
+ script = add_change (line0, line1, i0 - line0, i1 - line1, script);
+ }
+
+ /* We have reached lines in the two files that match each other. */
+ i0++, i1++;
+ }
+
+ return script;
+}
+
+/* Scan the tables of which lines are inserted and deleted,
+ producing an edit script in forward order. */
+
+static struct change *
+build_script (struct file_data const filevec[])
+{
+ struct change *script = 0;
+ char *changed0 = filevec[0].changed;
+ char *changed1 = filevec[1].changed;
+ lin i0 = filevec[0].buffered_lines, i1 = filevec[1].buffered_lines;
+
+ /* Note that changedN[-1] does exist, and is 0. */
+
+ while (i0 >= 0 || i1 >= 0)
+ {
+ if (changed0[i0 - 1] | changed1[i1 - 1])
+ {
+ lin line0 = i0, line1 = i1;
+
+ /* Find # lines changed here in each file. */
+ while (changed0[i0 - 1]) --i0;
+ while (changed1[i1 - 1]) --i1;
+
+ /* Record this change. */
+ script = add_change (i0, i1, line0 - i0, line1 - i1, script);
+ }
+
+ /* We have reached lines in the two files that match each other. */
+ i0--, i1--;
+ }
+
+ return script;
+}
+
+/* If CHANGES, briefly report that two files differed. */
+static void
+briefly_report (int changes, struct file_data const filevec[])
+{
+ if (changes)
+ message ((brief
+ ? _("Files %s and %s differ\n")
+ : _("Binary files %s and %s differ\n")),
+ file_label[0] ? file_label[0] : filevec[0].name,
+ file_label[1] ? file_label[1] : filevec[1].name);
+}
+
+/* Report the differences of two files. */
+int
+diff_2_files (struct comparison *cmp)
+{
+ int f;
+ struct change *e, *p;
+ struct change *script;
+ int changes;
+
+
+ /* If we have detected that either file is binary,
+ compare the two files as binary. This can happen
+ only when the first chunk is read.
+ Also, --brief without any --ignore-* options means
+ we can speed things up by treating the files as binary. */
+
+ if (read_files (cmp->file, files_can_be_treated_as_binary))
+ {
+ /* Files with different lengths must be different. */
+ if (cmp->file[0].stat.st_size != cmp->file[1].stat.st_size
+ && 0 < cmp->file[0].stat.st_size
+ && 0 < cmp->file[1].stat.st_size
+ && (cmp->file[0].desc < 0 || S_ISREG (cmp->file[0].stat.st_mode))
+ && (cmp->file[1].desc < 0 || S_ISREG (cmp->file[1].stat.st_mode)))
+ changes = 1;
+
+ /* Standard input equals itself. */
+ else if (cmp->file[0].desc == cmp->file[1].desc)
+ changes = 0;
+
+ else
+ /* Scan both files, a buffer at a time, looking for a difference. */
+ {
+ /* Allocate same-sized buffers for both files. */
+ size_t lcm_max = PTRDIFF_MAX - 1;
+ size_t buffer_size =
+ buffer_lcm (sizeof (word),
+ buffer_lcm (STAT_BLOCKSIZE (cmp->file[0].stat),
+ STAT_BLOCKSIZE (cmp->file[1].stat),
+ lcm_max),
+ lcm_max);
+ for (f = 0; f < 2; f++)
+ cmp->file[f].buffer = xrealloc (cmp->file[f].buffer, buffer_size);
+
+ for (;; cmp->file[0].buffered = cmp->file[1].buffered = 0)
+ {
+ /* Read a buffer's worth from both files. */
+ for (f = 0; f < 2; f++)
+ if (0 <= cmp->file[f].desc)
+ file_block_read (&cmp->file[f],
+ buffer_size - cmp->file[f].buffered);
+
+ /* If the buffers differ, the files differ. */
+ if (cmp->file[0].buffered != cmp->file[1].buffered
+ || memcmp (cmp->file[0].buffer,
+ cmp->file[1].buffer,
+ cmp->file[0].buffered))
+ {
+ changes = 1;
+ break;
+ }
+
+ /* If we reach end of file, the files are the same. */
+ if (cmp->file[0].buffered != buffer_size)
+ {
+ changes = 0;
+ break;
+ }
+ }
+ }
+
+ briefly_report (changes, cmp->file);
+ }
+ else
+ {
+ struct context ctxt;
+ lin diags;
+
+ /* Allocate vectors for the results of comparison:
+ a flag for each line of each file, saying whether that line
+ is an insertion or deletion.
+ Allocate an extra element, always 0, at each end of each vector. */
+
+ size_t s = cmp->file[0].buffered_lines + cmp->file[1].buffered_lines + 4;
+ char *flag_space = zalloc (s);
+ cmp->file[0].changed = flag_space + 1;
+ cmp->file[1].changed = flag_space + cmp->file[0].buffered_lines + 3;
+
+ /* Some lines are obviously insertions or deletions
+ because they don't match anything. Detect them now, and
+ avoid even thinking about them in the main comparison algorithm. */
+
+ discard_confusing_lines (cmp->file);
+
+ /* Now do the main comparison algorithm, considering just the
+ undiscarded lines. */
+
+ ctxt.xvec = cmp->file[0].undiscarded;
+ ctxt.yvec = cmp->file[1].undiscarded;
+ diags = (cmp->file[0].nondiscarded_lines
+ + cmp->file[1].nondiscarded_lines + 3);
+ ctxt.fdiag = xmalloc (diags * (2 * sizeof *ctxt.fdiag));
+ ctxt.bdiag = ctxt.fdiag + diags;
+ ctxt.fdiag += cmp->file[1].nondiscarded_lines + 1;
+ ctxt.bdiag += cmp->file[1].nondiscarded_lines + 1;
+
+ ctxt.heuristic = speed_large_files;
+
+ files[0] = cmp->file[0];
+ files[1] = cmp->file[1];
+
+ compareseq (0, cmp->file[0].nondiscarded_lines,
+ 0, cmp->file[1].nondiscarded_lines, &ctxt);
+
+ free (ctxt.fdiag - (cmp->file[1].nondiscarded_lines + 1));
+
+ /* Modify the results slightly to make them prettier
+ in cases where that can validly be done. */
+
+ shift_boundaries (cmp->file);
+
+ /* Get the results of comparison in the form of a chain
+ of 'struct change's -- an edit script. */
+
+ if (output_style == OUTPUT_ED)
+ script = build_reverse_script (cmp->file);
+ else
+ script = build_script (cmp->file);
+
+ /* Set CHANGES if we had any diffs.
+ If some changes are ignored, we must scan the script to decide. */
+ if (ignore_blank_lines || ignore_regexp.fastmap)
+ {
+ struct change *next = script;
+ changes = 0;
+
+ while (next && changes == 0)
+ {
+ struct change *this, *end;
+ lin first0, last0, first1, last1;
+
+ /* Find a set of changes that belong together. */
+ this = next;
+ end = find_change (next);
+
+ /* Disconnect them from the rest of the changes, making them
+ a hunk, and remember the rest for next iteration. */
+ next = end->link;
+ end->link = 0;
+
+ /* Determine whether this hunk is really a difference. */
+ if (analyze_hunk (this, &first0, &last0, &first1, &last1))
+ changes = 1;
+
+ /* Reconnect the script so it will all be freed properly. */
+ end->link = next;
+ }
+ }
+ else
+ changes = (script != 0);
+
+ if (brief)
+ briefly_report (changes, cmp->file);
+ else
+ {
+ if (changes || !no_diff_means_no_output)
+ {
+ /* Record info for starting up output,
+ to be used if and when we have some output to print. */
+ setup_output (file_label[0] ? file_label[0] : cmp->file[0].name,
+ file_label[1] ? file_label[1] : cmp->file[1].name,
+ cmp->parent != 0);
+
+ switch (output_style)
+ {
+ case OUTPUT_CONTEXT:
+ print_context_script (script, false);
+ break;
+
+ case OUTPUT_UNIFIED:
+ print_context_script (script, true);
+ break;
+
+ case OUTPUT_ED:
+ print_ed_script (script);
+ break;
+
+ case OUTPUT_FORWARD_ED:
+ pr_forward_ed_script (script);
+ break;
+
+ case OUTPUT_RCS:
+ print_rcs_script (script);
+ break;
+
+ case OUTPUT_NORMAL:
+ print_normal_script (script);
+ break;
+
+ case OUTPUT_IFDEF:
+ print_ifdef_script (script);
+ break;
+
+ case OUTPUT_SDIFF:
+ print_sdiff_script (script);
+ break;
+
+ default:
+ abort ();
+ }
+
+ finish_output ();
+ }
+ }
+
+ free (cmp->file[0].undiscarded);
+
+ free (flag_space);
+
+ for (f = 0; f < 2; f++)
+ {
+ free (cmp->file[f].equivs);
+ free (cmp->file[f].linbuf + cmp->file[f].linbuf_base);
+ }
+
+ for (e = script; e; e = p)
+ {
+ p = e->link;
+ free (e);
+ }
+
+ if (! ROBUST_OUTPUT_STYLE (output_style))
+ for (f = 0; f < 2; ++f)
+ if (cmp->file[f].missing_newline)
+ {
+ error (0, 0, "%s: %s\n",
+ file_label[f] ? file_label[f] : cmp->file[f].name,
+ _("No newline at end of file"));
+ changes = 2;
+ }
+ }
+
+ if (cmp->file[0].buffer != cmp->file[1].buffer)
+ free (cmp->file[0].buffer);
+ free (cmp->file[1].buffer);
+
+ return changes;
+}
diff --git a/src/cmp.c b/src/cmp.c
new file mode 100644
index 0000000..ba5553b
--- /dev/null
+++ b/src/cmp.c
@@ -0,0 +1,661 @@
+/* cmp - compare two files byte by byte
+
+ Copyright (C) 1990-1996, 1998, 2001-2002, 2004, 2006-2007, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "system.h"
+#include "paths.h"
+
+#include <stdio.h>
+
+#include <c-stack.h>
+#include <cmpbuf.h>
+#include <error.h>
+#include <exitfail.h>
+#include <file-type.h>
+#include <getopt.h>
+#include <hard-locale.h>
+#include <inttostr.h>
+#include <progname.h>
+#include <unlocked-io.h>
+#include <version-etc.h>
+#include <xalloc.h>
+#include <binary-io.h>
+#include <xstrtol.h>
+
+/* The official name of this program (e.g., no 'g' prefix). */
+#define PROGRAM_NAME "cmp"
+
+#define AUTHORS \
+ proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+ proper_name ("David MacKenzie")
+
+#if defined LC_MESSAGES && ENABLE_NLS
+# define hard_locale_LC_MESSAGES hard_locale (LC_MESSAGES)
+#else
+# define hard_locale_LC_MESSAGES 0
+#endif
+
+static int cmp (void);
+static off_t file_position (int);
+static size_t block_compare (word const *, word const *) _GL_ATTRIBUTE_PURE;
+static size_t count_newlines (char *, size_t);
+static void sprintc (char *, unsigned char);
+
+/* Filenames of the compared files. */
+static char const *file[2];
+
+/* File descriptors of the files. */
+static int file_desc[2];
+
+/* Status of the files. */
+static struct stat stat_buf[2];
+
+/* Read buffers for the files. */
+static word *buffer[2];
+
+/* Optimal block size for the files. */
+static size_t buf_size;
+
+/* Initial prefix to ignore for each file. */
+static off_t ignore_initial[2];
+
+/* Number of bytes to compare. */
+static uintmax_t bytes = UINTMAX_MAX;
+
+/* Output format. */
+static enum comparison_type
+ {
+ type_first_diff, /* Print the first difference. */
+ type_all_diffs, /* Print all differences. */
+ type_no_stdout, /* Do not output to stdout; only stderr. */
+ type_status /* Exit status only. */
+ } comparison_type;
+
+/* If nonzero, print values of bytes quoted like cat -t does. */
+static bool opt_print_bytes;
+
+/* Values for long options that do not have single-letter equivalents. */
+enum
+{
+ HELP_OPTION = CHAR_MAX + 1
+};
+
+static struct option const long_options[] =
+{
+ {"print-bytes", 0, 0, 'b'},
+ {"print-chars", 0, 0, 'c'}, /* obsolescent as of diffutils 2.7.3 */
+ {"ignore-initial", 1, 0, 'i'},
+ {"verbose", 0, 0, 'l'},
+ {"bytes", 1, 0, 'n'},
+ {"silent", 0, 0, 's'},
+ {"quiet", 0, 0, 's'},
+ {"version", 0, 0, 'v'},
+ {"help", 0, 0, HELP_OPTION},
+ {0, 0, 0, 0}
+};
+
+static void try_help (char const *, char const *) __attribute__((noreturn));
+static void
+try_help (char const *reason_msgid, char const *operand)
+{
+ if (reason_msgid)
+ error (0, 0, _(reason_msgid), operand);
+ error (EXIT_TROUBLE, 0,
+ _("Try '%s --help' for more information."), program_name);
+ abort ();
+}
+
+static char const valid_suffixes[] = "kKMGTPEZY0";
+
+/* Update ignore_initial[F] according to the result of parsing an
+ *operand ARGPTR of --ignore-initial, updating *ARGPTR to point
+ *after the operand. If DELIMITER is nonzero, the operand may be
+ *followed by DELIMITER; otherwise it must be null-terminated. */
+static void
+specify_ignore_initial (int f, char **argptr, char delimiter)
+{
+ uintmax_t val;
+ char const *arg = *argptr;
+ strtol_error e = xstrtoumax (arg, argptr, 0, &val, valid_suffixes);
+ if (! (e == LONGINT_OK
+ || (e == LONGINT_INVALID_SUFFIX_CHAR && **argptr == delimiter))
+ || TYPE_MAXIMUM (off_t) < val)
+ try_help ("invalid --ignore-initial value '%s'", arg);
+ if (ignore_initial[f] < val)
+ ignore_initial[f] = val;
+}
+
+/* Specify the output format. */
+static void
+specify_comparison_type (enum comparison_type t)
+{
+ if (comparison_type && comparison_type != t)
+ try_help ("options -l and -s are incompatible", 0);
+ comparison_type = t;
+}
+
+static void
+check_stdout (void)
+{
+ if (ferror (stdout))
+ error (EXIT_TROUBLE, 0, "%s", _("write failed"));
+ else if (fclose (stdout) != 0)
+ error (EXIT_TROUBLE, errno, "%s", _("standard output"));
+}
+
+static char const * const option_help_msgid[] = {
+ N_("-b, --print-bytes print differing bytes"),
+ N_("-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs"),
+ N_("-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and\n"
+ " first SKIP2 bytes of FILE2"),
+ N_("-l, --verbose output byte numbers and differing byte values"),
+ N_("-n, --bytes=LIMIT compare at most LIMIT bytes"),
+ N_("-s, --quiet, --silent suppress all normal output"),
+ N_(" --help display this help and exit"),
+ N_("-v, --version output version information and exit"),
+ 0
+};
+
+static void
+usage (void)
+{
+ char const * const *p;
+
+ printf (_("Usage: %s [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]\n"),
+ program_name);
+ printf ("%s\n", _("Compare two files byte by byte."));
+ printf ("\n%s\n\n",
+_("The optional SKIP1 and SKIP2 specify the number of bytes to skip\n"
+ "at the beginning of each file (zero by default)."));
+
+ fputs (_("\
+Mandatory arguments to long options are mandatory for short options too.\n\
+"), stdout);
+ for (p = option_help_msgid; *p; p++)
+ printf (" %s\n", _(*p));
+ printf ("\n%s\n\n%s\n%s\n",
+ _("SKIP values may be followed by the following multiplicative suffixes:\n\
+kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n\
+GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."),
+ _("If a FILE is '-' or missing, read standard input."),
+ _("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."));
+ emit_bug_reporting_address ();
+}
+
+int
+main (int argc, char **argv)
+{
+ int c, f, exit_status;
+ size_t words_per_buffer;
+
+ exit_failure = EXIT_TROUBLE;
+ initialize_main (&argc, &argv);
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ c_stack_action (0);
+
+ /* Parse command line options. */
+
+ while ((c = getopt_long (argc, argv, "bci:ln:sv", long_options, 0))
+ != -1)
+ switch (c)
+ {
+ case 'b':
+ case 'c': /* 'c' is obsolescent as of diffutils 2.7.3 */
+ opt_print_bytes = true;
+ break;
+
+ case 'i':
+ specify_ignore_initial (0, &optarg, ':');
+ if (*optarg++ == ':')
+ specify_ignore_initial (1, &optarg, 0);
+ else if (ignore_initial[1] < ignore_initial[0])
+ ignore_initial[1] = ignore_initial[0];
+ break;
+
+ case 'l':
+ specify_comparison_type (type_all_diffs);
+ break;
+
+ case 'n':
+ {
+ uintmax_t n;
+ if (xstrtoumax (optarg, 0, 0, &n, valid_suffixes) != LONGINT_OK)
+ try_help ("invalid --bytes value '%s'", optarg);
+ if (n < bytes)
+ bytes = n;
+ }
+ break;
+
+ case 's':
+ specify_comparison_type (type_status);
+ break;
+
+ case 'v':
+ version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version,
+ AUTHORS, (char *) NULL);
+ check_stdout ();
+ return EXIT_SUCCESS;
+
+ case HELP_OPTION:
+ usage ();
+ check_stdout ();
+ return EXIT_SUCCESS;
+
+ default:
+ try_help (0, 0);
+ }
+
+ if (optind == argc)
+ try_help ("missing operand after '%s'", argv[argc - 1]);
+
+ file[0] = argv[optind++];
+ file[1] = optind < argc ? argv[optind++] : "-";
+
+ for (f = 0; f < 2 && optind < argc; f++)
+ {
+ char *arg = argv[optind++];
+ specify_ignore_initial (f, &arg, 0);
+ }
+
+ if (optind < argc)
+ try_help ("extra operand '%s'", argv[optind]);
+
+ for (f = 0; f < 2; f++)
+ {
+ /* If file[1] is "-", treat it first; this avoids a misdiagnostic if
+ stdin is closed and opening file[0] yields file descriptor 0. */
+ int f1 = f ^ (STREQ (file[1], "-"));
+
+ /* Two files with the same name and offset are identical.
+ But wait until we open the file once, for proper diagnostics. */
+ if (f && ignore_initial[0] == ignore_initial[1]
+ && file_name_cmp (file[0], file[1]) == 0)
+ return EXIT_SUCCESS;
+
+ if (STREQ (file[f1], "-"))
+ {
+ file_desc[f1] = STDIN_FILENO;
+ if (O_BINARY && ! isatty (STDIN_FILENO))
+ set_binary_mode (STDIN_FILENO, O_BINARY);
+ }
+ else
+ file_desc[f1] = open (file[f1], O_RDONLY | O_BINARY, 0);
+
+ if (file_desc[f1] < 0 || fstat (file_desc[f1], stat_buf + f1) != 0)
+ {
+ if (file_desc[f1] < 0 && comparison_type == type_status)
+ exit (EXIT_TROUBLE);
+ else
+ error (EXIT_TROUBLE, errno, "%s", file[f1]);
+ }
+ }
+
+ /* If the files are links to the same inode and have the same file position,
+ they are identical. */
+
+ if (0 < same_file (&stat_buf[0], &stat_buf[1])
+ && same_file_attributes (&stat_buf[0], &stat_buf[1])
+ && file_position (0) == file_position (1))
+ return EXIT_SUCCESS;
+
+ /* If output is redirected to the null device, we can avoid some of
+ the work. */
+
+ if (comparison_type != type_status)
+ {
+ struct stat outstat, nullstat;
+
+ if (fstat (STDOUT_FILENO, &outstat) == 0
+ && stat (NULL_DEVICE, &nullstat) == 0
+ && 0 < same_file (&outstat, &nullstat))
+ comparison_type = type_no_stdout;
+ }
+
+ /* If only a return code is needed,
+ and if both input descriptors are associated with plain files,
+ conclude that the files differ if they have different sizes
+ and if more bytes will be compared than are in the smaller file. */
+
+ if (comparison_type == type_status
+ && S_ISREG (stat_buf[0].st_mode)
+ && S_ISREG (stat_buf[1].st_mode))
+ {
+ off_t s0 = stat_buf[0].st_size - file_position (0);
+ off_t s1 = stat_buf[1].st_size - file_position (1);
+ if (s0 < 0)
+ s0 = 0;
+ if (s1 < 0)
+ s1 = 0;
+ if (s0 != s1 && MIN (s0, s1) < bytes)
+ exit (EXIT_FAILURE);
+ }
+
+ /* Get the optimal block size of the files. */
+
+ buf_size = buffer_lcm (STAT_BLOCKSIZE (stat_buf[0]),
+ STAT_BLOCKSIZE (stat_buf[1]),
+ PTRDIFF_MAX - sizeof (word));
+
+ /* Allocate word-aligned buffers, with space for sentinels at the end. */
+
+ words_per_buffer = (buf_size + 2 * sizeof (word) - 1) / sizeof (word);
+ buffer[0] = xmalloc (2 * sizeof (word) * words_per_buffer);
+ buffer[1] = buffer[0] + words_per_buffer;
+
+ exit_status = cmp ();
+
+ for (f = 0; f < 2; f++)
+ if (close (file_desc[f]) != 0)
+ error (EXIT_TROUBLE, errno, "%s", file[f]);
+ if (exit_status != EXIT_SUCCESS && comparison_type < type_no_stdout)
+ check_stdout ();
+ exit (exit_status);
+ return exit_status;
+}
+
+/* Compare the two files already open on 'file_desc[0]' and 'file_desc[1]',
+ using 'buffer[0]' and 'buffer[1]'.
+ Return EXIT_SUCCESS if identical, EXIT_FAILURE if different,
+ >1 if error. */
+
+static int
+cmp (void)
+{
+ off_t line_number = 1; /* Line number (1...) of difference. */
+ off_t byte_number = 1; /* Byte number (1...) of difference. */
+ uintmax_t remaining = bytes; /* Remaining number of bytes to compare. */
+ size_t read0, read1; /* Number of bytes read from each file. */
+ size_t first_diff; /* Offset (0...) in buffers of 1st diff. */
+ size_t smaller; /* The lesser of 'read0' and 'read1'. */
+ word *buffer0 = buffer[0];
+ word *buffer1 = buffer[1];
+ char *buf0 = (char *) buffer0;
+ char *buf1 = (char *) buffer1;
+ int differing = 0;
+ int f;
+ int offset_width IF_LINT (= 0);
+
+ if (comparison_type == type_all_diffs)
+ {
+ off_t byte_number_max = MIN (bytes, TYPE_MAXIMUM (off_t));
+
+ for (f = 0; f < 2; f++)
+ if (S_ISREG (stat_buf[f].st_mode))
+ {
+ off_t file_bytes = stat_buf[f].st_size - file_position (f);
+ if (file_bytes < byte_number_max)
+ byte_number_max = file_bytes;
+ }
+
+ for (offset_width = 1; (byte_number_max /= 10) != 0; offset_width++)
+ continue;
+ }
+
+ for (f = 0; f < 2; f++)
+ {
+ off_t ig = ignore_initial[f];
+ if (ig && file_position (f) == -1)
+ {
+ /* lseek failed; read and discard the ignored initial prefix. */
+ do
+ {
+ size_t bytes_to_read = MIN (ig, buf_size);
+ size_t r = block_read (file_desc[f], buf0, bytes_to_read);
+ if (r != bytes_to_read)
+ {
+ if (r == SIZE_MAX)
+ error (EXIT_TROUBLE, errno, "%s", file[f]);
+ break;
+ }
+ ig -= r;
+ }
+ while (ig);
+ }
+ }
+
+ do
+ {
+ size_t bytes_to_read = buf_size;
+
+ if (remaining != UINTMAX_MAX)
+ {
+ if (remaining < bytes_to_read)
+ bytes_to_read = remaining;
+ remaining -= bytes_to_read;
+ }
+
+ read0 = block_read (file_desc[0], buf0, bytes_to_read);
+ if (read0 == SIZE_MAX)
+ error (EXIT_TROUBLE, errno, "%s", file[0]);
+ read1 = block_read (file_desc[1], buf1, bytes_to_read);
+ if (read1 == SIZE_MAX)
+ error (EXIT_TROUBLE, errno, "%s", file[1]);
+
+ smaller = MIN (read0, read1);
+
+ /* Optimize the common case where the buffers are the same. */
+ if (memcmp (buf0, buf1, smaller) == 0)
+ first_diff = smaller;
+ else
+ {
+ /* Insert sentinels for the block compare. */
+ buf0[read0] = ~buf1[read0];
+ buf1[read1] = ~buf0[read1];
+
+ first_diff = block_compare (buffer0, buffer1);
+ }
+
+ byte_number += first_diff;
+ if (comparison_type == type_first_diff)
+ line_number += count_newlines (buf0, first_diff);
+
+ if (first_diff < smaller)
+ {
+ switch (comparison_type)
+ {
+ case type_first_diff:
+ {
+ char byte_buf[INT_BUFSIZE_BOUND (off_t)];
+ char line_buf[INT_BUFSIZE_BOUND (off_t)];
+ char const *byte_num = offtostr (byte_number, byte_buf);
+ char const *line_num = offtostr (line_number, line_buf);
+ if (!opt_print_bytes)
+ {
+ /* See POSIX 1003.1-2001 for this format. This
+ message is used only in the POSIX locale, so it
+ need not be translated. */
+ static char const char_message[] =
+ "%s %s differ: char %s, line %s\n";
+
+ /* The POSIX rationale recommends using the word
+ "byte" outside the POSIX locale. Some gettext
+ implementations translate even in the POSIX
+ locale if certain other environment variables
+ are set, so use "byte" if a translation is
+ available, or if outside the POSIX locale. */
+ static char const byte_msgid[] =
+ N_("%s %s differ: byte %s, line %s\n");
+ char const *byte_message = _(byte_msgid);
+ bool use_byte_message = (byte_message != byte_msgid
+ || hard_locale_LC_MESSAGES);
+
+ printf (use_byte_message ? byte_message : char_message,
+ file[0], file[1], byte_num, line_num);
+ }
+ else
+ {
+ unsigned char c0 = buf0[first_diff];
+ unsigned char c1 = buf1[first_diff];
+ char s0[5];
+ char s1[5];
+ sprintc (s0, c0);
+ sprintc (s1, c1);
+ printf (_("%s %s differ: byte %s, line %s is %3o %s %3o %s\n"),
+ file[0], file[1], byte_num, line_num,
+ c0, s0, c1, s1);
+ }
+ }
+ /* Fall through. */
+ case type_status:
+ return EXIT_FAILURE;
+
+ case type_all_diffs:
+ do
+ {
+ unsigned char c0 = buf0[first_diff];
+ unsigned char c1 = buf1[first_diff];
+ if (c0 != c1)
+ {
+ char byte_buf[INT_BUFSIZE_BOUND (off_t)];
+ char const *byte_num = offtostr (byte_number, byte_buf);
+ if (!opt_print_bytes)
+ {
+ /* See POSIX 1003.1-2001 for this format. */
+ printf ("%*s %3o %3o\n",
+ offset_width, byte_num, c0, c1);
+ }
+ else
+ {
+ char s0[5];
+ char s1[5];
+ sprintc (s0, c0);
+ sprintc (s1, c1);
+ printf ("%*s %3o %-4s %3o %s\n",
+ offset_width, byte_num, c0, s0, c1, s1);
+ }
+ }
+ byte_number++;
+ first_diff++;
+ }
+ while (first_diff < smaller);
+ differing = -1;
+ break;
+
+ case type_no_stdout:
+ differing = 1;
+ break;
+ }
+ }
+
+ if (read0 != read1)
+ {
+ if (differing <= 0 && comparison_type != type_status)
+ {
+ /* See POSIX 1003.1-2001 for this format. */
+ fprintf (stderr, _("cmp: EOF on %s\n"), file[read1 < read0]);
+ }
+
+ return EXIT_FAILURE;
+ }
+ }
+ while (differing <= 0 && read0 == buf_size);
+
+ return differing == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+/* Compare two blocks of memory P0 and P1 until they differ.
+ If the blocks are not guaranteed to be different, put sentinels at the ends
+ of the blocks before calling this function.
+
+ Return the offset of the first byte that differs. */
+
+static size_t
+block_compare (word const *p0, word const *p1)
+{
+ word const *l0, *l1;
+ char const *c0, *c1;
+
+ /* Find the rough position of the first difference by reading words,
+ not bytes. */
+
+ for (l0 = p0, l1 = p1; *l0 == *l1; l0++, l1++)
+ continue;
+
+ /* Find the exact differing position (endianness independent). */
+
+ for (c0 = (char const *) l0, c1 = (char const *) l1;
+ *c0 == *c1;
+ c0++, c1++)
+ continue;
+
+ return c0 - (char const *) p0;
+}
+
+/* Return the number of newlines in BUF, of size BUFSIZE,
+ where BUF[NBYTES] is available for use as a sentinel. */
+
+static size_t
+count_newlines (char *buf, size_t bufsize)
+{
+ size_t count = 0;
+ char *p;
+ char *lim = buf + bufsize;
+ *lim = '\n';
+ for (p = buf; (p = rawmemchr (p, '\n')) != lim; p++)
+ count++;
+ return count;
+}
+
+/* Put into BUF the unsigned char C, making unprintable bytes
+ visible by quoting like cat -t does. */
+
+static void
+sprintc (char *buf, unsigned char c)
+{
+ if (! isprint (c))
+ {
+ if (c >= 128)
+ {
+ *buf++ = 'M';
+ *buf++ = '-';
+ c -= 128;
+ }
+ if (c < 32)
+ {
+ *buf++ = '^';
+ c += 64;
+ }
+ else if (c == 127)
+ {
+ *buf++ = '^';
+ c = '?';
+ }
+ }
+
+ *buf++ = c;
+ *buf = 0;
+}
+
+/* Position file F to ignore_initial[F] bytes from its initial position,
+ and yield its new position. Don't try more than once. */
+
+static off_t
+file_position (int f)
+{
+ static bool positioned[2];
+ static off_t position[2];
+
+ if (! positioned[f])
+ {
+ positioned[f] = true;
+ position[f] = lseek (file_desc[f], ignore_initial[f], SEEK_CUR);
+ }
+ return position[f];
+}
diff --git a/src/context.c b/src/context.c
new file mode 100644
index 0000000..1a92a60
--- /dev/null
+++ b/src/context.c
@@ -0,0 +1,537 @@
+/* Context-format output routines for GNU DIFF.
+
+ Copyright (C) 1988-1989, 1991-1995, 1998, 2001-2002, 2004, 2006, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+#include "c-ctype.h"
+#include <stat-time.h>
+#include <strftime.h>
+
+static char const *find_function (char const * const *, lin);
+static struct change *find_hunk (struct change *);
+static void mark_ignorable (struct change *);
+static void pr_context_hunk (struct change *);
+static void pr_unidiff_hunk (struct change *);
+
+/* Last place find_function started searching from. */
+static lin find_function_last_search;
+
+/* The value find_function returned when it started searching there. */
+static lin find_function_last_match;
+
+/* Print a label for a context diff, with a file name and date or a label. */
+
+static void
+print_context_label (char const *mark,
+ struct file_data *inf,
+ char const *name,
+ char const *label)
+{
+ if (label)
+ fprintf (outfile, "%s %s\n", mark, label);
+ else
+ {
+ char buf[MAX (INT_STRLEN_BOUND (int) + 32,
+ INT_STRLEN_BOUND (time_t) + 11)];
+ struct tm const *tm = localtime (&inf->stat.st_mtime);
+ int nsec = get_stat_mtime_ns (&inf->stat);
+ if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
+ {
+ verify (TYPE_IS_INTEGER (time_t));
+ if (LONG_MIN <= TYPE_MINIMUM (time_t)
+ && TYPE_MAXIMUM (time_t) <= LONG_MAX)
+ {
+ long int sec = inf->stat.st_mtime;
+ sprintf (buf, "%ld.%.9d", sec, nsec);
+ }
+ else if (TYPE_MAXIMUM (time_t) <= INTMAX_MAX)
+ {
+ intmax_t sec = inf->stat.st_mtime;
+ sprintf (buf, "%"PRIdMAX".%.9d", sec, nsec);
+ }
+ else
+ {
+ uintmax_t sec = inf->stat.st_mtime;
+ sprintf (buf, "%"PRIuMAX".%.9d", sec, nsec);
+ }
+ }
+ fprintf (outfile, "%s %s\t%s\n", mark, name, buf);
+ }
+}
+
+/* Print a header for a context diff, with the file names and dates. */
+
+void
+print_context_header (struct file_data inf[], char const *const *names, bool unidiff)
+{
+ set_color_context (HEADER_CONTEXT);
+ if (unidiff)
+ {
+ print_context_label ("---", &inf[0], names[0], file_label[0]);
+ print_context_label ("+++", &inf[1], names[1], file_label[1]);
+ }
+ else
+ {
+ print_context_label ("***", &inf[0], names[0], file_label[0]);
+ print_context_label ("---", &inf[1], names[1], file_label[1]);
+ }
+ set_color_context (RESET_CONTEXT);
+}
+
+/* Print an edit script in context format. */
+
+void
+print_context_script (struct change *script, bool unidiff)
+{
+ if (ignore_blank_lines || ignore_regexp.fastmap)
+ mark_ignorable (script);
+ else
+ {
+ struct change *e;
+ for (e = script; e; e = e->link)
+ e->ignore = false;
+ }
+
+ find_function_last_search = - files[0].prefix_lines;
+ find_function_last_match = LIN_MAX;
+
+ if (unidiff)
+ print_script (script, find_hunk, pr_unidiff_hunk);
+ else
+ print_script (script, find_hunk, pr_context_hunk);
+}
+
+/* Print a pair of line numbers with a comma, translated for file FILE.
+ If the second number is not greater, use the first in place of it.
+
+ Args A and B are internal line numbers.
+ We print the translated (real) line numbers. */
+
+static void
+print_context_number_range (struct file_data const *file, lin a, lin b)
+{
+ long int trans_a, trans_b;
+ translate_range (file, a, b, &trans_a, &trans_b);
+
+ /* We can have B <= A in the case of a range of no lines.
+ In this case, we should print the line number before the range,
+ which is B.
+
+ POSIX 1003.1-2001 requires two line numbers separated by a comma
+ even if the line numbers are the same. However, this does not
+ match existing practice and is surely an error in the
+ specification. */
+
+ if (trans_b <= trans_a)
+ fprintf (outfile, "%ld", trans_b);
+ else
+ fprintf (outfile, "%ld,%ld", trans_a, trans_b);
+}
+
+/* Print FUNCTION in a context header. */
+static void
+print_context_function (FILE *out, char const *function)
+{
+ int i, j;
+ putc (' ', out);
+ for (i = 0; c_isspace ((unsigned char) function[i]) && function[i] != '\n'; i++)
+ continue;
+ for (j = i; j < i + 40 && function[j] != '\n'; j++)
+ continue;
+ while (i < j && c_isspace ((unsigned char) function[j - 1]))
+ j--;
+ fwrite (function + i, sizeof (char), j - i, out);
+}
+
+/* Print a portion of an edit script in context format.
+ HUNK is the beginning of the portion to be printed.
+ The end is marked by a 'link' that has been nulled out.
+
+ Prints out lines from both files, and precedes each
+ line with the appropriate flag-character. */
+
+static void
+pr_context_hunk (struct change *hunk)
+{
+ lin first0, last0, first1, last1, i;
+ char const *prefix;
+ char const *function;
+ FILE *out;
+
+ /* Determine range of line numbers involved in each file. */
+
+ enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1);
+ if (! changes)
+ return;
+
+ /* Include a context's width before and after. */
+
+ i = - files[0].prefix_lines;
+ first0 = MAX (first0 - context, i);
+ first1 = MAX (first1 - context, i);
+ if (last0 < files[0].valid_lines - context)
+ last0 += context;
+ else
+ last0 = files[0].valid_lines - 1;
+ if (last1 < files[1].valid_lines - context)
+ last1 += context;
+ else
+ last1 = files[1].valid_lines - 1;
+
+ /* If desired, find the preceding function definition line in file 0. */
+ function = NULL;
+ if (function_regexp.fastmap)
+ function = find_function (files[0].linbuf, first0);
+
+ begin_output ();
+ out = outfile;
+
+ fputs ("***************", out);
+
+ if (function)
+ print_context_function (out, function);
+
+ putc ('\n', out);
+ set_color_context (LINE_NUMBER_CONTEXT);
+ fputs ("*** ", out);
+ print_context_number_range (&files[0], first0, last0);
+ fputs (" ****", out);
+ set_color_context (RESET_CONTEXT);
+ putc ('\n', out);
+
+ if (changes & OLD)
+ {
+ struct change *next = hunk;
+
+ if (first0 <= last0)
+ set_color_context (DELETE_CONTEXT);
+
+ for (i = first0; i <= last0; i++)
+ {
+ /* Skip past changes that apply (in file 0)
+ only to lines before line I. */
+
+ while (next && next->line0 + next->deleted <= i)
+ next = next->link;
+
+ /* Compute the marking for line I. */
+
+ prefix = " ";
+ if (next && next->line0 <= i)
+ {
+ /* The change NEXT covers this line.
+ If lines were inserted here in file 1, this is "changed".
+ Otherwise it is "deleted". */
+ prefix = (next->inserted > 0 ? "!" : "-");
+ }
+ print_1_line_nl (prefix, &files[0].linbuf[i], true);
+ if (i == last0)
+ set_color_context (RESET_CONTEXT);
+ if (files[0].linbuf[i + 1][-1] == '\n')
+ putc ('\n', out);
+ }
+ }
+
+ set_color_context (LINE_NUMBER_CONTEXT);
+ fputs ("--- ", out);
+ print_context_number_range (&files[1], first1, last1);
+ fputs (" ----", out);
+ set_color_context (RESET_CONTEXT);
+ putc ('\n', out);
+
+ if (changes & NEW)
+ {
+ struct change *next = hunk;
+
+ if (first1 <= last1)
+ set_color_context (ADD_CONTEXT);
+
+ for (i = first1; i <= last1; i++)
+ {
+ /* Skip past changes that apply (in file 1)
+ only to lines before line I. */
+
+ while (next && next->line1 + next->inserted <= i)
+ next = next->link;
+
+ /* Compute the marking for line I. */
+
+ prefix = " ";
+ if (next && next->line1 <= i)
+ {
+ /* The change NEXT covers this line.
+ If lines were deleted here in file 0, this is "changed".
+ Otherwise it is "inserted". */
+ prefix = (next->deleted > 0 ? "!" : "+");
+ }
+ print_1_line_nl (prefix, &files[1].linbuf[i], true);
+ if (i == last1)
+ set_color_context (RESET_CONTEXT);
+ if (files[1].linbuf[i + 1][-1] == '\n')
+ putc ('\n', out);
+ }
+ }
+}
+
+/* Print a pair of line numbers with a comma, translated for file FILE.
+ If the second number is smaller, use the first in place of it.
+ If the numbers are equal, print just one number.
+
+ Args A and B are internal line numbers.
+ We print the translated (real) line numbers. */
+
+static void
+print_unidiff_number_range (struct file_data const *file, lin a, lin b)
+{
+ long int trans_a, trans_b;
+ translate_range (file, a, b, &trans_a, &trans_b);
+
+ /* We can have B < A in the case of a range of no lines.
+ In this case, we print the line number before the range,
+ which is B. It would be more logical to print A, but
+ 'patch' expects B in order to detect diffs against empty files. */
+ if (trans_b <= trans_a)
+ fprintf (outfile, trans_b < trans_a ? "%ld,0" : "%ld", trans_b);
+ else
+ fprintf (outfile, "%ld,%ld", trans_a, trans_b - trans_a + 1);
+}
+
+/* Print a portion of an edit script in unidiff format.
+ HUNK is the beginning of the portion to be printed.
+ The end is marked by a 'link' that has been nulled out.
+
+ Prints out lines from both files, and precedes each
+ line with the appropriate flag-character. */
+
+static void
+pr_unidiff_hunk (struct change *hunk)
+{
+ lin first0, last0, first1, last1;
+ lin i, j, k;
+ struct change *next;
+ char const *function;
+ FILE *out;
+
+ /* Determine range of line numbers involved in each file. */
+
+ if (! analyze_hunk (hunk, &first0, &last0, &first1, &last1))
+ return;
+
+ /* Include a context's width before and after. */
+
+ i = - files[0].prefix_lines;
+ first0 = MAX (first0 - context, i);
+ first1 = MAX (first1 - context, i);
+ if (last0 < files[0].valid_lines - context)
+ last0 += context;
+ else
+ last0 = files[0].valid_lines - 1;
+ if (last1 < files[1].valid_lines - context)
+ last1 += context;
+ else
+ last1 = files[1].valid_lines - 1;
+
+ /* If desired, find the preceding function definition line in file 0. */
+ function = NULL;
+ if (function_regexp.fastmap)
+ function = find_function (files[0].linbuf, first0);
+
+ begin_output ();
+ out = outfile;
+
+ set_color_context (LINE_NUMBER_CONTEXT);
+ fputs ("@@ -", out);
+ print_unidiff_number_range (&files[0], first0, last0);
+ fputs (" +", out);
+ print_unidiff_number_range (&files[1], first1, last1);
+ fputs (" @@", out);
+ set_color_context (RESET_CONTEXT);
+
+ if (function)
+ print_context_function (out, function);
+
+ putc ('\n', out);
+
+ next = hunk;
+ i = first0;
+ j = first1;
+
+ while (i <= last0 || j <= last1)
+ {
+
+ /* If the line isn't a difference, output the context from file 0. */
+
+ if (!next || i < next->line0)
+ {
+ char const *const *line = &files[0].linbuf[i++];
+ if (! (suppress_blank_empty && **line == '\n'))
+ putc (initial_tab ? '\t' : ' ', out);
+ print_1_line (NULL, line);
+ j++;
+ }
+ else
+ {
+ /* For each difference, first output the deleted part. */
+
+ k = next->deleted;
+ if (k)
+ set_color_context (DELETE_CONTEXT);
+
+ while (k--)
+ {
+ char const * const *line = &files[0].linbuf[i++];
+ putc ('-', out);
+ if (initial_tab && ! (suppress_blank_empty && **line == '\n'))
+ putc ('\t', out);
+ print_1_line_nl (NULL, line, true);
+
+ if (!k)
+ set_color_context (RESET_CONTEXT);
+
+ if (line[1][-1] == '\n')
+ putc ('\n', out);
+ }
+
+ /* Then output the inserted part. */
+
+ k = next->inserted;
+ if (k)
+ set_color_context (ADD_CONTEXT);
+
+ while (k--)
+ {
+ char const * const *line = &files[1].linbuf[j++];
+ putc ('+', out);
+ if (initial_tab && ! (suppress_blank_empty && **line == '\n'))
+ putc ('\t', out);
+ print_1_line_nl (NULL, line, true);
+
+ if (!k)
+ set_color_context (RESET_CONTEXT);
+
+ if (line[1][-1] == '\n')
+ putc ('\n', out);
+ }
+
+ /* We're done with this hunk, so on to the next! */
+
+ next = next->link;
+ }
+ }
+}
+
+/* Scan a (forward-ordered) edit script for the first place that more than
+ 2*CONTEXT unchanged lines appear, and return a pointer
+ to the 'struct change' for the last change before those lines. */
+
+static struct change * _GL_ATTRIBUTE_PURE
+find_hunk (struct change *start)
+{
+ struct change *prev;
+ lin top0, top1;
+ lin thresh;
+
+ /* Threshold distance is CONTEXT if the second change is ignorable,
+ 2 * CONTEXT + 1 otherwise. Integer overflow can't happen, due
+ to CONTEXT_LIM. */
+ lin ignorable_threshold = context;
+ lin non_ignorable_threshold = 2 * context + 1;
+
+ do
+ {
+ /* Compute number of first line in each file beyond this changed. */
+ top0 = start->line0 + start->deleted;
+ top1 = start->line1 + start->inserted;
+ prev = start;
+ start = start->link;
+ thresh = (start && start->ignore
+ ? ignorable_threshold
+ : non_ignorable_threshold);
+ /* It is not supposed to matter which file we check in the end-test.
+ If it would matter, crash. */
+ if (start && start->line0 - top0 != start->line1 - top1)
+ abort ();
+ } while (start
+ /* Keep going if less than THRESH lines
+ elapse before the affected line. */
+ && start->line0 - top0 < thresh);
+
+ return prev;
+}
+
+/* Set the 'ignore' flag properly in each change in SCRIPT.
+ It should be 1 if all the lines inserted or deleted in that change
+ are ignorable lines. */
+
+static void
+mark_ignorable (struct change *script)
+{
+ while (script)
+ {
+ struct change *next = script->link;
+ lin first0, last0, first1, last1;
+
+ /* Turn this change into a hunk: detach it from the others. */
+ script->link = NULL;
+
+ /* Determine whether this change is ignorable. */
+ script->ignore = ! analyze_hunk (script,
+ &first0, &last0, &first1, &last1);
+
+ /* Reconnect the chain as before. */
+ script->link = next;
+
+ /* Advance to the following change. */
+ script = next;
+ }
+}
+
+/* Find the last function-header line in LINBUF prior to line number LINENUM.
+ This is a line containing a match for the regexp in 'function_regexp'.
+ Return the address of the text, or NULL if no function-header is found. */
+
+static char const *
+find_function (char const * const *linbuf, lin linenum)
+{
+ lin i = linenum;
+ lin last = find_function_last_search;
+ find_function_last_search = i;
+
+ while (last <= --i)
+ {
+ /* See if this line is what we want. */
+ char const *line = linbuf[i];
+ size_t linelen = linbuf[i + 1] - line - 1;
+
+ /* FIXME: re_search's size args should be size_t, not int. */
+ int len = MIN (linelen, INT_MAX);
+
+ if (0 <= re_search (&function_regexp, line, len, 0, len, NULL))
+ {
+ find_function_last_match = i;
+ return line;
+ }
+ }
+ /* If we search back to where we started searching the previous time,
+ find the line we found last time. */
+ if (find_function_last_match != LIN_MAX)
+ return linbuf[find_function_last_match];
+
+ return NULL;
+}
diff --git a/src/diff.c b/src/diff.c
new file mode 100644
index 0000000..686945e
--- /dev/null
+++ b/src/diff.c
@@ -0,0 +1,1472 @@
+/* diff - compare files line by line
+
+ Copyright (C) 1988-1989, 1992-1994, 1996, 1998, 2001-2002, 2004, 2006-2007,
+ 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define GDIFF_MAIN
+#include "diff.h"
+#include <assert.h>
+#include "paths.h"
+#include <c-stack.h>
+#include <dirname.h>
+#include <error.h>
+#include <exclude.h>
+#include <exitfail.h>
+#include <filenamecat.h>
+#include <file-type.h>
+#include <fnmatch.h>
+#include <getopt.h>
+#include <hard-locale.h>
+#include <prepargs.h>
+#include <progname.h>
+#include <sh-quote.h>
+#include <stat-time.h>
+#include <timespec.h>
+#include <version-etc.h>
+#include <xalloc.h>
+#include <xreadlink.h>
+#include <binary-io.h>
+
+/* The official name of this program (e.g., no 'g' prefix). */
+#define PROGRAM_NAME "diff"
+
+#define AUTHORS \
+ proper_name ("Paul Eggert"), \
+ proper_name ("Mike Haertel"), \
+ proper_name ("David Hayes"), \
+ proper_name ("Richard Stallman"), \
+ proper_name ("Len Tower")
+
+#ifndef GUTTER_WIDTH_MINIMUM
+# define GUTTER_WIDTH_MINIMUM 3
+#endif
+
+struct regexp_list
+{
+ char *regexps; /* chars representing disjunction of the regexps */
+ size_t len; /* chars used in 'regexps' */
+ size_t size; /* size malloc'ed for 'regexps'; 0 if not malloc'ed */
+ bool multiple_regexps;/* Does 'regexps' represent a disjunction? */
+ struct re_pattern_buffer *buf;
+};
+
+static int compare_files (struct comparison const *, char const *, char const *);
+static void add_regexp (struct regexp_list *, char const *);
+static void summarize_regexp_list (struct regexp_list *);
+static void specify_style (enum output_style);
+static void specify_value (char const **, char const *, char const *);
+static void specify_colors_style (char const *);
+static void try_help (char const *, char const *) __attribute__((noreturn));
+static void check_stdout (void);
+static void usage (void);
+
+/* If comparing directories, compare their common subdirectories
+ recursively. */
+static bool recursive;
+
+/* In context diffs, show previous lines that match these regexps. */
+static struct regexp_list function_regexp_list;
+
+/* Ignore changes affecting only lines that match these regexps. */
+static struct regexp_list ignore_regexp_list;
+
+#if O_BINARY
+/* Use binary I/O when reading and writing data (--binary).
+ On POSIX hosts, this has no effect. */
+static bool binary;
+#else
+enum { binary = true };
+#endif
+
+/* If one file is missing, treat it as present but empty (-N). */
+static bool new_file;
+
+/* If the first file is missing, treat it as present but empty
+ (--unidirectional-new-file). */
+static bool unidirectional_new_file;
+
+/* Report files compared that are the same (-s).
+ Normally nothing is output when that happens. */
+static bool report_identical_files;
+
+static char const shortopts[] =
+"0123456789abBcC:dD:eEfF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:yZ";
+
+/* Values for long options that do not have single-letter equivalents. */
+enum
+{
+ BINARY_OPTION = CHAR_MAX + 1,
+ FROM_FILE_OPTION,
+ HELP_OPTION,
+ HORIZON_LINES_OPTION,
+ IGNORE_FILE_NAME_CASE_OPTION,
+ INHIBIT_HUNK_MERGE_OPTION,
+ LEFT_COLUMN_OPTION,
+ LINE_FORMAT_OPTION,
+ NO_DEREFERENCE_OPTION,
+ NO_IGNORE_FILE_NAME_CASE_OPTION,
+ NORMAL_OPTION,
+ SDIFF_MERGE_ASSIST_OPTION,
+ STRIP_TRAILING_CR_OPTION,
+ SUPPRESS_BLANK_EMPTY_OPTION,
+ SUPPRESS_COMMON_LINES_OPTION,
+ TABSIZE_OPTION,
+ TO_FILE_OPTION,
+
+ /* These options must be in sequence. */
+ UNCHANGED_LINE_FORMAT_OPTION,
+ OLD_LINE_FORMAT_OPTION,
+ NEW_LINE_FORMAT_OPTION,
+
+ /* These options must be in sequence. */
+ UNCHANGED_GROUP_FORMAT_OPTION,
+ OLD_GROUP_FORMAT_OPTION,
+ NEW_GROUP_FORMAT_OPTION,
+ CHANGED_GROUP_FORMAT_OPTION,
+
+ COLOR_OPTION,
+ COLOR_PALETTE_OPTION,
+
+ PRESUME_OUTPUT_TTY_OPTION,
+};
+
+static char const group_format_option[][sizeof "--unchanged-group-format"] =
+ {
+ "--unchanged-group-format",
+ "--old-group-format",
+ "--new-group-format",
+ "--changed-group-format"
+ };
+
+static char const line_format_option[][sizeof "--unchanged-line-format"] =
+ {
+ "--unchanged-line-format",
+ "--old-line-format",
+ "--new-line-format"
+ };
+
+static struct option const longopts[] =
+{
+ {"binary", 0, 0, BINARY_OPTION},
+ {"brief", 0, 0, 'q'},
+ {"changed-group-format", 1, 0, CHANGED_GROUP_FORMAT_OPTION},
+ {"color", 2, 0, COLOR_OPTION},
+ {"context", 2, 0, 'C'},
+ {"ed", 0, 0, 'e'},
+ {"exclude", 1, 0, 'x'},
+ {"exclude-from", 1, 0, 'X'},
+ {"expand-tabs", 0, 0, 't'},
+ {"forward-ed", 0, 0, 'f'},
+ {"from-file", 1, 0, FROM_FILE_OPTION},
+ {"help", 0, 0, HELP_OPTION},
+ {"horizon-lines", 1, 0, HORIZON_LINES_OPTION},
+ {"ifdef", 1, 0, 'D'},
+ {"ignore-all-space", 0, 0, 'w'},
+ {"ignore-blank-lines", 0, 0, 'B'},
+ {"ignore-case", 0, 0, 'i'},
+ {"ignore-file-name-case", 0, 0, IGNORE_FILE_NAME_CASE_OPTION},
+ {"ignore-matching-lines", 1, 0, 'I'},
+ {"ignore-space-change", 0, 0, 'b'},
+ {"ignore-tab-expansion", 0, 0, 'E'},
+ {"ignore-trailing-space", 0, 0, 'Z'},
+ {"inhibit-hunk-merge", 0, 0, INHIBIT_HUNK_MERGE_OPTION},
+ {"initial-tab", 0, 0, 'T'},
+ {"label", 1, 0, 'L'},
+ {"left-column", 0, 0, LEFT_COLUMN_OPTION},
+ {"line-format", 1, 0, LINE_FORMAT_OPTION},
+ {"minimal", 0, 0, 'd'},
+ {"new-file", 0, 0, 'N'},
+ {"new-group-format", 1, 0, NEW_GROUP_FORMAT_OPTION},
+ {"new-line-format", 1, 0, NEW_LINE_FORMAT_OPTION},
+ {"no-dereference", 0, 0, NO_DEREFERENCE_OPTION},
+ {"no-ignore-file-name-case", 0, 0, NO_IGNORE_FILE_NAME_CASE_OPTION},
+ {"normal", 0, 0, NORMAL_OPTION},
+ {"old-group-format", 1, 0, OLD_GROUP_FORMAT_OPTION},
+ {"old-line-format", 1, 0, OLD_LINE_FORMAT_OPTION},
+ {"paginate", 0, 0, 'l'},
+ {"palette", 1, 0, COLOR_PALETTE_OPTION},
+ {"rcs", 0, 0, 'n'},
+ {"recursive", 0, 0, 'r'},
+ {"report-identical-files", 0, 0, 's'},
+ {"sdiff-merge-assist", 0, 0, SDIFF_MERGE_ASSIST_OPTION},
+ {"show-c-function", 0, 0, 'p'},
+ {"show-function-line", 1, 0, 'F'},
+ {"side-by-side", 0, 0, 'y'},
+ {"speed-large-files", 0, 0, 'H'},
+ {"starting-file", 1, 0, 'S'},
+ {"strip-trailing-cr", 0, 0, STRIP_TRAILING_CR_OPTION},
+ {"suppress-blank-empty", 0, 0, SUPPRESS_BLANK_EMPTY_OPTION},
+ {"suppress-common-lines", 0, 0, SUPPRESS_COMMON_LINES_OPTION},
+ {"tabsize", 1, 0, TABSIZE_OPTION},
+ {"text", 0, 0, 'a'},
+ {"to-file", 1, 0, TO_FILE_OPTION},
+ {"unchanged-group-format", 1, 0, UNCHANGED_GROUP_FORMAT_OPTION},
+ {"unchanged-line-format", 1, 0, UNCHANGED_LINE_FORMAT_OPTION},
+ {"unidirectional-new-file", 0, 0, 'P'},
+ {"unified", 2, 0, 'U'},
+ {"version", 0, 0, 'v'},
+ {"width", 1, 0, 'W'},
+
+ /* This is solely for testing. Do not document. */
+ {"-presume-output-tty", no_argument, NULL, PRESUME_OUTPUT_TTY_OPTION},
+ {0, 0, 0, 0}
+};
+
+/* Return a string containing the command options with which diff was invoked.
+ Spaces appear between what were separate ARGV-elements.
+ There is a space at the beginning but none at the end.
+ If there were no options, the result is an empty string.
+
+ Arguments: OPTIONVEC, a vector containing separate ARGV-elements, and COUNT,
+ the length of that vector. */
+
+static char *
+option_list (char **optionvec, int count)
+{
+ int i;
+ size_t size = 1;
+ char *result;
+ char *p;
+
+ for (i = 0; i < count; i++)
+ size += 1 + shell_quote_length (optionvec[i]);
+
+ p = result = xmalloc (size);
+
+ for (i = 0; i < count; i++)
+ {
+ *p++ = ' ';
+ p = shell_quote_copy (p, optionvec[i]);
+ }
+
+ *p = '\0';
+ return result;
+}
+
+
+/* Return an option value suitable for add_exclude. */
+
+static int
+exclude_options (void)
+{
+ return EXCLUDE_WILDCARDS | (ignore_file_name_case ? FNM_CASEFOLD : 0);
+}
+
+int
+main (int argc, char **argv)
+{
+ int exit_status = EXIT_SUCCESS;
+ int c;
+ int i;
+ int prev = -1;
+ lin ocontext = -1;
+ bool explicit_context = false;
+ size_t width = 0;
+ bool show_c_function = false;
+ char const *from_file = NULL;
+ char const *to_file = NULL;
+ uintmax_t numval;
+ char *numend;
+
+ /* Do our initializations. */
+ exit_failure = EXIT_TROUBLE;
+ initialize_main (&argc, &argv);
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ c_stack_action (0);
+ function_regexp_list.buf = &function_regexp;
+ ignore_regexp_list.buf = &ignore_regexp;
+ re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
+ excluded = new_exclude ();
+
+ /* Decode the options. */
+
+ while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
+ {
+ switch (c)
+ {
+ case 0:
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ ocontext = (! ISDIGIT (prev)
+ ? c - '0'
+ : (ocontext - (c - '0' <= CONTEXT_MAX % 10)
+ < CONTEXT_MAX / 10)
+ ? 10 * ocontext + (c - '0')
+ : CONTEXT_MAX);
+ break;
+
+ case 'a':
+ text = true;
+ break;
+
+ case 'b':
+ if (ignore_white_space < IGNORE_SPACE_CHANGE)
+ ignore_white_space = IGNORE_SPACE_CHANGE;
+ break;
+
+ case 'Z':
+ if (ignore_white_space < IGNORE_SPACE_CHANGE)
+ ignore_white_space |= IGNORE_TRAILING_SPACE;
+ break;
+
+ case 'B':
+ ignore_blank_lines = true;
+ break;
+
+ case 'C':
+ case 'U':
+ {
+ if (optarg)
+ {
+ numval = strtoumax (optarg, &numend, 10);
+ if (*numend)
+ try_help ("invalid context length '%s'", optarg);
+ if (CONTEXT_MAX < numval)
+ numval = CONTEXT_MAX;
+ }
+ else
+ numval = 3;
+
+ specify_style (c == 'U' ? OUTPUT_UNIFIED : OUTPUT_CONTEXT);
+ if (context < numval)
+ context = numval;
+ explicit_context = true;
+ }
+ break;
+
+ case 'c':
+ specify_style (OUTPUT_CONTEXT);
+ if (context < 3)
+ context = 3;
+ break;
+
+ case 'd':
+ minimal = true;
+ break;
+
+ case 'D':
+ specify_style (OUTPUT_IFDEF);
+ {
+ static char const C_ifdef_group_formats[] =
+ "%%=%c#ifndef %s\n%%<#endif /* ! %s */\n%c#ifdef %s\n%%>#endif /* %s */\n%c#ifndef %s\n%%<#else /* %s */\n%%>#endif /* %s */\n";
+ char *b = xmalloc (sizeof C_ifdef_group_formats
+ + 7 * strlen (optarg) - 14 /* 7*"%s" */
+ - 8 /* 5*"%%" + 3*"%c" */);
+ sprintf (b, C_ifdef_group_formats,
+ 0,
+ optarg, optarg, 0,
+ optarg, optarg, 0,
+ optarg, optarg, optarg);
+ for (i = 0; i < sizeof group_format / sizeof group_format[0]; i++)
+ {
+ specify_value (&group_format[i], b, "-D");
+ b += strlen (b) + 1;
+ }
+ }
+ break;
+
+ case 'e':
+ specify_style (OUTPUT_ED);
+ break;
+
+ case 'E':
+ if (ignore_white_space < IGNORE_SPACE_CHANGE)
+ ignore_white_space |= IGNORE_TAB_EXPANSION;
+ break;
+
+ case 'f':
+ specify_style (OUTPUT_FORWARD_ED);
+ break;
+
+ case 'F':
+ add_regexp (&function_regexp_list, optarg);
+ break;
+
+ case 'h':
+ /* Split the files into chunks for faster processing.
+ Usually does not change the result.
+
+ This currently has no effect. */
+ break;
+
+ case 'H':
+ speed_large_files = true;
+ break;
+
+ case 'i':
+ ignore_case = true;
+ break;
+
+ case 'I':
+ add_regexp (&ignore_regexp_list, optarg);
+ break;
+
+ case 'l':
+ if (!pr_program[0])
+ try_help ("pagination not supported on this host", NULL);
+ paginate = true;
+#ifdef SIGCHLD
+ /* Pagination requires forking and waiting, and
+ System V fork+wait does not work if SIGCHLD is ignored. */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+ break;
+
+ case 'L':
+ if (!file_label[0])
+ file_label[0] = optarg;
+ else if (!file_label[1])
+ file_label[1] = optarg;
+ else
+ fatal ("too many file label options");
+ break;
+
+ case 'n':
+ specify_style (OUTPUT_RCS);
+ break;
+
+ case 'N':
+ new_file = true;
+ break;
+
+ case 'p':
+ show_c_function = true;
+ add_regexp (&function_regexp_list, "^[[:alpha:]$_]");
+ break;
+
+ case 'P':
+ unidirectional_new_file = true;
+ break;
+
+ case 'q':
+ brief = true;
+ break;
+
+ case 'r':
+ recursive = true;
+ break;
+
+ case 's':
+ report_identical_files = true;
+ break;
+
+ case 'S':
+ specify_value (&starting_file, optarg, "-S");
+ break;
+
+ case 't':
+ expand_tabs = true;
+ break;
+
+ case 'T':
+ initial_tab = true;
+ break;
+
+ case 'u':
+ specify_style (OUTPUT_UNIFIED);
+ if (context < 3)
+ context = 3;
+ break;
+
+ case 'v':
+ version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version,
+ AUTHORS, (char *) NULL);
+ check_stdout ();
+ return EXIT_SUCCESS;
+
+ case 'w':
+ ignore_white_space = IGNORE_ALL_SPACE;
+ break;
+
+ case 'x':
+ add_exclude (excluded, optarg, exclude_options ());
+ break;
+
+ case 'X':
+ if (add_exclude_file (add_exclude, excluded, optarg,
+ exclude_options (), '\n'))
+ pfatal_with_name (optarg);
+ break;
+
+ case 'y':
+ specify_style (OUTPUT_SDIFF);
+ break;
+
+ case 'W':
+ numval = strtoumax (optarg, &numend, 10);
+ if (! (0 < numval && numval <= SIZE_MAX) || *numend)
+ try_help ("invalid width '%s'", optarg);
+ if (width != numval)
+ {
+ if (width)
+ fatal ("conflicting width options");
+ width = numval;
+ }
+ break;
+
+ case BINARY_OPTION:
+#if O_BINARY
+ binary = true;
+ if (! isatty (STDOUT_FILENO))
+ set_binary_mode (STDOUT_FILENO, O_BINARY);
+#endif
+ break;
+
+ case FROM_FILE_OPTION:
+ specify_value (&from_file, optarg, "--from-file");
+ break;
+
+ case HELP_OPTION:
+ usage ();
+ check_stdout ();
+ return EXIT_SUCCESS;
+
+ case HORIZON_LINES_OPTION:
+ numval = strtoumax (optarg, &numend, 10);
+ if (*numend)
+ try_help ("invalid horizon length '%s'", optarg);
+ horizon_lines = MAX (horizon_lines, MIN (numval, LIN_MAX));
+ break;
+
+ case IGNORE_FILE_NAME_CASE_OPTION:
+ ignore_file_name_case = true;
+ break;
+
+ case INHIBIT_HUNK_MERGE_OPTION:
+ /* This option is obsolete, but accept it for backward
+ compatibility. */
+ break;
+
+ case LEFT_COLUMN_OPTION:
+ left_column = true;
+ break;
+
+ case LINE_FORMAT_OPTION:
+ specify_style (OUTPUT_IFDEF);
+ for (i = 0; i < sizeof line_format / sizeof line_format[0]; i++)
+ specify_value (&line_format[i], optarg, "--line-format");
+ break;
+
+ case NO_DEREFERENCE_OPTION:
+ no_dereference_symlinks = true;
+ break;
+
+ case NO_IGNORE_FILE_NAME_CASE_OPTION:
+ ignore_file_name_case = false;
+ break;
+
+ case NORMAL_OPTION:
+ specify_style (OUTPUT_NORMAL);
+ break;
+
+ case SDIFF_MERGE_ASSIST_OPTION:
+ specify_style (OUTPUT_SDIFF);
+ sdiff_merge_assist = true;
+ break;
+
+ case STRIP_TRAILING_CR_OPTION:
+ strip_trailing_cr = true;
+ break;
+
+ case SUPPRESS_BLANK_EMPTY_OPTION:
+ suppress_blank_empty = true;
+ break;
+
+ case SUPPRESS_COMMON_LINES_OPTION:
+ suppress_common_lines = true;
+ break;
+
+ case TABSIZE_OPTION:
+ numval = strtoumax (optarg, &numend, 10);
+ if (! (0 < numval && numval <= SIZE_MAX - GUTTER_WIDTH_MINIMUM)
+ || *numend)
+ try_help ("invalid tabsize '%s'", optarg);
+ if (tabsize != numval)
+ {
+ if (tabsize)
+ fatal ("conflicting tabsize options");
+ tabsize = numval;
+ }
+ break;
+
+ case TO_FILE_OPTION:
+ specify_value (&to_file, optarg, "--to-file");
+ break;
+
+ case UNCHANGED_LINE_FORMAT_OPTION:
+ case OLD_LINE_FORMAT_OPTION:
+ case NEW_LINE_FORMAT_OPTION:
+ specify_style (OUTPUT_IFDEF);
+ c -= UNCHANGED_LINE_FORMAT_OPTION;
+ specify_value (&line_format[c], optarg, line_format_option[c]);
+ break;
+
+ case UNCHANGED_GROUP_FORMAT_OPTION:
+ case OLD_GROUP_FORMAT_OPTION:
+ case NEW_GROUP_FORMAT_OPTION:
+ case CHANGED_GROUP_FORMAT_OPTION:
+ specify_style (OUTPUT_IFDEF);
+ c -= UNCHANGED_GROUP_FORMAT_OPTION;
+ specify_value (&group_format[c], optarg, group_format_option[c]);
+ break;
+
+ case COLOR_OPTION:
+ specify_colors_style (optarg);
+ break;
+
+ case COLOR_PALETTE_OPTION:
+ set_color_palette (optarg);
+ break;
+
+ case PRESUME_OUTPUT_TTY_OPTION:
+ presume_output_tty = true;
+ break;
+
+ default:
+ try_help (NULL, NULL);
+ }
+ prev = c;
+ }
+
+ if (colors_style == AUTO)
+ {
+ char const *t = getenv ("TERM");
+ if (t && STREQ (t, "dumb"))
+ colors_style = NEVER;
+ }
+
+ if (output_style == OUTPUT_UNSPECIFIED)
+ {
+ if (show_c_function)
+ {
+ specify_style (OUTPUT_CONTEXT);
+ if (ocontext < 0)
+ context = 3;
+ }
+ else
+ specify_style (OUTPUT_NORMAL);
+ }
+
+ if (output_style != OUTPUT_CONTEXT || hard_locale (LC_TIME))
+ {
+#if (defined STAT_TIMESPEC || defined STAT_TIMESPEC_NS \
+ || defined HAVE_STRUCT_STAT_ST_SPARE1)
+ time_format = "%Y-%m-%d %H:%M:%S.%N %z";
+#else
+ time_format = "%Y-%m-%d %H:%M:%S %z";
+#endif
+ }
+ else
+ {
+ /* See POSIX 1003.1-2001 for this format. */
+ time_format = "%a %b %e %T %Y";
+ }
+
+ if (0 <= ocontext
+ && (output_style == OUTPUT_CONTEXT
+ || output_style == OUTPUT_UNIFIED)
+ && (context < ocontext
+ || (ocontext < context && ! explicit_context)))
+ context = ocontext;
+
+ if (! tabsize)
+ tabsize = 8;
+ if (! width)
+ width = 130;
+
+ {
+ /* Maximize first the half line width, and then the gutter width,
+ according to the following constraints:
+
+ 1. Two half lines plus a gutter must fit in a line.
+ 2. If the half line width is nonzero:
+ a. The gutter width is at least GUTTER_WIDTH_MINIMUM.
+ b. If tabs are not expanded to spaces,
+ a half line plus a gutter is an integral number of tabs,
+ so that tabs in the right column line up. */
+
+ size_t t = expand_tabs ? 1 : tabsize;
+ size_t w = width;
+ size_t t_plus_g = t + GUTTER_WIDTH_MINIMUM;
+ size_t unaligned_off = (w >> 1) + (t_plus_g >> 1) + (w & t_plus_g & 1);
+ size_t off = unaligned_off - unaligned_off % t;
+ sdiff_half_width = (off <= GUTTER_WIDTH_MINIMUM || w <= off
+ ? 0
+ : MIN (off - GUTTER_WIDTH_MINIMUM, w - off));
+ sdiff_column2_offset = sdiff_half_width ? off : w;
+ }
+
+ /* Make the horizon at least as large as the context, so that
+ shift_boundaries has more freedom to shift the first and last hunks. */
+ if (horizon_lines < context)
+ horizon_lines = context;
+
+ summarize_regexp_list (&function_regexp_list);
+ summarize_regexp_list (&ignore_regexp_list);
+
+ if (output_style == OUTPUT_IFDEF)
+ {
+ for (i = 0; i < sizeof line_format / sizeof line_format[0]; i++)
+ if (!line_format[i])
+ line_format[i] = "%l\n";
+ if (!group_format[OLD])
+ group_format[OLD]
+ = group_format[CHANGED] ? group_format[CHANGED] : "%<";
+ if (!group_format[NEW])
+ group_format[NEW]
+ = group_format[CHANGED] ? group_format[CHANGED] : "%>";
+ if (!group_format[UNCHANGED])
+ group_format[UNCHANGED] = "%=";
+ if (!group_format[CHANGED])
+ group_format[CHANGED] = concat (group_format[OLD],
+ group_format[NEW], "");
+ }
+
+ no_diff_means_no_output =
+ (output_style == OUTPUT_IFDEF ?
+ (!*group_format[UNCHANGED]
+ || (STREQ (group_format[UNCHANGED], "%=")
+ && !*line_format[UNCHANGED]))
+ : (output_style != OUTPUT_SDIFF) | suppress_common_lines);
+
+ files_can_be_treated_as_binary =
+ (brief & binary
+ & ~ (ignore_blank_lines | ignore_case | strip_trailing_cr
+ | (ignore_regexp_list.regexps || ignore_white_space)));
+
+ switch_string = option_list (argv + 1, optind - 1);
+
+ if (from_file)
+ {
+ if (to_file)
+ fatal ("--from-file and --to-file both specified");
+ else
+ for (; optind < argc; optind++)
+ {
+ int status = compare_files (NULL, from_file, argv[optind]);
+ if (exit_status < status)
+ exit_status = status;
+ }
+ }
+ else
+ {
+ if (to_file)
+ for (; optind < argc; optind++)
+ {
+ int status = compare_files (NULL, argv[optind], to_file);
+ if (exit_status < status)
+ exit_status = status;
+ }
+ else
+ {
+ if (argc - optind != 2)
+ {
+ if (argc - optind < 2)
+ try_help ("missing operand after '%s'", argv[argc - 1]);
+ else
+ try_help ("extra operand '%s'", argv[optind + 2]);
+ }
+
+ exit_status = compare_files (NULL, argv[optind], argv[optind + 1]);
+ }
+ }
+
+ /* Print any messages that were saved up for last. */
+ print_message_queue ();
+
+ check_stdout ();
+ exit (exit_status);
+ return exit_status;
+}
+
+/* Append to REGLIST the regexp PATTERN. */
+
+static void
+add_regexp (struct regexp_list *reglist, char const *pattern)
+{
+ size_t patlen = strlen (pattern);
+ char const *m = re_compile_pattern (pattern, patlen, reglist->buf);
+
+ if (m != 0)
+ error (0, 0, "%s: %s", pattern, m);
+ else
+ {
+ char *regexps = reglist->regexps;
+ size_t len = reglist->len;
+ bool multiple_regexps = reglist->multiple_regexps = regexps != 0;
+ size_t newlen = reglist->len = len + 2 * multiple_regexps + patlen;
+ size_t size = reglist->size;
+
+ if (size <= newlen)
+ {
+ if (!size)
+ size = 1;
+
+ do size *= 2;
+ while (size <= newlen);
+
+ reglist->size = size;
+ reglist->regexps = regexps = xrealloc (regexps, size);
+ }
+ if (multiple_regexps)
+ {
+ regexps[len++] = '\\';
+ regexps[len++] = '|';
+ }
+ memcpy (regexps + len, pattern, patlen + 1);
+ }
+}
+
+/* Ensure that REGLIST represents the disjunction of its regexps.
+ This is done here, rather than earlier, to avoid O(N^2) behavior. */
+
+static void
+summarize_regexp_list (struct regexp_list *reglist)
+{
+ if (reglist->regexps)
+ {
+ /* At least one regexp was specified. Allocate a fastmap for it. */
+ reglist->buf->fastmap = xmalloc (1 << CHAR_BIT);
+ if (reglist->multiple_regexps)
+ {
+ /* Compile the disjunction of the regexps.
+ (If just one regexp was specified, it is already compiled.) */
+ char const *m = re_compile_pattern (reglist->regexps, reglist->len,
+ reglist->buf);
+ if (m)
+ error (EXIT_TROUBLE, 0, "%s: %s", reglist->regexps, m);
+ }
+ }
+}
+
+static void
+try_help (char const *reason_msgid, char const *operand)
+{
+ if (reason_msgid)
+ error (0, 0, _(reason_msgid), operand);
+ error (EXIT_TROUBLE, 0, _("Try '%s --help' for more information."),
+ program_name);
+ abort ();
+}
+
+static void
+check_stdout (void)
+{
+ if (ferror (stdout))
+ fatal ("write failed");
+ else if (fclose (stdout) != 0)
+ pfatal_with_name (_("standard output"));
+}
+
+static char const * const option_help_msgid[] = {
+ N_(" --normal output a normal diff (the default)"),
+ N_("-q, --brief report only when files differ"),
+ N_("-s, --report-identical-files report when two files are the same"),
+ N_("-c, -C NUM, --context[=NUM] output NUM (default 3) lines of copied context"),
+ N_("-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context"),
+ N_("-e, --ed output an ed script"),
+ N_("-n, --rcs output an RCS format diff"),
+ N_("-y, --side-by-side output in two columns"),
+ N_("-W, --width=NUM output at most NUM (default 130) print columns"),
+ N_(" --left-column output only the left column of common lines"),
+ N_(" --suppress-common-lines do not output common lines"),
+ "",
+ N_("-p, --show-c-function show which C function each change is in"),
+ N_("-F, --show-function-line=RE show the most recent line matching RE"),
+ N_(" --label LABEL use LABEL instead of file name and timestamp\n"
+ " (can be repeated)"),
+ "",
+ N_("-t, --expand-tabs expand tabs to spaces in output"),
+ N_("-T, --initial-tab make tabs line up by prepending a tab"),
+ N_(" --tabsize=NUM tab stops every NUM (default 8) print columns"),
+ N_(" --suppress-blank-empty suppress space or tab before empty output lines"),
+ N_("-l, --paginate pass output through 'pr' to paginate it"),
+ "",
+ N_("-r, --recursive recursively compare any subdirectories found"),
+ N_(" --no-dereference don't follow symbolic links"),
+ N_("-N, --new-file treat absent files as empty"),
+ N_(" --unidirectional-new-file treat absent first files as empty"),
+ N_(" --ignore-file-name-case ignore case when comparing file names"),
+ N_(" --no-ignore-file-name-case consider case when comparing file names"),
+ N_("-x, --exclude=PAT exclude files that match PAT"),
+ N_("-X, --exclude-from=FILE exclude files that match any pattern in FILE"),
+ N_("-S, --starting-file=FILE start with FILE when comparing directories"),
+ N_(" --from-file=FILE1 compare FILE1 to all operands;\n"
+ " FILE1 can be a directory"),
+ N_(" --to-file=FILE2 compare all operands to FILE2;\n"
+ " FILE2 can be a directory"),
+ "",
+ N_("-i, --ignore-case ignore case differences in file contents"),
+ N_("-E, --ignore-tab-expansion ignore changes due to tab expansion"),
+ N_("-Z, --ignore-trailing-space ignore white space at line end"),
+ N_("-b, --ignore-space-change ignore changes in the amount of white space"),
+ N_("-w, --ignore-all-space ignore all white space"),
+ N_("-B, --ignore-blank-lines ignore changes where lines are all blank"),
+ N_("-I, --ignore-matching-lines=RE ignore changes where all lines match RE"),
+ "",
+ N_("-a, --text treat all files as text"),
+ N_(" --strip-trailing-cr strip trailing carriage return on input"),
+#if O_BINARY
+ N_(" --binary read and write data in binary mode"),
+#endif
+ "",
+ N_("-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs"),
+ N_(" --GTYPE-group-format=GFMT format GTYPE input groups with GFMT"),
+ N_(" --line-format=LFMT format all input lines with LFMT"),
+ N_(" --LTYPE-line-format=LFMT format LTYPE input lines with LFMT"),
+ N_(" These format options provide fine-grained control over the output\n"
+ " of diff, generalizing -D/--ifdef."),
+ N_(" LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'."),
+ N_(" GFMT (only) may contain:\n\
+ %< lines from FILE1\n\
+ %> lines from FILE2\n\
+ %= lines common to FILE1 and FILE2\n\
+ %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER\n\
+ LETTERs are as follows for new group, lower case for old group:\n\
+ F first line number\n\
+ L last line number\n\
+ N number of lines = L-F+1\n\
+ E F-1\n\
+ M L+1\n\
+ %(A=B?T:E) if A equals B then T else E"),
+ N_(" LFMT (only) may contain:\n\
+ %L contents of line\n\
+ %l contents of line, excluding any trailing newline\n\
+ %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number"),
+ N_(" Both GFMT and LFMT may contain:\n\
+ %% %\n\
+ %c'C' the single character C\n\
+ %c'\\OOO' the character with octal code OOO\n\
+ C the character C (other characters represent themselves)"),
+ "",
+ N_("-d, --minimal try hard to find a smaller set of changes"),
+ N_(" --horizon-lines=NUM keep NUM lines of the common prefix and suffix"),
+ N_(" --speed-large-files assume large files and many scattered small changes"),
+ N_(" --color[=WHEN] colorize the output; WHEN can be 'never', 'always',"),
+ N_(" or 'auto' (the default)"),
+ N_(" --palette=PALETTE specify the colors to use when --color is active"),
+ N_(" PALETTE is a colon-separated list terminfo capabilities"),
+ "",
+ N_(" --help display this help and exit"),
+ N_("-v, --version output version information and exit"),
+ "",
+ N_("FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'."),
+ N_("If --from-file or --to-file is given, there are no restrictions on FILE(s)."),
+ N_("If a FILE is '-', read standard input."),
+ N_("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."),
+ 0
+};
+
+static void
+usage (void)
+{
+ char const * const *p;
+
+ printf (_("Usage: %s [OPTION]... FILES\n"), program_name);
+ printf ("%s\n\n", _("Compare FILES line by line."));
+
+ fputs (_("\
+Mandatory arguments to long options are mandatory for short options too.\n\
+"), stdout);
+
+ for (p = option_help_msgid; *p; p++)
+ {
+ if (!**p)
+ putchar ('\n');
+ else
+ {
+ char const *msg = _(*p);
+ char const *nl;
+ while ((nl = strchr (msg, '\n')))
+ {
+ int msglen = nl + 1 - msg;
+ printf (" %.*s", msglen, msg);
+ msg = nl + 1;
+ }
+
+ printf (" %s\n" + 2 * (*msg != ' ' && *msg != '-'), msg);
+ }
+ }
+ emit_bug_reporting_address ();
+}
+
+/* Set VAR to VALUE, reporting an OPTION error if this is a
+ conflict. */
+static void
+specify_value (char const **var, char const *value, char const *option)
+{
+ if (*var && ! STREQ (*var, value))
+ {
+ error (0, 0, _("conflicting %s option value '%s'"), option, value);
+ try_help (NULL, NULL);
+ }
+ *var = value;
+}
+
+/* Set the output style to STYLE, diagnosing conflicts. */
+static void
+specify_style (enum output_style style)
+{
+ if (output_style != style)
+ {
+ if (output_style != OUTPUT_UNSPECIFIED)
+ try_help ("conflicting output style options", NULL);
+ output_style = style;
+ }
+}
+
+/* Set the color mode. */
+static void
+specify_colors_style (char const *value)
+{
+ if (value == NULL || STREQ (value, "auto"))
+ colors_style = AUTO;
+ else if (STREQ (value, "always"))
+ colors_style = ALWAYS;
+ else if (STREQ (value, "never"))
+ colors_style = NEVER;
+ else
+ try_help ("invalid color '%s'", value);
+}
+
+
+/* Set the last-modified time of *ST to be the current time. */
+
+static void
+set_mtime_to_now (struct stat *st)
+{
+#ifdef STAT_TIMESPEC
+ gettime (&STAT_TIMESPEC (st, st_mtim));
+#else
+ struct timespec t;
+ gettime (&t);
+ st->st_mtime = t.tv_sec;
+# if defined STAT_TIMESPEC_NS
+ STAT_TIMESPEC_NS (st, st_mtim) = t.tv_nsec;
+# elif defined HAVE_STRUCT_STAT_ST_SPARE1
+ st->st_spare1 = t.tv_nsec / 1000;
+# endif
+#endif
+}
+
+/* Compare two files (or dirs) with parent comparison PARENT
+ and names NAME0 and NAME1.
+ (If PARENT is null, then the first name is just NAME0, etc.)
+ This is self-contained; it opens the files and closes them.
+
+ Value is EXIT_SUCCESS if files are the same, EXIT_FAILURE if
+ different, EXIT_TROUBLE if there is a problem opening them. */
+
+static int
+compare_files (struct comparison const *parent,
+ char const *name0,
+ char const *name1)
+{
+ struct comparison cmp;
+#define DIR_P(f) (S_ISDIR (cmp.file[f].stat.st_mode) != 0)
+ register int f;
+ int status = EXIT_SUCCESS;
+ bool same_files;
+ char *free0;
+ char *free1;
+
+ /* If this is directory comparison, perhaps we have a file
+ that exists only in one of the directories.
+ If so, just print a message to that effect. */
+
+ if (! ((name0 && name1)
+ || (unidirectional_new_file && name1)
+ || new_file))
+ {
+ char const *name = name0 ? name0 : name1;
+ char const *dir = parent->file[!name0].name;
+
+ /* See POSIX 1003.1-2001 for this format. */
+ message ("Only in %s: %s\n", dir, name);
+
+ /* Return EXIT_FAILURE so that diff_dirs will return
+ EXIT_FAILURE ("some files differ"). */
+ return EXIT_FAILURE;
+ }
+
+ memset (cmp.file, 0, sizeof cmp.file);
+ cmp.parent = parent;
+
+ /* cmp.file[f].desc markers */
+#define NONEXISTENT (-1) /* nonexistent file */
+#define UNOPENED (-2) /* unopened file (e.g. directory) */
+#define ERRNO_ENCODE(errno) (-3 - (errno)) /* encoded errno value */
+
+#define ERRNO_DECODE(desc) (-3 - (desc)) /* inverse of ERRNO_ENCODE */
+
+ cmp.file[0].desc = name0 ? UNOPENED : NONEXISTENT;
+ cmp.file[1].desc = name1 ? UNOPENED : NONEXISTENT;
+
+ /* Now record the full name of each file, including nonexistent ones. */
+
+ if (!name0)
+ name0 = name1;
+ if (!name1)
+ name1 = name0;
+
+ if (!parent)
+ {
+ free0 = NULL;
+ free1 = NULL;
+ cmp.file[0].name = name0;
+ cmp.file[1].name = name1;
+ }
+ else
+ {
+ cmp.file[0].name = free0
+ = file_name_concat (parent->file[0].name, name0, NULL);
+ cmp.file[1].name = free1
+ = file_name_concat (parent->file[1].name, name1, NULL);
+ }
+
+ /* Stat the files. */
+
+ for (f = 0; f < 2; f++)
+ {
+ if (cmp.file[f].desc != NONEXISTENT)
+ {
+ if (f && file_name_cmp (cmp.file[f].name, cmp.file[0].name) == 0)
+ {
+ cmp.file[f].desc = cmp.file[0].desc;
+ cmp.file[f].stat = cmp.file[0].stat;
+ }
+ else if (STREQ (cmp.file[f].name, "-"))
+ {
+ cmp.file[f].desc = STDIN_FILENO;
+ if (binary && ! isatty (STDIN_FILENO))
+ set_binary_mode (STDIN_FILENO, O_BINARY);
+ if (fstat (STDIN_FILENO, &cmp.file[f].stat) != 0)
+ cmp.file[f].desc = ERRNO_ENCODE (errno);
+ else
+ {
+ if (S_ISREG (cmp.file[f].stat.st_mode))
+ {
+ off_t pos = lseek (STDIN_FILENO, 0, SEEK_CUR);
+ if (pos < 0)
+ cmp.file[f].desc = ERRNO_ENCODE (errno);
+ else
+ cmp.file[f].stat.st_size =
+ MAX (0, cmp.file[f].stat.st_size - pos);
+ }
+
+ /* POSIX 1003.1-2001 requires current time for
+ stdin. */
+ set_mtime_to_now (&cmp.file[f].stat);
+ }
+ }
+ else if ((no_dereference_symlinks
+ ? lstat (cmp.file[f].name, &cmp.file[f].stat)
+ : stat (cmp.file[f].name, &cmp.file[f].stat))
+ != 0)
+ cmp.file[f].desc = ERRNO_ENCODE (errno);
+ }
+ }
+
+ /* Mark files as nonexistent as needed for -N and -P, if they are
+ inaccessible empty regular files (the kind of files that 'patch'
+ creates to indicate nonexistent backups), or if they are
+ top-level files that do not exist but their counterparts do
+ exist. */
+ for (f = 0; f < 2; f++)
+ if ((new_file || (f == 0 && unidirectional_new_file))
+ && (cmp.file[f].desc == UNOPENED
+ ? (S_ISREG (cmp.file[f].stat.st_mode)
+ && ! (cmp.file[f].stat.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO))
+ && cmp.file[f].stat.st_size == 0)
+ : ((cmp.file[f].desc == ERRNO_ENCODE (ENOENT)
+ || cmp.file[f].desc == ERRNO_ENCODE (EBADF))
+ && ! parent
+ && (cmp.file[1 - f].desc == UNOPENED
+ || cmp.file[1 - f].desc == STDIN_FILENO))))
+ cmp.file[f].desc = NONEXISTENT;
+
+ for (f = 0; f < 2; f++)
+ if (cmp.file[f].desc == NONEXISTENT)
+ {
+ memset (&cmp.file[f].stat, 0, sizeof cmp.file[f].stat);
+ cmp.file[f].stat.st_mode = cmp.file[1 - f].stat.st_mode;
+ }
+
+ for (f = 0; f < 2; f++)
+ {
+ int e = ERRNO_DECODE (cmp.file[f].desc);
+ if (0 <= e)
+ {
+ errno = e;
+ perror_with_name (cmp.file[f].name);
+ status = EXIT_TROUBLE;
+ }
+ }
+
+ if (status == EXIT_SUCCESS && ! parent && DIR_P (0) != DIR_P (1))
+ {
+ /* If one is a directory, and it was specified in the command line,
+ use the file in that dir with the other file's basename. */
+
+ int fnm_arg = DIR_P (0);
+ int dir_arg = 1 - fnm_arg;
+ char const *fnm = cmp.file[fnm_arg].name;
+ char const *dir = cmp.file[dir_arg].name;
+ char const *filename = cmp.file[dir_arg].name = free0
+ = find_dir_file_pathname (dir, last_component (fnm));
+
+ if (STREQ (fnm, "-"))
+ fatal ("cannot compare '-' to a directory");
+
+ if ((no_dereference_symlinks
+ ? lstat (filename, &cmp.file[dir_arg].stat)
+ : stat (filename, &cmp.file[dir_arg].stat))
+ != 0)
+ {
+ perror_with_name (filename);
+ status = EXIT_TROUBLE;
+ }
+ }
+
+ if (status != EXIT_SUCCESS)
+ {
+ /* One of the files should exist but does not. */
+ }
+ else if (cmp.file[0].desc == NONEXISTENT
+ && cmp.file[1].desc == NONEXISTENT)
+ {
+ /* Neither file "exists", so there's nothing to compare. */
+ }
+ else if ((same_files
+ = (cmp.file[0].desc != NONEXISTENT
+ && cmp.file[1].desc != NONEXISTENT
+ && 0 < same_file (&cmp.file[0].stat, &cmp.file[1].stat)
+ && same_file_attributes (&cmp.file[0].stat,
+ &cmp.file[1].stat)))
+ && no_diff_means_no_output)
+ {
+ /* The two named files are actually the same physical file.
+ We know they are identical without actually reading them. */
+ }
+ else if (DIR_P (0) & DIR_P (1))
+ {
+ if (output_style == OUTPUT_IFDEF)
+ fatal ("-D option not supported with directories");
+
+ /* If both are directories, compare the files in them. */
+
+ if (parent && !recursive)
+ {
+ /* But don't compare dir contents one level down
+ unless -r was specified.
+ See POSIX 1003.1-2001 for this format. */
+ message ("Common subdirectories: %s and %s\n",
+ cmp.file[0].name, cmp.file[1].name);
+ }
+ else
+ status = diff_dirs (&cmp, compare_files);
+ }
+ else if ((DIR_P (0) | DIR_P (1))
+ || (parent
+ && !((S_ISREG (cmp.file[0].stat.st_mode)
+ || S_ISLNK (cmp.file[0].stat.st_mode))
+ && (S_ISREG (cmp.file[1].stat.st_mode)
+ || S_ISLNK (cmp.file[1].stat.st_mode)))))
+ {
+ if (cmp.file[0].desc == NONEXISTENT || cmp.file[1].desc == NONEXISTENT)
+ {
+ /* We have a subdirectory that exists only in one directory. */
+
+ if ((DIR_P (0) | DIR_P (1))
+ && recursive
+ && (new_file
+ || (unidirectional_new_file
+ && cmp.file[0].desc == NONEXISTENT)))
+ status = diff_dirs (&cmp, compare_files);
+ else
+ {
+ char const *dir;
+
+ /* PARENT must be non-NULL here. */
+ assert (parent);
+ dir = parent->file[cmp.file[0].desc == NONEXISTENT].name;
+
+ /* See POSIX 1003.1-2001 for this format. */
+ message ("Only in %s: %s\n", dir, name0);
+
+ status = EXIT_FAILURE;
+ }
+ }
+ else
+ {
+ /* We have two files that are not to be compared. */
+
+ /* See POSIX 1003.1-2001 for this format. */
+ message5 ("File %s is a %s while file %s is a %s\n",
+ file_label[0] ? file_label[0] : cmp.file[0].name,
+ file_type (&cmp.file[0].stat),
+ file_label[1] ? file_label[1] : cmp.file[1].name,
+ file_type (&cmp.file[1].stat));
+
+ /* This is a difference. */
+ status = EXIT_FAILURE;
+ }
+ }
+ else if (S_ISLNK (cmp.file[0].stat.st_mode)
+ || S_ISLNK (cmp.file[1].stat.st_mode))
+ {
+ /* We get here only if we use lstat(), not stat(). */
+ assert (no_dereference_symlinks);
+
+ if (S_ISLNK (cmp.file[0].stat.st_mode)
+ && S_ISLNK (cmp.file[1].stat.st_mode))
+ {
+ /* Compare the values of the symbolic links. */
+ char *link_value[2] = { NULL, NULL };
+
+ for (f = 0; f < 2; f++)
+ {
+ link_value[f] = xreadlink (cmp.file[f].name);
+ if (link_value[f] == NULL)
+ {
+ perror_with_name (cmp.file[f].name);
+ status = EXIT_TROUBLE;
+ break;
+ }
+ }
+ if (status == EXIT_SUCCESS)
+ {
+ if ( ! STREQ (link_value[0], link_value[1]))
+ {
+ message ("Symbolic links %s and %s differ\n",
+ cmp.file[0].name, cmp.file[1].name);
+ /* This is a difference. */
+ status = EXIT_FAILURE;
+ }
+ }
+ for (f = 0; f < 2; f++)
+ free (link_value[f]);
+ }
+ else
+ {
+ /* We have two files that are not to be compared, because
+ one of them is a symbolic link and the other one is not. */
+
+ message5 ("File %s is a %s while file %s is a %s\n",
+ file_label[0] ? file_label[0] : cmp.file[0].name,
+ file_type (&cmp.file[0].stat),
+ file_label[1] ? file_label[1] : cmp.file[1].name,
+ file_type (&cmp.file[1].stat));
+
+ /* This is a difference. */
+ status = EXIT_FAILURE;
+ }
+ }
+ else if (files_can_be_treated_as_binary
+ && S_ISREG (cmp.file[0].stat.st_mode)
+ && S_ISREG (cmp.file[1].stat.st_mode)
+ && cmp.file[0].stat.st_size != cmp.file[1].stat.st_size
+ && 0 < cmp.file[0].stat.st_size
+ && 0 < cmp.file[1].stat.st_size)
+ {
+ message ("Files %s and %s differ\n",
+ file_label[0] ? file_label[0] : cmp.file[0].name,
+ file_label[1] ? file_label[1] : cmp.file[1].name);
+ status = EXIT_FAILURE;
+ }
+ else
+ {
+ /* Both exist and neither is a directory. */
+
+ /* Open the files and record their descriptors. */
+
+ int oflags = O_RDONLY | (binary ? O_BINARY : 0);
+
+ if (cmp.file[0].desc == UNOPENED)
+ if ((cmp.file[0].desc = open (cmp.file[0].name, oflags, 0)) < 0)
+ {
+ perror_with_name (cmp.file[0].name);
+ status = EXIT_TROUBLE;
+ }
+ if (cmp.file[1].desc == UNOPENED)
+ {
+ if (same_files)
+ cmp.file[1].desc = cmp.file[0].desc;
+ else if ((cmp.file[1].desc = open (cmp.file[1].name, oflags, 0)) < 0)
+ {
+ perror_with_name (cmp.file[1].name);
+ status = EXIT_TROUBLE;
+ }
+ }
+
+ /* Compare the files, if no error was found. */
+
+ if (status == EXIT_SUCCESS)
+ status = diff_2_files (&cmp);
+
+ /* Close the file descriptors. */
+
+ if (0 <= cmp.file[0].desc && close (cmp.file[0].desc) != 0)
+ {
+ perror_with_name (cmp.file[0].name);
+ status = EXIT_TROUBLE;
+ }
+ if (0 <= cmp.file[1].desc && cmp.file[0].desc != cmp.file[1].desc
+ && close (cmp.file[1].desc) != 0)
+ {
+ perror_with_name (cmp.file[1].name);
+ status = EXIT_TROUBLE;
+ }
+ }
+
+ /* Now the comparison has been done, if no error prevented it,
+ and STATUS is the value this function will return. */
+
+ if (status == EXIT_SUCCESS)
+ {
+ if (report_identical_files && !DIR_P (0))
+ message ("Files %s and %s are identical\n",
+ file_label[0] ? file_label[0] : cmp.file[0].name,
+ file_label[1] ? file_label[1] : cmp.file[1].name);
+ }
+ else
+ {
+ /* Flush stdout so that the user sees differences immediately.
+ This can hurt performance, unfortunately. */
+ if (fflush (stdout) != 0)
+ pfatal_with_name (_("standard output"));
+ }
+
+ free (free0);
+ free (free1);
+
+ return status;
+}
diff --git a/src/diff.h b/src/diff.h
new file mode 100644
index 0000000..0983e7c
--- /dev/null
+++ b/src/diff.h
@@ -0,0 +1,423 @@
+/* Shared definitions for GNU DIFF
+
+ Copyright (C) 1988-1989, 1991-1995, 1998, 2001-2002, 2004, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "system.h"
+#include <regex.h>
+#include <stdio.h>
+#include <unlocked-io.h>
+
+/* What kind of changes a hunk contains. */
+enum changes
+{
+ /* No changes: lines common to both files. */
+ UNCHANGED,
+
+ /* Deletes only: lines taken from just the first file. */
+ OLD,
+
+ /* Inserts only: lines taken from just the second file. */
+ NEW,
+
+ /* Both deletes and inserts: a hunk containing both old and new lines. */
+ CHANGED
+};
+
+/* When colors should be used in the output. */
+enum colors_style
+{
+ /* Never output colors. */
+ NEVER,
+
+ /* Output colors if the output is a terminal. */
+ AUTO,
+
+ /* Always output colors. */
+ ALWAYS,
+};
+
+/* Variables for command line options */
+
+#ifndef GDIFF_MAIN
+# define XTERN extern
+#else
+# define XTERN
+#endif
+
+enum output_style
+{
+ /* No output style specified. */
+ OUTPUT_UNSPECIFIED,
+
+ /* Default output style. */
+ OUTPUT_NORMAL,
+
+ /* Output the differences with lines of context before and after (-c). */
+ OUTPUT_CONTEXT,
+
+ /* Output the differences in a unified context diff format (-u). */
+ OUTPUT_UNIFIED,
+
+ /* Output the differences as commands suitable for 'ed' (-e). */
+ OUTPUT_ED,
+
+ /* Output the diff as a forward ed script (-f). */
+ OUTPUT_FORWARD_ED,
+
+ /* Like -f, but output a count of changed lines in each "command" (-n). */
+ OUTPUT_RCS,
+
+ /* Output merged #ifdef'd file (-D). */
+ OUTPUT_IFDEF,
+
+ /* Output sdiff style (-y). */
+ OUTPUT_SDIFF
+};
+
+/* True for output styles that are robust,
+ i.e. can handle a file that ends in a non-newline. */
+#define ROBUST_OUTPUT_STYLE(S) ((S) != OUTPUT_ED && (S) != OUTPUT_FORWARD_ED)
+
+XTERN enum output_style output_style;
+
+/* Define the current color context used to print a line. */
+XTERN enum colors_style colors_style;
+
+/* Nonzero if output cannot be generated for identical files. */
+XTERN bool no_diff_means_no_output;
+
+/* Number of lines of context to show in each set of diffs.
+ This is zero when context is not to be shown. */
+XTERN lin context;
+
+/* Consider all files as text files (-a).
+ Don't interpret codes over 0177 as implying a "binary file". */
+XTERN bool text;
+
+/* Number of lines to keep in identical prefix and suffix. */
+XTERN lin horizon_lines;
+
+/* The significance of white space during comparisons. */
+enum DIFF_white_space
+{
+ /* All white space is significant (the default). */
+ IGNORE_NO_WHITE_SPACE,
+
+ /* Ignore changes due to tab expansion (-E). */
+ IGNORE_TAB_EXPANSION,
+
+ /* Ignore changes in trailing horizontal white space (-Z). */
+ IGNORE_TRAILING_SPACE,
+
+ /* IGNORE_TAB_EXPANSION and IGNORE_TRAILING_SPACE are a special case
+ because they are independent and can be ORed together, yielding
+ IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE. */
+ IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE,
+
+ /* Ignore changes in horizontal white space (-b). */
+ IGNORE_SPACE_CHANGE,
+
+ /* Ignore all horizontal white space (-w). */
+ IGNORE_ALL_SPACE
+};
+XTERN enum DIFF_white_space ignore_white_space;
+
+/* Ignore changes that affect only blank lines (-B). */
+XTERN bool ignore_blank_lines;
+
+/* Files can be compared byte-by-byte, as if they were binary.
+ This depends on various options. */
+XTERN bool files_can_be_treated_as_binary;
+
+/* Ignore differences in case of letters (-i). */
+XTERN bool ignore_case;
+
+/* Ignore differences in case of letters in file names. */
+XTERN bool ignore_file_name_case;
+
+/* Act on symbolic links themselves rather than on their target
+ (--no-dereference). */
+XTERN bool no_dereference_symlinks;
+
+/* File labels for '-c' output headers (--label). */
+XTERN char *file_label[2];
+
+/* Regexp to identify function-header lines (-F). */
+XTERN struct re_pattern_buffer function_regexp;
+
+/* Ignore changes that affect only lines matching this regexp (-I). */
+XTERN struct re_pattern_buffer ignore_regexp;
+
+/* Say only whether files differ, not how (-q). */
+XTERN bool brief;
+
+/* Expand tabs in the output so the text lines up properly
+ despite the characters added to the front of each line (-t). */
+XTERN bool expand_tabs;
+
+/* Number of columns between tab stops. */
+XTERN size_t tabsize;
+
+/* Use a tab in the output, rather than a space, before the text of an
+ input line, so as to keep the proper alignment in the input line
+ without changing the characters in it (-T). */
+XTERN bool initial_tab;
+
+/* Do not output an initial space or tab before the text of an empty line. */
+XTERN bool suppress_blank_empty;
+
+/* Remove trailing carriage returns from input. */
+XTERN bool strip_trailing_cr;
+
+/* In directory comparison, specify file to start with (-S).
+ This is used for resuming an aborted comparison.
+ All file names less than this name are ignored. */
+XTERN char const *starting_file;
+
+/* Pipe each file's output through pr (-l). */
+XTERN bool paginate;
+
+/* Line group formats for unchanged, old, new, and changed groups. */
+XTERN char const *group_format[CHANGED + 1];
+
+/* Line formats for unchanged, old, and new lines. */
+XTERN char const *line_format[NEW + 1];
+
+/* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */
+XTERN bool sdiff_merge_assist;
+
+/* Tell OUTPUT_SDIFF to show only the left version of common lines. */
+XTERN bool left_column;
+
+/* Tell OUTPUT_SDIFF to not show common lines. */
+XTERN bool suppress_common_lines;
+
+/* The half line width and column 2 offset for OUTPUT_SDIFF. */
+XTERN size_t sdiff_half_width;
+XTERN size_t sdiff_column2_offset;
+
+/* String containing all the command options diff received,
+ with spaces between and at the beginning but none at the end.
+ If there were no options given, this string is empty. */
+XTERN char *switch_string;
+
+/* Use heuristics for better speed with large files with a small
+ density of changes. */
+XTERN bool speed_large_files;
+
+/* Patterns that match file names to be excluded. */
+XTERN struct exclude *excluded;
+
+/* Don't discard lines. This makes things slower (sometimes much
+ slower) but will find a guaranteed minimal set of changes. */
+XTERN bool minimal;
+
+/* The strftime format to use for time strings. */
+XTERN char const *time_format;
+
+/* The result of comparison is an "edit script": a chain of 'struct change'.
+ Each 'struct change' represents one place where some lines are deleted
+ and some are inserted.
+
+ LINE0 and LINE1 are the first affected lines in the two files (origin 0).
+ DELETED is the number of lines deleted here from file 0.
+ INSERTED is the number of lines inserted here in file 1.
+
+ If DELETED is 0 then LINE0 is the number of the line before
+ which the insertion was done; vice versa for INSERTED and LINE1. */
+
+struct change
+{
+ struct change *link; /* Previous or next edit command */
+ lin inserted; /* # lines of file 1 changed here. */
+ lin deleted; /* # lines of file 0 changed here. */
+ lin line0; /* Line number of 1st deleted line. */
+ lin line1; /* Line number of 1st inserted line. */
+ bool ignore; /* Flag used in context.c. */
+};
+
+/* Structures that describe the input files. */
+
+/* Data on one input file being compared. */
+
+struct file_data {
+ int desc; /* File descriptor */
+ char const *name; /* File name */
+ struct stat stat; /* File status */
+
+ /* Buffer in which text of file is read. */
+ word *buffer;
+
+ /* Allocated size of buffer, in bytes. Always a multiple of
+ sizeof *buffer. */
+ size_t bufsize;
+
+ /* Number of valid bytes now in the buffer. */
+ size_t buffered;
+
+ /* Array of pointers to lines in the file. */
+ char const **linbuf;
+
+ /* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines.
+ linebuf[linbuf_base ... buffered_lines - 1] are possibly differing.
+ linebuf[linbuf_base ... valid_lines - 1] contain valid data.
+ linebuf[linbuf_base ... alloc_lines - 1] are allocated. */
+ lin linbuf_base, buffered_lines, valid_lines, alloc_lines;
+
+ /* Pointer to end of prefix of this file to ignore when hashing. */
+ char const *prefix_end;
+
+ /* Count of lines in the prefix.
+ There are this many lines in the file before linbuf[0]. */
+ lin prefix_lines;
+
+ /* Pointer to start of suffix of this file to ignore when hashing. */
+ char const *suffix_begin;
+
+ /* Vector, indexed by line number, containing an equivalence code for
+ each line. It is this vector that is actually compared with that
+ of another file to generate differences. */
+ lin *equivs;
+
+ /* Vector, like the previous one except that
+ the elements for discarded lines have been squeezed out. */
+ lin *undiscarded;
+
+ /* Vector mapping virtual line numbers (not counting discarded lines)
+ to real ones (counting those lines). Both are origin-0. */
+ lin *realindexes;
+
+ /* Total number of nondiscarded lines. */
+ lin nondiscarded_lines;
+
+ /* Vector, indexed by real origin-0 line number,
+ containing 1 for a line that is an insertion or a deletion.
+ The results of comparison are stored here. */
+ char *changed;
+
+ /* 1 if file ends in a line with no final newline. */
+ bool missing_newline;
+
+ /* 1 if at end of file. */
+ bool eof;
+
+ /* 1 more than the maximum equivalence value used for this or its
+ sibling file. */
+ lin equiv_max;
+};
+
+/* The file buffer, considered as an array of bytes rather than
+ as an array of words. */
+#define FILE_BUFFER(f) ((char *) (f)->buffer)
+
+/* Data on two input files being compared. */
+
+struct comparison
+ {
+ struct file_data file[2];
+ struct comparison const *parent; /* parent, if a recursive comparison */
+ };
+
+/* Describe the two files currently being compared. */
+
+XTERN struct file_data files[2];
+
+/* Stdio stream to output diffs to. */
+
+XTERN FILE *outfile;
+
+/* Declare various functions. */
+
+/* analyze.c */
+extern int diff_2_files (struct comparison *);
+
+/* context.c */
+extern void print_context_header (struct file_data[], char const * const *, bool);
+extern void print_context_script (struct change *, bool);
+
+/* dir.c */
+extern int diff_dirs (struct comparison const *,
+ int (*) (struct comparison const *,
+ char const *, char const *));
+extern char *find_dir_file_pathname (char const *, char const *);
+
+/* ed.c */
+extern void print_ed_script (struct change *);
+extern void pr_forward_ed_script (struct change *);
+
+/* ifdef.c */
+extern void print_ifdef_script (struct change *);
+
+/* io.c */
+extern void file_block_read (struct file_data *, size_t);
+extern bool read_files (struct file_data[], bool);
+
+/* normal.c */
+extern void print_normal_script (struct change *);
+
+/* rcs.c */
+extern void print_rcs_script (struct change *);
+
+/* side.c */
+extern void print_sdiff_script (struct change *);
+
+/* util.c */
+extern char const change_letter[4];
+extern char const pr_program[];
+extern char *concat (char const *, char const *, char const *);
+extern bool lines_differ (char const *, char const *) _GL_ATTRIBUTE_PURE;
+extern lin translate_line_number (struct file_data const *, lin);
+extern struct change *find_change (struct change *);
+extern struct change *find_reverse_change (struct change *);
+extern void *zalloc (size_t);
+extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *);
+extern void begin_output (void);
+extern void debug_script (struct change *);
+extern void fatal (char const *) __attribute__((noreturn));
+extern void finish_output (void);
+extern void message (char const *, char const *, char const *);
+extern void message5 (char const *, char const *, char const *,
+ char const *, char const *);
+extern void output_1_line (char const *, char const *, char const *,
+ char const *);
+extern void perror_with_name (char const *);
+extern void pfatal_with_name (char const *) __attribute__((noreturn));
+extern void print_1_line (char const *, char const * const *);
+extern void print_1_line_nl (char const *, char const * const *, bool);
+extern void print_message_queue (void);
+extern void print_number_range (char, struct file_data *, lin, lin);
+extern void print_script (struct change *, struct change * (*) (struct change *),
+ void (*) (struct change *));
+extern void setup_output (char const *, char const *, bool);
+extern void translate_range (struct file_data const *, lin, lin,
+ long int *, long int *);
+
+enum color_context
+{
+ HEADER_CONTEXT,
+ ADD_CONTEXT,
+ DELETE_CONTEXT,
+ RESET_CONTEXT,
+ LINE_NUMBER_CONTEXT,
+};
+
+XTERN bool presume_output_tty;
+
+extern void set_color_context (enum color_context color_context);
+extern void set_color_palette (char const *palette);
diff --git a/src/diff3.c b/src/diff3.c
new file mode 100644
index 0000000..b80aeb3
--- /dev/null
+++ b/src/diff3.c
@@ -0,0 +1,1791 @@
+/* diff3 - compare three files line by line
+
+ Copyright (C) 1988-1989, 1992-1996, 1998, 2001-2002, 2004, 2006, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "system.h"
+#include "paths.h"
+
+#include <stdio.h>
+#include <unlocked-io.h>
+
+#include <c-stack.h>
+#include <cmpbuf.h>
+#include <error.h>
+#include <exitfail.h>
+#include <file-type.h>
+#include <getopt.h>
+#include <progname.h>
+#include <system-quote.h>
+#include <version-etc.h>
+#include <xalloc.h>
+#include <xfreopen.h>
+
+/* The official name of this program (e.g., no 'g' prefix). */
+#define PROGRAM_NAME "diff3"
+
+#define AUTHORS \
+ proper_name ("Randy Smith")
+
+/* Internal data structures and macros for the diff3 program; includes
+ data structures for both diff3 diffs and normal diffs. */
+
+/* Different files within a three way diff. */
+#define FILE0 0
+#define FILE1 1
+#define FILE2 2
+
+/* A three way diff is built from two two-way diffs; the file which
+ the two two-way diffs share is: */
+#define FILEC FILE2
+
+/* Different files within a two way diff.
+ FC is the common file, FO the other file. */
+#define FO 0
+#define FC 1
+
+/* The ranges are indexed by */
+#define RANGE_START 0
+#define RANGE_END 1
+
+enum diff_type {
+ ERROR, /* Should not be used */
+ ADD, /* Two way diff add */
+ CHANGE, /* Two way diff change */
+ DELETE, /* Two way diff delete */
+ DIFF_ALL, /* All three are different */
+ DIFF_1ST, /* Only the first is different */
+ DIFF_2ND, /* Only the second */
+ DIFF_3RD /* Only the third */
+};
+
+/* Two way diff */
+struct diff_block {
+ lin ranges[2][2]; /* Ranges are inclusive */
+ char **lines[2]; /* The actual lines (may contain nulls) */
+ size_t *lengths[2]; /* Line lengths (including newlines, if any) */
+ struct diff_block *next;
+#ifdef lint
+ struct diff_block *n2; /* Used only when freeing. */
+#endif
+};
+
+/* Three way diff */
+
+struct diff3_block {
+ enum diff_type correspond; /* Type of diff */
+ lin ranges[3][2]; /* Ranges are inclusive */
+ char **lines[3]; /* The actual lines (may contain nulls) */
+ size_t *lengths[3]; /* Line lengths (including newlines, if any) */
+ struct diff3_block *next;
+};
+
+/* Access the ranges on a diff block. */
+#define D_LOWLINE(diff, filenum) \
+ ((diff)->ranges[filenum][RANGE_START])
+#define D_HIGHLINE(diff, filenum) \
+ ((diff)->ranges[filenum][RANGE_END])
+#define D_NUMLINES(diff, filenum) \
+ (D_HIGHLINE (diff, filenum) - D_LOWLINE (diff, filenum) + 1)
+
+/* Access the line numbers in a file in a diff by relative line
+ numbers (i.e. line number within the diff itself). Note that these
+ are lvalues and can be used for assignment. */
+#define D_RELNUM(diff, filenum, linenum) \
+ ((diff)->lines[filenum][linenum])
+#define D_RELLEN(diff, filenum, linenum) \
+ ((diff)->lengths[filenum][linenum])
+
+/* And get at them directly, when that should be necessary. */
+#define D_LINEARRAY(diff, filenum) \
+ ((diff)->lines[filenum])
+#define D_LENARRAY(diff, filenum) \
+ ((diff)->lengths[filenum])
+
+/* Next block. */
+#define D_NEXT(diff) ((diff)->next)
+
+/* Access the type of a diff3 block. */
+#define D3_TYPE(diff) ((diff)->correspond)
+
+/* Line mappings based on diffs. The first maps off the top of the
+ diff, the second off of the bottom. */
+#define D_HIGH_MAPLINE(diff, fromfile, tofile, linenum) \
+ ((linenum) \
+ - D_HIGHLINE ((diff), (fromfile)) \
+ + D_HIGHLINE ((diff), (tofile)))
+
+#define D_LOW_MAPLINE(diff, fromfile, tofile, linenum) \
+ ((linenum) \
+ - D_LOWLINE ((diff), (fromfile)) \
+ + D_LOWLINE ((diff), (tofile)))
+
+/* Options variables for flags set on command line. */
+
+/* If nonzero, treat all files as text files, never as binary. */
+static bool text;
+
+/* Remove trailing carriage returns from input. */
+static bool strip_trailing_cr;
+
+/* If nonzero, write out an ed script instead of the standard diff3 format. */
+static bool edscript;
+
+/* If nonzero, in the case of overlapping diffs (type DIFF_ALL),
+ preserve the lines which would normally be deleted from
+ file 1 with a special flagging mechanism. */
+static bool flagging;
+
+/* Use a tab to align output lines (-T). */
+static bool initial_tab;
+
+/* If nonzero, do not output information for overlapping diffs. */
+static bool simple_only;
+
+/* If nonzero, do not output information for non-overlapping diffs. */
+static bool overlap_only;
+
+/* If nonzero, show information for DIFF_2ND diffs. */
+static bool show_2nd;
+
+/* If nonzero, include ':wq' at the end of the script
+ to write out the file being edited. */
+static bool finalwrite;
+
+/* If nonzero, output a merged file. */
+static bool merge;
+
+static char *read_diff (char const *, char const *, char **);
+static char *scan_diff_line (char *, char **, size_t *, char *, char);
+static enum diff_type process_diff_control (char **, struct diff_block *);
+static bool compare_line_list (char * const[], size_t const[], char * const[], size_t const[], lin);
+static bool copy_stringlist (char * const[], size_t const[], char *[], size_t[], lin);
+static bool output_diff3_edscript (FILE *, struct diff3_block *, int const[3], int const[3], char const *, char const *, char const *);
+static bool output_diff3_merge (FILE *, FILE *, struct diff3_block *, int const[3], int const[3], char const *, char const *, char const *);
+static struct diff3_block *create_diff3_block (lin, lin, lin, lin, lin, lin);
+static struct diff3_block *make_3way_diff (struct diff_block *, struct diff_block *);
+static struct diff3_block *reverse_diff3_blocklist (struct diff3_block *);
+static struct diff3_block *using_to_diff3_block (struct diff_block *[2], struct diff_block *[2], int, int, struct diff3_block const *);
+static struct diff_block *process_diff (char const *, char const *, struct diff_block **, char **);
+static void check_stdout (void);
+static void fatal (char const *) __attribute__((noreturn));
+static void output_diff3 (FILE *, struct diff3_block *, int const[3], int const[3]);
+static void perror_with_exit (char const *) __attribute__((noreturn));
+static void try_help (char const *, char const *) __attribute__((noreturn));
+static void usage (void);
+
+static char const *diff_program = DEFAULT_DIFF_PROGRAM;
+
+/* Values for long options that do not have single-letter equivalents. */
+enum
+{
+ DIFF_PROGRAM_OPTION = CHAR_MAX + 1,
+ HELP_OPTION,
+ STRIP_TRAILING_CR_OPTION
+};
+
+static struct option const longopts[] =
+{
+ {"diff-program", 1, 0, DIFF_PROGRAM_OPTION},
+ {"easy-only", 0, 0, '3'},
+ {"ed", 0, 0, 'e'},
+ {"help", 0, 0, HELP_OPTION},
+ {"initial-tab", 0, 0, 'T'},
+ {"label", 1, 0, 'L'},
+ {"merge", 0, 0, 'm'},
+ {"overlap-only", 0, 0, 'x'},
+ {"show-all", 0, 0, 'A'},
+ {"show-overlap", 0, 0, 'E'},
+ {"strip-trailing-cr", 0, 0, STRIP_TRAILING_CR_OPTION},
+ {"text", 0, 0, 'a'},
+ {"version", 0, 0, 'v'},
+ {0, 0, 0, 0}
+};
+
+static void
+free_diff_block (struct diff_block *p)
+{
+#ifndef lint
+ (void)p;
+#else
+ while (p)
+ {
+ free (p->lines[0]);
+ free (p->lines[1]);
+ free (p->lengths[0]);
+ free (p->lengths[1]);
+ struct diff_block *next = p->n2;
+ free (p);
+ p = next;
+ }
+#endif
+}
+
+/* Copy each next pointer to n2, since make_3way_diff would clobber the former,
+ yet we will still need something to free these buffers. */
+static void
+next_to_n2 (struct diff_block *p)
+{
+#ifndef lint
+ (void)p;
+#else
+ while (p)
+ p = p->n2 = p->next;
+#endif
+}
+
+int
+main (int argc, char **argv)
+{
+ int c, i;
+ int common;
+ int mapping[3];
+ int rev_mapping[3];
+ int incompat = 0;
+ bool conflicts_found;
+ struct diff_block *thread0, *thread1, *last_block;
+ struct diff3_block *diff3;
+ int tag_count = 0;
+ char *tag_strings[3];
+ char *commonname;
+ char **file;
+ struct stat statb;
+
+ exit_failure = EXIT_TROUBLE;
+ initialize_main (&argc, &argv);
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ c_stack_action (0);
+
+ while ((c = getopt_long (argc, argv, "aeimvx3AEL:TX", longopts, 0)) != -1)
+ {
+ switch (c)
+ {
+ case 'a':
+ text = true;
+ break;
+ case 'A':
+ show_2nd = true;
+ flagging = true;
+ incompat++;
+ break;
+ case 'x':
+ overlap_only = true;
+ incompat++;
+ break;
+ case '3':
+ simple_only = true;
+ incompat++;
+ break;
+ case 'i':
+ finalwrite = true;
+ break;
+ case 'm':
+ merge = true;
+ break;
+ case 'X':
+ overlap_only = true;
+ /* Fall through. */
+ case 'E':
+ flagging = true;
+ /* Fall through. */
+ case 'e':
+ incompat++;
+ break;
+ case 'T':
+ initial_tab = true;
+ break;
+ case STRIP_TRAILING_CR_OPTION:
+ strip_trailing_cr = true;
+ break;
+ case 'v':
+ version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version,
+ AUTHORS, (char *) NULL);
+ check_stdout ();
+ return EXIT_SUCCESS;
+ case DIFF_PROGRAM_OPTION:
+ diff_program = optarg;
+ break;
+ case HELP_OPTION:
+ usage ();
+ check_stdout ();
+ return EXIT_SUCCESS;
+ case 'L':
+ /* Handle up to three -L options. */
+ if (tag_count < 3)
+ {
+ tag_strings[tag_count++] = optarg;
+ break;
+ }
+ try_help ("too many file label options", 0);
+ default:
+ try_help (0, 0);
+ }
+ }
+
+ edscript = incompat & ~merge; /* -AeExX3 without -m implies ed script. */
+ show_2nd |= ~incompat & merge; /* -m without -AeExX3 implies -A. */
+ flagging |= ~incompat & merge;
+
+ if (incompat > 1 /* Ensure at most one of -AeExX3. */
+ || finalwrite & merge /* -i -m would rewrite input file. */
+ || (tag_count && ! flagging)) /* -L requires one of -AEX. */
+ try_help ("incompatible options", 0);
+
+ if (argc - optind != 3)
+ {
+ if (argc - optind < 3)
+ try_help ("missing operand after '%s'", argv[argc - 1]);
+ else
+ try_help ("extra operand '%s'", argv[optind + 3]);
+ }
+
+ file = &argv[optind];
+
+ for (i = tag_count; i < 3; i++)
+ tag_strings[i] = file[i];
+
+ /* Always compare file1 to file2, even if file2 is "-".
+ This is needed for -mAeExX3. Using the file0 as
+ the common file would produce wrong results, because if the
+ file0-file1 diffs didn't line up with the file0-file2 diffs
+ (which is entirely possible since we don't use diff's -n option),
+ diff3 might report phantom changes from file1 to file2.
+
+ Also, try to compare file0 to file1, because this is where
+ changes are expected to come from. Diffing between these pairs
+ of files is more likely to avoid phantom changes from file0 to file1.
+
+ Historically, the default common file was file2, so some older
+ applications (e.g. Emacs ediff) used file2 as the ancestor. So,
+ for compatibility, if this is a 3-way diff (not a merge or
+ edscript), prefer file2 as the common file. */
+
+ common = 2 - (edscript | merge);
+
+ if (STREQ (file[common], "-"))
+ {
+ /* Sigh. We've got standard input as the common file. We can't
+ call diff twice on stdin. Use the other arg as the common
+ file instead. */
+ common = 3 - common;
+ if (STREQ (file[0], "-") || STREQ (file[common], "-"))
+ fatal ("'-' specified for more than one input file");
+ }
+
+ mapping[0] = 0;
+ mapping[1] = 3 - common;
+ mapping[2] = common;
+
+ for (i = 0; i < 3; i++)
+ rev_mapping[mapping[i]] = i;
+
+ for (i = 0; i < 3; i++)
+ if (! STREQ (file[i], "-"))
+ {
+ if (stat (file[i], &statb) < 0)
+ perror_with_exit (file[i]);
+ else if (S_ISDIR (statb.st_mode))
+ error (EXIT_TROUBLE, EISDIR, "%s", file[i]);
+ }
+
+#ifdef SIGCHLD
+ /* System V fork+wait does not work if SIGCHLD is ignored. */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
+ /* Invoke diff twice on two pairs of input files, combine the two
+ diffs, and output them. */
+
+ char *b0, *b1;
+ commonname = file[rev_mapping[FILEC]];
+ thread1 = process_diff (file[rev_mapping[FILE1]], commonname, &last_block, &b1);
+ thread0 = process_diff (file[rev_mapping[FILE0]], commonname, &last_block, &b0);
+
+ next_to_n2 (thread0);
+ next_to_n2 (thread1);
+
+ diff3 = make_3way_diff (thread0, thread1);
+
+ free_diff_block (thread0);
+ free_diff_block (thread1);
+
+ if (edscript)
+ conflicts_found
+ = output_diff3_edscript (stdout, diff3, mapping, rev_mapping,
+ tag_strings[0], tag_strings[1], tag_strings[2]);
+ else if (merge)
+ {
+ xfreopen (file[rev_mapping[FILE0]], "r", stdin);
+ conflicts_found
+ = output_diff3_merge (stdin, stdout, diff3, mapping, rev_mapping,
+ tag_strings[0], tag_strings[1], tag_strings[2]);
+ if (ferror (stdin))
+ fatal ("read failed");
+ }
+ else
+ {
+ output_diff3 (stdout, diff3, mapping, rev_mapping);
+ conflicts_found = false;
+ }
+
+ free (b0);
+ free (b1);
+ check_stdout ();
+ exit (conflicts_found);
+}
+
+static void
+try_help (char const *reason_msgid, char const *operand)
+{
+ if (reason_msgid)
+ error (0, 0, _(reason_msgid), operand);
+ error (EXIT_TROUBLE, 0,
+ _("Try '%s --help' for more information."), program_name);
+ abort ();
+}
+
+static void
+check_stdout (void)
+{
+ if (ferror (stdout))
+ fatal ("write failed");
+ else if (fclose (stdout) != 0)
+ perror_with_exit (_("standard output"));
+}
+
+static char const * const option_help_msgid[] = {
+ N_("-A, --show-all output all changes, bracketing conflicts"),
+ "",
+ N_("-e, --ed output ed script incorporating changes\n"
+ " from OLDFILE to YOURFILE into MYFILE"),
+ N_("-E, --show-overlap like -e, but bracket conflicts"),
+ N_("-3, --easy-only like -e, but incorporate only nonoverlapping changes"),
+ N_("-x, --overlap-only like -e, but incorporate only overlapping changes"),
+ N_("-X like -x, but bracket conflicts"),
+ N_("-i append 'w' and 'q' commands to ed scripts"),
+ "",
+ N_("-m, --merge output actual merged file, according to\n"
+ " -A if no other options are given"),
+ "",
+ N_("-a, --text treat all files as text"),
+ N_(" --strip-trailing-cr strip trailing carriage return on input"),
+ N_("-T, --initial-tab make tabs line up by prepending a tab"),
+ N_(" --diff-program=PROGRAM use PROGRAM to compare files"),
+ N_("-L, --label=LABEL use LABEL instead of file name\n"
+ " (can be repeated up to three times)"),
+ "",
+ N_(" --help display this help and exit"),
+ N_("-v, --version output version information and exit"),
+ 0
+};
+
+static void
+usage (void)
+{
+ char const * const *p;
+
+ printf (_("Usage: %s [OPTION]... MYFILE OLDFILE YOURFILE\n"),
+ program_name);
+ printf ("%s\n\n", _("Compare three files line by line."));
+
+ fputs (_("\
+Mandatory arguments to long options are mandatory for short options too.\n\
+"), stdout);
+ for (p = option_help_msgid; *p; p++)
+ if (**p)
+ printf (" %s\n", _(*p));
+ else
+ putchar ('\n');
+ fputs (_("\n\
+The default output format is a somewhat human-readable representation of\n\
+the changes.\n\
+\n\
+The -e, -E, -x, -X (and corresponding long) options cause an ed script\n\
+to be output instead of the default.\n\
+\n\
+Finally, the -m (--merge) option causes diff3 to do the merge internally\n\
+and output the actual merged file. For unusual input, this is more\n\
+robust than using ed.\n"), stdout);
+ printf ("\n%s\n%s\n",
+ _("If a FILE is '-', read standard input."),
+ _("Exit status is 0 if successful, 1 if conflicts, 2 if trouble."));
+ emit_bug_reporting_address ();
+}
+
+/* Combine the two diffs together into one.
+ Here is the algorithm:
+
+ File2 is shared in common between the two diffs.
+ Diff02 is the diff between 0 and 2.
+ Diff12 is the diff between 1 and 2.
+
+ 1) Find the range for the first block in File2.
+ a) Take the lowest of the two ranges (in File2) in the two
+ current blocks (one from each diff) as being the low
+ water mark. Assign the upper end of this block as
+ being the high water mark and move the current block up
+ one. Mark the block just moved over as to be used.
+ b) Check the next block in the diff that the high water
+ mark is *not* from.
+
+ *If* the high water mark is above
+ the low end of the range in that block,
+
+ mark that block as to be used and move the current
+ block up. Set the high water mark to the max of
+ the high end of this block and the current. Repeat b.
+
+ 2) Find the corresponding ranges in File0 (from the blocks
+ in diff02; line per line outside of diffs) and in File1.
+ Create a diff3_block, reserving space as indicated by the ranges.
+
+ 3) Copy all of the pointers for file2 in. At least for now,
+ do memcmp's between corresponding strings in the two diffs.
+
+ 4) Copy all of the pointers for file0 and 1 in. Get what is
+ needed from file2 (when there isn't a diff block, it's
+ identical to file2 within the range between diff blocks).
+
+ 5) If the diff blocks used came from only one of the two
+ strings of diffs, then that file (i.e. the one other than
+ the common file in that diff) is the odd person out. If
+ diff blocks are used from both sets, check to see if files
+ 0 and 1 match:
+
+ Same number of lines? If so, do a set of memcmp's (if
+ a memcmp matches; copy the pointer over; it'll be easier
+ later during comparisons). If they match, 0 & 1 are the
+ same. If not, all three different.
+
+ Then do it again, until the blocks are exhausted. */
+
+
+/* Make a three way diff (chain of diff3_block's) from two two way
+ diffs (chains of diff_block's). Assume that each of the two diffs
+ passed are onto the same file (i.e. that each of the diffs were
+ made "to" the same file). Return a three way diff pointer with
+ numbering FILE0 = the other file in diff02, FILE1 = the other file
+ in diff12, and FILEC = the common file. */
+
+static struct diff3_block *
+make_3way_diff (struct diff_block *thread0, struct diff_block *thread1)
+{
+ /* Work on the two diffs passed to it as threads. Thread number 0
+ is diff02, thread number 1 is diff12. USING is the base of the
+ list of blocks to be used to construct each block of the three
+ way diff; if no blocks from a particular thread are to be used,
+ that element of USING is 0. LAST_USING contains the last
+ elements on each of the using lists.
+
+ HIGH_WATER_MARK is the highest line number in the common file
+ described in any of the diffs in either of the USING lists.
+ HIGH_WATER_THREAD names the thread. Similarly BASE_WATER_MARK
+ and BASE_WATER_THREAD describe the lowest line number in the
+ common file described in any of the diffs in either of the USING
+ lists. HIGH_WATER_DIFF is the diff from which the
+ HIGH_WATER_MARK was taken.
+
+ HIGH_WATER_DIFF should always be equal to
+ LAST_USING[HIGH_WATER_THREAD]. OTHER_DIFF is the next diff to
+ check for higher water, and should always be equal to
+ CURRENT[HIGH_WATER_THREAD ^ 1]. OTHER_THREAD is the thread in
+ which the OTHER_DIFF is, and hence should always be equal to
+ HIGH_WATER_THREAD ^ 1.
+
+ LAST_DIFF is the last diff block produced by this routine, for
+ line correspondence purposes between that diff and the one
+ currently being worked on. It is ZERO_DIFF before any blocks
+ have been created. */
+
+ struct diff_block *using[2];
+ struct diff_block *last_using[2];
+ struct diff_block *current[2];
+
+ lin high_water_mark;
+
+ int high_water_thread;
+ int base_water_thread;
+ int other_thread;
+
+ struct diff_block *high_water_diff;
+ struct diff_block *other_diff;
+
+ struct diff3_block *result;
+ struct diff3_block *tmpblock;
+ struct diff3_block **result_end;
+
+ struct diff3_block const *last_diff3;
+
+ static struct diff3_block const zero_diff3;
+
+ /* Initialization */
+ result = 0;
+ result_end = &result;
+ current[0] = thread0; current[1] = thread1;
+ last_diff3 = &zero_diff3;
+
+ /* Sniff up the threads until we reach the end */
+
+ while (current[0] || current[1])
+ {
+ using[0] = using[1] = last_using[0] = last_using[1] = 0;
+
+ /* Setup low and high water threads, diffs, and marks. */
+ if (!current[0])
+ base_water_thread = 1;
+ else if (!current[1])
+ base_water_thread = 0;
+ else
+ base_water_thread =
+ (D_LOWLINE (current[0], FC) > D_LOWLINE (current[1], FC));
+
+ high_water_thread = base_water_thread;
+
+ high_water_diff = current[high_water_thread];
+
+ high_water_mark = D_HIGHLINE (high_water_diff, FC);
+
+ /* Make the diff you just got info from into the using class */
+ using[high_water_thread]
+ = last_using[high_water_thread]
+ = high_water_diff;
+ current[high_water_thread] = high_water_diff->next;
+ last_using[high_water_thread]->next = 0;
+
+ /* And mark the other diff */
+ other_thread = high_water_thread ^ 0x1;
+ other_diff = current[other_thread];
+
+ /* Shuffle up the ladder, checking the other diff to see if it
+ needs to be incorporated. */
+ while (other_diff
+ && D_LOWLINE (other_diff, FC) <= high_water_mark + 1)
+ {
+
+ /* Incorporate this diff into the using list. Note that
+ this doesn't take it off the current list */
+ if (using[other_thread])
+ last_using[other_thread]->next = other_diff;
+ else
+ using[other_thread] = other_diff;
+ last_using[other_thread] = other_diff;
+
+ /* Take it off the current list. Note that this following
+ code assumes that other_diff enters it equal to
+ current[high_water_thread ^ 0x1] */
+ current[other_thread] = current[other_thread]->next;
+ other_diff->next = 0;
+
+ /* Set the high_water stuff
+ If this comparison is equal, then this is the last pass
+ through this loop; since diff blocks within a given
+ thread cannot overlap, the high_water_mark will be
+ *below* the range_start of either of the next diffs. */
+
+ if (high_water_mark < D_HIGHLINE (other_diff, FC))
+ {
+ high_water_thread ^= 1;
+ high_water_mark = D_HIGHLINE (other_diff, FC);
+ }
+
+ /* Set the other diff */
+ other_thread = high_water_thread ^ 0x1;
+ other_diff = current[other_thread];
+ }
+
+ /* The using lists contain a list of all of the blocks to be
+ included in this diff3_block. Create it. */
+
+ tmpblock = using_to_diff3_block (using, last_using,
+ base_water_thread, high_water_thread,
+ last_diff3);
+
+ if (!tmpblock)
+ fatal ("internal error: screwup in format of diff blocks");
+
+ /* Put it on the list. */
+ *result_end = tmpblock;
+ result_end = &tmpblock->next;
+
+ /* Set up corresponding lines correctly. */
+ last_diff3 = tmpblock;
+ }
+ return result;
+}
+
+/* Take two lists of blocks (from two separate diff threads) and put
+ them together into one diff3 block. Return a pointer to this diff3
+ block or 0 for failure.
+
+ All arguments besides using are for the convenience of the routine;
+ they could be derived from the using array. LAST_USING is a pair
+ of pointers to the last blocks in the using structure. LOW_THREAD
+ and HIGH_THREAD tell which threads contain the lowest and highest
+ line numbers for File0. LAST_DIFF3 contains the last diff produced
+ in the calling routine. This is used for lines mappings that
+ would still be identical to the state that diff ended in.
+
+ A distinction should be made in this routine between the two diffs
+ that are part of a normal two diff block, and the three diffs that
+ are part of a diff3_block. */
+
+static struct diff3_block *
+using_to_diff3_block (struct diff_block *using[2],
+ struct diff_block *last_using[2],
+ int low_thread, int high_thread,
+ struct diff3_block const *last_diff3)
+{
+ lin low[2], high[2];
+ struct diff3_block *result;
+ struct diff_block *ptr;
+ int d;
+ lin i;
+
+ /* Find the range in the common file. */
+ lin lowc = D_LOWLINE (using[low_thread], FC);
+ lin highc = D_HIGHLINE (last_using[high_thread], FC);
+
+ /* Find the ranges in the other files.
+ If using[d] is null, that means that the file to which that diff
+ refers is equivalent to the common file over this range. */
+
+ for (d = 0; d < 2; d++)
+ if (using[d])
+ {
+ low[d] = D_LOW_MAPLINE (using[d], FC, FO, lowc);
+ high[d] = D_HIGH_MAPLINE (last_using[d], FC, FO, highc);
+ }
+ else
+ {
+ low[d] = D_HIGH_MAPLINE (last_diff3, FILEC, FILE0 + d, lowc);
+ high[d] = D_HIGH_MAPLINE (last_diff3, FILEC, FILE0 + d, highc);
+ }
+
+ /* Create a block with the appropriate sizes */
+ result = create_diff3_block (low[0], high[0], low[1], high[1], lowc, highc);
+
+ /* Copy information for the common file.
+ Return with a zero if any of the compares failed. */
+
+ for (d = 0; d < 2; d++)
+ for (ptr = using[d]; ptr; ptr = D_NEXT (ptr))
+ {
+ lin result_offset = D_LOWLINE (ptr, FC) - lowc;
+
+ if (!copy_stringlist (D_LINEARRAY (ptr, FC),
+ D_LENARRAY (ptr, FC),
+ D_LINEARRAY (result, FILEC) + result_offset,
+ D_LENARRAY (result, FILEC) + result_offset,
+ D_NUMLINES (ptr, FC)))
+ return 0;
+ }
+
+ /* Copy information for file d. First deal with anything that might be
+ before the first diff. */
+
+ for (d = 0; d < 2; d++)
+ {
+ struct diff_block *u = using[d];
+ lin lo = low[d], hi = high[d];
+
+ for (i = 0;
+ i + lo < (u ? D_LOWLINE (u, FO) : hi + 1);
+ i++)
+ {
+ D_RELNUM (result, FILE0 + d, i) = D_RELNUM (result, FILEC, i);
+ D_RELLEN (result, FILE0 + d, i) = D_RELLEN (result, FILEC, i);
+ }
+
+ for (ptr = u; ptr; ptr = D_NEXT (ptr))
+ {
+ lin result_offset = D_LOWLINE (ptr, FO) - lo;
+ lin linec;
+
+ if (!copy_stringlist (D_LINEARRAY (ptr, FO),
+ D_LENARRAY (ptr, FO),
+ D_LINEARRAY (result, FILE0 + d) + result_offset,
+ D_LENARRAY (result, FILE0 + d) + result_offset,
+ D_NUMLINES (ptr, FO)))
+ return 0;
+
+ /* Catch the lines between here and the next diff */
+ linec = D_HIGHLINE (ptr, FC) + 1 - lowc;
+ for (i = D_HIGHLINE (ptr, FO) + 1 - lo;
+ i < (D_NEXT (ptr) ? D_LOWLINE (D_NEXT (ptr), FO) : hi + 1) - lo;
+ i++)
+ {
+ D_RELNUM (result, FILE0 + d, i) = D_RELNUM (result, FILEC, linec);
+ D_RELLEN (result, FILE0 + d, i) = D_RELLEN (result, FILEC, linec);
+ linec++;
+ }
+ }
+ }
+
+ /* Set correspond */
+ if (!using[0])
+ D3_TYPE (result) = DIFF_2ND;
+ else if (!using[1])
+ D3_TYPE (result) = DIFF_1ST;
+ else
+ {
+ lin nl0 = D_NUMLINES (result, FILE0);
+ lin nl1 = D_NUMLINES (result, FILE1);
+
+ if (nl0 != nl1
+ || !compare_line_list (D_LINEARRAY (result, FILE0),
+ D_LENARRAY (result, FILE0),
+ D_LINEARRAY (result, FILE1),
+ D_LENARRAY (result, FILE1),
+ nl0))
+ D3_TYPE (result) = DIFF_ALL;
+ else
+ D3_TYPE (result) = DIFF_3RD;
+ }
+
+ return result;
+}
+
+/* Copy pointers from a list of strings to a different list of
+ strings. If a spot in the second list is already filled, make sure
+ that it is filled with the same string; if not, return false, the copy
+ incomplete. Upon successful completion of the copy, return true. */
+
+static bool
+copy_stringlist (char * const fromptrs[], size_t const fromlengths[],
+ char *toptrs[], size_t tolengths[],
+ lin copynum)
+{
+ register char * const *f = fromptrs;
+ register char **t = toptrs;
+ register size_t const *fl = fromlengths;
+ register size_t *tl = tolengths;
+
+ while (copynum--)
+ {
+ if (*t)
+ {
+ if (*fl != *tl || memcmp (*f, *t, *fl) != 0)
+ return false;
+ }
+ else
+ {
+ *t = *f;
+ *tl = *fl;
+ }
+
+ t++; f++; tl++; fl++;
+ }
+
+ return true;
+}
+
+/* Create a diff3_block, with ranges as specified in the arguments.
+ Allocate the arrays for the various pointers (and zero them) based
+ on the arguments passed. Return the block as a result. */
+
+static struct diff3_block *
+create_diff3_block (lin low0, lin high0,
+ lin low1, lin high1,
+ lin low2, lin high2)
+{
+ struct diff3_block *result = xmalloc (sizeof *result);
+ lin numlines;
+
+ D3_TYPE (result) = ERROR;
+ D_NEXT (result) = 0;
+
+ /* Assign ranges */
+ D_LOWLINE (result, FILE0) = low0;
+ D_HIGHLINE (result, FILE0) = high0;
+ D_LOWLINE (result, FILE1) = low1;
+ D_HIGHLINE (result, FILE1) = high1;
+ D_LOWLINE (result, FILE2) = low2;
+ D_HIGHLINE (result, FILE2) = high2;
+
+ /* Allocate and zero space */
+ numlines = D_NUMLINES (result, FILE0);
+ if (numlines)
+ {
+ D_LINEARRAY (result, FILE0) = xcalloc (numlines, sizeof (char *));
+ D_LENARRAY (result, FILE0) = xcalloc (numlines, sizeof (size_t));
+ }
+ else
+ {
+ D_LINEARRAY (result, FILE0) = 0;
+ D_LENARRAY (result, FILE0) = 0;
+ }
+
+ numlines = D_NUMLINES (result, FILE1);
+ if (numlines)
+ {
+ D_LINEARRAY (result, FILE1) = xcalloc (numlines, sizeof (char *));
+ D_LENARRAY (result, FILE1) = xcalloc (numlines, sizeof (size_t));
+ }
+ else
+ {
+ D_LINEARRAY (result, FILE1) = 0;
+ D_LENARRAY (result, FILE1) = 0;
+ }
+
+ numlines = D_NUMLINES (result, FILE2);
+ if (numlines)
+ {
+ D_LINEARRAY (result, FILE2) = xcalloc (numlines, sizeof (char *));
+ D_LENARRAY (result, FILE2) = xcalloc (numlines, sizeof (size_t));
+ }
+ else
+ {
+ D_LINEARRAY (result, FILE2) = 0;
+ D_LENARRAY (result, FILE2) = 0;
+ }
+
+ /* Return */
+ return result;
+}
+
+/* Compare two lists of lines of text.
+ Return 1 if they are equivalent, 0 if not. */
+
+static bool
+compare_line_list (char * const list1[], size_t const lengths1[],
+ char * const list2[], size_t const lengths2[],
+ lin nl)
+{
+ char * const *l1 = list1;
+ char * const *l2 = list2;
+ size_t const *lgths1 = lengths1;
+ size_t const *lgths2 = lengths2;
+
+ while (nl--)
+ if (!*l1 || !*l2 || *lgths1 != *lgths2++
+ || memcmp (*l1++, *l2++, *lgths1++) != 0)
+ return false;
+ return true;
+}
+
+/* Input and parse two way diffs. */
+
+static struct diff_block *
+process_diff (char const *filea,
+ char const *fileb,
+ struct diff_block **last_block,
+ char **buf_to_free)
+{
+ char *diff_contents;
+ char *diff_limit;
+ char *scan_diff;
+ enum diff_type dt;
+ lin i;
+ struct diff_block *block_list;
+ struct diff_block **block_list_end = &block_list;
+ struct diff_block *bptr IF_LINT (= NULL);
+ size_t too_many_lines = (PTRDIFF_MAX
+ / MIN (sizeof *bptr->lines[1],
+ sizeof *bptr->lengths[1]));
+
+ diff_limit = read_diff (filea, fileb, &diff_contents);
+ *buf_to_free = diff_contents;
+ scan_diff = diff_contents;
+
+ while (scan_diff < diff_limit)
+ {
+ bptr = xmalloc (sizeof *bptr);
+ bptr->lines[0] = bptr->lines[1] = 0;
+ bptr->lengths[0] = bptr->lengths[1] = 0;
+
+ dt = process_diff_control (&scan_diff, bptr);
+ if (dt == ERROR || *scan_diff != '\n')
+ {
+ fprintf (stderr, _("%s: diff failed: "), program_name);
+ do
+ {
+ putc (*scan_diff, stderr);
+ }
+ while (*scan_diff++ != '\n');
+ exit (EXIT_TROUBLE);
+ }
+ scan_diff++;
+
+ /* Force appropriate ranges to be null, if necessary */
+ switch (dt)
+ {
+ case ADD:
+ bptr->ranges[0][0]++;
+ break;
+ case DELETE:
+ bptr->ranges[1][0]++;
+ break;
+ case CHANGE:
+ break;
+ default:
+ fatal ("internal error: invalid diff type in process_diff");
+ break;
+ }
+
+ /* Allocate space for the pointers for the lines from filea, and
+ parcel them out among these pointers */
+ if (dt != ADD)
+ {
+ lin numlines = D_NUMLINES (bptr, 0);
+ if (too_many_lines <= numlines)
+ xalloc_die ();
+ bptr->lines[0] = xmalloc (numlines * sizeof *bptr->lines[0]);
+ bptr->lengths[0] = xmalloc (numlines * sizeof *bptr->lengths[0]);
+ for (i = 0; i < numlines; i++)
+ scan_diff = scan_diff_line (scan_diff,
+ &(bptr->lines[0][i]),
+ &(bptr->lengths[0][i]),
+ diff_limit,
+ '<');
+ }
+
+ /* Get past the separator for changes */
+ if (dt == CHANGE)
+ {
+ if (strncmp (scan_diff, "---\n", 4))
+ fatal ("invalid diff format; invalid change separator");
+ scan_diff += 4;
+ }
+
+ /* Allocate space for the pointers for the lines from fileb, and
+ parcel them out among these pointers */
+ if (dt != DELETE)
+ {
+ lin numlines = D_NUMLINES (bptr, 1);
+ if (too_many_lines <= numlines)
+ xalloc_die ();
+ bptr->lines[1] = xmalloc (numlines * sizeof *bptr->lines[1]);
+ bptr->lengths[1] = xmalloc (numlines * sizeof *bptr->lengths[1]);
+ for (i = 0; i < numlines; i++)
+ scan_diff = scan_diff_line (scan_diff,
+ &(bptr->lines[1][i]),
+ &(bptr->lengths[1][i]),
+ diff_limit,
+ '>');
+ }
+
+ /* Place this block on the blocklist. */
+ *block_list_end = bptr;
+ block_list_end = &bptr->next;
+ }
+
+ *block_list_end = NULL;
+ *last_block = bptr;
+ return block_list;
+}
+
+/* Skip tabs and spaces, and return the first character after them. */
+
+static char * _GL_ATTRIBUTE_PURE
+skipwhite (char *s)
+{
+ while (*s == ' ' || *s == '\t')
+ s++;
+ return s;
+}
+
+/* Read a nonnegative line number from S, returning the address of the
+ first character after the line number, and storing the number into
+ *PNUM. Return 0 if S does not point to a valid line number. */
+
+static char *
+readnum (char *s, lin *pnum)
+{
+ unsigned char c = *s;
+ lin num = 0;
+
+ if (! ISDIGIT (c))
+ return 0;
+
+ do
+ {
+ num = c - '0' + num * 10;
+ c = *++s;
+ }
+ while (ISDIGIT (c));
+
+ *pnum = num;
+ return s;
+}
+
+/* Parse a normal format diff control string. Return the type of the
+ diff (ERROR if the format is bad). All of the other important
+ information is filled into to the structure pointed to by db, and
+ the string pointer (whose location is passed to this routine) is
+ updated to point beyond the end of the string parsed. Note that
+ only the ranges in the diff_block will be set by this routine.
+
+ If some specific pair of numbers has been reduced to a single
+ number, then both corresponding numbers in the diff block are set
+ to that number. In general these numbers are interpreted as ranges
+ inclusive, unless being used by the ADD or DELETE commands. It is
+ assumed that these will be special cased in a superior routine. */
+
+static enum diff_type
+process_diff_control (char **string, struct diff_block *db)
+{
+ char *s = *string;
+ enum diff_type type;
+
+ /* Read first set of digits */
+ s = readnum (skipwhite (s), &db->ranges[0][RANGE_START]);
+ if (! s)
+ return ERROR;
+
+ /* Was that the only digit? */
+ s = skipwhite (s);
+ if (*s == ',')
+ {
+ s = readnum (s + 1, &db->ranges[0][RANGE_END]);
+ if (! s)
+ return ERROR;
+ }
+ else
+ db->ranges[0][RANGE_END] = db->ranges[0][RANGE_START];
+
+ /* Get the letter */
+ s = skipwhite (s);
+ switch (*s)
+ {
+ case 'a':
+ type = ADD;
+ break;
+ case 'c':
+ type = CHANGE;
+ break;
+ case 'd':
+ type = DELETE;
+ break;
+ default:
+ return ERROR; /* Bad format */
+ }
+ s++; /* Past letter */
+
+ /* Read second set of digits */
+ s = readnum (skipwhite (s), &db->ranges[1][RANGE_START]);
+ if (! s)
+ return ERROR;
+
+ /* Was that the only digit? */
+ s = skipwhite (s);
+ if (*s == ',')
+ {
+ s = readnum (s + 1, &db->ranges[1][RANGE_END]);
+ if (! s)
+ return ERROR;
+ s = skipwhite (s); /* To move to end */
+ }
+ else
+ db->ranges[1][RANGE_END] = db->ranges[1][RANGE_START];
+
+ *string = s;
+ return type;
+}
+
+static char *
+read_diff (char const *filea,
+ char const *fileb,
+ char **output_placement)
+{
+ char *diff_result;
+ size_t current_chunk_size, total;
+ int fd, wstatus, status;
+ int werrno = 0;
+ struct stat pipestat;
+ char const *argv[9];
+ char const **ap;
+#if HAVE_WORKING_FORK
+ int fds[2];
+ pid_t pid;
+#else
+ FILE *fpipe;
+ char *command;
+#endif
+
+ ap = argv;
+ *ap++ = diff_program;
+ if (text)
+ *ap++ = "-a";
+ if (strip_trailing_cr)
+ *ap++ = "--strip-trailing-cr";
+ *ap++ = "--horizon-lines=100";
+ *ap++ = "--";
+ *ap++ = filea;
+ *ap++ = fileb;
+ *ap = 0;
+
+#if HAVE_WORKING_FORK
+
+ if (pipe (fds) != 0)
+ perror_with_exit ("pipe");
+
+ pid = fork ();
+ if (pid == 0)
+ {
+ /* Child */
+ close (fds[0]);
+ if (fds[1] != STDOUT_FILENO)
+ {
+ dup2 (fds[1], STDOUT_FILENO);
+ close (fds[1]);
+ }
+
+ /* The cast to (char **) is needed for portability to older
+ hosts with a nonstandard prototype for execvp. */
+ execvp (diff_program, (char **) argv);
+
+ _exit (errno == ENOENT ? 127 : 126);
+ }
+
+ if (pid == -1)
+ perror_with_exit ("fork");
+
+ close (fds[1]); /* Prevent erroneous lack of EOF */
+ fd = fds[0];
+
+#else
+
+ command = system_quote_argv (SCI_SYSTEM, (char **) argv);
+ errno = 0;
+ fpipe = popen (command, "r");
+ if (!fpipe)
+ perror_with_exit (command);
+ free (command);
+ fd = fileno (fpipe);
+
+#endif
+
+ if (fstat (fd, &pipestat) != 0)
+ perror_with_exit ("fstat");
+ current_chunk_size = MAX (1, STAT_BLOCKSIZE (pipestat));
+ diff_result = xmalloc (current_chunk_size);
+ total = 0;
+
+ for (;;)
+ {
+ size_t bytes_to_read = current_chunk_size - total;
+ size_t bytes = block_read (fd, diff_result + total, bytes_to_read);
+ total += bytes;
+ if (bytes != bytes_to_read)
+ {
+ if (bytes == SIZE_MAX)
+ perror_with_exit (_("read failed"));
+ break;
+ }
+ if (PTRDIFF_MAX / 2 <= current_chunk_size)
+ xalloc_die ();
+ current_chunk_size *= 2;
+ diff_result = xrealloc (diff_result, current_chunk_size);
+ }
+
+ if (total != 0 && diff_result[total-1] != '\n')
+ fatal ("invalid diff format; incomplete last line");
+
+ *output_placement = diff_result;
+
+#if ! HAVE_WORKING_FORK
+
+ wstatus = pclose (fpipe);
+ if (wstatus == -1)
+ werrno = errno;
+
+#else
+
+ if (close (fd) != 0)
+ perror_with_exit ("close");
+ if (waitpid (pid, &wstatus, 0) < 0)
+ perror_with_exit ("waitpid");
+
+#endif
+
+ status = ! werrno && WIFEXITED (wstatus) ? WEXITSTATUS (wstatus) : INT_MAX;
+
+ if (EXIT_TROUBLE <= status)
+ error (EXIT_TROUBLE, werrno,
+ _(status == 126
+ ? "subsidiary program '%s' could not be invoked"
+ : status == 127
+ ? "subsidiary program '%s' not found"
+ : status == INT_MAX
+ ? "subsidiary program '%s' failed"
+ : "subsidiary program '%s' failed (exit status %d)"),
+ diff_program, status);
+
+ return diff_result + total;
+}
+
+
+/* Scan a regular diff line (consisting of > or <, followed by a
+ space, followed by text (including nulls) up to a newline.
+
+ This next routine began life as a macro and many parameters in it
+ are used as call-by-reference values. */
+static char *
+scan_diff_line (char *scan_ptr, char **set_start, size_t *set_length,
+ char *limit, char leadingchar)
+{
+ char *line_ptr;
+
+ if (!(scan_ptr[0] == leadingchar
+ && scan_ptr[1] == ' '))
+ fatal ("invalid diff format; incorrect leading line chars");
+
+ *set_start = line_ptr = scan_ptr + 2;
+ while (*line_ptr++ != '\n')
+ continue;
+
+ /* Include newline if the original line ended in a newline,
+ or if an edit script is being generated.
+ Copy any missing newline message to stderr if an edit script is being
+ generated, because edit scripts cannot handle missing newlines.
+ Return the beginning of the next line. */
+ *set_length = line_ptr - *set_start;
+ if (line_ptr < limit && *line_ptr == '\\')
+ {
+ if (edscript)
+ fprintf (stderr, "%s:", program_name);
+ else
+ --*set_length;
+ line_ptr++;
+ do
+ {
+ if (edscript)
+ putc (*line_ptr, stderr);
+ }
+ while (*line_ptr++ != '\n');
+ }
+
+ return line_ptr;
+}
+
+/* Output a three way diff passed as a list of diff3_block's. The
+ argument MAPPING is indexed by external file number (in the
+ argument list) and contains the internal file number (from the diff
+ passed). This is important because the user expects outputs in
+ terms of the argument list number, and the diff passed may have
+ been done slightly differently (if the last argument was "-", for
+ example). REV_MAPPING is the inverse of MAPPING. */
+
+static void
+output_diff3 (FILE *outputfile, struct diff3_block *diff,
+ int const mapping[3], int const rev_mapping[3])
+{
+ int i;
+ int oddoneout;
+ char *cp;
+ struct diff3_block *ptr;
+ lin line;
+ size_t length;
+ int dontprint;
+ static int skew_increment[3] = { 2, 3, 1 }; /* 0==>2==>1==>3 */
+ char const *line_prefix = initial_tab ? "\t" : " ";
+
+ for (ptr = diff; ptr; ptr = D_NEXT (ptr))
+ {
+ char x[2];
+
+ switch (ptr->correspond)
+ {
+ case DIFF_ALL:
+ x[0] = 0;
+ dontprint = 3; /* Print them all */
+ oddoneout = 3; /* Nobody's odder than anyone else */
+ break;
+ case DIFF_1ST:
+ case DIFF_2ND:
+ case DIFF_3RD:
+ oddoneout = rev_mapping[ptr->correspond - DIFF_1ST];
+
+ x[0] = oddoneout + '1';
+ x[1] = 0;
+ dontprint = oddoneout == 0;
+ break;
+ default:
+ fatal ("internal error: invalid diff type passed to output");
+ }
+ fprintf (outputfile, "====%s\n", x);
+
+ /* Go 0, 2, 1 if the first and third outputs are equivalent. */
+ for (i = 0; i < 3;
+ i = (oddoneout == 1 ? skew_increment[i] : i + 1))
+ {
+ int realfile = mapping[i];
+ lin lowt = D_LOWLINE (ptr, realfile);
+ lin hight = D_HIGHLINE (ptr, realfile);
+ long int llowt = lowt;
+ long int lhight = hight;
+
+ fprintf (outputfile, "%d:", i + 1);
+ switch (lowt - hight)
+ {
+ case 1:
+ fprintf (outputfile, "%lda\n", llowt - 1);
+ break;
+ case 0:
+ fprintf (outputfile, "%ldc\n", llowt);
+ break;
+ default:
+ fprintf (outputfile, "%ld,%ldc\n", llowt, lhight);
+ break;
+ }
+
+ if (i == dontprint) continue;
+
+ if (lowt <= hight)
+ {
+ line = 0;
+ do
+ {
+ fputs (line_prefix, outputfile);
+ cp = D_RELNUM (ptr, realfile, line);
+ length = D_RELLEN (ptr, realfile, line);
+ fwrite (cp, sizeof (char), length, outputfile);
+ }
+ while (++line < hight - lowt + 1);
+ if (cp[length - 1] != '\n')
+ fprintf (outputfile, "\n\\ %s\n",
+ _("No newline at end of file"));
+ }
+ }
+ }
+}
+
+
+/* Output to OUTPUTFILE the lines of B taken from FILENUM. Double any
+ initial '.'s; yield nonzero if any initial '.'s were doubled. */
+
+static bool
+dotlines (FILE *outputfile, struct diff3_block *b, int filenum)
+{
+ lin i;
+ bool leading_dot = false;
+
+ for (i = 0;
+ i < D_NUMLINES (b, filenum);
+ i++)
+ {
+ char *line = D_RELNUM (b, filenum, i);
+ if (line[0] == '.')
+ {
+ leading_dot = true;
+ fputc ('.', outputfile);
+ }
+ fwrite (line, sizeof (char),
+ D_RELLEN (b, filenum, i), outputfile);
+ }
+
+ return leading_dot;
+}
+
+/* Output to OUTPUTFILE a '.' line. If LEADING_DOT is true, also
+ output a command that removes initial '.'s starting with line START
+ and continuing for NUM lines. (START is long int, not lin, for
+ convenience with printf %ld formats.) */
+
+static void
+undotlines (FILE *outputfile, bool leading_dot, long int start, lin num)
+{
+ fputs (".\n", outputfile);
+ if (leading_dot)
+ {
+ if (num == 1)
+ fprintf (outputfile, "%lds/^\\.//\n", start);
+ else
+ fprintf (outputfile, "%ld,%lds/^\\.//\n", start, start + num - 1);
+ }
+}
+
+/* Output a diff3 set of blocks as an ed script. This script applies
+ the changes between file's 2 & 3 to file 1. Take the precise
+ format of the ed script to be output from global variables set
+ during options processing. Reverse the order of
+ the set of diff3 blocks in DIFF; this gets
+ around the problems involved with changing line numbers in an ed
+ script.
+
+ As in 'output_diff3', the variable MAPPING maps from file number
+ according to the argument list to file number according to the diff
+ passed. All files listed below are in terms of the argument list.
+ REV_MAPPING is the inverse of MAPPING.
+
+ FILE0, FILE1 and FILE2 are the strings to print as the names of the
+ three files. These may be the actual names, or may be the
+ arguments specified with -L.
+
+ Return 1 if conflicts were found. */
+
+static bool
+output_diff3_edscript (FILE *outputfile, struct diff3_block *diff,
+ int const mapping[3], int const rev_mapping[3],
+ char const *file0, char const *file1, char const *file2)
+{
+ bool leading_dot;
+ bool conflicts_found = false;
+ bool conflict;
+ struct diff3_block *b;
+
+ for (b = reverse_diff3_blocklist (diff); b; b = b->next)
+ {
+ /* Must do mapping correctly. */
+ enum diff_type type
+ = (b->correspond == DIFF_ALL
+ ? DIFF_ALL
+ : DIFF_1ST + rev_mapping[b->correspond - DIFF_1ST]);
+
+ long int low0, high0;
+
+ /* If we aren't supposed to do this output block, skip it. */
+ switch (type)
+ {
+ default: continue;
+ case DIFF_2ND: if (!show_2nd) continue; conflict = true; break;
+ case DIFF_3RD: if (overlap_only) continue; conflict = false; break;
+ case DIFF_ALL: if (simple_only) continue; conflict = flagging; break;
+ }
+
+ low0 = D_LOWLINE (b, mapping[FILE0]);
+ high0 = D_HIGHLINE (b, mapping[FILE0]);
+
+ if (conflict)
+ {
+ conflicts_found = true;
+
+
+ /* Mark end of conflict. */
+
+ fprintf (outputfile, "%lda\n", high0);
+ leading_dot = false;
+ if (type == DIFF_ALL)
+ {
+ if (show_2nd)
+ {
+ /* Append lines from FILE1. */
+ fprintf (outputfile, "||||||| %s\n", file1);
+ leading_dot = dotlines (outputfile, b, mapping[FILE1]);
+ }
+ /* Append lines from FILE2. */
+ fputs ("=======\n", outputfile);
+ leading_dot |= dotlines (outputfile, b, mapping[FILE2]);
+ }
+ fprintf (outputfile, ">>>>>>> %s\n", file2);
+ undotlines (outputfile, leading_dot, high0 + 2,
+ (D_NUMLINES (b, mapping[FILE1])
+ + D_NUMLINES (b, mapping[FILE2]) + 1));
+
+
+ /* Mark start of conflict. */
+
+ fprintf (outputfile, "%lda\n<<<<<<< %s\n", low0 - 1,
+ type == DIFF_ALL ? file0 : file1);
+ leading_dot = false;
+ if (type == DIFF_2ND)
+ {
+ /* Prepend lines from FILE1. */
+ leading_dot = dotlines (outputfile, b, mapping[FILE1]);
+ fputs ("=======\n", outputfile);
+ }
+ undotlines (outputfile, leading_dot, low0 + 1,
+ D_NUMLINES (b, mapping[FILE1]));
+ }
+ else if (D_NUMLINES (b, mapping[FILE2]) == 0)
+ /* Write out a delete */
+ {
+ if (low0 == high0)
+ fprintf (outputfile, "%ldd\n", low0);
+ else
+ fprintf (outputfile, "%ld,%ldd\n", low0, high0);
+ }
+ else
+ /* Write out an add or change */
+ {
+ switch (high0 - low0)
+ {
+ case -1:
+ fprintf (outputfile, "%lda\n", high0);
+ break;
+ case 0:
+ fprintf (outputfile, "%ldc\n", high0);
+ break;
+ default:
+ fprintf (outputfile, "%ld,%ldc\n", low0, high0);
+ break;
+ }
+
+ undotlines (outputfile, dotlines (outputfile, b, mapping[FILE2]),
+ low0, D_NUMLINES (b, mapping[FILE2]));
+ }
+ }
+ if (finalwrite)
+ fputs ("w\nq\n", outputfile);
+ return conflicts_found;
+}
+
+/* Read from INFILE and output to OUTPUTFILE a set of diff3_blocks
+ DIFF as a merged file. This acts like 'ed file0
+ <[output_diff3_edscript]', except that it works even for binary
+ data or incomplete lines.
+
+ As before, MAPPING maps from arg list file number to diff file
+ number, REV_MAPPING is its inverse, and FILE0, FILE1, and FILE2 are
+ the names of the files.
+
+ Return 1 if conflicts were found. */
+
+static bool
+output_diff3_merge (FILE *infile, FILE *outputfile, struct diff3_block *diff,
+ int const mapping[3], int const rev_mapping[3],
+ char const *file0, char const *file1, char const *file2)
+{
+ int c;
+ lin i;
+ bool conflicts_found = false;
+ bool conflict;
+ struct diff3_block *b;
+ lin linesread = 0;
+
+ for (b = diff; b; b = b->next)
+ {
+ /* Must do mapping correctly. */
+ enum diff_type type
+ = ((b->correspond == DIFF_ALL)
+ ? DIFF_ALL
+ : DIFF_1ST + rev_mapping[b->correspond - DIFF_1ST]);
+ char const *format_2nd = "<<<<<<< %s\n";
+
+ /* If we aren't supposed to do this output block, skip it. */
+ switch (type)
+ {
+ default: continue;
+ case DIFF_2ND: if (!show_2nd) continue; conflict = true; break;
+ case DIFF_3RD: if (overlap_only) continue; conflict = false; break;
+ case DIFF_ALL: if (simple_only) continue; conflict = flagging;
+ format_2nd = "||||||| %s\n";
+ break;
+ }
+
+ /* Copy I lines from file 0. */
+ i = D_LOWLINE (b, FILE0) - linesread - 1;
+ linesread += i;
+ while (0 <= --i)
+ do
+ {
+ c = getc (infile);
+ if (c == EOF)
+ {
+ if (ferror (infile))
+ perror_with_exit (_("read failed"));
+ else if (feof (infile))
+ fatal ("input file shrank");
+ }
+ putc (c, outputfile);
+ }
+ while (c != '\n');
+
+ if (conflict)
+ {
+ conflicts_found = true;
+
+ if (type == DIFF_ALL)
+ {
+ /* Put in lines from FILE0 with bracket. */
+ fprintf (outputfile, "<<<<<<< %s\n", file0);
+ for (i = 0;
+ i < D_NUMLINES (b, mapping[FILE0]);
+ i++)
+ fwrite (D_RELNUM (b, mapping[FILE0], i), sizeof (char),
+ D_RELLEN (b, mapping[FILE0], i), outputfile);
+ }
+
+ if (show_2nd)
+ {
+ /* Put in lines from FILE1 with bracket. */
+ fprintf (outputfile, format_2nd, file1);
+ for (i = 0;
+ i < D_NUMLINES (b, mapping[FILE1]);
+ i++)
+ fwrite (D_RELNUM (b, mapping[FILE1], i), sizeof (char),
+ D_RELLEN (b, mapping[FILE1], i), outputfile);
+ }
+
+ fputs ("=======\n", outputfile);
+ }
+
+ /* Put in lines from FILE2. */
+ for (i = 0;
+ i < D_NUMLINES (b, mapping[FILE2]);
+ i++)
+ fwrite (D_RELNUM (b, mapping[FILE2], i), sizeof (char),
+ D_RELLEN (b, mapping[FILE2], i), outputfile);
+
+ if (conflict)
+ fprintf (outputfile, ">>>>>>> %s\n", file2);
+
+ /* Skip I lines in file 0. */
+ i = D_NUMLINES (b, FILE0);
+ linesread += i;
+ while (0 <= --i)
+ while ((c = getc (infile)) != '\n')
+ if (c == EOF)
+ {
+ if (ferror (infile))
+ perror_with_exit (_("read failed"));
+ else if (feof (infile))
+ {
+ if (i || b->next)
+ fatal ("input file shrank");
+ return conflicts_found;
+ }
+ }
+ }
+ /* Copy rest of common file. */
+ while ((c = getc (infile)) != EOF || !(ferror (infile) | feof (infile)))
+ putc (c, outputfile);
+ return conflicts_found;
+}
+
+/* Reverse the order of the list of diff3 blocks. */
+
+static struct diff3_block *
+reverse_diff3_blocklist (struct diff3_block *diff)
+{
+ register struct diff3_block *tmp, *next, *prev;
+
+ for (tmp = diff, prev = 0; tmp; tmp = next)
+ {
+ next = tmp->next;
+ tmp->next = prev;
+ prev = tmp;
+ }
+
+ return prev;
+}
+
+static void
+fatal (char const *msgid)
+{
+ error (EXIT_TROUBLE, 0, "%s", _(msgid));
+ abort ();
+}
+
+static void
+perror_with_exit (char const *string)
+{
+ error (EXIT_TROUBLE, errno, "%s", string);
+ abort ();
+}
diff --git a/src/dir.c b/src/dir.c
new file mode 100644
index 0000000..c8aa6a5
--- /dev/null
+++ b/src/dir.c
@@ -0,0 +1,385 @@
+/* Read, sort and compare two directories. Used for GNU DIFF.
+
+ Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006-2007,
+ 2009-2013, 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+#include <error.h>
+#include <exclude.h>
+#include <filenamecat.h>
+#include <setjmp.h>
+#include <xalloc.h>
+
+/* Read the directory named by DIR and store into DIRDATA a sorted vector
+ of filenames for its contents. DIR->desc == -1 means this directory is
+ known to be nonexistent, so set DIRDATA to an empty vector.
+ Return -1 (setting errno) if error, 0 otherwise. */
+
+struct dirdata
+{
+ size_t nnames; /* Number of names. */
+ char const **names; /* Sorted names of files in dir, followed by 0. */
+ char *data; /* Allocated storage for file names. */
+};
+
+/* Whether file names in directories should be compared with
+ locale-specific sorting. */
+static bool locale_specific_sorting;
+
+/* Where to go if locale-specific sorting fails. */
+static jmp_buf failed_locale_specific_sorting;
+
+static bool dir_loop (struct comparison const *, int);
+
+
+/* Read a directory and get its vector of names. */
+
+static bool
+dir_read (struct file_data const *dir, struct dirdata *dirdata)
+{
+ register struct dirent *next;
+ register size_t i;
+
+ /* Address of block containing the files that are described. */
+ char const **names;
+
+ /* Number of files in directory. */
+ size_t nnames;
+
+ /* Allocated and used storage for file name data. */
+ char *data;
+ size_t data_alloc, data_used;
+
+ dirdata->names = 0;
+ dirdata->data = 0;
+ nnames = 0;
+ data = 0;
+
+ if (dir->desc != -1)
+ {
+ /* Open the directory and check for errors. */
+ register DIR *reading = opendir (dir->name);
+ if (!reading)
+ return false;
+
+ /* Initialize the table of filenames. */
+
+ data_alloc = 512;
+ data_used = 0;
+ dirdata->data = data = xmalloc (data_alloc);
+
+ /* Read the directory entries, and insert the subfiles
+ into the 'data' table. */
+
+ while ((errno = 0, (next = readdir (reading)) != 0))
+ {
+ char *d_name = next->d_name;
+ size_t d_size = _D_EXACT_NAMLEN (next) + 1;
+
+ /* Ignore "." and "..". */
+ if (d_name[0] == '.'
+ && (d_name[1] == 0 || (d_name[1] == '.' && d_name[2] == 0)))
+ continue;
+
+ if (excluded_file_name (excluded, d_name))
+ continue;
+
+ while (data_alloc < data_used + d_size)
+ {
+ if (PTRDIFF_MAX / 2 <= data_alloc)
+ xalloc_die ();
+ dirdata->data = data = xrealloc (data, data_alloc *= 2);
+ }
+
+ memcpy (data + data_used, d_name, d_size);
+ data_used += d_size;
+ nnames++;
+ }
+ if (errno)
+ {
+ int e = errno;
+ closedir (reading);
+ errno = e;
+ return false;
+ }
+#if CLOSEDIR_VOID
+ closedir (reading);
+#else
+ if (closedir (reading) != 0)
+ return false;
+#endif
+ }
+
+ /* Create the 'names' table from the 'data' table. */
+ if (PTRDIFF_MAX / sizeof *names - 1 <= nnames)
+ xalloc_die ();
+ dirdata->names = names = xmalloc ((nnames + 1) * sizeof *names);
+ dirdata->nnames = nnames;
+ for (i = 0; i < nnames; i++)
+ {
+ names[i] = data;
+ data += strlen (data) + 1;
+ }
+ names[nnames] = 0;
+ return true;
+}
+
+/* Compare strings in a locale-specific way, returning a value
+ compatible with strcmp. */
+
+static int
+compare_collated (char const *name1, char const *name2)
+{
+ int r;
+ errno = 0;
+ if (ignore_file_name_case)
+ r = strcasecoll (name1, name2);
+ else
+ r = strcoll (name1, name2);
+ if (errno)
+ {
+ error (0, errno, _("cannot compare file names '%s' and '%s'"),
+ name1, name2);
+ longjmp (failed_locale_specific_sorting, 1);
+ }
+ return r;
+}
+
+/* Compare file names, returning a value compatible with strcmp. */
+
+static int
+compare_names (char const *name1, char const *name2)
+{
+ if (locale_specific_sorting)
+ {
+ int diff = compare_collated (name1, name2);
+ if (diff || ignore_file_name_case)
+ return diff;
+ }
+ return file_name_cmp (name1, name2);
+}
+
+/* Compare names FILE1 and FILE2 when sorting a directory.
+ Prefer filtered comparison, breaking ties with file_name_cmp. */
+
+static int
+compare_names_for_qsort (void const *file1, void const *file2)
+{
+ char const *const *f1 = file1;
+ char const *const *f2 = file2;
+ char const *name1 = *f1;
+ char const *name2 = *f2;
+ if (locale_specific_sorting)
+ {
+ int diff = compare_collated (name1, name2);
+ if (diff)
+ return diff;
+ }
+ return file_name_cmp (name1, name2);
+}
+
+/* Compare the contents of two directories named in CMP.
+ This is a top-level routine; it does everything necessary for diff
+ on two directories.
+
+ CMP->file[0].desc == -1 says directory CMP->file[0] doesn't exist,
+ but pretend it is empty. Likewise for CMP->file[1].
+
+ HANDLE_FILE is a caller-provided subroutine called to handle each file.
+ It gets three operands: CMP, name of file in dir 0, name of file in dir 1.
+ These names are relative to the original working directory.
+
+ For a file that appears in only one of the dirs, one of the name-args
+ to HANDLE_FILE is zero.
+
+ Returns the maximum of all the values returned by HANDLE_FILE,
+ or EXIT_TROUBLE if trouble is encountered in opening files. */
+
+int
+diff_dirs (struct comparison const *cmp,
+ int (*handle_file) (struct comparison const *,
+ char const *, char const *))
+{
+ struct dirdata dirdata[2];
+ int volatile val = EXIT_SUCCESS;
+ int i;
+
+ if ((cmp->file[0].desc == -1 || dir_loop (cmp, 0))
+ && (cmp->file[1].desc == -1 || dir_loop (cmp, 1)))
+ {
+ error (0, 0, _("%s: recursive directory loop"),
+ cmp->file[cmp->file[0].desc == -1].name);
+ return EXIT_TROUBLE;
+ }
+
+ /* Get contents of both dirs. */
+ for (i = 0; i < 2; i++)
+ if (! dir_read (&cmp->file[i], &dirdata[i]))
+ {
+ perror_with_name (cmp->file[i].name);
+ val = EXIT_TROUBLE;
+ }
+
+ if (val == EXIT_SUCCESS)
+ {
+ char const **volatile names[2];
+ names[0] = dirdata[0].names;
+ names[1] = dirdata[1].names;
+
+ /* Use locale-specific sorting if possible, else native byte order. */
+ locale_specific_sorting = true;
+ if (setjmp (failed_locale_specific_sorting))
+ locale_specific_sorting = false;
+
+ /* Sort the directories. */
+ for (i = 0; i < 2; i++)
+ qsort (names[i], dirdata[i].nnames, sizeof *dirdata[i].names,
+ compare_names_for_qsort);
+
+ /* If '-S name' was given, and this is the topmost level of comparison,
+ ignore all file names less than the specified starting name. */
+
+ if (starting_file && ! cmp->parent)
+ {
+ while (*names[0] && compare_names (*names[0], starting_file) < 0)
+ names[0]++;
+ while (*names[1] && compare_names (*names[1], starting_file) < 0)
+ names[1]++;
+ }
+
+ /* Loop while files remain in one or both dirs. */
+ while (*names[0] || *names[1])
+ {
+ /* Compare next name in dir 0 with next name in dir 1.
+ At the end of a dir,
+ pretend the "next name" in that dir is very large. */
+ int nameorder = (!*names[0] ? 1 : !*names[1] ? -1
+ : compare_names (*names[0], *names[1]));
+
+ /* Prefer a file_name_cmp match if available. This algorithm is
+ O(N**2), where N is the number of names in a directory
+ that compare_names says are all equal, but in practice N
+ is so small it's not worth tuning. */
+ if (nameorder == 0 && ignore_file_name_case)
+ {
+ int raw_order = file_name_cmp (*names[0], *names[1]);
+ if (raw_order != 0)
+ {
+ int greater_side = raw_order < 0;
+ int lesser_side = 1 - greater_side;
+ char const **lesser = names[lesser_side];
+ char const *greater_name = *names[greater_side];
+ char const **p;
+
+ for (p = lesser + 1;
+ *p && compare_names (*p, greater_name) == 0;
+ p++)
+ {
+ int c = file_name_cmp (*p, greater_name);
+ if (0 <= c)
+ {
+ if (c == 0)
+ {
+ memmove (lesser + 1, lesser,
+ (char *) p - (char *) lesser);
+ *lesser = greater_name;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ int v1 = (*handle_file) (cmp,
+ 0 < nameorder ? 0 : *names[0]++,
+ nameorder < 0 ? 0 : *names[1]++);
+ if (val < v1)
+ val = v1;
+ }
+ }
+
+ for (i = 0; i < 2; i++)
+ {
+ free (dirdata[i].names);
+ free (dirdata[i].data);
+ }
+
+ return val;
+}
+
+/* Return nonzero if CMP is looping recursively in argument I. */
+
+static bool _GL_ATTRIBUTE_PURE
+dir_loop (struct comparison const *cmp, int i)
+{
+ struct comparison const *p = cmp;
+ while ((p = p->parent))
+ if (0 < same_file (&p->file[i].stat, &cmp->file[i].stat))
+ return true;
+ return false;
+}
+
+/* Find a matching filename in a directory. */
+
+char *
+find_dir_file_pathname (char const *dir, char const *file)
+{
+ /* The 'IF_LINT (volatile)' works around what appears to be a bug in
+ gcc 4.8.0 20120825; see
+ <http://lists.gnu.org/archive/html/bug-diffutils/2012-08/msg00007.html>.
+ */
+ char const * IF_LINT (volatile) match = file;
+
+ char *val;
+ struct dirdata dirdata;
+ dirdata.names = NULL;
+ dirdata.data = NULL;
+
+ if (ignore_file_name_case)
+ {
+ struct file_data filedata;
+ filedata.name = dir;
+ filedata.desc = 0;
+
+ if (dir_read (&filedata, &dirdata))
+ {
+ locale_specific_sorting = true;
+ if (setjmp (failed_locale_specific_sorting))
+ match = file; /* longjmp may mess up MATCH. */
+ else
+ {
+ for (char const **p = dirdata.names; *p; p++)
+ if (compare_names (*p, file) == 0)
+ {
+ if (file_name_cmp (*p, file) == 0)
+ {
+ match = *p;
+ break;
+ }
+ if (match == file)
+ match = *p;
+ }
+ }
+ }
+ }
+
+ val = file_name_concat (dir, match, NULL);
+ free (dirdata.names);
+ free (dirdata.data);
+ return val;
+}
diff --git a/src/ed.c b/src/ed.c
new file mode 100644
index 0000000..1fae2b8
--- /dev/null
+++ b/src/ed.c
@@ -0,0 +1,175 @@
+/* Output routines for ed-script format.
+
+ Copyright (C) 1988-1989, 1991-1993, 1995, 1998, 2001, 2004, 2006, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+
+static void print_ed_hunk (struct change *);
+static void print_rcs_hunk (struct change *);
+static void pr_forward_ed_hunk (struct change *);
+
+/* Print our script as ed commands. */
+
+void
+print_ed_script (struct change *script)
+{
+ print_script (script, find_reverse_change, print_ed_hunk);
+}
+
+/* Print a hunk of an ed diff */
+
+static void
+print_ed_hunk (struct change *hunk)
+{
+ lin f0, l0, f1, l1;
+ enum changes changes;
+
+#ifdef DEBUG
+ debug_script (hunk);
+#endif
+
+ /* Determine range of line numbers involved in each file. */
+ changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1);
+ if (!changes)
+ return;
+
+ begin_output ();
+
+ /* Print out the line number header for this hunk */
+ print_number_range (',', &files[0], f0, l0);
+ fputc (change_letter[changes], outfile);
+ fputc ('\n', outfile);
+
+ /* Print new/changed lines from second file, if needed */
+ if (changes != OLD)
+ {
+ lin i;
+ bool insert_mode = true;
+
+ for (i = f1; i <= l1; i++)
+ {
+ if (!insert_mode)
+ {
+ fputs ("a\n", outfile);
+ insert_mode = true;
+ }
+ if (files[1].linbuf[i][0] == '.' && files[1].linbuf[i][1] == '\n')
+ {
+ /* The file's line is just a dot, and it would exit
+ insert mode. Precede the dot with another dot, exit
+ insert mode and remove the extra dot. */
+ fputs ("..\n.\ns/.//\n", outfile);
+ insert_mode = false;
+ }
+ else
+ print_1_line ("", &files[1].linbuf[i]);
+ }
+
+ if (insert_mode)
+ fputs (".\n", outfile);
+ }
+}
+
+/* Print change script in the style of ed commands,
+ but print the changes in the order they appear in the input files,
+ which means that the commands are not truly useful with ed.
+ Because of the issue with lines containing just a dot, the output
+ is not even parseable. */
+
+void
+pr_forward_ed_script (struct change *script)
+{
+ print_script (script, find_change, pr_forward_ed_hunk);
+}
+
+static void
+pr_forward_ed_hunk (struct change *hunk)
+{
+ lin i, f0, l0, f1, l1;
+
+ /* Determine range of line numbers involved in each file. */
+ enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1);
+ if (!changes)
+ return;
+
+ begin_output ();
+
+ fputc (change_letter[changes], outfile);
+ print_number_range (' ', files, f0, l0);
+ fputc ('\n', outfile);
+
+ /* If deletion only, print just the number range. */
+
+ if (changes == OLD)
+ return;
+
+ /* For insertion (with or without deletion), print the number range
+ and the lines from file 2. */
+
+ for (i = f1; i <= l1; i++)
+ print_1_line ("", &files[1].linbuf[i]);
+
+ fputs (".\n", outfile);
+}
+
+/* Print in a format somewhat like ed commands
+ except that each insert command states the number of lines it inserts.
+ This format is used for RCS. */
+
+void
+print_rcs_script (struct change *script)
+{
+ print_script (script, find_change, print_rcs_hunk);
+}
+
+/* Print a hunk of an RCS diff */
+
+static void
+print_rcs_hunk (struct change *hunk)
+{
+ lin i, f0, l0, f1, l1;
+ long int tf0, tl0, tf1, tl1;
+
+ /* Determine range of line numbers involved in each file. */
+ enum changes changes = analyze_hunk (hunk, &f0, &l0, &f1, &l1);
+ if (!changes)
+ return;
+
+ begin_output ();
+
+ translate_range (&files[0], f0, l0, &tf0, &tl0);
+
+ if (changes & OLD)
+ {
+ /* For deletion, print just the starting line number from file 0
+ and the number of lines deleted. */
+ fprintf (outfile, "d%ld %ld\n", tf0, tf0 <= tl0 ? tl0 - tf0 + 1 : 1);
+ }
+
+ if (changes & NEW)
+ {
+ /* Take last-line-number from file 0 and # lines from file 1. */
+ translate_range (&files[1], f1, l1, &tf1, &tl1);
+ fprintf (outfile, "a%ld %ld\n", tl0, tf1 <= tl1 ? tl1 - tf1 + 1 : 1);
+
+ /* Print the inserted lines. */
+ for (i = f1; i <= l1; i++)
+ print_1_line ("", &files[1].linbuf[i]);
+ }
+}
diff --git a/src/ifdef.c b/src/ifdef.c
new file mode 100644
index 0000000..b8b084f
--- /dev/null
+++ b/src/ifdef.c
@@ -0,0 +1,430 @@
+/* #ifdef-format output routines for GNU DIFF.
+
+ Copyright (C) 1989, 1991-1994, 2001-2002, 2004, 2006, 2009-2013, 2015-2016
+ Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ GNU DIFF is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. No author or distributor
+ accepts responsibility to anyone for the consequences of using it
+ or for whether it serves any particular purpose or works at all,
+ unless he says so in writing. Refer to the GNU General Public
+ License for full details.
+
+ Everyone is granted permission to copy, modify and redistribute
+ GNU DIFF, but only under the conditions described in the
+ GNU General Public License. A copy of this license is
+ supposed to have been given to you along with GNU DIFF so you
+ can know your rights and responsibilities. It should be in a
+ file named COPYING. Among other things, the copyright notice
+ and this notice must be preserved on all copies. */
+
+#include "diff.h"
+
+#include <xalloc.h>
+
+struct group
+{
+ struct file_data const *file;
+ lin from, upto; /* start and limit lines for this group of lines */
+};
+
+static char const *format_group (FILE *, char const *, char,
+ struct group const *);
+static char const *do_printf_spec (FILE *, char const *,
+ struct file_data const *, lin,
+ struct group const *);
+static char const *scan_char_literal (char const *, char *);
+static lin groups_letter_value (struct group const *, char);
+static void format_ifdef (char const *, lin, lin, lin, lin);
+static void print_ifdef_hunk (struct change *);
+static void print_ifdef_lines (FILE *, char const *, struct group const *);
+
+static lin next_line0;
+static lin next_line1;
+
+/* Print the edit-script SCRIPT as a merged #ifdef file. */
+
+void
+print_ifdef_script (struct change *script)
+{
+ next_line0 = next_line1 = - files[0].prefix_lines;
+ print_script (script, find_change, print_ifdef_hunk);
+ if (next_line0 < files[0].valid_lines
+ || next_line1 < files[1].valid_lines)
+ {
+ begin_output ();
+ format_ifdef (group_format[UNCHANGED],
+ next_line0, files[0].valid_lines,
+ next_line1, files[1].valid_lines);
+ }
+}
+
+/* Print a hunk of an ifdef diff.
+ This is a contiguous portion of a complete edit script,
+ describing changes in consecutive lines. */
+
+static void
+print_ifdef_hunk (struct change *hunk)
+{
+ lin first0, last0, first1, last1;
+
+ /* Determine range of line numbers involved in each file. */
+ enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1);
+ if (!changes)
+ return;
+
+ begin_output ();
+
+ /* Print lines up to this change. */
+ if (next_line0 < first0 || next_line1 < first1)
+ format_ifdef (group_format[UNCHANGED],
+ next_line0, first0,
+ next_line1, first1);
+
+ /* Print this change. */
+ next_line0 = last0 + 1;
+ next_line1 = last1 + 1;
+ format_ifdef (group_format[changes],
+ first0, next_line0,
+ first1, next_line1);
+}
+
+/* Print a set of lines according to FORMAT.
+ Lines BEG0 up to END0 are from the first file;
+ lines BEG1 up to END1 are from the second file. */
+
+static void
+format_ifdef (char const *format, lin beg0, lin end0, lin beg1, lin end1)
+{
+ struct group groups[2];
+
+ groups[0].file = &files[0];
+ groups[0].from = beg0;
+ groups[0].upto = end0;
+ groups[1].file = &files[1];
+ groups[1].from = beg1;
+ groups[1].upto = end1;
+ format_group (outfile, format, 0, groups);
+}
+
+/* Print to file OUT a set of lines according to FORMAT.
+ The format ends at the first free instance of ENDCHAR.
+ Yield the address of the terminating character.
+ GROUPS specifies which lines to print.
+ If OUT is zero, do not actually print anything; just scan the format. */
+
+static char const *
+format_group (register FILE *out, char const *format, char endchar,
+ struct group const *groups)
+{
+ register char c;
+ register char const *f = format;
+
+ while ((c = *f) != endchar && c != 0)
+ {
+ char const *f1 = ++f;
+ if (c == '%')
+ switch ((c = *f++))
+ {
+ case '%':
+ break;
+
+ case '(':
+ /* Print if-then-else format e.g. '%(n=1?thenpart:elsepart)'. */
+ {
+ int i;
+ uintmax_t value[2];
+ FILE *thenout, *elseout;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (ISDIGIT (*f))
+ {
+ char *fend;
+ errno = 0;
+ value[i] = strtoumax (f, &fend, 10);
+ if (errno)
+ goto bad_format;
+ f = fend;
+ }
+ else
+ {
+ value[i] = groups_letter_value (groups, *f);
+ if (value[i] == -1)
+ goto bad_format;
+ f++;
+ }
+ if (*f++ != "=?"[i])
+ goto bad_format;
+ }
+ if (value[0] == value[1])
+ thenout = out, elseout = 0;
+ else
+ thenout = 0, elseout = out;
+ f = format_group (thenout, f, ':', groups);
+ if (*f)
+ {
+ f = format_group (elseout, f + 1, ')', groups);
+ if (*f)
+ f++;
+ }
+ }
+ continue;
+
+ case '<':
+ /* Print lines deleted from first file. */
+ print_ifdef_lines (out, line_format[OLD], &groups[0]);
+ continue;
+
+ case '=':
+ /* Print common lines. */
+ print_ifdef_lines (out, line_format[UNCHANGED], &groups[0]);
+ continue;
+
+ case '>':
+ /* Print lines inserted from second file. */
+ print_ifdef_lines (out, line_format[NEW], &groups[1]);
+ continue;
+
+ default:
+ f = do_printf_spec (out, f - 2, 0, 0, groups);
+ if (f)
+ continue;
+ /* Fall through. */
+ bad_format:
+ c = '%';
+ f = f1;
+ break;
+ }
+
+ if (out)
+ putc (c, out);
+ }
+
+ return f;
+}
+
+/* For the line group pair G, return the number corresponding to LETTER.
+ Return -1 if LETTER is not a group format letter. */
+static lin
+groups_letter_value (struct group const *g, char letter)
+{
+ switch (letter)
+ {
+ case 'E': letter = 'e'; g++; break;
+ case 'F': letter = 'f'; g++; break;
+ case 'L': letter = 'l'; g++; break;
+ case 'M': letter = 'm'; g++; break;
+ case 'N': letter = 'n'; g++; break;
+ }
+
+ switch (letter)
+ {
+ case 'e': return translate_line_number (g->file, g->from) - 1;
+ case 'f': return translate_line_number (g->file, g->from);
+ case 'l': return translate_line_number (g->file, g->upto) - 1;
+ case 'm': return translate_line_number (g->file, g->upto);
+ case 'n': return g->upto - g->from;
+ default: return -1;
+ }
+}
+
+/* Print to file OUT, using FORMAT to print the line group GROUP.
+ But do nothing if OUT is zero. */
+static void
+print_ifdef_lines (register FILE *out, char const *format,
+ struct group const *group)
+{
+ struct file_data const *file = group->file;
+ char const * const *linbuf = file->linbuf;
+ lin from = group->from, upto = group->upto;
+
+ if (!out)
+ return;
+
+ /* If possible, use a single fwrite; it's faster. */
+ if (!expand_tabs && format[0] == '%')
+ {
+ if (format[1] == 'l' && format[2] == '\n' && !format[3] && from < upto)
+ {
+ fwrite (linbuf[from], sizeof (char),
+ linbuf[upto] + (linbuf[upto][-1] != '\n') - linbuf[from],
+ out);
+ return;
+ }
+ if (format[1] == 'L' && !format[2])
+ {
+ fwrite (linbuf[from], sizeof (char),
+ linbuf[upto] - linbuf[from], out);
+ return;
+ }
+ }
+
+ for (; from < upto; from++)
+ {
+ register char c;
+ register char const *f = format;
+
+ while ((c = *f++) != 0)
+ {
+ char const *f1 = f;
+ if (c == '%')
+ switch ((c = *f++))
+ {
+ case '%':
+ break;
+
+ case 'l':
+ output_1_line (linbuf[from],
+ (linbuf[from + 1]
+ - (linbuf[from + 1][-1] == '\n')),
+ 0, 0);
+ continue;
+
+ case 'L':
+ output_1_line (linbuf[from], linbuf[from + 1], 0, 0);
+ continue;
+
+ default:
+ f = do_printf_spec (out, f - 2, file, from, 0);
+ if (f)
+ continue;
+ c = '%';
+ f = f1;
+ break;
+ }
+
+ putc (c, out);
+ }
+ }
+}
+
+static char const *
+do_printf_spec (FILE *out, char const *spec,
+ struct file_data const *file, lin n,
+ struct group const *groups)
+{
+ char const *f = spec;
+ char c;
+ char c1;
+
+ /* Scan printf-style SPEC of the form %[-'0]*[0-9]*(.[0-9]*)?[cdoxX]. */
+ /* assert (*f == '%'); */
+ f++;
+ while ((c = *f++) == '-' || c == '\'' || c == '0')
+ continue;
+ while (ISDIGIT (c))
+ c = *f++;
+ if (c == '.')
+ while (ISDIGIT (c = *f++))
+ continue;
+ c1 = *f++;
+
+ switch (c)
+ {
+ case 'c':
+ if (c1 != '\'')
+ return 0;
+ else
+ {
+ char value IF_LINT (= 0);
+ f = scan_char_literal (f, &value);
+ if (!f)
+ return 0;
+ if (out)
+ putc (value, out);
+ }
+ break;
+
+ case 'd': case 'o': case 'x': case 'X':
+ {
+ lin value;
+
+ if (file)
+ {
+ if (c1 != 'n')
+ return 0;
+ value = translate_line_number (file, n);
+ }
+ else
+ {
+ value = groups_letter_value (groups, c1);
+ if (value < 0)
+ return 0;
+ }
+
+ if (out)
+ {
+ /* For example, if the spec is "%3xn", use the printf
+ format spec "%3lx". Here the spec prefix is "%3". */
+ long int long_value = value;
+ size_t spec_prefix_len = f - spec - 2;
+#if HAVE_C_VARARRAYS
+ char format[spec_prefix_len + 3];
+#else
+ char *format = xmalloc (spec_prefix_len + 3);
+#endif
+ char *p = format + spec_prefix_len;
+ memcpy (format, spec, spec_prefix_len);
+ *p++ = 'l';
+ *p++ = c;
+ *p = '\0';
+ fprintf (out, format, long_value);
+#if ! HAVE_C_VARARRAYS
+ free (format);
+#endif
+ }
+ }
+ break;
+
+ default:
+ return 0;
+ }
+
+ return f;
+}
+
+/* Scan the character literal represented in the string LIT; LIT points just
+ after the initial apostrophe. Put the literal's value into *VALPTR.
+ Yield the address of the first character after the closing apostrophe,
+ or a null pointer if the literal is ill-formed. */
+static char const *
+scan_char_literal (char const *lit, char *valptr)
+{
+ register char const *p = lit;
+ char value;
+ ptrdiff_t digits;
+ char c = *p++;
+
+ switch (c)
+ {
+ case 0:
+ case '\'':
+ return NULL;
+
+ case '\\':
+ value = 0;
+ while ((c = *p++) != '\'')
+ {
+ unsigned int digit = c - '0';
+ if (8 <= digit)
+ return NULL;
+ value = 8 * value + digit;
+ }
+ digits = p - lit - 2;
+ if (! (1 <= digits && digits <= 3))
+ return NULL;
+ break;
+
+ default:
+ value = c;
+ if (*p++ != '\'')
+ return NULL;
+ break;
+ }
+
+ *valptr = value;
+ return p;
+}
diff --git a/src/io.c b/src/io.c
new file mode 100644
index 0000000..410bfef
--- /dev/null
+++ b/src/io.c
@@ -0,0 +1,830 @@
+/* File I/O for GNU DIFF.
+
+ Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+#include <binary-io.h>
+#include <cmpbuf.h>
+#include <file-type.h>
+#include <xalloc.h>
+
+/* Rotate an unsigned value to the left. */
+#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n)))
+
+/* Given a hash value and a new character, return a new hash value. */
+#define HASH(h, c) ((c) + ROL (h, 7))
+
+/* The type of a hash value. */
+typedef size_t hash_value;
+verify (! TYPE_SIGNED (hash_value));
+
+/* Lines are put into equivalence classes of lines that match in lines_differ.
+ Each equivalence class is represented by one of these structures,
+ but only while the classes are being computed.
+ Afterward, each class is represented by a number. */
+struct equivclass
+{
+ lin next; /* Next item in this bucket. */
+ hash_value hash; /* Hash of lines in this class. */
+ char const *line; /* A line that fits this class. */
+ size_t length; /* That line's length, not counting its newline. */
+};
+
+/* Hash-table: array of buckets, each being a chain of equivalence classes.
+ buckets[-1] is reserved for incomplete lines. */
+static lin *buckets;
+
+/* Number of buckets in the hash table array, not counting buckets[-1]. */
+static size_t nbuckets;
+
+/* Array in which the equivalence classes are allocated.
+ The bucket-chains go through the elements in this array.
+ The number of an equivalence class is its index in this array. */
+static struct equivclass *equivs;
+
+/* Index of first free element in the array 'equivs'. */
+static lin equivs_index;
+
+/* Number of elements allocated in the array 'equivs'. */
+static lin equivs_alloc;
+
+/* Read a block of data into a file buffer, checking for EOF and error. */
+
+void
+file_block_read (struct file_data *current, size_t size)
+{
+ if (size && ! current->eof)
+ {
+ size_t s = block_read (current->desc,
+ FILE_BUFFER (current) + current->buffered, size);
+ if (s == SIZE_MAX)
+ pfatal_with_name (current->name);
+ current->buffered += s;
+ current->eof = s < size;
+ }
+}
+
+/* Check for binary files and compare them for exact identity. */
+
+/* Return 1 if BUF contains a non text character.
+ SIZE is the number of characters in BUF. */
+
+#define binary_file_p(buf, size) (memchr (buf, 0, size) != 0)
+
+/* Get ready to read the current file.
+ Return nonzero if SKIP_TEST is zero,
+ and if it appears to be a binary file. */
+
+static bool
+sip (struct file_data *current, bool skip_test)
+{
+ /* If we have a nonexistent file at this stage, treat it as empty. */
+ if (current->desc < 0)
+ {
+ /* Leave room for a sentinel. */
+ current->bufsize = sizeof (word);
+ current->buffer = xmalloc (current->bufsize);
+ }
+ else
+ {
+ current->bufsize = buffer_lcm (sizeof (word),
+ STAT_BLOCKSIZE (current->stat),
+ PTRDIFF_MAX - 2 * sizeof (word));
+ current->buffer = xmalloc (current->bufsize);
+
+#ifdef __KLIBC__
+ /* Skip test if seek is not possible */
+ skip_test = skip_test
+ || (lseek (current->desc, 0, SEEK_CUR) < 0
+ && errno == ESPIPE);
+#endif
+
+ if (! skip_test)
+ {
+ /* Check first part of file to see if it's a binary file. */
+
+ int prev_mode = set_binary_mode (current->desc, O_BINARY);
+ off_t buffered;
+ file_block_read (current, current->bufsize);
+ buffered = current->buffered;
+
+ if (prev_mode != O_BINARY)
+ {
+ /* Revert to text mode and seek back to the start to reread
+ the file. Use relative seek, since file descriptors
+ like stdin might not start at offset zero. */
+ if (lseek (current->desc, - buffered, SEEK_CUR) < 0)
+ pfatal_with_name (current->name);
+ set_binary_mode (current->desc, prev_mode);
+ current->buffered = 0;
+ current->eof = false;
+ }
+
+ return binary_file_p (current->buffer, buffered);
+ }
+ }
+
+ current->buffered = 0;
+ current->eof = false;
+ return false;
+}
+
+/* Slurp the rest of the current file completely into memory. */
+
+static void
+slurp (struct file_data *current)
+{
+ size_t cc;
+
+ if (current->desc < 0)
+ {
+ /* The file is nonexistent. */
+ return;
+ }
+
+ if (S_ISREG (current->stat.st_mode))
+ {
+ /* It's a regular file; slurp in the rest all at once. */
+
+ /* Get the size out of the stat block.
+ Allocate just enough room for appended newline plus word sentinel,
+ plus word-alignment since we want the buffer word-aligned. */
+ size_t file_size = current->stat.st_size;
+ cc = file_size + 2 * sizeof (word) - file_size % sizeof (word);
+ if (file_size != current->stat.st_size || cc < file_size
+ || PTRDIFF_MAX <= cc)
+ xalloc_die ();
+
+ if (current->bufsize < cc)
+ {
+ current->bufsize = cc;
+ current->buffer = xrealloc (current->buffer, cc);
+ }
+
+ /* Try to read at least 1 more byte than the size indicates, to
+ detect whether the file is growing. This is a nicety for
+ users who run 'diff' on files while they are changing. */
+
+ if (current->buffered <= file_size)
+ {
+ file_block_read (current, file_size + 1 - current->buffered);
+ if (current->buffered <= file_size)
+ return;
+ }
+ }
+
+ /* It's not a regular file, or it's a growing regular file; read it,
+ growing the buffer as needed. */
+
+ file_block_read (current, current->bufsize - current->buffered);
+
+ if (current->buffered)
+ {
+ while (current->buffered == current->bufsize)
+ {
+ if (PTRDIFF_MAX / 2 - sizeof (word) < current->bufsize)
+ xalloc_die ();
+ current->bufsize *= 2;
+ current->buffer = xrealloc (current->buffer, current->bufsize);
+ file_block_read (current, current->bufsize - current->buffered);
+ }
+
+ /* Allocate just enough room for appended newline plus word
+ sentinel, plus word-alignment. */
+ cc = current->buffered + 2 * sizeof (word);
+ current->bufsize = cc - cc % sizeof (word);
+ current->buffer = xrealloc (current->buffer, current->bufsize);
+ }
+}
+
+/* Split the file into lines, simultaneously computing the equivalence
+ class for each line. */
+
+static void
+find_and_hash_each_line (struct file_data *current)
+{
+ char const *p = current->prefix_end;
+ lin i, *bucket;
+ size_t length;
+
+ /* Cache often-used quantities in local variables to help the compiler. */
+ char const **linbuf = current->linbuf;
+ lin alloc_lines = current->alloc_lines;
+ lin line = 0;
+ lin linbuf_base = current->linbuf_base;
+ lin *cureqs = xmalloc (alloc_lines * sizeof *cureqs);
+ struct equivclass *eqs = equivs;
+ lin eqs_index = equivs_index;
+ lin eqs_alloc = equivs_alloc;
+ char const *suffix_begin = current->suffix_begin;
+ char const *bufend = FILE_BUFFER (current) + current->buffered;
+ bool ig_case = ignore_case;
+ enum DIFF_white_space ig_white_space = ignore_white_space;
+ bool diff_length_compare_anyway =
+ ig_white_space != IGNORE_NO_WHITE_SPACE;
+ bool same_length_diff_contents_compare_anyway =
+ diff_length_compare_anyway | ig_case;
+
+ while (p < suffix_begin)
+ {
+ char const *ip = p;
+ hash_value h = 0;
+ unsigned char c;
+
+ /* Hash this line until we find a newline. */
+ switch (ig_white_space)
+ {
+ case IGNORE_ALL_SPACE:
+ while ((c = *p++) != '\n')
+ if (! isspace (c))
+ h = HASH (h, ig_case ? tolower (c) : c);
+ break;
+
+ case IGNORE_SPACE_CHANGE:
+ while ((c = *p++) != '\n')
+ {
+ if (isspace (c))
+ {
+ do
+ if ((c = *p++) == '\n')
+ goto hashing_done;
+ while (isspace (c));
+
+ h = HASH (h, ' ');
+ }
+
+ /* C is now the first non-space. */
+ h = HASH (h, ig_case ? tolower (c) : c);
+ }
+ break;
+
+ case IGNORE_TAB_EXPANSION:
+ case IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE:
+ case IGNORE_TRAILING_SPACE:
+ {
+ size_t column = 0;
+ while ((c = *p++) != '\n')
+ {
+ if (ig_white_space & IGNORE_TRAILING_SPACE
+ && isspace (c))
+ {
+ char const *p1 = p;
+ unsigned char c1;
+ do
+ if ((c1 = *p1++) == '\n')
+ {
+ p = p1;
+ goto hashing_done;
+ }
+ while (isspace (c1));
+ }
+
+ size_t repetitions = 1;
+
+ if (ig_white_space & IGNORE_TAB_EXPANSION)
+ switch (c)
+ {
+ case '\b':
+ column -= 0 < column;
+ break;
+
+ case '\t':
+ c = ' ';
+ repetitions = tabsize - column % tabsize;
+ column = (column + repetitions < column
+ ? 0
+ : column + repetitions);
+ break;
+
+ case '\r':
+ column = 0;
+ break;
+
+ default:
+ column++;
+ break;
+ }
+
+ if (ig_case)
+ c = tolower (c);
+
+ do
+ h = HASH (h, c);
+ while (--repetitions != 0);
+ }
+ }
+ break;
+
+ default:
+ if (ig_case)
+ while ((c = *p++) != '\n')
+ h = HASH (h, tolower (c));
+ else
+ while ((c = *p++) != '\n')
+ h = HASH (h, c);
+ break;
+ }
+
+ hashing_done:;
+
+ bucket = &buckets[h % nbuckets];
+ length = p - ip - 1;
+
+ if (p == bufend
+ && current->missing_newline
+ && ROBUST_OUTPUT_STYLE (output_style))
+ {
+ /* The last line is incomplete and we do not silently
+ complete lines. If the line cannot compare equal to any
+ complete line, put it into buckets[-1] so that it can
+ compare equal only to the other file's incomplete line
+ (if one exists). */
+ if (ig_white_space < IGNORE_TRAILING_SPACE)
+ bucket = &buckets[-1];
+ }
+
+ for (i = *bucket; ; i = eqs[i].next)
+ if (!i)
+ {
+ /* Create a new equivalence class in this bucket. */
+ i = eqs_index++;
+ if (i == eqs_alloc)
+ {
+ if (PTRDIFF_MAX / (2 * sizeof *eqs) <= eqs_alloc)
+ xalloc_die ();
+ eqs_alloc *= 2;
+ eqs = xrealloc (eqs, eqs_alloc * sizeof *eqs);
+ }
+ eqs[i].next = *bucket;
+ eqs[i].hash = h;
+ eqs[i].line = ip;
+ eqs[i].length = length;
+ *bucket = i;
+ break;
+ }
+ else if (eqs[i].hash == h)
+ {
+ char const *eqline = eqs[i].line;
+
+ /* Reuse existing class if lines_differ reports the lines
+ equal. */
+ if (eqs[i].length == length)
+ {
+ /* Reuse existing equivalence class if the lines are identical.
+ This detects the common case of exact identity
+ faster than lines_differ would. */
+ if (memcmp (eqline, ip, length) == 0)
+ break;
+ if (!same_length_diff_contents_compare_anyway)
+ continue;
+ }
+ else if (!diff_length_compare_anyway)
+ continue;
+
+ if (! lines_differ (eqline, ip))
+ break;
+ }
+
+ /* Maybe increase the size of the line table. */
+ if (line == alloc_lines)
+ {
+ /* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */
+ if (PTRDIFF_MAX / 3 <= alloc_lines
+ || PTRDIFF_MAX / sizeof *cureqs <= 2 * alloc_lines - linbuf_base
+ || PTRDIFF_MAX / sizeof *linbuf <= alloc_lines - linbuf_base)
+ xalloc_die ();
+ alloc_lines = 2 * alloc_lines - linbuf_base;
+ cureqs = xrealloc (cureqs, alloc_lines * sizeof *cureqs);
+ linbuf += linbuf_base;
+ linbuf = xrealloc (linbuf,
+ (alloc_lines - linbuf_base) * sizeof *linbuf);
+ linbuf -= linbuf_base;
+ }
+ linbuf[line] = ip;
+ cureqs[line] = i;
+ ++line;
+ }
+
+ current->buffered_lines = line;
+
+ for (i = 0; ; i++)
+ {
+ /* Record the line start for lines in the suffix that we care about.
+ Record one more line start than lines,
+ so that we can compute the length of any buffered line. */
+ if (line == alloc_lines)
+ {
+ /* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */
+ if (PTRDIFF_MAX / 3 <= alloc_lines
+ || PTRDIFF_MAX / sizeof *cureqs <= 2 * alloc_lines - linbuf_base
+ || PTRDIFF_MAX / sizeof *linbuf <= alloc_lines - linbuf_base)
+ xalloc_die ();
+ alloc_lines = 2 * alloc_lines - linbuf_base;
+ linbuf += linbuf_base;
+ linbuf = xrealloc (linbuf,
+ (alloc_lines - linbuf_base) * sizeof *linbuf);
+ linbuf -= linbuf_base;
+ }
+ linbuf[line] = p;
+
+ if (p == bufend)
+ {
+ /* If the last line is incomplete and we do not silently
+ complete lines, don't count its appended newline. */
+ if (current->missing_newline && ROBUST_OUTPUT_STYLE (output_style))
+ linbuf[line]--;
+ break;
+ }
+
+ if (context <= i && no_diff_means_no_output)
+ break;
+
+ line++;
+
+ while (*p++ != '\n')
+ continue;
+ }
+
+ /* Done with cache in local variables. */
+ current->linbuf = linbuf;
+ current->valid_lines = line;
+ current->alloc_lines = alloc_lines;
+ current->equivs = cureqs;
+ equivs = eqs;
+ equivs_alloc = eqs_alloc;
+ equivs_index = eqs_index;
+}
+
+/* Prepare the text. Make sure the text end is initialized.
+ Make sure text ends in a newline,
+ but remember that we had to add one.
+ Strip trailing CRs, if that was requested. */
+
+static void
+prepare_text (struct file_data *current)
+{
+ size_t buffered = current->buffered;
+ char *p = FILE_BUFFER (current);
+
+ if (buffered == 0 || p[buffered - 1] == '\n')
+ current->missing_newline = false;
+ else
+ {
+ p[buffered++] = '\n';
+ current->missing_newline = true;
+ }
+
+ if (!p)
+ return;
+
+ /* Don't use uninitialized storage when planting or using sentinels. */
+ memset (p + buffered, 0, sizeof (word));
+
+ if (strip_trailing_cr)
+ {
+ char *dst;
+ char *srclim = p + buffered;
+ *srclim = '\r';
+ dst = rawmemchr (p, '\r');
+
+ if (dst != srclim)
+ {
+ char const *src = dst;
+ do
+ {
+ *dst = *src++;
+ dst += ! (*dst == '\r' && *src == '\n');
+ }
+ while (src < srclim);
+
+ buffered -= src - dst;
+ }
+ }
+
+ current->buffered = buffered;
+}
+
+/* We have found N lines in a buffer of size S; guess the
+ proportionate number of lines that will be found in a buffer of
+ size T. However, do not guess a number of lines so large that the
+ resulting line table might cause overflow in size calculations. */
+static lin
+guess_lines (lin n, size_t s, size_t t)
+{
+ size_t guessed_bytes_per_line = n < 10 ? 32 : s / (n - 1);
+ lin guessed_lines = MAX (1, t / guessed_bytes_per_line);
+ return MIN (guessed_lines, PTRDIFF_MAX / (2 * sizeof (char *) + 1) - 5) + 5;
+}
+
+/* Given a vector of two file_data objects, find the identical
+ prefixes and suffixes of each object. */
+
+static void
+find_identical_ends (struct file_data filevec[])
+{
+ word *w0, *w1;
+ char *p0, *p1, *buffer0, *buffer1;
+ char const *end0, *beg0;
+ char const **linbuf0, **linbuf1;
+ lin i, lines;
+ size_t n0, n1;
+ lin alloc_lines0, alloc_lines1;
+ bool prefix_needed;
+ lin buffered_prefix, prefix_count, prefix_mask;
+ lin middle_guess, suffix_guess;
+
+ slurp (&filevec[0]);
+ prepare_text (&filevec[0]);
+ if (filevec[0].desc != filevec[1].desc)
+ {
+ slurp (&filevec[1]);
+ prepare_text (&filevec[1]);
+ }
+ else
+ {
+ filevec[1].buffer = filevec[0].buffer;
+ filevec[1].bufsize = filevec[0].bufsize;
+ filevec[1].buffered = filevec[0].buffered;
+ filevec[1].missing_newline = filevec[0].missing_newline;
+ }
+
+ /* Find identical prefix. */
+
+ w0 = filevec[0].buffer;
+ w1 = filevec[1].buffer;
+ p0 = buffer0 = (char *) w0;
+ p1 = buffer1 = (char *) w1;
+ n0 = filevec[0].buffered;
+ n1 = filevec[1].buffered;
+
+ if (p0 == p1)
+ /* The buffers are the same; sentinels won't work. */
+ p0 = p1 += n1;
+ else
+ {
+ /* Insert end sentinels, in this case characters that are guaranteed
+ to make the equality test false, and thus terminate the loop. */
+
+ if (n0 < n1)
+ p0[n0] = ~p1[n0];
+ else
+ p1[n1] = ~p0[n1];
+
+ /* Loop until first mismatch, or to the sentinel characters. */
+
+ /* Compare a word at a time for speed. */
+ while (*w0 == *w1)
+ w0++, w1++;
+
+ /* Do the last few bytes of comparison a byte at a time. */
+ p0 = (char *) w0;
+ p1 = (char *) w1;
+ while (*p0 == *p1)
+ p0++, p1++;
+
+ /* Don't mistakenly count missing newline as part of prefix. */
+ if (ROBUST_OUTPUT_STYLE (output_style)
+ && ((buffer0 + n0 - filevec[0].missing_newline < p0)
+ !=
+ (buffer1 + n1 - filevec[1].missing_newline < p1)))
+ p0--, p1--;
+ }
+
+ /* Now P0 and P1 point at the first nonmatching characters. */
+
+ /* Skip back to last line-beginning in the prefix,
+ and then discard up to HORIZON_LINES lines from the prefix. */
+ i = horizon_lines;
+ while (p0 != buffer0 && (p0[-1] != '\n' || i--))
+ p0--, p1--;
+
+ /* Record the prefix. */
+ filevec[0].prefix_end = p0;
+ filevec[1].prefix_end = p1;
+
+ /* Find identical suffix. */
+
+ /* P0 and P1 point beyond the last chars not yet compared. */
+ p0 = buffer0 + n0;
+ p1 = buffer1 + n1;
+
+ if (! ROBUST_OUTPUT_STYLE (output_style)
+ || filevec[0].missing_newline == filevec[1].missing_newline)
+ {
+ end0 = p0; /* Addr of last char in file 0. */
+
+ /* Get value of P0 at which we should stop scanning backward:
+ this is when either P0 or P1 points just past the last char
+ of the identical prefix. */
+ beg0 = filevec[0].prefix_end + (n0 < n1 ? 0 : n0 - n1);
+
+ /* Scan back until chars don't match or we reach that point. */
+ while (p0 != beg0)
+ if (*--p0 != *--p1)
+ {
+ /* Point at the first char of the matching suffix. */
+ ++p0, ++p1;
+ beg0 = p0;
+ break;
+ }
+
+ /* Are we at a line-beginning in both files? If not, add the rest of
+ this line to the main body. Discard up to HORIZON_LINES lines from
+ the identical suffix. Also, discard one extra line,
+ because shift_boundaries may need it. */
+ i = horizon_lines + !((buffer0 == p0 || p0[-1] == '\n')
+ &&
+ (buffer1 == p1 || p1[-1] == '\n'));
+ while (i-- && p0 != end0)
+ while (*p0++ != '\n')
+ continue;
+
+ p1 += p0 - beg0;
+ }
+
+ /* Record the suffix. */
+ filevec[0].suffix_begin = p0;
+ filevec[1].suffix_begin = p1;
+
+ /* Calculate number of lines of prefix to save.
+
+ prefix_count == 0 means save the whole prefix;
+ we need this for options like -D that output the whole file,
+ or for enormous contexts (to avoid worrying about arithmetic overflow).
+ We also need it for options like -F that output some preceding line;
+ at least we will need to find the last few lines,
+ but since we don't know how many, it's easiest to find them all.
+
+ Otherwise, prefix_count != 0. Save just prefix_count lines at start
+ of the line buffer; they'll be moved to the proper location later.
+ Handle 1 more line than the context says (because we count 1 too many),
+ rounded up to the next power of 2 to speed index computation. */
+
+ if (no_diff_means_no_output && ! function_regexp.fastmap
+ && context < LIN_MAX / 4 && context < n0)
+ {
+ middle_guess = guess_lines (0, 0, p0 - filevec[0].prefix_end);
+ suffix_guess = guess_lines (0, 0, buffer0 + n0 - p0);
+ for (prefix_count = 1; prefix_count <= context; prefix_count *= 2)
+ continue;
+ alloc_lines0 = (prefix_count + middle_guess
+ + MIN (context, suffix_guess));
+ }
+ else
+ {
+ prefix_count = 0;
+ alloc_lines0 = guess_lines (0, 0, n0);
+ }
+
+ prefix_mask = prefix_count - 1;
+ lines = 0;
+ linbuf0 = xmalloc (alloc_lines0 * sizeof *linbuf0);
+ prefix_needed = ! (no_diff_means_no_output
+ && filevec[0].prefix_end == p0
+ && filevec[1].prefix_end == p1);
+ p0 = buffer0;
+
+ /* If the prefix is needed, find the prefix lines. */
+ if (prefix_needed)
+ {
+ end0 = filevec[0].prefix_end;
+ while (p0 != end0)
+ {
+ lin l = lines++ & prefix_mask;
+ if (l == alloc_lines0)
+ {
+ if (PTRDIFF_MAX / (2 * sizeof *linbuf0) <= alloc_lines0)
+ xalloc_die ();
+ alloc_lines0 *= 2;
+ linbuf0 = xrealloc (linbuf0, alloc_lines0 * sizeof *linbuf0);
+ }
+ linbuf0[l] = p0;
+ while (*p0++ != '\n')
+ continue;
+ }
+ }
+ buffered_prefix = prefix_count && context < lines ? context : lines;
+
+ /* Allocate line buffer 1. */
+
+ middle_guess = guess_lines (lines, p0 - buffer0, p1 - filevec[1].prefix_end);
+ suffix_guess = guess_lines (lines, p0 - buffer0, buffer1 + n1 - p1);
+ alloc_lines1 = buffered_prefix + middle_guess + MIN (context, suffix_guess);
+ if (alloc_lines1 < buffered_prefix
+ || PTRDIFF_MAX / sizeof *linbuf1 <= alloc_lines1)
+ xalloc_die ();
+ linbuf1 = xmalloc (alloc_lines1 * sizeof *linbuf1);
+
+ if (buffered_prefix != lines)
+ {
+ /* Rotate prefix lines to proper location. */
+ for (i = 0; i < buffered_prefix; i++)
+ linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask];
+ for (i = 0; i < buffered_prefix; i++)
+ linbuf0[i] = linbuf1[i];
+ }
+
+ /* Initialize line buffer 1 from line buffer 0. */
+ for (i = 0; i < buffered_prefix; i++)
+ linbuf1[i] = linbuf0[i] - buffer0 + buffer1;
+
+ /* Record the line buffer, adjusted so that
+ linbuf[0] points at the first differing line. */
+ filevec[0].linbuf = linbuf0 + buffered_prefix;
+ filevec[1].linbuf = linbuf1 + buffered_prefix;
+ filevec[0].linbuf_base = filevec[1].linbuf_base = - buffered_prefix;
+ filevec[0].alloc_lines = alloc_lines0 - buffered_prefix;
+ filevec[1].alloc_lines = alloc_lines1 - buffered_prefix;
+ filevec[0].prefix_lines = filevec[1].prefix_lines = lines;
+}
+
+/* If 1 < k, then (2**k - prime_offset[k]) is the largest prime less
+ than 2**k. This table is derived from Chris K. Caldwell's list
+ <http://www.utm.edu/research/primes/lists/2small/>. */
+
+static unsigned char const prime_offset[] =
+{
+ 0, 0, 1, 1, 3, 1, 3, 1, 5, 3, 3, 9, 3, 1, 3, 19, 15, 1, 5, 1, 3, 9, 3,
+ 15, 3, 39, 5, 39, 57, 3, 35, 1, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21,
+ 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27,
+ 55, 93, 1, 57, 25
+};
+
+/* Verify that this host's size_t is not too wide for the above table. */
+
+verify (sizeof (size_t) * CHAR_BIT <= sizeof prime_offset);
+
+/* Given a vector of two file_data objects, read the file associated
+ with each one, and build the table of equivalence classes.
+ Return nonzero if either file appears to be a binary file.
+ If PRETEND_BINARY is nonzero, pretend they are binary regardless. */
+
+bool
+read_files (struct file_data filevec[], bool pretend_binary)
+{
+ int i;
+ bool skip_test = text | pretend_binary;
+ bool appears_binary = pretend_binary | sip (&filevec[0], skip_test);
+
+ if (filevec[0].desc != filevec[1].desc)
+ appears_binary |= sip (&filevec[1], skip_test | appears_binary);
+ else
+ {
+ filevec[1].buffer = filevec[0].buffer;
+ filevec[1].bufsize = filevec[0].bufsize;
+ filevec[1].buffered = filevec[0].buffered;
+ }
+ if (appears_binary)
+ {
+ set_binary_mode (filevec[0].desc, O_BINARY);
+ set_binary_mode (filevec[1].desc, O_BINARY);
+ return true;
+ }
+
+ find_identical_ends (filevec);
+
+ equivs_alloc = filevec[0].alloc_lines + filevec[1].alloc_lines + 1;
+ if (PTRDIFF_MAX / sizeof *equivs <= equivs_alloc)
+ xalloc_die ();
+ equivs = xmalloc (equivs_alloc * sizeof *equivs);
+ /* Equivalence class 0 is permanently safe for lines that were not
+ hashed. Real equivalence classes start at 1. */
+ equivs_index = 1;
+
+ /* Allocate (one plus) a prime number of hash buckets. Use a prime
+ number between 1/3 and 2/3 of the value of equiv_allocs,
+ approximately. */
+ for (i = 9; (size_t) 1 << i < equivs_alloc / 3; i++)
+ continue;
+ nbuckets = ((size_t) 1 << i) - prime_offset[i];
+ if (PTRDIFF_MAX / sizeof *buckets <= nbuckets)
+ xalloc_die ();
+ buckets = zalloc ((nbuckets + 1) * sizeof *buckets);
+ buckets++;
+
+ for (i = 0; i < 2; i++)
+ find_and_hash_each_line (&filevec[i]);
+
+ filevec[0].equiv_max = filevec[1].equiv_max = equivs_index;
+
+ free (equivs);
+ free (buckets - 1);
+
+ return false;
+}
diff --git a/src/normal.c b/src/normal.c
new file mode 100644
index 0000000..852a767
--- /dev/null
+++ b/src/normal.c
@@ -0,0 +1,91 @@
+/* Normal-format output routines for GNU DIFF.
+
+ Copyright (C) 1988-1989, 1993, 1995, 1998, 2001, 2006, 2009-2013, 2015-2016
+ Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+
+static void print_normal_hunk (struct change *);
+
+/* Print the edit-script SCRIPT as a normal diff.
+ INF points to an array of descriptions of the two files. */
+
+void
+print_normal_script (struct change *script)
+{
+ print_script (script, find_change, print_normal_hunk);
+}
+
+/* Print a hunk of a normal diff.
+ This is a contiguous portion of a complete edit script,
+ describing changes in consecutive lines. */
+
+static void
+print_normal_hunk (struct change *hunk)
+{
+ lin first0, last0, first1, last1;
+ register lin i;
+
+ /* Determine range of line numbers involved in each file. */
+ enum changes changes = analyze_hunk (hunk, &first0, &last0, &first1, &last1);
+ if (!changes)
+ return;
+
+ begin_output ();
+
+ /* Print out the line number header for this hunk */
+ set_color_context (LINE_NUMBER_CONTEXT);
+ print_number_range (',', &files[0], first0, last0);
+ fputc (change_letter[changes], outfile);
+ print_number_range (',', &files[1], first1, last1);
+ set_color_context (RESET_CONTEXT);
+ fputc ('\n', outfile);
+
+ /* Print the lines that the first file has. */
+ if (changes & OLD)
+ {
+ if (first0 <= last0)
+ set_color_context (DELETE_CONTEXT);
+ for (i = first0; i <= last0; i++)
+ {
+ print_1_line_nl ("<", &files[0].linbuf[i], true);
+ if (i == last0)
+ set_color_context (RESET_CONTEXT);
+ if (files[0].linbuf[i + 1][-1] == '\n')
+ putc ('\n', outfile);
+ }
+ }
+
+ if (changes == CHANGED)
+ fputs ("---\n", outfile);
+
+ /* Print the lines that the second file has. */
+ if (changes & NEW)
+ {
+ if (first1 <= last1)
+ set_color_context (ADD_CONTEXT);
+ for (i = first1; i <= last1; i++)
+ {
+ print_1_line_nl (">", &files[1].linbuf[i], true);
+ if (i == last1)
+ set_color_context (RESET_CONTEXT);
+ if (files[1].linbuf[i + 1][-1] == '\n')
+ putc ('\n', outfile);
+ }
+ }
+}
diff --git a/src/sdiff.c b/src/sdiff.c
new file mode 100644
index 0000000..22d6e5b
--- /dev/null
+++ b/src/sdiff.c
@@ -0,0 +1,1173 @@
+/* sdiff - side-by-side merge of file differences
+
+ Copyright (C) 1992-1996, 1998, 2001-2002, 2004, 2006-2007, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "system.h"
+#include "paths.h"
+
+#include <stdio.h>
+#include <unlocked-io.h>
+
+#include <c-stack.h>
+#include <dirname.h>
+#include <error.h>
+#include <exitfail.h>
+#include <file-type.h>
+#include <getopt.h>
+#include <progname.h>
+#include <system-quote.h>
+#include <version-etc.h>
+#include <xalloc.h>
+
+/* The official name of this program (e.g., no 'g' prefix). */
+#define PROGRAM_NAME "sdiff"
+
+#define AUTHORS \
+ proper_name ("Thomas Lord")
+
+/* Size of chunks read from files which must be parsed into lines. */
+#define SDIFF_BUFSIZE ((size_t) 65536)
+
+static char const *editor_program = DEFAULT_EDITOR_PROGRAM;
+static char const **diffargv;
+
+static char * volatile tmpname;
+static FILE *tmp;
+
+#if HAVE_WORKING_FORK
+static pid_t volatile diffpid;
+#endif
+
+struct line_filter;
+
+static void catchsig (int);
+static bool edit (struct line_filter *, char const *, lin, lin, struct line_filter *, char const *, lin, lin, FILE *);
+static bool interact (struct line_filter *, struct line_filter *, char const *, struct line_filter *, char const *, FILE *);
+static void checksigs (void);
+static void diffarg (char const *);
+static void fatal (char const *) __attribute__((noreturn));
+static void perror_fatal (char const *) __attribute__((noreturn));
+static void trapsigs (void);
+static void untrapsig (int);
+
+static int const sigs[] = {
+#ifdef SIGHUP
+ SIGHUP,
+#endif
+#ifdef SIGQUIT
+ SIGQUIT,
+#endif
+#ifdef SIGTERM
+ SIGTERM,
+#endif
+#ifdef SIGXCPU
+ SIGXCPU,
+#endif
+#ifdef SIGXFSZ
+ SIGXFSZ,
+#endif
+#ifdef SIGPIPE
+ SIGPIPE,
+#endif
+ SIGINT
+};
+enum
+ {
+ NUM_SIGS = sizeof sigs / sizeof *sigs,
+ handler_index_of_SIGINT = NUM_SIGS - 1
+ };
+
+#if HAVE_SIGACTION
+ /* Prefer 'sigaction' if available, since 'signal' can lose signals. */
+ static struct sigaction initial_action[NUM_SIGS];
+# define initial_handler(i) (initial_action[i].sa_handler)
+ static void signal_handler (int, void (*) (int));
+#else
+ static void (*initial_action[NUM_SIGS]) ();
+# define initial_handler(i) (initial_action[i])
+# define signal_handler(sig, handler) signal (sig, handler)
+#endif
+
+static bool diraccess (char const *);
+static int temporary_file (void);
+
+/* Options: */
+
+/* Name of output file if -o specified. */
+static char const *output;
+
+/* Do not print common lines. */
+static bool suppress_common_lines;
+
+/* Value for the long option that does not have single-letter equivalents. */
+enum
+{
+ DIFF_PROGRAM_OPTION = CHAR_MAX + 1,
+ HELP_OPTION,
+ STRIP_TRAILING_CR_OPTION,
+ TABSIZE_OPTION
+};
+
+static struct option const longopts[] =
+{
+ {"diff-program", 1, 0, DIFF_PROGRAM_OPTION},
+ {"expand-tabs", 0, 0, 't'},
+ {"help", 0, 0, HELP_OPTION},
+ {"ignore-all-space", 0, 0, 'W'}, /* swap W and w for historical reasons */
+ {"ignore-blank-lines", 0, 0, 'B'},
+ {"ignore-case", 0, 0, 'i'},
+ {"ignore-matching-lines", 1, 0, 'I'},
+ {"ignore-space-change", 0, 0, 'b'},
+ {"ignore-tab-expansion", 0, 0, 'E'},
+ {"ignore-trailing-space", 0, 0, 'Z'},
+ {"left-column", 0, 0, 'l'},
+ {"minimal", 0, 0, 'd'},
+ {"output", 1, 0, 'o'},
+ {"speed-large-files", 0, 0, 'H'},
+ {"strip-trailing-cr", 0, 0, STRIP_TRAILING_CR_OPTION},
+ {"suppress-common-lines", 0, 0, 's'},
+ {"tabsize", 1, 0, TABSIZE_OPTION},
+ {"text", 0, 0, 'a'},
+ {"version", 0, 0, 'v'},
+ {"width", 1, 0, 'w'},
+ {0, 0, 0, 0}
+};
+
+static void try_help (char const *, char const *) __attribute__((noreturn));
+static void
+try_help (char const *reason_msgid, char const *operand)
+{
+ if (reason_msgid)
+ error (0, 0, _(reason_msgid), operand);
+ error (EXIT_TROUBLE, 0, _("Try '%s --help' for more information."),
+ program_name);
+ abort ();
+}
+
+static void
+check_stdout (void)
+{
+ if (ferror (stdout))
+ fatal ("write failed");
+ else if (fclose (stdout) != 0)
+ perror_fatal (_("standard output"));
+}
+
+static char const * const option_help_msgid[] = {
+ N_("-o, --output=FILE operate interactively, sending output to FILE"),
+ "",
+ N_("-i, --ignore-case consider upper- and lower-case to be the same"),
+ N_("-E, --ignore-tab-expansion ignore changes due to tab expansion"),
+ N_("-Z, --ignore-trailing-space ignore white space at line end"),
+ N_("-b, --ignore-space-change ignore changes in the amount of white space"),
+ N_("-W, --ignore-all-space ignore all white space"),
+ N_("-B, --ignore-blank-lines ignore changes whose lines are all blank"),
+ N_("-I, --ignore-matching-lines=RE ignore changes all whose lines match RE"),
+ N_(" --strip-trailing-cr strip trailing carriage return on input"),
+ N_("-a, --text treat all files as text"),
+ "",
+ N_("-w, --width=NUM output at most NUM (default 130) print columns"),
+ N_("-l, --left-column output only the left column of common lines"),
+ N_("-s, --suppress-common-lines do not output common lines"),
+ "",
+ N_("-t, --expand-tabs expand tabs to spaces in output"),
+ N_(" --tabsize=NUM tab stops at every NUM (default 8) print columns"),
+ "",
+ N_("-d, --minimal try hard to find a smaller set of changes"),
+ N_("-H, --speed-large-files assume large files, many scattered small changes"),
+ N_(" --diff-program=PROGRAM use PROGRAM to compare files"),
+ "",
+ N_(" --help display this help and exit"),
+ N_("-v, --version output version information and exit"),
+ 0
+};
+
+static void
+usage (void)
+{
+ char const * const *p;
+
+ printf (_("Usage: %s [OPTION]... FILE1 FILE2\n"), program_name);
+ printf ("%s\n\n",
+ _("Side-by-side merge of differences between FILE1 and FILE2."));
+
+ fputs (_("\
+Mandatory arguments to long options are mandatory for short options too.\n\
+"), stdout);
+ for (p = option_help_msgid; *p; p++)
+ if (**p)
+ printf (" %s\n", _(*p));
+ else
+ putchar ('\n');
+ printf ("\n%s\n%s\n",
+ _("If a FILE is '-', read standard input."),
+ _("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."));
+ emit_bug_reporting_address ();
+}
+
+/* Clean up after a signal or other failure. This function is
+ async-signal-safe. */
+static void
+cleanup (int signo __attribute__((unused)))
+{
+#if HAVE_WORKING_FORK
+ if (0 < diffpid)
+ kill (diffpid, SIGPIPE);
+#endif
+ if (tmpname)
+ unlink (tmpname);
+}
+
+static void exiterr (void) __attribute__((noreturn));
+static void
+exiterr (void)
+{
+ cleanup (0);
+ untrapsig (0);
+ checksigs ();
+ exit (EXIT_TROUBLE);
+}
+
+static void
+fatal (char const *msgid)
+{
+ error (0, 0, "%s", _(msgid));
+ exiterr ();
+}
+
+static void
+perror_fatal (char const *msg)
+{
+ int e = errno;
+ checksigs ();
+ error (0, e, "%s", msg);
+ exiterr ();
+}
+
+static void
+check_child_status (int werrno, int wstatus, int max_ok_status,
+ char const *subsidiary_program)
+{
+ int status = (! werrno && WIFEXITED (wstatus)
+ ? WEXITSTATUS (wstatus)
+ : INT_MAX);
+
+ if (max_ok_status < status)
+ {
+ error (0, werrno,
+ _(status == 126
+ ? "subsidiary program '%s' could not be invoked"
+ : status == 127
+ ? "subsidiary program '%s' not found"
+ : status == INT_MAX
+ ? "subsidiary program '%s' failed"
+ : "subsidiary program '%s' failed (exit status %d)"),
+ subsidiary_program, status);
+ exiterr ();
+ }
+}
+
+static FILE *
+ck_fopen (char const *fname, char const *type)
+{
+ FILE *r = fopen (fname, type);
+ if (! r)
+ perror_fatal (fname);
+ return r;
+}
+
+static void
+ck_fclose (FILE *f)
+{
+ if (fclose (f))
+ perror_fatal ("fclose");
+}
+
+static size_t
+ck_fread (char *buf, size_t size, FILE *f)
+{
+ size_t r = fread (buf, sizeof (char), size, f);
+ if (r == 0 && ferror (f))
+ perror_fatal (_("read failed"));
+ return r;
+}
+
+static void
+ck_fwrite (char const *buf, size_t size, FILE *f)
+{
+ if (fwrite (buf, sizeof (char), size, f) != size)
+ perror_fatal (_("write failed"));
+}
+
+static void
+ck_fflush (FILE *f)
+{
+ if (fflush (f) != 0)
+ perror_fatal (_("write failed"));
+}
+
+static char const *
+expand_name (char *name, bool is_dir, char const *other_name)
+{
+ if (STREQ (name, "-"))
+ fatal ("cannot interactively merge standard input");
+ if (! is_dir)
+ return name;
+ else
+ {
+ /* Yield NAME/BASE, where BASE is OTHER_NAME's basename. */
+ char const *base = last_component (other_name);
+ size_t namelen = strlen (name), baselen = base_len (base);
+ bool insert_slash = *last_component (name) && name[namelen - 1] != '/';
+ char *r = xmalloc (namelen + insert_slash + baselen + 1);
+ memcpy (r, name, namelen);
+ r[namelen] = '/';
+ memcpy (r + namelen + insert_slash, base, baselen);
+ r[namelen + insert_slash + baselen] = '\0';
+ return r;
+ }
+}
+
+struct line_filter {
+ FILE *infile;
+ char *bufpos;
+ char *buffer;
+ char *buflim;
+};
+
+static void
+lf_init (struct line_filter *lf, FILE *infile)
+{
+ lf->infile = infile;
+ lf->bufpos = lf->buffer = lf->buflim = xmalloc (SDIFF_BUFSIZE + 1);
+ lf->buflim[0] = '\n';
+}
+
+/* Fill an exhausted line_filter buffer from its INFILE */
+static size_t
+lf_refill (struct line_filter *lf)
+{
+ size_t s = ck_fread (lf->buffer, SDIFF_BUFSIZE, lf->infile);
+ lf->bufpos = lf->buffer;
+ lf->buflim = lf->buffer + s;
+ lf->buflim[0] = '\n';
+ checksigs ();
+ return s;
+}
+
+/* Advance LINES on LF's infile, copying lines to OUTFILE */
+static void
+lf_copy (struct line_filter *lf, lin lines, FILE *outfile)
+{
+ char *start = lf->bufpos;
+
+ while (lines)
+ {
+ lf->bufpos = rawmemchr (lf->bufpos, '\n');
+ if (lf->bufpos == lf->buflim)
+ {
+ ck_fwrite (start, lf->buflim - start, outfile);
+ if (! lf_refill (lf))
+ return;
+ start = lf->bufpos;
+ }
+ else
+ {
+ --lines;
+ ++lf->bufpos;
+ }
+ }
+
+ ck_fwrite (start, lf->bufpos - start, outfile);
+}
+
+/* Advance LINES on LF's infile without doing output */
+static void
+lf_skip (struct line_filter *lf, lin lines)
+{
+ while (lines)
+ {
+ lf->bufpos = rawmemchr (lf->bufpos, '\n');
+ if (lf->bufpos == lf->buflim)
+ {
+ if (! lf_refill (lf))
+ break;
+ }
+ else
+ {
+ --lines;
+ ++lf->bufpos;
+ }
+ }
+}
+
+/* Snarf a line into a buffer. Return EOF if EOF, 0 if error, 1 if OK. */
+static int
+lf_snarf (struct line_filter *lf, char *buffer, size_t bufsize)
+{
+ for (;;)
+ {
+ char *start = lf->bufpos;
+ char *next = rawmemchr (start, '\n');
+ size_t s = next - start;
+ if (bufsize <= s)
+ return 0;
+ memcpy (buffer, start, s);
+ if (next < lf->buflim)
+ {
+ buffer[s] = 0;
+ lf->bufpos = next + 1;
+ return 1;
+ }
+ if (! lf_refill (lf))
+ return s ? 0 : EOF;
+ buffer += s;
+ bufsize -= s;
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ int opt;
+ char const *prog;
+
+ exit_failure = EXIT_TROUBLE;
+ initialize_main (&argc, &argv);
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ c_stack_action (cleanup);
+
+ prog = getenv ("EDITOR");
+ if (prog)
+ editor_program = prog;
+
+ diffarg (DEFAULT_DIFF_PROGRAM);
+
+ /* parse command line args */
+ while ((opt = getopt_long (argc, argv, "abBdEHiI:lo:stvw:WZ", longopts, 0))
+ != -1)
+ {
+ switch (opt)
+ {
+ case 'a':
+ diffarg ("-a");
+ break;
+
+ case 'b':
+ diffarg ("-b");
+ break;
+
+ case 'B':
+ diffarg ("-B");
+ break;
+
+ case 'd':
+ diffarg ("-d");
+ break;
+
+ case 'E':
+ diffarg ("-E");
+ break;
+
+ case 'H':
+ diffarg ("-H");
+ break;
+
+ case 'i':
+ diffarg ("-i");
+ break;
+
+ case 'I':
+ diffarg ("-I");
+ diffarg (optarg);
+ break;
+
+ case 'l':
+ diffarg ("--left-column");
+ break;
+
+ case 'o':
+ output = optarg;
+ break;
+
+ case 's':
+ suppress_common_lines = true;
+ break;
+
+ case 't':
+ diffarg ("-t");
+ break;
+
+ case 'v':
+ version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version,
+ AUTHORS, (char *) NULL);
+ check_stdout ();
+ return EXIT_SUCCESS;
+
+ case 'w':
+ diffarg ("-W");
+ diffarg (optarg);
+ break;
+
+ case 'W':
+ diffarg ("-w");
+ break;
+
+ case 'Z':
+ diffarg ("-Z");
+ break;
+
+ case DIFF_PROGRAM_OPTION:
+ diffargv[0] = optarg;
+ break;
+
+ case HELP_OPTION:
+ usage ();
+ check_stdout ();
+ return EXIT_SUCCESS;
+
+ case STRIP_TRAILING_CR_OPTION:
+ diffarg ("--strip-trailing-cr");
+ break;
+
+ case TABSIZE_OPTION:
+ diffarg ("--tabsize");
+ diffarg (optarg);
+ break;
+
+ default:
+ try_help (0, 0);
+ }
+ }
+
+ if (argc - optind != 2)
+ {
+ if (argc - optind < 2)
+ try_help ("missing operand after '%s'", argv[argc - 1]);
+ else
+ try_help ("extra operand '%s'", argv[optind + 2]);
+ }
+
+ if (! output)
+ {
+ /* easy case: diff does everything for us */
+ if (suppress_common_lines)
+ diffarg ("--suppress-common-lines");
+ diffarg ("-y");
+ diffarg ("--");
+ diffarg (argv[optind]);
+ diffarg (argv[optind + 1]);
+ diffarg (0);
+ execvp (diffargv[0], (char **) diffargv);
+ perror_fatal (diffargv[0]);
+ }
+ else
+ {
+ char const *lname, *rname;
+ FILE *left, *right, *out, *diffout;
+ bool interact_ok;
+ struct line_filter lfilt;
+ struct line_filter rfilt;
+ struct line_filter diff_filt;
+ bool leftdir = diraccess (argv[optind]);
+ bool rightdir = diraccess (argv[optind + 1]);
+
+ if (leftdir & rightdir)
+ fatal ("both files to be compared are directories");
+
+ lname = expand_name (argv[optind], leftdir, argv[optind + 1]);
+ left = ck_fopen (lname, "r");
+ rname = expand_name (argv[optind + 1], rightdir, argv[optind]);
+ right = ck_fopen (rname, "r");
+ out = ck_fopen (output, "w");
+
+ diffarg ("--sdiff-merge-assist");
+ diffarg ("--");
+ diffarg (argv[optind]);
+ diffarg (argv[optind + 1]);
+ diffarg (0);
+
+ trapsigs ();
+
+#if ! HAVE_WORKING_FORK
+ {
+ char *command = system_quote_argv (SCI_SYSTEM, (char **) diffargv);
+ errno = 0;
+ diffout = popen (command, "r");
+ if (! diffout)
+ perror_fatal (command);
+ free (command);
+ }
+#else
+ {
+ int diff_fds[2];
+
+ if (pipe (diff_fds) != 0)
+ perror_fatal ("pipe");
+
+ diffpid = fork ();
+ if (diffpid < 0)
+ perror_fatal ("fork");
+ if (! diffpid)
+ {
+ /* Alter the child's SIGINT and SIGPIPE handlers;
+ this may munge the parent.
+ The child ignores SIGINT in case the user interrupts the editor.
+ The child does not ignore SIGPIPE, even if the parent does. */
+ if (initial_handler (handler_index_of_SIGINT) != SIG_IGN)
+ signal_handler (SIGINT, SIG_IGN);
+ signal_handler (SIGPIPE, SIG_DFL);
+ close (diff_fds[0]);
+ if (diff_fds[1] != STDOUT_FILENO)
+ {
+ dup2 (diff_fds[1], STDOUT_FILENO);
+ close (diff_fds[1]);
+ }
+
+ execvp (diffargv[0], (char **) diffargv);
+ _exit (errno == ENOENT ? 127 : 126);
+ }
+
+ close (diff_fds[1]);
+ diffout = fdopen (diff_fds[0], "r");
+ if (! diffout)
+ perror_fatal ("fdopen");
+ }
+#endif
+
+ lf_init (&diff_filt, diffout);
+ lf_init (&lfilt, left);
+ lf_init (&rfilt, right);
+
+ interact_ok = interact (&diff_filt, &lfilt, lname, &rfilt, rname, out);
+
+ ck_fclose (left);
+ ck_fclose (right);
+ ck_fclose (out);
+
+ {
+ int wstatus;
+ int werrno = 0;
+
+#if ! HAVE_WORKING_FORK
+ wstatus = pclose (diffout);
+ if (wstatus == -1)
+ werrno = errno;
+#else
+ ck_fclose (diffout);
+ while (waitpid (diffpid, &wstatus, 0) < 0)
+ if (errno == EINTR)
+ checksigs ();
+ else
+ perror_fatal ("waitpid");
+ diffpid = 0;
+#endif
+
+ if (tmpname)
+ {
+ unlink (tmpname);
+ tmpname = 0;
+ }
+
+ if (! interact_ok)
+ exiterr ();
+
+ check_child_status (werrno, wstatus, EXIT_FAILURE, diffargv[0]);
+ untrapsig (0);
+ checksigs ();
+ exit (WEXITSTATUS (wstatus));
+ }
+ }
+ return EXIT_SUCCESS; /* Fool '-Wall'. */
+}
+
+static void
+diffarg (char const *a)
+{
+ static size_t diffargs, diffarglim;
+
+ if (diffargs == diffarglim)
+ {
+ if (! diffarglim)
+ diffarglim = 16;
+ else if (PTRDIFF_MAX / (2 * sizeof *diffargv) <= diffarglim)
+ xalloc_die ();
+ else
+ diffarglim *= 2;
+ diffargv = xrealloc (diffargv, diffarglim * sizeof *diffargv);
+ }
+ diffargv[diffargs++] = a;
+}
+
+/* Signal handling */
+
+static bool volatile ignore_SIGINT;
+static int volatile signal_received;
+static bool sigs_trapped;
+
+static void
+catchsig (int s)
+{
+#if ! HAVE_SIGACTION
+ signal (s, SIG_IGN);
+#endif
+ if (! (s == SIGINT && ignore_SIGINT))
+ signal_received = s;
+}
+
+#if HAVE_SIGACTION
+static struct sigaction catchaction;
+
+static void
+signal_handler (int sig, void (*handler) (int))
+{
+ catchaction.sa_handler = handler;
+ sigaction (sig, &catchaction, 0);
+}
+#endif
+
+static void
+trapsigs (void)
+{
+ int i;
+
+#if HAVE_SIGACTION
+ catchaction.sa_flags = SA_RESTART;
+ sigemptyset (&catchaction.sa_mask);
+ for (i = 0; i < NUM_SIGS; i++)
+ sigaddset (&catchaction.sa_mask, sigs[i]);
+#endif
+
+ for (i = 0; i < NUM_SIGS; i++)
+ {
+#if HAVE_SIGACTION
+ sigaction (sigs[i], 0, &initial_action[i]);
+#else
+ initial_action[i] = signal (sigs[i], SIG_IGN);
+#endif
+ if (initial_handler (i) != SIG_IGN)
+ signal_handler (sigs[i], catchsig);
+ }
+
+#ifdef SIGCHLD
+ /* System V fork+wait does not work if SIGCHLD is ignored. */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
+ sigs_trapped = true;
+}
+
+/* Untrap signal S, or all trapped signals if S is zero. */
+static void
+untrapsig (int s)
+{
+ int i;
+
+ if (sigs_trapped)
+ for (i = 0; i < NUM_SIGS; i++)
+ if ((! s || sigs[i] == s) && initial_handler (i) != SIG_IGN)
+ {
+#if HAVE_SIGACTION
+ sigaction (sigs[i], &initial_action[i], 0);
+#else
+ signal (sigs[i], initial_action[i]);
+#endif
+ }
+}
+
+/* Exit if a signal has been received. */
+static void
+checksigs (void)
+{
+ int s = signal_received;
+ if (s)
+ {
+ cleanup (0);
+
+ /* Yield an exit status indicating that a signal was received. */
+ untrapsig (s);
+ kill (getpid (), s);
+
+ /* That didn't work, so exit with error status. */
+ exit (EXIT_TROUBLE);
+ }
+}
+
+static void
+give_help (void)
+{
+ fprintf (stderr, "%s", _("\
+ed:\tEdit then use both versions, each decorated with a header.\n\
+eb:\tEdit then use both versions.\n\
+el or e1:\tEdit then use the left version.\n\
+er or e2:\tEdit then use the right version.\n\
+e:\tDiscard both versions then edit a new one.\n\
+l or 1:\tUse the left version.\n\
+r or 2:\tUse the right version.\n\
+s:\tSilently include common lines.\n\
+v:\tVerbosely include common lines.\n\
+q:\tQuit.\n\
+"));
+}
+
+static int
+skip_white (void)
+{
+ int c;
+ for (;;)
+ {
+ c = getchar ();
+ if (! isspace (c) || c == '\n')
+ break;
+ checksigs ();
+ }
+ if (ferror (stdin))
+ perror_fatal (_("read failed"));
+ return c;
+}
+
+static void
+flush_line (void)
+{
+ int c;
+ while ((c = getchar ()) != '\n' && c != EOF)
+ continue;
+ if (ferror (stdin))
+ perror_fatal (_("read failed"));
+}
+
+
+/* interpret an edit command */
+static bool
+edit (struct line_filter *left, char const *lname, lin lline, lin llen,
+ struct line_filter *right, char const *rname, lin rline, lin rlen,
+ FILE *outfile)
+{
+ for (;;)
+ {
+ int cmd0 IF_LINT (= 0);
+ int cmd1 IF_LINT (= 0);
+ bool gotcmd = false;
+
+ while (! gotcmd)
+ {
+ if (putchar ('%') != '%')
+ perror_fatal (_("write failed"));
+ ck_fflush (stdout);
+
+ cmd0 = skip_white ();
+ switch (cmd0)
+ {
+ case '1': case '2': case 'l': case 'r':
+ case 's': case 'v': case 'q':
+ if (skip_white () != '\n')
+ {
+ give_help ();
+ flush_line ();
+ continue;
+ }
+ gotcmd = true;
+ break;
+
+ case 'e':
+ cmd1 = skip_white ();
+ switch (cmd1)
+ {
+ case '1': case '2': case 'b': case 'd': case 'l': case 'r':
+ if (skip_white () != '\n')
+ {
+ give_help ();
+ flush_line ();
+ continue;
+ }
+ gotcmd = true;
+ break;
+ case '\n':
+ gotcmd = true;
+ break;
+ default:
+ give_help ();
+ flush_line ();
+ continue;
+ }
+ break;
+
+ case EOF:
+ if (feof (stdin))
+ {
+ gotcmd = true;
+ cmd0 = 'q';
+ break;
+ }
+ /* Fall through. */
+ default:
+ flush_line ();
+ /* Fall through. */
+ case '\n':
+ give_help ();
+ continue;
+ }
+ }
+
+ switch (cmd0)
+ {
+ case '1': case 'l':
+ lf_copy (left, llen, outfile);
+ lf_skip (right, rlen);
+ return true;
+ case '2': case 'r':
+ lf_copy (right, rlen, outfile);
+ lf_skip (left, llen);
+ return true;
+ case 's':
+ suppress_common_lines = true;
+ break;
+ case 'v':
+ suppress_common_lines = false;
+ break;
+ case 'q':
+ return false;
+ case 'e':
+ {
+ int fd;
+
+ if (tmpname)
+ tmp = fopen (tmpname, "w");
+ else
+ {
+ if ((fd = temporary_file ()) < 0)
+ perror_fatal ("mkstemp");
+ tmp = fdopen (fd, "w");
+ }
+
+ if (! tmp)
+ perror_fatal (tmpname);
+
+ switch (cmd1)
+ {
+ case 'd':
+ if (llen)
+ {
+ if (llen == 1)
+ fprintf (tmp, "--- %s %ld\n", lname, (long int) lline);
+ else
+ fprintf (tmp, "--- %s %ld,%ld\n", lname,
+ (long int) lline,
+ (long int) (lline + llen - 1));
+ }
+ /* Fall through. */
+ case '1': case 'b': case 'l':
+ lf_copy (left, llen, tmp);
+ break;
+
+ default:
+ lf_skip (left, llen);
+ break;
+ }
+
+ switch (cmd1)
+ {
+ case 'd':
+ if (rlen)
+ {
+ if (rlen == 1)
+ fprintf (tmp, "+++ %s %ld\n", rname, (long int) rline);
+ else
+ fprintf (tmp, "+++ %s %ld,%ld\n", rname,
+ (long int) rline,
+ (long int) (rline + rlen - 1));
+ }
+ /* Fall through. */
+ case '2': case 'b': case 'r':
+ lf_copy (right, rlen, tmp);
+ break;
+
+ default:
+ lf_skip (right, rlen);
+ break;
+ }
+
+ ck_fclose (tmp);
+
+ {
+ int wstatus;
+ int werrno = 0;
+ char const *argv[3];
+
+ ignore_SIGINT = true;
+ checksigs ();
+ argv[0] = editor_program;
+ argv[1] = tmpname;
+ argv[2] = 0;
+
+ {
+#if ! HAVE_WORKING_FORK
+ char *command = system_quote_argv (SCI_SYSTEM, (char **) argv);
+ wstatus = system (command);
+ if (wstatus == -1)
+ werrno = errno;
+ free (command);
+#else
+ pid_t pid;
+
+ pid = fork ();
+ if (pid == 0)
+ {
+ execvp (editor_program, (char **) argv);
+ _exit (errno == ENOENT ? 127 : 126);
+ }
+
+ if (pid < 0)
+ perror_fatal ("fork");
+
+ while (waitpid (pid, &wstatus, 0) < 0)
+ if (errno == EINTR)
+ checksigs ();
+ else
+ perror_fatal ("waitpid");
+#endif
+ }
+
+ ignore_SIGINT = false;
+ check_child_status (werrno, wstatus, EXIT_SUCCESS,
+ editor_program);
+ }
+
+ {
+ char buf[SDIFF_BUFSIZE];
+ size_t size;
+ tmp = ck_fopen (tmpname, "r");
+ while ((size = ck_fread (buf, SDIFF_BUFSIZE, tmp)) != 0)
+ {
+ checksigs ();
+ ck_fwrite (buf, size, outfile);
+ }
+ ck_fclose (tmp);
+ }
+ return true;
+ }
+ default:
+ give_help ();
+ break;
+ }
+ }
+}
+
+/* Alternately reveal bursts of diff output and handle user commands. */
+static bool
+interact (struct line_filter *diff,
+ struct line_filter *left, char const *lname,
+ struct line_filter *right, char const *rname,
+ FILE *outfile)
+{
+ lin lline = 1, rline = 1;
+
+ for (;;)
+ {
+ char diff_help[256];
+ int snarfed = lf_snarf (diff, diff_help, sizeof diff_help);
+
+ if (snarfed <= 0)
+ return snarfed != 0;
+
+ checksigs ();
+
+ if (diff_help[0] == ' ')
+ puts (diff_help + 1);
+ else
+ {
+ char *numend;
+ uintmax_t val;
+ lin llen, rlen, lenmax;
+ errno = 0;
+ val = strtoumax (diff_help + 1, &numend, 10);
+ if (LIN_MAX < val || errno || *numend != ',')
+ fatal (diff_help);
+ llen = val;
+ val = strtoumax (numend + 1, &numend, 10);
+ if (LIN_MAX < val || errno || *numend)
+ fatal (diff_help);
+ rlen = val;
+
+ lenmax = MAX (llen, rlen);
+
+ switch (diff_help[0])
+ {
+ case 'i':
+ if (suppress_common_lines)
+ lf_skip (diff, lenmax);
+ else
+ lf_copy (diff, lenmax, stdout);
+
+ lf_copy (left, llen, outfile);
+ lf_skip (right, rlen);
+ break;
+
+ case 'c':
+ lf_copy (diff, lenmax, stdout);
+ if (! edit (left, lname, lline, llen,
+ right, rname, rline, rlen,
+ outfile))
+ return false;
+ break;
+
+ default:
+ fatal (diff_help);
+ }
+
+ lline += llen;
+ rline += rlen;
+ }
+ }
+}
+
+/* Return true if DIR is an existing directory. */
+static bool
+diraccess (char const *dir)
+{
+ struct stat buf;
+ return stat (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+}
+
+#ifndef P_tmpdir
+# define P_tmpdir "/tmp"
+#endif
+#ifndef TMPDIR_ENV
+# define TMPDIR_ENV "TMPDIR"
+#endif
+
+/* Open a temporary file and return its file descriptor. Put into
+ tmpname the address of a newly allocated buffer that holds the
+ file's name. Use the prefix "sdiff". */
+static int
+temporary_file (void)
+{
+ char const *tmpdir = getenv (TMPDIR_ENV);
+ char const *dir = tmpdir ? tmpdir : P_tmpdir;
+ char *buf = xmalloc (strlen (dir) + 1 + 5 + 6 + 1);
+ int fd;
+ sprintf (buf, "%s/sdiffXXXXXX", dir);
+ fd = mkstemp (buf);
+ if (0 <= fd)
+ tmpname = buf;
+ return fd;
+}
diff --git a/src/side.c b/src/side.c
new file mode 100644
index 0000000..2276385
--- /dev/null
+++ b/src/side.c
@@ -0,0 +1,335 @@
+/* sdiff-format output routines for GNU DIFF.
+
+ Copyright (C) 1991-1993, 1998, 2001-2002, 2004, 2009-2013, 2015-2016 Free
+ Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ GNU DIFF is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. No author or distributor
+ accepts responsibility to anyone for the consequences of using it
+ or for whether it serves any particular purpose or works at all,
+ unless he says so in writing. Refer to the GNU General Public
+ License for full details.
+
+ Everyone is granted permission to copy, modify and redistribute
+ GNU DIFF, but only under the conditions described in the
+ GNU General Public License. A copy of this license is
+ supposed to have been given to you along with GNU DIFF so you
+ can know your rights and responsibilities. It should be in a
+ file named COPYING. Among other things, the copyright notice
+ and this notice must be preserved on all copies. */
+
+#include "diff.h"
+
+#include <wchar.h>
+
+static void print_sdiff_common_lines (lin, lin);
+static void print_sdiff_hunk (struct change *);
+
+/* Next line number to be printed in the two input files. */
+static lin next0, next1;
+
+/* Print the edit-script SCRIPT as a sdiff style output. */
+
+void
+print_sdiff_script (struct change *script)
+{
+ begin_output ();
+
+ next0 = next1 = - files[0].prefix_lines;
+ print_script (script, find_change, print_sdiff_hunk);
+
+ print_sdiff_common_lines (files[0].valid_lines, files[1].valid_lines);
+}
+
+/* Tab from column FROM to column TO, where FROM <= TO. Yield TO. */
+
+static size_t
+tab_from_to (size_t from, size_t to)
+{
+ FILE *out = outfile;
+ size_t tab;
+ size_t tab_size = tabsize;
+
+ if (!expand_tabs)
+ for (tab = from + tab_size - from % tab_size; tab <= to; tab += tab_size)
+ {
+ putc ('\t', out);
+ from = tab;
+ }
+ while (from++ < to)
+ putc (' ', out);
+ return to;
+}
+
+/* Print the text for half an sdiff line. This means truncate to
+ width observing tabs, and trim a trailing newline. Return the
+ last column written (not the number of chars). */
+
+static size_t
+print_half_line (char const *const *line, size_t indent, size_t out_bound)
+{
+ FILE *out = outfile;
+ register size_t in_position = 0;
+ register size_t out_position = 0;
+ register char const *text_pointer = line[0];
+ register char const *text_limit = line[1];
+ mbstate_t mbstate = { 0 };
+
+ while (text_pointer < text_limit)
+ {
+ char const *tp0 = text_pointer;
+ register char c = *text_pointer++;
+
+ switch (c)
+ {
+ case '\t':
+ {
+ size_t spaces = tabsize - in_position % tabsize;
+ if (in_position == out_position)
+ {
+ size_t tabstop = out_position + spaces;
+ if (expand_tabs)
+ {
+ if (out_bound < tabstop)
+ tabstop = out_bound;
+ for (; out_position < tabstop; out_position++)
+ putc (' ', out);
+ }
+ else
+ if (tabstop < out_bound)
+ {
+ out_position = tabstop;
+ putc (c, out);
+ }
+ }
+ in_position += spaces;
+ }
+ break;
+
+ case '\r':
+ {
+ putc (c, out);
+ tab_from_to (0, indent);
+ in_position = out_position = 0;
+ }
+ break;
+
+ case '\b':
+ if (in_position != 0 && --in_position < out_bound)
+ {
+ if (out_position <= in_position)
+ /* Add spaces to make up for suppressed tab past out_bound. */
+ for (; out_position < in_position; out_position++)
+ putc (' ', out);
+ else
+ {
+ out_position = in_position;
+ putc (c, out);
+ }
+ }
+ break;
+
+ default:
+ {
+ wchar_t wc;
+ size_t bytes = mbrtowc (&wc, tp0, text_limit - tp0, &mbstate);
+
+ if (0 < bytes && bytes < (size_t) -2)
+ {
+ int width = wcwidth (wc);
+ if (0 < width)
+ in_position += width;
+ if (in_position <= out_bound)
+ {
+ out_position = in_position;
+ fwrite (tp0, 1, bytes, stdout);
+ }
+ text_pointer = tp0 + bytes;
+ break;
+ }
+ }
+ /* Fall through. */
+ case '\f':
+ case '\v':
+ if (in_position < out_bound)
+ putc (c, out);
+ break;
+
+ case ' ': case '!': case '"': case '#': case '%':
+ case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>':
+ case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y':
+ case 'Z':
+ case '[': case '\\': case ']': case '^': case '_':
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}': case '~':
+ /* These characters are printable ASCII characters. */
+ if (in_position++ < out_bound)
+ {
+ out_position = in_position;
+ putc (c, out);
+ }
+ break;
+
+ case '\n':
+ return out_position;
+ }
+ }
+
+ return out_position;
+}
+
+/* Print side by side lines with a separator in the middle.
+ 0 parameters are taken to indicate white space text.
+ Blank lines that can easily be caught are reduced to a single newline. */
+
+static void
+print_1sdiff_line (char const *const *left, char sep,
+ char const *const *right)
+{
+ FILE *out = outfile;
+ size_t hw = sdiff_half_width;
+ size_t c2o = sdiff_column2_offset;
+ size_t col = 0;
+ bool put_newline = false;
+ bool color_to_reset = false;
+
+ if (sep == '<')
+ {
+ set_color_context (DELETE_CONTEXT);
+ color_to_reset = true;
+ }
+ else if (sep == '>')
+ {
+ set_color_context (ADD_CONTEXT);
+ color_to_reset = true;
+ }
+
+ if (left)
+ {
+ put_newline |= left[1][-1] == '\n';
+ col = print_half_line (left, 0, hw);
+ }
+
+ if (sep != ' ')
+ {
+ col = tab_from_to (col, (hw + c2o - 1) / 2) + 1;
+ if (sep == '|' && put_newline != (right[1][-1] == '\n'))
+ sep = put_newline ? '/' : '\\';
+ putc (sep, out);
+ }
+
+ if (right)
+ {
+ put_newline |= right[1][-1] == '\n';
+ if (**right != '\n')
+ {
+ col = tab_from_to (col, c2o);
+ print_half_line (right, col, hw);
+ }
+ }
+
+ if (put_newline)
+ putc ('\n', out);
+
+ if (color_to_reset)
+ set_color_context (RESET_CONTEXT);
+}
+
+/* Print lines common to both files in side-by-side format. */
+static void
+print_sdiff_common_lines (lin limit0, lin limit1)
+{
+ lin i0 = next0, i1 = next1;
+
+ if (!suppress_common_lines && (i0 != limit0 || i1 != limit1))
+ {
+ if (sdiff_merge_assist)
+ {
+ long int len0 = limit0 - i0;
+ long int len1 = limit1 - i1;
+ fprintf (outfile, "i%ld,%ld\n", len0, len1);
+ }
+
+ if (!left_column)
+ {
+ while (i0 != limit0 && i1 != limit1)
+ print_1sdiff_line (&files[0].linbuf[i0++], ' ',
+ &files[1].linbuf[i1++]);
+ while (i1 != limit1)
+ print_1sdiff_line (0, ')', &files[1].linbuf[i1++]);
+ }
+ while (i0 != limit0)
+ print_1sdiff_line (&files[0].linbuf[i0++], '(', 0);
+ }
+
+ next0 = limit0;
+ next1 = limit1;
+}
+
+/* Print a hunk of an sdiff diff.
+ This is a contiguous portion of a complete edit script,
+ describing changes in consecutive lines. */
+
+static void
+print_sdiff_hunk (struct change *hunk)
+{
+ lin first0, last0, first1, last1;
+ register lin i, j;
+
+ /* Determine range of line numbers involved in each file. */
+ enum changes changes =
+ analyze_hunk (hunk, &first0, &last0, &first1, &last1);
+ if (!changes)
+ return;
+
+ /* Print out lines up to this change. */
+ print_sdiff_common_lines (first0, first1);
+
+ if (sdiff_merge_assist)
+ {
+ long int len0 = last0 - first0 + 1;
+ long int len1 = last1 - first1 + 1;
+ fprintf (outfile, "c%ld,%ld\n", len0, len1);
+ }
+
+ /* Print "xxx | xxx " lines. */
+ if (changes == CHANGED)
+ {
+ for (i = first0, j = first1; i <= last0 && j <= last1; i++, j++)
+ print_1sdiff_line (&files[0].linbuf[i], '|', &files[1].linbuf[j]);
+ changes = (i <= last0 ? OLD : 0) + (j <= last1 ? NEW : 0);
+ next0 = first0 = i;
+ next1 = first1 = j;
+ }
+
+ /* Print " > xxx " lines. */
+ if (changes & NEW)
+ {
+ for (j = first1; j <= last1; ++j)
+ print_1sdiff_line (0, '>', &files[1].linbuf[j]);
+ next1 = j;
+ }
+
+ /* Print "xxx < " lines. */
+ if (changes & OLD)
+ {
+ for (i = first0; i <= last0; ++i)
+ print_1sdiff_line (&files[0].linbuf[i], '<', 0);
+ next0 = i;
+ }
+}
diff --git a/src/system.h b/src/system.h
new file mode 100644
index 0000000..be1c0bd
--- /dev/null
+++ b/src/system.h
@@ -0,0 +1,214 @@
+/* System dependent declarations.
+
+ Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Use this to suppress gcc's "...may be used before initialized" warnings. */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+/* Define '__attribute__' and 'volatile' first
+ so that they're used consistently in all system includes. */
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__
+# define __attribute__(x)
+#endif
+
+#include <verify.h>
+
+#include <sys/types.h>
+
+#include <sys/stat.h>
+#include "stat-macros.h"
+
+#ifndef STAT_BLOCKSIZE
+# if HAVE_STRUCT_STAT_ST_BLKSIZE
+# define STAT_BLOCKSIZE(s) ((s).st_blksize)
+# else
+# define STAT_BLOCKSIZE(s) (8 * 1024)
+# endif
+#endif
+
+#include <unistd.h>
+
+#include <fcntl.h>
+#include <time.h>
+
+#include <sys/wait.h>
+
+#include <dirent.h>
+#ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name)
+#endif
+
+#include <stdlib.h>
+#define EXIT_TROUBLE 2
+
+#include <limits.h>
+#include <locale.h>
+#include <stddef.h>
+#include <inttypes.h>
+
+#include <string.h>
+#if ! HAVE_STRCASECOLL
+# if HAVE_STRICOLL || defined stricoll
+# define strcasecoll(a, b) stricoll (a, b)
+# else
+# define strcasecoll(a, b) strcasecmp (a, b) /* best we can do */
+# endif
+#endif
+#if ! (HAVE_STRCASECMP || defined strcasecmp)
+int strcasecmp (char const *, char const *);
+#endif
+
+#include <gettext.h>
+#if ! ENABLE_NLS
+# undef textdomain
+# define textdomain(Domainname) /* empty */
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) /* empty */
+#endif
+
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+#include <ctype.h>
+
+/* ISDIGIT differs from isdigit, as follows:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char.
+ - It's guaranteed to evaluate its argument exactly once.
+ - It's typically faster.
+ POSIX 1003.1-2001 says that only '0' through '9' are digits.
+ Prefer ISDIGIT to isdigit unless it's important to use the locale's
+ definition of 'digit' even when the host does not conform to POSIX. */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+#include <errno.h>
+
+#include <signal.h>
+#if !defined SIGCHLD && defined SIGCLD
+# define SIGCHLD SIGCLD
+#endif
+
+#undef MIN
+#undef MAX
+#define MIN(a, b) ((a) <= (b) ? (a) : (b))
+#define MAX(a, b) ((a) >= (b) ? (a) : (b))
+
+#include <stdbool.h>
+#include <intprops.h>
+#include "propername.h"
+#include "version.h"
+
+/* Type used for fast comparison of several bytes at a time.
+ This used to be uintmax_t, but changing it to size_t
+ made plain 'cmp' 90% faster (GCC 4.8.1, x86). */
+
+#ifndef word
+# define word size_t
+#endif
+
+/* The integer type of a line number. Since files are read into main
+ memory, ptrdiff_t should be wide enough. */
+
+typedef ptrdiff_t lin;
+#define LIN_MAX PTRDIFF_MAX
+verify (TYPE_SIGNED (lin));
+verify (sizeof (ptrdiff_t) <= sizeof (lin));
+verify (sizeof (lin) <= sizeof (long int));
+
+/* Limit so that 2 * CONTEXT + 1 does not overflow. */
+
+#define CONTEXT_MAX ((LIN_MAX - 1) / 2)
+
+
+/* This section contains POSIX-compliant defaults for macros
+ that are meant to be overridden by hand in config.h as needed. */
+
+#ifndef file_name_cmp
+# define file_name_cmp strcmp
+#endif
+
+#ifndef initialize_main
+# define initialize_main(argcp, argvp)
+#endif
+
+#ifndef NULL_DEVICE
+# define NULL_DEVICE "/dev/null"
+#endif
+
+/* Do struct stat *S, *T describe the same special file? */
+#ifndef same_special_file
+# if HAVE_STRUCT_STAT_ST_RDEV && defined S_ISBLK && defined S_ISCHR
+# define same_special_file(s, t) \
+ (((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \
+ || (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \
+ && (s)->st_rdev == (t)->st_rdev)
+# else
+# define same_special_file(s, t) 0
+# endif
+#endif
+
+/* Do struct stat *S, *T describe the same file? Answer -1 if unknown. */
+#ifndef same_file
+# define same_file(s, t) \
+ ((((s)->st_ino == (t)->st_ino) && ((s)->st_dev == (t)->st_dev)) \
+ || same_special_file (s, t))
+#endif
+
+/* Do struct stat *S, *T have the same file attributes?
+
+ POSIX says that two files are identical if st_ino and st_dev are
+ the same, but many file systems incorrectly assign the same (device,
+ inode) pair to two distinct files, including:
+
+ - GNU/Linux NFS servers that export all local file systems as a
+ single NFS file system, if a local device number (st_dev) exceeds
+ 255, or if a local inode number (st_ino) exceeds 16777215.
+
+ - Network Appliance NFS servers in snapshot directories; see
+ Network Appliance bug #195.
+
+ - ClearCase MVFS; see bug id ATRia04618.
+
+ Check whether two files that purport to be the same have the same
+ attributes, to work around instances of this common bug. Do not
+ inspect all attributes, only attributes useful in checking for this
+ bug.
+
+ It's possible for two distinct files on a buggy file system to have
+ the same attributes, but it's not worth slowing down all
+ implementations (or complicating the configuration) to cater to
+ these rare cases in buggy implementations. */
+
+#ifndef same_file_attributes
+# define same_file_attributes(s, t) \
+ ((s)->st_mode == (t)->st_mode \
+ && (s)->st_nlink == (t)->st_nlink \
+ && (s)->st_uid == (t)->st_uid \
+ && (s)->st_gid == (t)->st_gid \
+ && (s)->st_size == (t)->st_size \
+ && (s)->st_mtime == (t)->st_mtime \
+ && (s)->st_ctime == (t)->st_ctime)
+#endif
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 0000000..76872cb
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,1577 @@
+/* Support routines for GNU DIFF.
+
+ Copyright (C) 1988-1989, 1992-1995, 1998, 2001-2002, 2004, 2006, 2009-2013,
+ 2015-2016 Free Software Foundation, Inc.
+
+ This file is part of GNU DIFF.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "diff.h"
+#include "argmatch.h"
+#include <dirname.h>
+#include <error.h>
+#include <system-quote.h>
+#include <xalloc.h>
+#include "xvasprintf.h"
+#include <signal.h>
+
+/* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is
+ present. */
+#ifndef SA_NOCLDSTOP
+# define SA_NOCLDSTOP 0
+# define sigprocmask(How, Set, Oset) /* empty */
+# define sigset_t int
+# if ! HAVE_SIGINTERRUPT
+# define siginterrupt(sig, flag) /* empty */
+# endif
+#endif
+
+#ifndef SA_RESTART
+# define SA_RESTART 0
+#endif
+
+char const pr_program[] = PR_PROGRAM;
+
+/* Queue up one-line messages to be printed at the end,
+ when -l is specified. Each message is recorded with a 'struct msg'. */
+
+struct msg
+{
+ struct msg *next;
+ char args[1]; /* Format + 4 args, each '\0' terminated, concatenated. */
+};
+
+/* Head of the chain of queues messages. */
+
+static struct msg *msg_chain;
+
+/* Tail of the chain of queues messages. */
+
+static struct msg **msg_chain_end = &msg_chain;
+
+/* Use when a system call returns non-zero status.
+ NAME should normally be the file name. */
+
+void
+perror_with_name (char const *name)
+{
+ error (0, errno, "%s", name);
+}
+
+/* Use when a system call returns non-zero status and that is fatal. */
+
+void
+pfatal_with_name (char const *name)
+{
+ int e = errno;
+ print_message_queue ();
+ error (EXIT_TROUBLE, e, "%s", name);
+ abort ();
+}
+
+/* Print an error message containing MSGID, then exit. */
+
+void
+fatal (char const *msgid)
+{
+ print_message_queue ();
+ error (EXIT_TROUBLE, 0, "%s", _(msgid));
+ abort ();
+}
+
+/* Like printf, except if -l in effect then save the message and print later.
+ This is used for things like "Only in ...". */
+
+void
+message (char const *format_msgid, char const *arg1, char const *arg2)
+{
+ message5 (format_msgid, arg1, arg2, 0, 0);
+}
+
+void
+message5 (char const *format_msgid, char const *arg1, char const *arg2,
+ char const *arg3, char const *arg4)
+{
+ if (paginate)
+ {
+ char *p;
+ char const *arg[5];
+ int i;
+ size_t size[5];
+ size_t total_size = offsetof (struct msg, args);
+ struct msg *new;
+
+ arg[0] = format_msgid;
+ arg[1] = arg1;
+ arg[2] = arg2;
+ arg[3] = arg3 ? arg3 : "";
+ arg[4] = arg4 ? arg4 : "";
+
+ for (i = 0; i < 5; i++)
+ total_size += size[i] = strlen (arg[i]) + 1;
+
+ new = xmalloc (total_size);
+
+ for (i = 0, p = new->args; i < 5; p += size[i++])
+ memcpy (p, arg[i], size[i]);
+
+ *msg_chain_end = new;
+ new->next = 0;
+ msg_chain_end = &new->next;
+ }
+ else
+ {
+ if (sdiff_merge_assist)
+ putchar (' ');
+ printf (_(format_msgid), arg1, arg2, arg3, arg4);
+ }
+}
+
+/* Output all the messages that were saved up by calls to 'message'. */
+
+void
+print_message_queue (void)
+{
+ char const *arg[5];
+ int i;
+ struct msg *m = msg_chain;
+
+ while (m)
+ {
+ struct msg *next = m->next;
+ arg[0] = m->args;
+ for (i = 0; i < 4; i++)
+ arg[i + 1] = arg[i] + strlen (arg[i]) + 1;
+ printf (_(arg[0]), arg[1], arg[2], arg[3], arg[4]);
+ free (m);
+ m = next;
+ }
+}
+
+/* The set of signals that are caught. */
+
+static sigset_t caught_signals;
+
+/* If nonzero, the value of the pending fatal signal. */
+
+static sig_atomic_t volatile interrupt_signal;
+
+/* A count of the number of pending stop signals that have been received. */
+
+static sig_atomic_t volatile stop_signal_count;
+
+/* An ordinary signal was received; arrange for the program to exit. */
+
+static void
+sighandler (int sig)
+{
+ if (! SA_NOCLDSTOP)
+ signal (sig, SIG_IGN);
+ if (! interrupt_signal)
+ interrupt_signal = sig;
+}
+
+/* A SIGTSTP was received; arrange for the program to suspend itself. */
+
+static void
+stophandler (int sig)
+{
+ if (! SA_NOCLDSTOP)
+ signal (sig, stophandler);
+ if (! interrupt_signal)
+ stop_signal_count++;
+}
+/* Process any pending signals. If signals are caught, this function
+ should be called periodically. Ideally there should never be an
+ unbounded amount of time when signals are not being processed.
+ Signal handling can restore the default colors, so callers must
+ immediately change colors after invoking this function. */
+
+static void
+process_signals (void)
+{
+ while (interrupt_signal || stop_signal_count)
+ {
+ int sig;
+ int stops;
+ sigset_t oldset;
+
+ set_color_context (RESET_CONTEXT);
+ fflush (stdout);
+
+ sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
+
+ /* Reload interrupt_signal and stop_signal_count, in case a new
+ signal was handled before sigprocmask took effect. */
+ sig = interrupt_signal;
+ stops = stop_signal_count;
+
+ /* SIGTSTP is special, since the application can receive that signal
+ more than once. In this case, don't set the signal handler to the
+ default. Instead, just raise the uncatchable SIGSTOP. */
+ if (stops)
+ {
+ stop_signal_count = stops - 1;
+ sig = SIGSTOP;
+ }
+ else
+ signal (sig, SIG_DFL);
+
+ /* Exit or suspend the program. */
+ raise (sig);
+ sigprocmask (SIG_SETMASK, &oldset, NULL);
+
+ /* If execution reaches here, then the program has been
+ continued (after being suspended). */
+ }
+}
+
+static void
+install_signal_handlers (void)
+{
+ /* The signals that are trapped, and the number of such signals. */
+ static int const sig[] =
+ {
+ /* This one is handled specially. */
+ SIGTSTP,
+
+ /* The usual suspects. */
+ SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM,
+#ifdef SIGPOLL
+ SIGPOLL,
+#endif
+#ifdef SIGPROF
+ SIGPROF,
+#endif
+#ifdef SIGVTALRM
+ SIGVTALRM,
+#endif
+#ifdef SIGXCPU
+ SIGXCPU,
+#endif
+#ifdef SIGXFSZ
+ SIGXFSZ,
+#endif
+ };
+ enum { nsigs = sizeof (sig) / sizeof *(sig) };
+
+#if ! SA_NOCLDSTOP
+ bool caught_sig[nsigs];
+#endif
+ {
+ int j;
+#if SA_NOCLDSTOP
+ struct sigaction act;
+
+ sigemptyset (&caught_signals);
+ for (j = 0; j < nsigs; j++)
+ {
+ sigaction (sig[j], NULL, &act);
+ if (act.sa_handler != SIG_IGN)
+ sigaddset (&caught_signals, sig[j]);
+ }
+
+ act.sa_mask = caught_signals;
+ act.sa_flags = SA_RESTART;
+
+ for (j = 0; j < nsigs; j++)
+ if (sigismember (&caught_signals, sig[j]))
+ {
+ act.sa_handler = sig[j] == SIGTSTP ? stophandler : sighandler;
+ sigaction (sig[j], &act, NULL);
+ }
+#else
+ for (j = 0; j < nsigs; j++)
+ {
+ caught_sig[j] = (signal (sig[j], SIG_IGN) != SIG_IGN);
+ if (caught_sig[j])
+ {
+ signal (sig[j], sig[j] == SIGTSTP ? stophandler : sighandler);
+ siginterrupt (sig[j], 0);
+ }
+ }
+#endif
+ }
+}
+
+static char const *current_name0;
+static char const *current_name1;
+static bool currently_recursive;
+static bool colors_enabled;
+
+static struct color_ext_type *color_ext_list = NULL;
+
+struct bin_str
+ {
+ size_t len; /* Number of bytes */
+ const char *string; /* Pointer to the same */
+ };
+
+struct color_ext_type
+ {
+ struct bin_str ext; /* The extension we're looking for */
+ struct bin_str seq; /* The sequence to output when we do */
+ struct color_ext_type *next; /* Next in list */
+ };
+
+/* Parse a string as part of the --palette argument; this may involve
+ decoding all kinds of escape characters. If equals_end is set an
+ unescaped equal sign ends the string, otherwise only a : or \0
+ does. Set *OUTPUT_COUNT to the number of bytes output. Return
+ true if successful.
+
+ The resulting string is *not* null-terminated, but may contain
+ embedded nulls.
+
+ Note that both dest and src are char **; on return they point to
+ the first free byte after the array and the character that ended
+ the input string, respectively. */
+
+static bool
+get_funky_string (char **dest, const char **src, bool equals_end,
+ size_t *output_count)
+{
+ char num; /* For numerical codes */
+ size_t count; /* Something to count with */
+ enum {
+ ST_GND, ST_BACKSLASH, ST_OCTAL, ST_HEX, ST_CARET, ST_END, ST_ERROR
+ } state;
+ const char *p;
+ char *q;
+
+ p = *src; /* We don't want to double-indirect */
+ q = *dest; /* the whole darn time. */
+
+ count = 0; /* No characters counted in yet. */
+ num = 0;
+
+ state = ST_GND; /* Start in ground state. */
+ while (state < ST_END)
+ {
+ switch (state)
+ {
+ case ST_GND: /* Ground state (no escapes) */
+ switch (*p)
+ {
+ case ':':
+ case '\0':
+ state = ST_END; /* End of string */
+ break;
+ case '\\':
+ state = ST_BACKSLASH; /* Backslash scape sequence */
+ ++p;
+ break;
+ case '^':
+ state = ST_CARET; /* Caret escape */
+ ++p;
+ break;
+ case '=':
+ if (equals_end)
+ {
+ state = ST_END; /* End */
+ break;
+ }
+ /* else fall through */
+ default:
+ *(q++) = *(p++);
+ ++count;
+ break;
+ }
+ break;
+
+ case ST_BACKSLASH: /* Backslash escaped character */
+ switch (*p)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ state = ST_OCTAL; /* Octal sequence */
+ num = *p - '0';
+ break;
+ case 'x':
+ case 'X':
+ state = ST_HEX; /* Hex sequence */
+ num = 0;
+ break;
+ case 'a': /* Bell */
+ num = '\a';
+ break;
+ case 'b': /* Backspace */
+ num = '\b';
+ break;
+ case 'e': /* Escape */
+ num = 27;
+ break;
+ case 'f': /* Form feed */
+ num = '\f';
+ break;
+ case 'n': /* Newline */
+ num = '\n';
+ break;
+ case 'r': /* Carriage return */
+ num = '\r';
+ break;
+ case 't': /* Tab */
+ num = '\t';
+ break;
+ case 'v': /* Vtab */
+ num = '\v';
+ break;
+ case '?': /* Delete */
+ num = 127;
+ break;
+ case '_': /* Space */
+ num = ' ';
+ break;
+ case '\0': /* End of string */
+ state = ST_ERROR; /* Error! */
+ break;
+ default: /* Escaped character like \ ^ : = */
+ num = *p;
+ break;
+ }
+ if (state == ST_BACKSLASH)
+ {
+ *(q++) = num;
+ ++count;
+ state = ST_GND;
+ }
+ ++p;
+ break;
+
+ case ST_OCTAL: /* Octal sequence */
+ if (*p < '0' || *p > '7')
+ {
+ *(q++) = num;
+ ++count;
+ state = ST_GND;
+ }
+ else
+ num = (num << 3) + (*(p++) - '0');
+ break;
+
+ case ST_HEX: /* Hex sequence */
+ switch (*p)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ num = (num << 4) + (*(p++) - '0');
+ break;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ num = (num << 4) + (*(p++) - 'a') + 10;
+ break;
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ num = (num << 4) + (*(p++) - 'A') + 10;
+ break;
+ default:
+ *(q++) = num;
+ ++count;
+ state = ST_GND;
+ break;
+ }
+ break;
+
+ case ST_CARET: /* Caret escape */
+ state = ST_GND; /* Should be the next state... */
+ if (*p >= '@' && *p <= '~')
+ {
+ *(q++) = *(p++) & 037;
+ ++count;
+ }
+ else if (*p == '?')
+ {
+ *(q++) = 127;
+ ++count;
+ }
+ else
+ state = ST_ERROR;
+ break;
+
+ default:
+ abort ();
+ }
+ }
+
+ *dest = q;
+ *src = p;
+ *output_count = count;
+
+ return state != ST_ERROR;
+}
+
+enum parse_state
+ {
+ PS_START = 1,
+ PS_2,
+ PS_3,
+ PS_4,
+ PS_DONE,
+ PS_FAIL
+ };
+
+#define LEN_STR_PAIR(s) sizeof (s) - 1, s
+
+static struct bin_str color_indicator[] =
+ {
+ { LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */
+ { LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */
+ { 0, NULL }, /* ec: End color (replaces lc+rs+rc) */
+ { LEN_STR_PAIR ("0") }, /* rs: Reset to ordinary colors */
+ { LEN_STR_PAIR ("1") }, /* hd: Header */
+ { LEN_STR_PAIR ("32") }, /* ad: Add line */
+ { LEN_STR_PAIR ("31") }, /* de: Delete line */
+ { LEN_STR_PAIR ("36") }, /* ln: Line number */
+ };
+
+static const char *const indicator_name[] =
+ {
+ "lc", "rc", "ec", "rs", "hd", "ad", "de", "ln", NULL
+ };
+ARGMATCH_VERIFY (indicator_name, color_indicator);
+
+static char const *color_palette;
+
+void
+set_color_palette (char const *palette)
+{
+ color_palette = palette;
+}
+
+static void
+parse_diff_color (void)
+{
+ char *color_buf;
+ const char *p; /* Pointer to character being parsed */
+ char *buf; /* color_buf buffer pointer */
+ int ind_no; /* Indicator number */
+ char label[3]; /* Indicator label */
+ struct color_ext_type *ext; /* Extension we are working on */
+
+ if ((p = color_palette) == NULL || *p == '\0')
+ return;
+
+ ext = NULL;
+ strcpy (label, "??");
+
+ /* This is an overly conservative estimate, but any possible
+ --palette string will *not* generate a color_buf longer than
+ itself, so it is a safe way of allocating a buffer in
+ advance. */
+ buf = color_buf = xstrdup (p);
+
+ enum parse_state state = PS_START;
+ while (true)
+ {
+ switch (state)
+ {
+ case PS_START: /* First label character */
+ switch (*p)
+ {
+ case ':':
+ ++p;
+ break;
+
+ case '*':
+ /* Allocate new extension block and add to head of
+ linked list (this way a later definition will
+ override an earlier one, which can be useful for
+ having terminal-specific defs override global). */
+
+ ext = xmalloc (sizeof *ext);
+ ext->next = color_ext_list;
+ color_ext_list = ext;
+
+ ++p;
+ ext->ext.string = buf;
+
+ state = (get_funky_string (&buf, &p, true, &ext->ext.len)
+ ? PS_4 : PS_FAIL);
+ break;
+
+ case '\0':
+ state = PS_DONE; /* Done! */
+ goto done;
+
+ default: /* Assume it is file type label */
+ label[0] = *(p++);
+ state = PS_2;
+ break;
+ }
+ break;
+
+ case PS_2: /* Second label character */
+ if (*p)
+ {
+ label[1] = *(p++);
+ state = PS_3;
+ }
+ else
+ state = PS_FAIL; /* Error */
+ break;
+
+ case PS_3: /* Equal sign after indicator label */
+ state = PS_FAIL; /* Assume failure... */
+ if (*(p++) == '=')/* It *should* be... */
+ {
+ for (ind_no = 0; indicator_name[ind_no] != NULL; ++ind_no)
+ {
+ if (STREQ (label, indicator_name[ind_no]))
+ {
+ color_indicator[ind_no].string = buf;
+ state = (get_funky_string (&buf, &p, false,
+ &color_indicator[ind_no].len)
+ ? PS_START : PS_FAIL);
+ break;
+ }
+ }
+ if (state == PS_FAIL)
+ error (0, 0, _("unrecognized prefix: %s"), label);
+ }
+ break;
+
+ case PS_4: /* Equal sign after *.ext */
+ if (*(p++) == '=')
+ {
+ ext->seq.string = buf;
+ state = (get_funky_string (&buf, &p, false, &ext->seq.len)
+ ? PS_START : PS_FAIL);
+ }
+ else
+ state = PS_FAIL;
+ break;
+
+ case PS_FAIL:
+ goto done;
+
+ default:
+ abort ();
+ }
+ }
+ done:
+
+ if (state == PS_FAIL)
+ {
+ struct color_ext_type *e;
+ struct color_ext_type *e2;
+
+ error (0, 0,
+ _("unparsable value for --palette"));
+ free (color_buf);
+ for (e = color_ext_list; e != NULL; /* empty */)
+ {
+ e2 = e;
+ e = e->next;
+ free (e2);
+ }
+ colors_enabled = false;
+ }
+}
+
+static void
+check_color_output (bool is_pipe)
+{
+ bool output_is_tty;
+
+ if (! outfile || colors_style == NEVER)
+ return;
+
+ output_is_tty = presume_output_tty || (!is_pipe && isatty (fileno (outfile)));
+
+ colors_enabled = (colors_style == ALWAYS
+ || (colors_style == AUTO && output_is_tty));
+
+ if (colors_enabled)
+ parse_diff_color ();
+
+ if (output_is_tty)
+ install_signal_handlers ();
+}
+
+/* Call before outputting the results of comparing files NAME0 and NAME1
+ to set up OUTFILE, the stdio stream for the output to go to.
+
+ Usually, OUTFILE is just stdout. But when -l was specified
+ we fork off a 'pr' and make OUTFILE a pipe to it.
+ 'pr' then outputs to our stdout. */
+
+void
+setup_output (char const *name0, char const *name1, bool recursive)
+{
+ current_name0 = name0;
+ current_name1 = name1;
+ currently_recursive = recursive;
+ outfile = 0;
+}
+
+#if HAVE_WORKING_FORK
+static pid_t pr_pid;
+#endif
+
+static char c_escape_char (char c)
+{
+ switch (c) {
+ case '\a': return 'a';
+ case '\b': return 'b';
+ case '\t': return 't';
+ case '\n': return 'n';
+ case '\v': return 'v';
+ case '\f': return 'f';
+ case '\r': return 'r';
+ case '"': return '"';
+ case '\\': return '\\';
+ default:
+ return c < 32;
+ }
+}
+
+static char *
+c_escape (char const *str)
+{
+ char const *s;
+ size_t plus = 0;
+ bool must_quote = false;
+
+ for (s = str; *s; s++)
+ {
+ char c = *s;
+
+ if (c == ' ')
+ {
+ must_quote = true;
+ continue;
+ }
+ switch (c_escape_char (*s))
+ {
+ case 1:
+ plus += 3;
+ /* fall through */
+ case 0:
+ break;
+ default:
+ plus++;
+ break;
+ }
+ }
+
+ if (must_quote || plus)
+ {
+ size_t s_len = s - str;
+ char *buffer = xmalloc (s_len + plus + 3);
+ char *b = buffer;
+
+ *b++ = '"';
+ for (s = str; *s; s++)
+ {
+ char c = *s;
+ char escape = c_escape_char (c);
+
+ switch (escape)
+ {
+ case 0:
+ *b++ = c;
+ break;
+ case 1:
+ *b++ = '\\';
+ *b++ = ((c >> 6) & 03) + '0';
+ *b++ = ((c >> 3) & 07) + '0';
+ *b++ = ((c >> 0) & 07) + '0';
+ break;
+ default:
+ *b++ = '\\';
+ *b++ = escape;
+ break;
+ }
+ }
+ *b++ = '"';
+ *b = 0;
+ return buffer;
+ }
+
+ return (char *) str;
+}
+
+void
+begin_output (void)
+{
+ char *names[2];
+ char *name;
+
+ if (outfile != 0)
+ return;
+
+ names[0] = c_escape (current_name0);
+ names[1] = c_escape (current_name1);
+
+ /* Construct the header of this piece of diff. */
+ /* POSIX 1003.1-2001 specifies this format. But there are some bugs in
+ the standard: it says that we must print only the last component
+ of the pathnames, and it requires two spaces after "diff" if
+ there are no options. These requirements are silly and do not
+ match historical practice. */
+ name = xasprintf ("diff%s %s %s", switch_string, names[0], names[1]);
+
+ if (paginate)
+ {
+ char const *argv[4];
+
+ if (fflush (stdout) != 0)
+ pfatal_with_name (_("write failed"));
+
+ argv[0] = pr_program;
+ argv[1] = "-h";
+ argv[2] = name;
+ argv[3] = 0;
+
+ /* Make OUTFILE a pipe to a subsidiary 'pr'. */
+ {
+#if HAVE_WORKING_FORK
+ int pipes[2];
+
+ if (pipe (pipes) != 0)
+ pfatal_with_name ("pipe");
+
+ pr_pid = fork ();
+ if (pr_pid < 0)
+ pfatal_with_name ("fork");
+
+ if (pr_pid == 0)
+ {
+ close (pipes[1]);
+ if (pipes[0] != STDIN_FILENO)
+ {
+ if (dup2 (pipes[0], STDIN_FILENO) < 0)
+ pfatal_with_name ("dup2");
+ close (pipes[0]);
+ }
+
+ execv (pr_program, (char **) argv);
+ _exit (errno == ENOENT ? 127 : 126);
+ }
+ else
+ {
+ close (pipes[0]);
+ outfile = fdopen (pipes[1], "w");
+ if (!outfile)
+ pfatal_with_name ("fdopen");
+ check_color_output (true);
+ }
+#else
+ char *command = system_quote_argv (SCI_SYSTEM, (char **) argv);
+ errno = 0;
+ outfile = popen (command, "w");
+ if (!outfile)
+ pfatal_with_name (command);
+ check_color_output (true);
+ free (command);
+#endif
+ }
+ }
+ else
+ {
+
+ /* If -l was not specified, output the diff straight to 'stdout'. */
+
+ outfile = stdout;
+ check_color_output (false);
+
+ /* If handling multiple files (because scanning a directory),
+ print which files the following output is about. */
+ if (currently_recursive)
+ printf ("%s\n", name);
+ }
+
+ free (name);
+
+ /* A special header is needed at the beginning of context output. */
+ switch (output_style)
+ {
+ case OUTPUT_CONTEXT:
+ print_context_header (files, (char const *const *)names, false);
+ break;
+
+ case OUTPUT_UNIFIED:
+ print_context_header (files, (char const *const *)names, true);
+ break;
+
+ default:
+ break;
+ }
+
+ if (names[0] != current_name0)
+ free (names[0]);
+ if (names[1] != current_name1)
+ free (names[1]);
+}
+
+/* Call after the end of output of diffs for one file.
+ Close OUTFILE and get rid of the 'pr' subfork. */
+
+void
+finish_output (void)
+{
+ if (outfile != 0 && outfile != stdout)
+ {
+ int status;
+ int wstatus;
+ int werrno = 0;
+ if (ferror (outfile))
+ fatal ("write failed");
+#if ! HAVE_WORKING_FORK
+ wstatus = pclose (outfile);
+ if (wstatus == -1)
+ werrno = errno;
+#else
+ if (fclose (outfile) != 0)
+ pfatal_with_name (_("write failed"));
+ if (waitpid (pr_pid, &wstatus, 0) < 0)
+ pfatal_with_name ("waitpid");
+#endif
+ status = (! werrno && WIFEXITED (wstatus)
+ ? WEXITSTATUS (wstatus)
+ : INT_MAX);
+ if (status)
+ error (EXIT_TROUBLE, werrno,
+ _(status == 126
+ ? "subsidiary program '%s' could not be invoked"
+ : status == 127
+ ? "subsidiary program '%s' not found"
+ : status == INT_MAX
+ ? "subsidiary program '%s' failed"
+ : "subsidiary program '%s' failed (exit status %d)"),
+ pr_program, status);
+ }
+
+ outfile = 0;
+}
+
+/* Compare two lines (typically one from each input file)
+ according to the command line options.
+ For efficiency, this is invoked only when the lines do not match exactly
+ but an option like -i might cause us to ignore the difference.
+ Return nonzero if the lines differ. */
+
+bool
+lines_differ (char const *s1, char const *s2)
+{
+ register char const *t1 = s1;
+ register char const *t2 = s2;
+ size_t column = 0;
+
+ while (1)
+ {
+ register unsigned char c1 = *t1++;
+ register unsigned char c2 = *t2++;
+
+ /* Test for exact char equality first, since it's a common case. */
+ if (c1 != c2)
+ {
+ switch (ignore_white_space)
+ {
+ case IGNORE_ALL_SPACE:
+ /* For -w, just skip past any white space. */
+ while (isspace (c1) && c1 != '\n') c1 = *t1++;
+ while (isspace (c2) && c2 != '\n') c2 = *t2++;
+ break;
+
+ case IGNORE_SPACE_CHANGE:
+ /* For -b, advance past any sequence of white space in
+ line 1 and consider it just one space, or nothing at
+ all if it is at the end of the line. */
+ if (isspace (c1))
+ {
+ while (c1 != '\n')
+ {
+ c1 = *t1++;
+ if (! isspace (c1))
+ {
+ --t1;
+ c1 = ' ';
+ break;
+ }
+ }
+ }
+
+ /* Likewise for line 2. */
+ if (isspace (c2))
+ {
+ while (c2 != '\n')
+ {
+ c2 = *t2++;
+ if (! isspace (c2))
+ {
+ --t2;
+ c2 = ' ';
+ break;
+ }
+ }
+ }
+
+ if (c1 != c2)
+ {
+ /* If we went too far when doing the simple test
+ for equality, go back to the first non-white-space
+ character in both sides and try again. */
+ if (c2 == ' ' && c1 != '\n'
+ && s1 + 1 < t1
+ && isspace ((unsigned char) t1[-2]))
+ {
+ --t1;
+ continue;
+ }
+ if (c1 == ' ' && c2 != '\n'
+ && s2 + 1 < t2
+ && isspace ((unsigned char) t2[-2]))
+ {
+ --t2;
+ continue;
+ }
+ }
+
+ break;
+
+ case IGNORE_TRAILING_SPACE:
+ case IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE:
+ if (isspace (c1) && isspace (c2))
+ {
+ unsigned char c;
+ if (c1 != '\n')
+ {
+ char const *p = t1;
+ while ((c = *p) != '\n' && isspace (c))
+ ++p;
+ if (c != '\n')
+ break;
+ }
+ if (c2 != '\n')
+ {
+ char const *p = t2;
+ while ((c = *p) != '\n' && isspace (c))
+ ++p;
+ if (c != '\n')
+ break;
+ }
+ /* Both lines have nothing but whitespace left. */
+ return false;
+ }
+ if (ignore_white_space == IGNORE_TRAILING_SPACE)
+ break;
+ /* Fall through. */
+ case IGNORE_TAB_EXPANSION:
+ if ((c1 == ' ' && c2 == '\t')
+ || (c1 == '\t' && c2 == ' '))
+ {
+ size_t column2 = column;
+ for (;; c1 = *t1++)
+ {
+ if (c1 == ' ')
+ column++;
+ else if (c1 == '\t')
+ column += tabsize - column % tabsize;
+ else
+ break;
+ }
+ for (;; c2 = *t2++)
+ {
+ if (c2 == ' ')
+ column2++;
+ else if (c2 == '\t')
+ column2 += tabsize - column2 % tabsize;
+ else
+ break;
+ }
+ if (column != column2)
+ return true;
+ }
+ break;
+
+ case IGNORE_NO_WHITE_SPACE:
+ break;
+ }
+
+ /* Lowercase all letters if -i is specified. */
+
+ if (ignore_case)
+ {
+ c1 = tolower (c1);
+ c2 = tolower (c2);
+ }
+
+ if (c1 != c2)
+ break;
+ }
+ if (c1 == '\n')
+ return false;
+
+ column += c1 == '\t' ? tabsize - column % tabsize : 1;
+ }
+
+ return true;
+}
+
+/* Find the consecutive changes at the start of the script START.
+ Return the last link before the first gap. */
+
+struct change * _GL_ATTRIBUTE_CONST
+find_change (struct change *start)
+{
+ return start;
+}
+
+struct change * _GL_ATTRIBUTE_CONST
+find_reverse_change (struct change *start)
+{
+ return start;
+}
+
+/* Divide SCRIPT into pieces by calling HUNKFUN and
+ print each piece with PRINTFUN.
+ Both functions take one arg, an edit script.
+
+ HUNKFUN is called with the tail of the script
+ and returns the last link that belongs together with the start
+ of the tail.
+
+ PRINTFUN takes a subscript which belongs together (with a null
+ link at the end) and prints it. */
+
+void
+print_script (struct change *script,
+ struct change * (*hunkfun) (struct change *),
+ void (*printfun) (struct change *))
+{
+ struct change *next = script;
+
+ while (next)
+ {
+ struct change *this, *end;
+
+ /* Find a set of changes that belong together. */
+ this = next;
+ end = (*hunkfun) (next);
+
+ /* Disconnect them from the rest of the changes,
+ making them a hunk, and remember the rest for next iteration. */
+ next = end->link;
+ end->link = 0;
+#ifdef DEBUG
+ debug_script (this);
+#endif
+
+ /* Print this hunk. */
+ (*printfun) (this);
+
+ /* Reconnect the script so it will all be freed properly. */
+ end->link = next;
+ }
+}
+
+/* Print the text of a single line LINE,
+ flagging it with the characters in LINE_FLAG (which say whether
+ the line is inserted, deleted, changed, etc.). LINE_FLAG must not
+ end in a blank, unless it is a single blank. */
+
+void
+print_1_line (char const *line_flag, char const *const *line)
+{
+ print_1_line_nl (line_flag, line, false);
+}
+
+/* Print the text of a single line LINE,
+ flagging it with the characters in LINE_FLAG (which say whether
+ the line is inserted, deleted, changed, etc.). LINE_FLAG must not
+ end in a blank, unless it is a single blank. If SKIP_NL is set, then
+ the final '\n' is not printed. */
+
+void
+print_1_line_nl (char const *line_flag, char const *const *line, bool skip_nl)
+{
+ char const *base = line[0], *limit = line[1]; /* Help the compiler. */
+ FILE *out = outfile; /* Help the compiler some more. */
+ char const *flag_format = 0;
+
+ /* If -T was specified, use a Tab between the line-flag and the text.
+ Otherwise use a Space (as Unix diff does).
+ Print neither space nor tab if line-flags are empty.
+ But omit trailing blanks if requested. */
+
+ if (line_flag && *line_flag)
+ {
+ char const *flag_format_1 = flag_format = initial_tab ? "%s\t" : "%s ";
+ char const *line_flag_1 = line_flag;
+
+ if (suppress_blank_empty && **line == '\n')
+ {
+ flag_format_1 = "%s";
+
+ /* This hack to omit trailing blanks takes advantage of the
+ fact that the only way that LINE_FLAG can end in a blank
+ is when LINE_FLAG consists of a single blank. */
+ line_flag_1 += *line_flag_1 == ' ';
+ }
+
+ fprintf (out, flag_format_1, line_flag_1);
+ }
+
+ output_1_line (base, limit - (skip_nl && limit[-1] == '\n'), flag_format, line_flag);
+
+ if ((!line_flag || line_flag[0]) && limit[-1] != '\n')
+ {
+ set_color_context (RESET_CONTEXT);
+ fprintf (out, "\n\\ %s\n", _("No newline at end of file"));
+ }
+}
+
+/* Output a line from BASE up to LIMIT.
+ With -t, expand white space characters to spaces, and if FLAG_FORMAT
+ is nonzero, output it with argument LINE_FLAG after every
+ internal carriage return, so that tab stops continue to line up. */
+
+void
+output_1_line (char const *base, char const *limit, char const *flag_format,
+ char const *line_flag)
+{
+ const size_t MAX_CHUNK = 1024;
+ if (!expand_tabs)
+ {
+ size_t left = limit - base;
+ while (left)
+ {
+ size_t to_write = MIN (left, MAX_CHUNK);
+ size_t written = fwrite (base, sizeof (char), to_write, outfile);
+ if (written < to_write)
+ return;
+ base += written;
+ left -= written;
+ process_signals ();
+ }
+ }
+ else
+ {
+ register FILE *out = outfile;
+ register unsigned char c;
+ register char const *t = base;
+ register size_t column = 0;
+ size_t tab_size = tabsize;
+ size_t counter_proc_signals = 0;
+
+ while (t < limit)
+ {
+ counter_proc_signals++;
+ if (counter_proc_signals == MAX_CHUNK)
+ {
+ process_signals ();
+ counter_proc_signals = 0;
+ }
+
+ switch ((c = *t++))
+ {
+ case '\t':
+ {
+ size_t spaces = tab_size - column % tab_size;
+ column += spaces;
+ do
+ putc (' ', out);
+ while (--spaces);
+ }
+ break;
+
+ case '\r':
+ putc (c, out);
+ if (flag_format && t < limit && *t != '\n')
+ fprintf (out, flag_format, line_flag);
+ column = 0;
+ break;
+
+ case '\b':
+ if (column == 0)
+ continue;
+ column--;
+ putc (c, out);
+ break;
+
+ default:
+ column += isprint (c) != 0;
+ putc (c, out);
+ break;
+ }
+ }
+ }
+}
+
+enum indicator_no
+ {
+ C_LEFT, C_RIGHT, C_END, C_RESET, C_HEADER, C_ADD, C_DELETE, C_LINE
+ };
+
+static void
+put_indicator (const struct bin_str *ind)
+{
+ fwrite (ind->string, ind->len, 1, outfile);
+}
+
+static enum color_context last_context = RESET_CONTEXT;
+
+void
+set_color_context (enum color_context color_context)
+{
+ if (color_context != RESET_CONTEXT)
+ process_signals ();
+ if (colors_enabled && last_context != color_context)
+ {
+ put_indicator (&color_indicator[C_LEFT]);
+ switch (color_context)
+ {
+ case HEADER_CONTEXT:
+ put_indicator (&color_indicator[C_HEADER]);
+ break;
+
+ case LINE_NUMBER_CONTEXT:
+ put_indicator (&color_indicator[C_LINE]);
+ break;
+
+ case ADD_CONTEXT:
+ put_indicator (&color_indicator[C_ADD]);
+ break;
+
+ case DELETE_CONTEXT:
+ put_indicator (&color_indicator[C_DELETE]);
+ break;
+
+ case RESET_CONTEXT:
+ put_indicator (&color_indicator[C_RESET]);
+ break;
+
+ default:
+ abort ();
+ }
+ put_indicator (&color_indicator[C_RIGHT]);
+ last_context = color_context;
+ }
+}
+
+
+char const change_letter[] = { 0, 'd', 'a', 'c' };
+
+/* Translate an internal line number (an index into diff's table of lines)
+ into an actual line number in the input file.
+ The internal line number is I. FILE points to the data on the file.
+
+ Internal line numbers count from 0 starting after the prefix.
+ Actual line numbers count from 1 within the entire file. */
+
+lin _GL_ATTRIBUTE_PURE
+translate_line_number (struct file_data const *file, lin i)
+{
+ return i + file->prefix_lines + 1;
+}
+
+/* Translate a line number range. This is always done for printing,
+ so for convenience translate to long int rather than lin, so that the
+ caller can use printf with "%ld" without casting. */
+
+void
+translate_range (struct file_data const *file,
+ lin a, lin b,
+ long int *aptr, long int *bptr)
+{
+ *aptr = translate_line_number (file, a - 1) + 1;
+ *bptr = translate_line_number (file, b + 1) - 1;
+}
+
+/* Print a pair of line numbers with SEPCHAR, translated for file FILE.
+ If the two numbers are identical, print just one number.
+
+ Args A and B are internal line numbers.
+ We print the translated (real) line numbers. */
+
+void
+print_number_range (char sepchar, struct file_data *file, lin a, lin b)
+{
+ long int trans_a, trans_b;
+ translate_range (file, a, b, &trans_a, &trans_b);
+
+ /* Note: we can have B < A in the case of a range of no lines.
+ In this case, we should print the line number before the range,
+ which is B. */
+ if (trans_b > trans_a)
+ fprintf (outfile, "%ld%c%ld", trans_a, sepchar, trans_b);
+ else
+ fprintf (outfile, "%ld", trans_b);
+}
+
+/* Look at a hunk of edit script and report the range of lines in each file
+ that it applies to. HUNK is the start of the hunk, which is a chain
+ of 'struct change'. The first and last line numbers of file 0 are stored in
+ *FIRST0 and *LAST0, and likewise for file 1 in *FIRST1 and *LAST1.
+ Note that these are internal line numbers that count from 0.
+
+ If no lines from file 0 are deleted, then FIRST0 is LAST0+1.
+
+ Return UNCHANGED if only ignorable lines are inserted or deleted,
+ OLD if lines of file 0 are deleted,
+ NEW if lines of file 1 are inserted,
+ and CHANGED if both kinds of changes are found. */
+
+enum changes
+analyze_hunk (struct change *hunk,
+ lin *first0, lin *last0,
+ lin *first1, lin *last1)
+{
+ struct change *next;
+ lin l0, l1;
+ lin show_from, show_to;
+ lin i;
+ bool trivial = ignore_blank_lines || ignore_regexp.fastmap;
+ size_t trivial_length = ignore_blank_lines - 1;
+ /* If 0, ignore zero-length lines;
+ if SIZE_MAX, do not ignore lines just because of their length. */
+
+ bool skip_white_space =
+ ignore_blank_lines && IGNORE_TRAILING_SPACE <= ignore_white_space;
+ bool skip_leading_white_space =
+ skip_white_space && IGNORE_SPACE_CHANGE <= ignore_white_space;
+
+ char const * const *linbuf0 = files[0].linbuf; /* Help the compiler. */
+ char const * const *linbuf1 = files[1].linbuf;
+
+ show_from = show_to = 0;
+
+ *first0 = hunk->line0;
+ *first1 = hunk->line1;
+
+ next = hunk;
+ do
+ {
+ l0 = next->line0 + next->deleted - 1;
+ l1 = next->line1 + next->inserted - 1;
+ show_from += next->deleted;
+ show_to += next->inserted;
+
+ for (i = next->line0; i <= l0 && trivial; i++)
+ {
+ char const *line = linbuf0[i];
+ char const *lastbyte = linbuf0[i + 1] - 1;
+ char const *newline = lastbyte + (*lastbyte != '\n');
+ size_t len = newline - line;
+ char const *p = line;
+ if (skip_white_space)
+ for (; *p != '\n'; p++)
+ if (! isspace ((unsigned char) *p))
+ {
+ if (! skip_leading_white_space)
+ p = line;
+ break;
+ }
+ if (newline - p != trivial_length
+ && (! ignore_regexp.fastmap
+ || re_search (&ignore_regexp, line, len, 0, len, 0) < 0))
+ trivial = 0;
+ }
+
+ for (i = next->line1; i <= l1 && trivial; i++)
+ {
+ char const *line = linbuf1[i];
+ char const *lastbyte = linbuf1[i + 1] - 1;
+ char const *newline = lastbyte + (*lastbyte != '\n');
+ size_t len = newline - line;
+ char const *p = line;
+ if (skip_white_space)
+ for (; *p != '\n'; p++)
+ if (! isspace ((unsigned char) *p))
+ {
+ if (! skip_leading_white_space)
+ p = line;
+ break;
+ }
+ if (newline - p != trivial_length
+ && (! ignore_regexp.fastmap
+ || re_search (&ignore_regexp, line, len, 0, len, 0) < 0))
+ trivial = 0;
+ }
+ }
+ while ((next = next->link) != 0);
+
+ *last0 = l0;
+ *last1 = l1;
+
+ /* If all inserted or deleted lines are ignorable,
+ tell the caller to ignore this hunk. */
+
+ if (trivial)
+ return UNCHANGED;
+
+ return (show_from ? OLD : UNCHANGED) | (show_to ? NEW : UNCHANGED);
+}
+
+/* Concatenate three strings, returning a newly malloc'd string. */
+
+char *
+concat (char const *s1, char const *s2, char const *s3)
+{
+ char *new = xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1);
+ sprintf (new, "%s%s%s", s1, s2, s3);
+ return new;
+}
+
+/* Yield a new block of SIZE bytes, initialized to zero. */
+
+void *
+zalloc (size_t size)
+{
+ void *p = xmalloc (size);
+ memset (p, 0, size);
+ return p;
+}
+
+void
+debug_script (struct change *sp)
+{
+ fflush (stdout);
+
+ for (; sp; sp = sp->link)
+ {
+ long int line0 = sp->line0;
+ long int line1 = sp->line1;
+ long int deleted = sp->deleted;
+ long int inserted = sp->inserted;
+ fprintf (stderr, "%3ld %3ld delete %ld insert %ld\n",
+ line0, line1, deleted, inserted);
+ }
+
+ fflush (stderr);
+}
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..66e25a5
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,90 @@
+# tests for GNU diff
+
+TESTS = \
+ basic \
+ bignum \
+ binary \
+ brief-vs-stat-zero-kernel-lies \
+ colliding-file-names \
+ diff3 \
+ excess-slash \
+ help-version \
+ function-line-vs-leading-space \
+ ignore-matching-lines \
+ label-vs-func \
+ new-file \
+ no-dereference \
+ no-newline-at-eof \
+ stdin \
+ strcoll-0-names \
+ filename-quoting \
+ colors
+
+EXTRA_DIST = \
+ $(TESTS) init.sh t-local.sh envvar-check
+
+# Note that the first lines are statements. They ensure that environment
+# variables that can perturb tests are unset or set to expected values.
+# The rest are envvar settings that propagate build-related Makefile
+# variables to test scripts.
+TESTS_ENVIRONMENT = \
+ tmp__=$${TMPDIR-/tmp}; \
+ test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \
+ . $(srcdir)/envvar-check; \
+ TMPDIR=$$tmp__; export TMPDIR; \
+ \
+ if test -n "$$BASH_VERSION" || (eval "export v=x") 2>/dev/null; then \
+ export_with_values () { export "$$@"; }; \
+ else \
+ export_with_values () \
+ { \
+ sed_extract_var='s/=.*//'; \
+ sed_quote_value="s/'/'\\\\''/g;s/=\\(.*\\)/='\\1'/";\
+ for arg in "$$@"; do \
+ var=`echo "$$arg" | sed "$$sed_extract_var"`; \
+ arg=`echo "$$arg" | sed "$$sed_quote_value"`; \
+ eval "$$arg"; \
+ export "$$var"; \
+ done; \
+ }; \
+ fi; \
+ \
+ export_with_values \
+ VERSION='$(VERSION)' \
+ LOCALE_FR='$(LOCALE_FR)' \
+ LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
+ AWK=$(AWK) \
+ GREP_OPTIONS='' \
+ LC_ALL=C \
+ abs_top_builddir='$(abs_top_builddir)' \
+ abs_top_srcdir='$(abs_top_srcdir)' \
+ abs_srcdir='$(abs_srcdir)' \
+ built_programs="`$(built_programs)`" \
+ srcdir='$(srcdir)' \
+ top_srcdir='$(top_srcdir)' \
+ CC='$(CC)' \
+ DIFFUTILS_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
+ MAKE=$(MAKE) \
+ MALLOC_PERTURB_=$(MALLOC_PERTURB_) \
+ PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
+ PACKAGE_VERSION=$(PACKAGE_VERSION) \
+ PERL='$(PERL)' \
+ SHELL='$(SHELL)' \
+ PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
+ REPLACE_GETCWD=$(REPLACE_GETCWD) \
+ PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
+ stderr_fileno_=9 \
+ ; 9>&2
+
+LOG_COMPILER= $(SHELL)
+
+built_programs = \
+ echo 'spy:;@echo $$(PROGRAMS)' \
+ | { (cd ../src && MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy) \
+ | tr ' ' '\n' \
+ | sed '/^$$/d; s,$(EXEEXT)$$,,' \
+ | sort -u \
+ | tr '\n' ' '; echo; } \
+ | sed 's/ $$//'
+
+VERBOSE = yes
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 0000000..ee17a5f
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,1916 @@
+# Makefile.in generated by automake 1.99a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2015 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@
+
+# tests for GNU diff
+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@
+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@
+subdir = tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/btowc.m4 \
+ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/codeset.m4 \
+ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \
+ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+ $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/filenamecat.m4 \
+ $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpieee.m4 \
+ $(top_srcdir)/m4/freopen.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/ftruncate.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+ $(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+ $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttostr.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \
+ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+ $(top_srcdir)/m4/libunistring-base.m4 \
+ $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+ $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
+ $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \
+ $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
+ $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mkstemp.m4 \
+ $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/setlocale.m4 \
+ $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+ $(top_srcdir)/m4/signalblocking.m4 \
+ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \
+ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socketlib.m4 \
+ $(top_srcdir)/m4/sockets.m4 $(top_srcdir)/m4/socklen.m4 \
+ $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
+ $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
+ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strerror.m4 \
+ $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/strftime.m4 \
+ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
+ $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
+ $(top_srcdir)/m4/strptime.m4 $(top_srcdir)/m4/strtoull.m4 \
+ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \
+ $(top_srcdir)/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/m4/sys_select_h.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
+ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
+ $(top_srcdir)/m4/time_rz.m4 $(top_srcdir)/m4/timegm.m4 \
+ $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
+ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
+ $(top_srcdir)/m4/vararrays.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
+ $(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
+ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \
+ $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
+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@
+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@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+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@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFS = @GNULIB_FFS@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ICONV = @GNULIB_ICONV@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISBLANK = @GNULIB_ISBLANK@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PSELECT = @GNULIB_PSELECT@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
+GNULIB_SELECT = @GNULIB_SELECT@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+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_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_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+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_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_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+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_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+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_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+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_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+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_MEMCHR = @HAVE_MEMCHR@
+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_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+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_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+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_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+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_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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_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_TIMEGM = @HAVE_TIMEGM@
+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_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+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_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_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HELP2MAN = @HELP2MAN@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
+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@
+LDFLAGS = @LDFLAGS@
+LIBCSTACK = @LIBCSTACK@
+LIBDIFFUTILS_LIBDEPS = @LIBDIFFUTILS_LIBDEPS@
+LIBDIFFUTILS_LTLIBDEPS = @LIBDIFFUTILS_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSIGSEGV = @LIBSIGSEGV@
+LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBSIGSEGV = @LTLIBSIGSEGV@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_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_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_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_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_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_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_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_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_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_SYS_IOCTL_H = @NEXT_SYS_IOCTL_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_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+OBJEXT = @OBJEXT@
+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@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PR_PROGRAM = @PR_PROGRAM@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+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_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+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 = @REPLACE_MALLOC@
+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_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+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_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+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_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+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_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_STRERROR_R = @REPLACE_STRERROR_R@
+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_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_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+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@
+SRC_VERSION_C = @SRC_VERSION_C@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+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@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_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@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_aux_dir = @abs_aux_dir@
+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@
+am__include = @am__include@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+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@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TESTS = \
+ basic \
+ bignum \
+ binary \
+ brief-vs-stat-zero-kernel-lies \
+ colliding-file-names \
+ diff3 \
+ excess-slash \
+ help-version \
+ function-line-vs-leading-space \
+ ignore-matching-lines \
+ label-vs-func \
+ new-file \
+ no-dereference \
+ no-newline-at-eof \
+ stdin \
+ strcoll-0-names \
+ filename-quoting \
+ colors
+
+EXTRA_DIST = \
+ $(TESTS) init.sh t-local.sh envvar-check
+
+
+# Note that the first lines are statements. They ensure that environment
+# variables that can perturb tests are unset or set to expected values.
+# The rest are envvar settings that propagate build-related Makefile
+# variables to test scripts.
+TESTS_ENVIRONMENT = \
+ tmp__=$${TMPDIR-/tmp}; \
+ test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \
+ . $(srcdir)/envvar-check; \
+ TMPDIR=$$tmp__; export TMPDIR; \
+ \
+ if test -n "$$BASH_VERSION" || (eval "export v=x") 2>/dev/null; then \
+ export_with_values () { export "$$@"; }; \
+ else \
+ export_with_values () \
+ { \
+ sed_extract_var='s/=.*//'; \
+ sed_quote_value="s/'/'\\\\''/g;s/=\\(.*\\)/='\\1'/";\
+ for arg in "$$@"; do \
+ var=`echo "$$arg" | sed "$$sed_extract_var"`; \
+ arg=`echo "$$arg" | sed "$$sed_quote_value"`; \
+ eval "$$arg"; \
+ export "$$var"; \
+ done; \
+ }; \
+ fi; \
+ \
+ export_with_values \
+ VERSION='$(VERSION)' \
+ LOCALE_FR='$(LOCALE_FR)' \
+ LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
+ AWK=$(AWK) \
+ GREP_OPTIONS='' \
+ LC_ALL=C \
+ abs_top_builddir='$(abs_top_builddir)' \
+ abs_top_srcdir='$(abs_top_srcdir)' \
+ abs_srcdir='$(abs_srcdir)' \
+ built_programs="`$(built_programs)`" \
+ srcdir='$(srcdir)' \
+ top_srcdir='$(top_srcdir)' \
+ CC='$(CC)' \
+ DIFFUTILS_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
+ MAKE=$(MAKE) \
+ MALLOC_PERTURB_=$(MALLOC_PERTURB_) \
+ PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
+ PACKAGE_VERSION=$(PACKAGE_VERSION) \
+ PERL='$(PERL)' \
+ SHELL='$(SHELL)' \
+ PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
+ REPLACE_GETCWD=$(REPLACE_GETCWD) \
+ PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
+ stderr_fileno_=9 \
+ ; 9>&2
+
+LOG_COMPILER = $(SHELL)
+built_programs = \
+ echo 'spy:;@echo $$(PROGRAMS)' \
+ | { (cd ../src && MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy) \
+ | tr ' ' '\n' \
+ | sed '/^$$/d; s,$(EXEEXT)$$,,' \
+ | sort -u \
+ | tr '\n' ' '; echo; } \
+ | sed 's/ $$//'
+
+VERBOSE = yes
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .log .test .test$(EXEEXT) .trs
+$(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) --gnu tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/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):
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+basic.log: basic
+ @p='basic'; \
+ b='basic'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+bignum.log: bignum
+ @p='bignum'; \
+ b='bignum'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+binary.log: binary
+ @p='binary'; \
+ b='binary'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+brief-vs-stat-zero-kernel-lies.log: brief-vs-stat-zero-kernel-lies
+ @p='brief-vs-stat-zero-kernel-lies'; \
+ b='brief-vs-stat-zero-kernel-lies'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+colliding-file-names.log: colliding-file-names
+ @p='colliding-file-names'; \
+ b='colliding-file-names'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+diff3.log: diff3
+ @p='diff3'; \
+ b='diff3'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+excess-slash.log: excess-slash
+ @p='excess-slash'; \
+ b='excess-slash'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+help-version.log: help-version
+ @p='help-version'; \
+ b='help-version'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+function-line-vs-leading-space.log: function-line-vs-leading-space
+ @p='function-line-vs-leading-space'; \
+ b='function-line-vs-leading-space'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+ignore-matching-lines.log: ignore-matching-lines
+ @p='ignore-matching-lines'; \
+ b='ignore-matching-lines'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+label-vs-func.log: label-vs-func
+ @p='label-vs-func'; \
+ b='label-vs-func'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+new-file.log: new-file
+ @p='new-file'; \
+ b='new-file'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+no-dereference.log: no-dereference
+ @p='no-dereference'; \
+ b='no-dereference'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+no-newline-at-eof.log: no-newline-at-eof
+ @p='no-newline-at-eof'; \
+ b='no-newline-at-eof'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+stdin.log: stdin
+ @p='stdin'; \
+ b='stdin'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+strcoll-0-names.log: strcoll-0-names
+ @p='strcoll-0-names'; \
+ b='strcoll-0-names'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+filename-quoting.log: filename-quoting
+ @p='filename-quoting'; \
+ b='filename-quoting'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+colors.log: colors
+ @p='colors'; \
+ b='colors'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(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
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+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 "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+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)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+ cscopelist-am ctags-am distclean distclean-generic 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 maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am recheck tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# 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/tests/basic b/tests/basic
new file mode 100755
index 0000000..45b9c9c
--- /dev/null
+++ b/tests/basic
@@ -0,0 +1,42 @@
+#!/bin/sh
+# small examples
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+cat <<EOF > exp- || fail=1
+1c1
+< a
+---
+> b
+EOF
+
+cat <<EOF > exp--u || fail=1
+--- a
++++ b
+@@ -1 +1 @@
+-a
++b
+EOF
+
+cat <<EOF > exp--c || fail=1
+*** a
+--- b
+***************
+*** 1 ****
+! a
+--- 1 ----
+! b
+EOF
+
+echo a > a
+echo b > b
+for opt in '' -u -c; do
+ diff $opt a b > out 2> err; test $? = 1 || fail=1
+ # Remove date and time.
+ sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out
+ compare exp-$(echo $opt|tr ' ' _) out || fail=1
+done
+
+Exit $fail
diff --git a/tests/bignum b/tests/bignum
new file mode 100755
index 0000000..a0c95f6
--- /dev/null
+++ b/tests/bignum
@@ -0,0 +1,14 @@
+#!/bin/sh
+# big numbers
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+for tabsize in 2147483648 9223372036854775808; do
+ diff --tabsize=$tabsize /dev/null /dev/null
+ status=$?
+ test $status -eq 0 || test $status -eq 2 || fail=1
+done
+
+Exit $fail
diff --git a/tests/binary b/tests/binary
new file mode 100755
index 0000000..0110f6e
--- /dev/null
+++ b/tests/binary
@@ -0,0 +1,17 @@
+#!/bin/sh
+# small examples
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+printf 'Binary files - and /dev/null differ\n' > out-exp || fail_ setup
+
+fail=0
+
+printf '\0'|diff - /dev/null > out 2> err
+
+# diff must exit with status 1, stdout as above, and no stderr.
+test $? = 1 || fail=1
+compare out-exp out || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail
diff --git a/tests/brief-vs-stat-zero-kernel-lies b/tests/brief-vs-stat-zero-kernel-lies
new file mode 100755
index 0000000..7b043db
--- /dev/null
+++ b/tests/brief-vs-stat-zero-kernel-lies
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Before diff-3.4, diff --brief could mistakenly declare a difference.
+# For example, when comparing a file like /proc/cmdline (for which the linux
+# kernel reports a st_size of 0 even though it is not an empty file) to a
+# copy of that file's contents residing on a "normal" file system.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+# Skip the test unless we have an appropriate file.
+boot=/proc/cmdline
+test -f $boot || skip_ no $boot file
+sz=$(stat --format %s $boot) || skip_ stat --format %s does not work
+test $sz = 0 || skip_ $boot has nonzero size
+
+# /proc/self is not useful on the Hurd, where it always points to "1",
+# so skip this test when /proc/self does not point to a file whose name is
+# the current process ID.
+readlink /proc/self > pid & pid=$!
+wait $pid
+echo $pid > exp
+compare exp pid || skip_ /proc/self is not useful on this system
+
+# There are two code paths to test: one for non-binary and one for binary files.
+# $boot is non-binary.
+cat $boot > ref || framework_failure_
+diff --brief $boot ref > out 2>&1 || fail=1
+compare /dev/null out || fail=1
+
+# /proc/self/cmdline is a NUL-terminated list of argv values,
+# so construct the expected output here:
+printf 'diff\0--brief\0/proc/self/cmdline\0bin\0' > bin || framework_failure_
+# And run the command that is embedded in that output:
+diff --brief /proc/self/cmdline bin > out 2>&1 || fail=1
+compare /dev/null out || fail=1
+
+Exit $fail
diff --git a/tests/colliding-file-names b/tests/colliding-file-names
new file mode 100755
index 0000000..964d026
--- /dev/null
+++ b/tests/colliding-file-names
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Check that diff responds well if a directory has multiple file names
+# that compare equal.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+mkdir d1 d2 || fail=1
+
+for i in abc abC aBc aBC; do
+ echo xyz >d1/$i || fail=1
+done
+
+for i in ABC ABc AbC Abc; do
+ echo xyz >d2/$i || fail=1
+done
+
+diff -r --ignore-file-name-case d1 d2 || fail=1
+
+Exit $fail
diff --git a/tests/colors b/tests/colors
new file mode 100755
index 0000000..8651a5b
--- /dev/null
+++ b/tests/colors
@@ -0,0 +1,134 @@
+#!/bin/sh
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+TZ=UTC0
+export TZ
+
+fail=0
+
+echo a > a
+echo b > b
+
+epoch='1970-01-01 00:00:00'
+touch -t 197001010000.00 a b
+
+e=$(printf '\033')
+tab=$(printf '\t')
+
+gen_exp_u()
+{
+ local epoch_plus="$epoch.000000000 +0000"
+ local rs=$(printf "$e[${rs}m")
+ local hd=$(printf "$e[${hd}m")
+ local ad=$(printf "$e[${ad}m")
+ local de=$(printf "$e[${de}m")
+ local ln=$(printf "$e[${ln}m")
+ printf '%s' \
+"$hd--- a$tab$epoch_plus
++++ b$tab$epoch_plus
+$rs${ln}@@ -1 +1 @@$rs
+$de-a$rs
+$ad+b$rs
+"
+}
+
+gen_exp_c()
+{
+ local epoch_posix_1003_1_2001="Thu Jan 1 00:00:00 1970"
+ local rs=$(printf "$e[${rs}m")
+ local hd=$(printf "$e[${hd}m")
+ local ad=$(printf "$e[${ad}m")
+ local de=$(printf "$e[${de}m")
+ local ln=$(printf "$e[${ln}m")
+ printf '%s' \
+"$hd*** a$tab$epoch_posix_1003_1_2001
+--- b$tab$epoch_posix_1003_1_2001
+$rs***************
+$ln*** 1 ****$rs
+$de! a$rs
+$ln--- 1 ----$rs
+$ad! b$rs
+"
+}
+
+gen_exp_default()
+{
+ printf '%s' \
+"1c1
+< a
+---
+> b
+"
+}
+
+gen_exp_default_colors()
+{
+ local rs=$(printf "$e[${rs}m")
+ local hd=$(printf "$e[${hd}m")
+ local ad=$(printf "$e[${ad}m")
+ local de=$(printf "$e[${de}m")
+ local ln=$(printf "$e[${ln}m")
+ printf '%s' \
+"${ln}1c1$rs
+$de< a$rs
+---
+$ad> b$rs
+"
+}
+
+# Compare with some known outputs
+
+rs=0 hd=1 ad=32 de=31 ln=36
+
+diff --color=auto a b > out
+test $? = 1 || fail=1
+gen_exp_default > exp || framework_failure_
+compare exp out || fail=1
+
+TERM=dumb diff ---presume-output-tty --color=auto a b > out
+test $? = 1 || fail=1
+gen_exp_default > exp || framework_failure_
+compare exp out || fail=1
+
+diff --color=never a b > out
+test $? = 1 || fail=1
+gen_exp_default > exp || framework_failure_
+compare exp out || fail=1
+
+diff a b > out
+test $? = 1 || fail=1
+gen_exp_default > exp || framework_failure_
+compare exp out || fail=1
+
+diff --color=always a b > out
+test $? = 1 || fail=1
+gen_exp_default_colors > exp || framework_failure_
+compare exp out || fail=1
+
+diff -u --color=always a b > out
+test $? = 1 || fail=1
+gen_exp_u > exp || framework_failure_
+compare exp out || fail=1
+
+diff -c --color=always a b > out
+test $? = 1 || fail=1
+gen_exp_c > exp || framework_failure_
+compare exp out || fail=1
+
+rs=0 hd=33 ad=34 de=35 ln=36
+diff -u --color=always --palette="rs=0:hd=33:ad=34:de=35:ln=36" a b > out
+test $? = 1 || fail=1
+gen_exp_u > exp || framework_failure_
+compare exp out || fail=1
+
+# Before the fix in http://debbugs.gnu.org/22067,
+# this test would trigger an infinite loop bug.
+mkfifo fifo
+printf '%*s-a' 1000000 > a
+printf '%*s-b' 1000000 > b
+head -c 10 < fifo > /dev/null &
+diff --color=always ---presume-output-tty a b > fifo
+test $? = 141 || fail=1
+
+Exit $fail
diff --git a/tests/diff3 b/tests/diff3
new file mode 100644
index 0000000..b591751
--- /dev/null
+++ b/tests/diff3
@@ -0,0 +1,108 @@
+#!/bin/sh
+# This would malfunction in diff-3.4
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+# Some systems lack seq.
+# A limited replacement for seq: handle 1 or 2 args; increment must be 1
+seq()
+{
+ case $# in
+ 1) start=1 final=$1;;
+ 2) start=$1 final=$2;;
+ *) echo you lose 1>&2; exit 1;;
+ esac
+ awk 'BEGIN{for(i='$start';i<='$final';i++) print i}' < /dev/null
+}
+
+echo a > a || framework_failure_
+echo b > b || framework_failure_
+echo c > c || framework_failure_
+cat <<'EOF' > exp || framework_failure_
+====
+1:1c
+ a
+2:1c
+ b
+3:1c
+ c
+EOF
+
+fail=0
+
+diff3 a b c > out 2> err || fail=1
+compare exp out || fail=1
+compare /dev/null err || fail=1
+
+# Repeat, but with all three files the same:
+diff3 a a a > out 2> err || fail=1
+compare /dev/null out || fail=1
+compare /dev/null err || fail=1
+
+# This would have provoked a nontrivial leak prior to diffutils-3.5,
+# due to the nontrivial list of diff_block structs.
+seq 10 40|sed 's/1$/x/' > d || framework_failure_
+seq 10 40|sed 's/5$/y/' > e || framework_failure_
+seq 10 40|sed 's/8$/z/' > f || framework_failure_
+cat <<'EOF' > exp40 || framework_failure_
+====1
+1:2c
+ 1x
+2:2c
+3:2c
+ 11
+====2
+1:6c
+3:6c
+ 15
+2:6c
+ 1y
+====3
+1:9c
+2:9c
+ 18
+3:9c
+ 1z
+====1
+1:12c
+ 2x
+2:12c
+3:12c
+ 21
+====2
+1:16c
+3:16c
+ 25
+2:16c
+ 2y
+====3
+1:19c
+2:19c
+ 28
+3:19c
+ 2z
+====1
+1:22c
+ 3x
+2:22c
+3:22c
+ 31
+====2
+1:26c
+3:26c
+ 35
+2:26c
+ 3y
+====3
+1:29c
+2:29c
+ 38
+3:29c
+ 3z
+EOF
+
+diff3 d e f > out 2> err
+compare exp40 out || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail
diff --git a/tests/envvar-check b/tests/envvar-check
new file mode 100644
index 0000000..3debef7
--- /dev/null
+++ b/tests/envvar-check
@@ -0,0 +1,65 @@
+# -*- sh -*-
+# Check environment variables for sane values while testing.
+
+# Copyright (C) 2000-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+envvar_check_fail=0
+vars='
+ _POSIX2_VERSION
+ _STDBUF_E
+ _STDBUF_I
+ _STDBUF_O
+ BASH_ENV
+ BLOCKSIZE
+ BLOCK_SIZE
+ CDPATH
+ COLUMNS
+ DF_BLOCK_SIZE
+ DU_BLOCK_SIZE
+ EDITOR
+ ENV
+ GREP_OPTIONS
+ LANGUAGE
+ LS_BLOCK_SIZE
+ LS_COLORS
+ OMP_NUM_THREADS
+ POSIXLY_CORRECT
+ QUOTING_STYLE
+ SIMPLE_BACKUP_SUFFIX
+ TABSIZE
+ TERM
+ COLORTERM
+ TIME_STYLE
+ TMPDIR
+ VERSION_CONTROL
+'
+for var in $vars
+do
+ $as_unset $var
+ if eval test \"\${$var+set}\" = set; then
+ echo "$0: the $var environment variable is set --" \
+ ' unset it and rerun this test' >&2
+ envvar_check_fail=1
+ fi
+done
+
+test "$envvar_check_fail" = 1 && exit 1
diff --git a/tests/excess-slash b/tests/excess-slash
new file mode 100755
index 0000000..22c2060
--- /dev/null
+++ b/tests/excess-slash
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Ensure that no excess slash appears in diff -r output.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+mkdir -p a/f b/f/g || framework_failure_
+echo Only in b/f: g > expected-out || framework_failure_
+
+fail=0
+
+diff -r a b/ > out 2> err && fail=1
+
+# expect no stderr
+compare /dev/null err || fail=1
+
+compare expected-out out || fail=1
+
+Exit $fail
diff --git a/tests/filename-quoting b/tests/filename-quoting
new file mode 100755
index 0000000..e3e9193
--- /dev/null
+++ b/tests/filename-quoting
@@ -0,0 +1,61 @@
+#!/bin/sh
+# filename quoting
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+cat <<EOF > exp- || fail=1
+diff -N -r "a/ " "b/ "
+0a1
+> space
+EOF
+
+cat <<EOF > exp--u || fail=1
+diff -N -r -u "a/ " "b/ "
+--- "a/ "
++++ "b/ "
+@@ -0,0 +1 @@
++space
+EOF
+
+cat <<EOF > exp--c || fail=1
+diff -N -r -c "a/ " "b/ "
+*** "a/ "
+--- "b/ "
+***************
+*** 0 ****
+--- 1 ----
++ space
+EOF
+
+mkdir a b
+echo space > "b/ " || fail=1
+for opt in '' -u -c; do
+ diff -N -r $opt a b > out 2> err; test $? = 1 || fail=1
+ # Remove date and time.
+ sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out
+ compare exp-$(echo $opt|tr ' ' _) out || fail=1
+done
+
+rm -f "b/ "
+
+cat <<EOF > exp || fail=1
+--- "a/\t"
++++ "b/\001"
+@@ -1 +1 @@
+-tab
++one
+EOF
+
+tab=$(printf '\t')
+x01=$(printf '\001')
+
+echo tab > "a/$tab" || fail=1
+echo one > "b/$x01" || fail=1
+diff -u "a/$tab" "b/$x01" > out 2> err; test $? = 1 || fail=1
+# Remove date and time.
+sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out
+compare exp out || fail=1
+
+Exit $fail
diff --git a/tests/function-line-vs-leading-space b/tests/function-line-vs-leading-space
new file mode 100755
index 0000000..572427c
--- /dev/null
+++ b/tests/function-line-vs-leading-space
@@ -0,0 +1,65 @@
+#!/bin/sh
+# Demonstrate how -F RE behavior changed after diff-2.9.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+cat <<EOF > in || fail_ "failed to create temporary file"
+procedure AdaCode is
+ procedure Local_Level_1 is
+ procedure Local_Level_2 is
+ procedure Local_Level_3 is
+ procedure Local_Level_4 is
+ procedure Local_Level_5 is
+ begin
+ null;
+ null;
+ null;
+ foo;
+ end;
+ begin
+ Local_Level_5;
+ end;
+ begin
+ Local_Level_4;
+ end;
+ begin
+ Local_Level_3;
+ end;
+ begin
+ Local_Level_2;
+ end;
+begin
+ Local_Level_1;
+end;
+EOF
+
+sed s/foo/null/ < in > in2 || fail_ "failed to create temporary file"
+
+# Before diff-2.10, the function line would be truncated like this:
+# @@ -8,7 +8,7 @@ procedure Local_Leve
+
+cat <<EOF > exp || fail_ "failed to create temporary file"
+@@ -8,7 +8,7 @@ procedure Local_Level_5 is
+ null;
+ null;
+ null;
+- foo;
++ null;
+ end;
+ begin
+ Local_Level_5;
+EOF
+
+fail=0
+
+diff -u -F '^[[:space:]]*\(function\|procedure\)' in in2 > out 2> err
+test $? = 1 || fail=1
+
+sed -n '3,$p' out > k && mv k out || fail=1
+
+compare exp out || fail=1
+
+# expect empty stderr
+compare /dev/null err || fail=1
+
+Exit $fail
diff --git a/tests/help-version b/tests/help-version
new file mode 100755
index 0000000..339ece7
--- /dev/null
+++ b/tests/help-version
@@ -0,0 +1,269 @@
+#! /bin/sh
+# Make sure all these programs work properly
+# when invoked with --help or --version.
+
+# Copyright (C) 2000-2013, 2015-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Ensure that $SHELL is set to *some* value and exported.
+# This is required for dircolors, which would fail e.g., when
+# invoked via debuild (which removes SHELL from the environment).
+test "x$SHELL" = x && SHELL=/bin/sh
+export SHELL
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+expected_failure_status_chroot=125
+expected_failure_status_env=125
+expected_failure_status_nice=125
+expected_failure_status_nohup=125
+expected_failure_status_stdbuf=125
+expected_failure_status_su=125
+expected_failure_status_timeout=125
+expected_failure_status_printenv=2
+expected_failure_status_tty=3
+expected_failure_status_sort=2
+expected_failure_status_expr=3
+expected_failure_status_lbracket=2
+expected_failure_status_dir=2
+expected_failure_status_ls=2
+expected_failure_status_vdir=2
+
+expected_failure_status_cmp=2
+expected_failure_status_zcmp=2
+expected_failure_status_sdiff=2
+expected_failure_status_diff3=2
+expected_failure_status_diff=2
+expected_failure_status_zdiff=2
+expected_failure_status_zgrep=2
+expected_failure_status_zegrep=2
+expected_failure_status_zfgrep=2
+
+expected_failure_status_grep=2
+expected_failure_status_egrep=2
+expected_failure_status_fgrep=2
+
+test "$built_programs" \
+ || fail_ "built_programs not specified!?!"
+
+test "$VERSION" \
+ || fail_ "set envvar VERSION; it is required for a PATH sanity-check"
+
+# Extract version from --version output of the first program
+for i in $built_programs; do
+ v=$(env $i --version | sed -n '1s/.* //p;q')
+ break
+done
+
+# Ensure that it matches $VERSION.
+test "x$v" = "x$VERSION" \
+ || fail_ "--version-\$VERSION mismatch"
+
+for lang in C fr da; do
+ for i in $built_programs; do
+
+ # Skip 'test'; it doesn't accept --help or --version.
+ test $i = test && continue;
+
+ # false fails even when invoked with --help or --version.
+ if test $i = false; then
+ env LC_MESSAGES=$lang $i --help >/dev/null && fail=1
+ env LC_MESSAGES=$lang $i --version >/dev/null && fail=1
+ continue
+ fi
+
+ # The just-built install executable is always named 'ginstall'.
+ test $i = install && i=ginstall
+
+ # Make sure they exit successfully, under normal conditions.
+ env $i --help > h-$i || fail=1
+ env $i --version >/dev/null || fail=1
+
+ # Make sure they mention the bug-reporting address in --help output.
+ grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
+ rm -f h-$i
+
+ # Make sure they fail upon 'disk full' error.
+ if test -w /dev/full && test -c /dev/full; then
+ env $i --help >/dev/full 2>/dev/null && fail=1
+ env $i --version >/dev/full 2>/dev/null && fail=1
+ status=$?
+ test $i = [ && prog=lbracket || prog=$i
+ eval "expected=\$expected_failure_status_$prog"
+ test x$expected = x && expected=1
+ if test $status = $expected; then
+ : # ok
+ else
+ fail=1
+ echo "*** $i: bad exit status '$status' (expected $expected)," 1>&2
+ echo " with --help or --version output redirected to /dev/full" 1>&2
+ fi
+ fi
+ done
+done
+
+bigZ_in=bigZ-in.Z
+zin=zin.gz
+zin2=zin2.gz
+
+tmp=tmp-$$
+tmp_in=in-$$
+tmp_in2=in2-$$
+tmp_dir=dir-$$
+tmp_out=out-$$
+mkdir $tmp || fail=1
+cd $tmp || fail=1
+
+comm_setup () { args="$tmp_in $tmp_in"; }
+csplit_setup () { args="$tmp_in //"; }
+cut_setup () { args='-f 1'; }
+join_setup () { args="$tmp_in $tmp_in"; }
+tr_setup () { args='a a'; }
+
+chmod_setup () { args="a+x $tmp_in"; }
+# Punt on these.
+chgrp_setup () { args=--version; }
+chown_setup () { args=--version; }
+mkfifo_setup () { args=--version; }
+mknod_setup () { args=--version; }
+# Punt on uptime, since it fails (e.g., failing to get boot time)
+# on some systems, and we shouldn't let that stop 'make check'.
+uptime_setup () { args=--version; }
+
+# Create a file in the current directory, not in $TMPDIR.
+mktemp_setup () { args=mktemp.XXXX; }
+
+cmp_setup () { args="$tmp_in $tmp_in2"; }
+
+# Tell dd not to print the line with transfer rate and total.
+# The transfer rate would vary between runs.
+dd_setup () { args=status=noxfer; }
+
+zdiff_setup () { args="$zin $zin2"; }
+zcmp_setup () { args="$zin $zin2"; }
+zcat_setup () { args=$zin; }
+gunzip_setup () { args=$zin; }
+zmore_setup () { args=$zin; }
+zless_setup () { args=$zin; }
+znew_setup () { args=$bigZ_in; }
+zforce_setup () { args=$zin; }
+zgrep_setup () { args="z $zin"; }
+zegrep_setup () { args="z $zin"; }
+zfgrep_setup () { args="z $zin"; }
+gzexe_setup () { args=$tmp_in; }
+
+# We know that $tmp_in contains a "0"
+grep_setup () { args="0 $tmp_in"; }
+egrep_setup () { args="0 $tmp_in"; }
+fgrep_setup () { args="0 $tmp_in"; }
+
+diff_setup () { args="$tmp_in $tmp_in2"; }
+sdiff_setup () { args="$tmp_in $tmp_in2"; }
+diff3_setup () { args="$tmp_in $tmp_in2 $tmp_in2"; }
+cp_setup () { args="$tmp_in $tmp_in2"; }
+ln_setup () { args="$tmp_in ln-target"; }
+ginstall_setup () { args="$tmp_in $tmp_in2"; }
+mv_setup () { args="$tmp_in $tmp_in2"; }
+mkdir_setup () { args=$tmp_dir/subdir; }
+rmdir_setup () { args=$tmp_dir; }
+rm_setup () { args=$tmp_in; }
+shred_setup () { args=$tmp_in; }
+touch_setup () { args=$tmp_in2; }
+truncate_setup () { args="--reference=$tmp_in $tmp_in2"; }
+
+basename_setup () { args=$tmp_in; }
+dirname_setup () { args=$tmp_in; }
+expr_setup () { args=foo; }
+
+# Punt, in case GNU 'id' hasn't been installed yet.
+groups_setup () { args=--version; }
+
+pathchk_setup () { args=$tmp_in; }
+yes_setup () { args=--version; }
+logname_setup () { args=--version; }
+nohup_setup () { args=--version; }
+printf_setup () { args=foo; }
+seq_setup () { args=10; }
+sleep_setup () { args=0; }
+su_setup () { args=--version; }
+stdbuf_setup () { args="-oL true"; }
+timeout_setup () { args=--version; }
+
+# I'd rather not run sync, since it spins up disks that I've
+# deliberately caused to spin down (but not unmounted).
+sync_setup () { args=--version; }
+
+test_setup () { args=foo; }
+
+# This is necessary in the unusual event that there is
+# no valid entry in /etc/mtab.
+df_setup () { args=/; }
+
+# This is necessary in the unusual event that getpwuid (getuid ()) fails.
+id_setup () { args=-u; }
+
+# Use env to avoid invoking built-in sleep of Solaris 11's /bin/sh.
+kill_setup () {
+ env sleep 10m &
+ args=$!
+}
+
+link_setup () { args="$tmp_in link-target"; }
+unlink_setup () { args=$tmp_in; }
+
+readlink_setup () {
+ ln -s . slink
+ args=slink;
+}
+
+stat_setup () { args=$tmp_in; }
+unlink_setup () { args=$tmp_in; }
+lbracket_setup () { args=": ]"; }
+
+# Ensure that each program "works" (exits successfully) when doing
+# something more than --help or --version.
+for i in $built_programs; do
+ # Skip these.
+ case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac
+
+ rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out $bigZ_in $zin $zin2
+ echo z |gzip > $zin
+ cp $zin $zin2
+ cp $zin $bigZ_in
+
+ # This is sort of kludgey: use numbers so this is valid input for factor,
+ # and two tokens so it's valid input for tsort.
+ echo 2147483647 0 > $tmp_in
+ # Make $tmp_in2 identical. Then, using $tmp_in and $tmp_in2 as arguments
+ # to the likes of cmp and diff makes them exit successfully.
+ cp $tmp_in $tmp_in2
+ mkdir $tmp_dir
+ # echo ================== $i
+ test $i = [ && prog=lbracket || prog=$i
+ if type ${prog}_setup > /dev/null 2>&1; then
+ ${prog}_setup
+ else
+ args=
+ fi
+ if env $i $args < $tmp_in > $tmp_out; then
+ : # ok
+ else
+ echo FAIL: $i
+ fail=1
+ fi
+ rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir
+done
+
+Exit $fail
diff --git a/tests/ignore-matching-lines b/tests/ignore-matching-lines
new file mode 100755
index 0000000..5db9ba3
--- /dev/null
+++ b/tests/ignore-matching-lines
@@ -0,0 +1,47 @@
+#!/bin/sh
+# --ignore-matching-lines
+
+# Bug reported by Vincent Lefevre in <http://bugs.gnu.org/16864>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+cat <<'EOF' >a
+1a
+2
+3a
+4
+5
+6
+EOF
+
+cat <<'EOF' >b
+1b
+2
+3b
+4
+5
+6
+7
+EOF
+
+cat <<'EOF' >exp
+@@ -1,6 +1,7 @@
+-1a
++1b
+ 2
+-3a
++3b
+ 4
+ 5
+ 6
++7
+EOF
+
+diff -u --ignore-matching-lines 3 a b >out 2>err
+test $? = 1 || fail=1
+sed 1,2d out >outtail || framework_failure+
+compare exp outtail || fail=1
+
+Exit $fail
diff --git a/tests/init.sh b/tests/init.sh
new file mode 100644
index 0000000..97e4e4b
--- /dev/null
+++ b/tests/init.sh
@@ -0,0 +1,616 @@
+# source this file; set up for tests
+
+# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Using this file in a test
+# =========================
+#
+# The typical skeleton of a test looks like this:
+#
+# #!/bin/sh
+# . "${srcdir=.}/init.sh"; path_prepend_ .
+# Execute some commands.
+# Note that these commands are executed in a subdirectory, therefore you
+# need to prepend "../" to relative filenames in the build directory.
+# Note that the "path_prepend_ ." is useful only if the body of your
+# test invokes programs residing in the initial directory.
+# For example, if the programs you want to test are in src/, and this test
+# script is named tests/test-1, then you would use "path_prepend_ ../src",
+# or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
+# to all tests via automake's TESTS_ENVIRONMENT.
+# Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
+# Use the skip_ and fail_ functions to print a diagnostic and then exit
+# with the corresponding exit code.
+# Exit $?
+
+# Executing a test that uses this file
+# ====================================
+#
+# Running a single test:
+# $ make check TESTS=test-foo.sh
+#
+# Running a single test, with verbose output:
+# $ make check TESTS=test-foo.sh VERBOSE=yes
+#
+# Running a single test, with single-stepping:
+# 1. Go into a sub-shell:
+# $ bash
+# 2. Set relevant environment variables from TESTS_ENVIRONMENT in the
+# Makefile:
+# $ export srcdir=../../tests # this is an example
+# 3. Execute the commands from the test, copy&pasting them one by one:
+# $ . "$srcdir/init.sh"; path_prepend_ .
+# ...
+# 4. Finally
+# $ exit
+
+ME_=`expr "./$0" : '.*/\(.*\)$'`
+
+# We use a trap below for cleanup. This requires us to go through
+# hoops to get the right exit status transported through the handler.
+# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function.
+Exit () { set +e; (exit $1); exit $1; }
+
+# Print warnings (e.g., about skipped and failed tests) to this file number.
+# Override by defining to say, 9, in init.cfg, and putting say,
+# export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2
+# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file.
+# This is useful when using automake's parallel tests mode, to print
+# the reason for skip/failure to console, rather than to the .log files.
+: ${stderr_fileno_=2}
+
+# Note that correct expansion of "$*" depends on IFS starting with ' '.
+# Always write the full diagnostic to stderr.
+# When stderr_fileno_ is not 2, also emit the first line of the
+# diagnostic to that file descriptor.
+warn_ ()
+{
+ # If IFS does not start with ' ', set it and emit the warning in a subshell.
+ case $IFS in
+ ' '*) printf '%s\n' "$*" >&2
+ test $stderr_fileno_ = 2 \
+ || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
+ *) (IFS=' '; warn_ "$@");;
+ esac
+}
+fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
+skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
+fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
+framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
+
+# This is used to simplify checking of the return value
+# which is useful when ensuring a command fails as desired.
+# I.e., just doing `command ... &&fail=1` will not catch
+# a segfault in command for example. With this helper you
+# instead check an explicit exit code like
+# returns_ 1 command ... || fail
+returns_ () {
+ # Disable tracing so it doesn't interfere with stderr of the wrapped command
+ { set +x; } 2>/dev/null
+
+ local exp_exit="$1"
+ shift
+ "$@"
+ test $? -eq $exp_exit && ret_=0 || ret_=1
+
+ if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then
+ set -x
+ fi
+ { return $ret_; } 2>/dev/null
+}
+
+# Sanitize this shell to POSIX mode, if possible.
+DUALCASE=1; export DUALCASE
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+ esac
+fi
+
+# We require $(...) support unconditionally.
+# We require a few additional shell features only when $EXEEXT is nonempty,
+# in order to support automatic $EXEEXT emulation:
+# - hyphen-containing alias names
+# - we prefer to use ${var#...} substitution, rather than having
+# to work around lack of support for that feature.
+# The following code attempts to find a shell with support for these features.
+# If the current shell passes the test, we're done. Otherwise, test other
+# shells until we find one that passes. If one is found, re-exec it.
+# If no acceptable shell is found, skip the current test.
+#
+# The "...set -x; P=1 true 2>err..." test is to disqualify any shell that
+# emits "P=1" into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do.
+#
+# Use "9" to indicate success (rather than 0), in case some shell acts
+# like Solaris 10's /bin/sh but exits successfully instead of with status 2.
+
+# Eval this code in a subshell to determine a shell's suitability.
+# 10 - passes all tests; ok to use
+# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
+# ? - not ok
+gl_shell_test_script_='
+test $(echo y) = y || exit 1
+f_local_() { local v=1; }; f_local_ || exit 1
+score_=10
+if test "$VERBOSE" = yes; then
+ test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9
+fi
+test -z "$EXEEXT" && exit $score_
+shopt -s expand_aliases
+alias a-b="echo zoo"
+v=abx
+ test ${v%x} = ab \
+ && test ${v#a} = bx \
+ && test $(a-b) = zoo \
+ && exit $score_
+'
+
+if test "x$1" = "x--no-reexec"; then
+ shift
+else
+ # Assume a working shell. Export to subshells (setup_ needs this).
+ gl_set_x_corrupts_stderr_=false
+ export gl_set_x_corrupts_stderr_
+
+ # Record the first marginally acceptable shell.
+ marginal_=
+
+ # Search for a shell that meets our requirements.
+ for re_shell_ in __current__ "${CONFIG_SHELL:-no_shell}" \
+ /bin/sh bash dash zsh pdksh fail
+ do
+ test "$re_shell_" = no_shell && continue
+
+ # If we've made it all the way to the sentinel, "fail" without
+ # finding even a marginal shell, skip this test.
+ if test "$re_shell_" = fail; then
+ test -z "$marginal_" && skip_ failed to find an adequate shell
+ re_shell_=$marginal_
+ break
+ fi
+
+ # When testing the current shell, simply "eval" the test code.
+ # Otherwise, run it via $re_shell_ -c ...
+ if test "$re_shell_" = __current__; then
+ # 'eval'ing this code makes Solaris 10's /bin/sh exit with
+ # $? set to 2. It does not evaluate any of the code after the
+ # "unexpected" first '('. Thus, we must run it in a subshell.
+ ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
+ else
+ "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
+ fi
+
+ st_=$?
+
+ # $re_shell_ works just fine. Use it.
+ if test $st_ = 10; then
+ gl_set_x_corrupts_stderr_=false
+ break
+ fi
+
+ # If this is our first marginally acceptable shell, remember it.
+ if test "$st_:$marginal_" = 9: ; then
+ marginal_="$re_shell_"
+ gl_set_x_corrupts_stderr_=true
+ fi
+ done
+
+ if test "$re_shell_" != __current__; then
+ # Found a usable shell. Preserve -v and -x.
+ case $- in
+ *v*x* | *x*v*) opts_=-vx ;;
+ *v*) opts_=-v ;;
+ *x*) opts_=-x ;;
+ *) opts_= ;;
+ esac
+ re_shell=$re_shell_
+ export re_shell
+ exec "$re_shell_" $opts_ "$0" --no-reexec "$@"
+ echo "$ME_: exec failed" 1>&2
+ exit 127
+ fi
+fi
+
+# If this is bash, turn off all aliases.
+test -n "$BASH_VERSION" && unalias -a
+
+# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
+# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
+# That is part of the shell-selection test above. Why use aliases rather
+# than functions? Because support for hyphen-containing aliases is more
+# widespread than that for hyphen-containing function names.
+test -n "$EXEEXT" && shopt -s expand_aliases
+
+# Enable glibc's malloc-perturbing option.
+# This is useful for exposing code that depends on the fact that
+# malloc-related functions often return memory that is mostly zeroed.
+# If you have the time and cycles, use valgrind to do an even better job.
+: ${MALLOC_PERTURB_=87}
+export MALLOC_PERTURB_
+
+# This is a stub function that is run upon trap (upon regular exit and
+# interrupt). Override it with a per-test function, e.g., to unmount
+# a partition, or to undo any other global state changes.
+cleanup_ () { :; }
+
+# Emit a header similar to that from diff -u; Print the simulated "diff"
+# command so that the order of arguments is clear. Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+ printf '%s\n' "diff -u $*" \
+ "--- $1 1970-01-01" \
+ "+++ $2 1970-01-01"
+}
+
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+ test $# = 2 || return 2
+
+ if test "x$1" = x/dev/null; then
+ test -s "$2" || return 0
+ emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
+ return 1
+ fi
+
+ if test "x$2" = x/dev/null; then
+ test -s "$1" || return 0
+ emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
+ return 1
+ fi
+
+ return 2
+}
+
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+ && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+ # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+ # extra space on column 1 of every content line.
+ if test -z "$diff_out_"; then
+ compare_ () { diff -u "$@"; }
+ else
+ compare_ ()
+ {
+ if diff -u "$@" > diff.out; then
+ # No differences were found, but Solaris 'diff' produces output
+ # "No differences encountered". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif
+ for diff_opt_ in -U3 -c '' no; do
+ test "$diff_opt_" = no && break
+ diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" </dev/null` && break
+ done
+ test "$diff_opt_" != no
+then
+ if test -z "$diff_out_"; then
+ compare_ () { diff $diff_opt_ "$@"; }
+ else
+ compare_ ()
+ {
+ if diff $diff_opt_ "$@" > diff.out; then
+ # No differences were found, but AIX and HP-UX 'diff' produce output
+ # "No differences encountered" or "There are no differences between the
+ # files.". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif cmp -s /dev/null /dev/null 2>/dev/null; then
+ compare_ () { cmp -s "$@"; }
+else
+ compare_ () { cmp "$@"; }
+fi
+
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+ # This looks like it can be factored to use a simple "case $?"
+ # after unchecked compare_dev_null_ invocation, but that would
+ # fail in a "set -e" environment.
+ if compare_dev_null_ "$@"; then
+ return 0
+ else
+ case $? in
+ 1) return 1;;
+ *) compare_ "$@";;
+ esac
+ fi
+}
+
+# An arbitrary prefix to help distinguish test directories.
+testdir_prefix_ () { printf gt; }
+
+# Run the user-overridable cleanup_ function, remove the temporary
+# directory and exit with the incoming value of $?.
+remove_tmp_ ()
+{
+ __st=$?
+ cleanup_
+ # cd out of the directory we're about to remove
+ cd "$initial_cwd_" || cd / || cd /tmp
+ chmod -R u+rwx "$test_dir_"
+ # If removal fails and exit status was to be 0, then change it to 1.
+ rm -rf "$test_dir_" || { test $__st = 0 && __st=1; }
+ exit $__st
+}
+
+# Given a directory name, DIR, if every entry in it that matches *.exe
+# contains only the specified bytes (see the case stmt below), then print
+# a space-separated list of those names and return 0. Otherwise, don't
+# print anything and return 1. Naming constraints apply also to DIR.
+find_exe_basenames_ ()
+{
+ feb_dir_=$1
+ feb_fail_=0
+ feb_result_=
+ feb_sp_=
+ for feb_file_ in $feb_dir_/*.exe; do
+ # If there was no *.exe file, or there existed a file named "*.exe" that
+ # was deleted between the above glob expansion and the existence test
+ # below, just skip it.
+ test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
+ && continue
+ # Exempt [.exe, since we can't create a function by that name, yet
+ # we can't invoke [ by PATH search anyways due to shell builtins.
+ test "x$feb_file_" = "x$feb_dir_/[.exe" && continue
+ case $feb_file_ in
+ *[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
+ *) # Remove leading file name components as well as the .exe suffix.
+ feb_file_=${feb_file_##*/}
+ feb_file_=${feb_file_%.exe}
+ feb_result_="$feb_result_$feb_sp_$feb_file_";;
+ esac
+ feb_sp_=' '
+ done
+ test $feb_fail_ = 0 && printf %s "$feb_result_"
+ return $feb_fail_
+}
+
+# Consider the files in directory, $1.
+# For each file name of the form PROG.exe, create an alias named
+# PROG that simply invokes PROG.exe, then return 0. If any selected
+# file name or the directory name, $1, contains an unexpected character,
+# define no alias and return 1.
+create_exe_shims_ ()
+{
+ case $EXEEXT in
+ '') return 0 ;;
+ .exe) ;;
+ *) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;;
+ esac
+
+ base_names_=`find_exe_basenames_ $1` \
+ || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; }
+
+ if test -n "$base_names_"; then
+ for base_ in $base_names_; do
+ alias "$base_"="$base_$EXEEXT"
+ done
+ fi
+
+ return 0
+}
+
+# Use this function to prepend to PATH an absolute name for each
+# specified, possibly-$initial_cwd_-relative, directory.
+path_prepend_ ()
+{
+ while test $# != 0; do
+ path_dir_=$1
+ case $path_dir_ in
+ '') fail_ "invalid path dir: '$1'";;
+ /*) abs_path_dir_=$path_dir_;;
+ *) abs_path_dir_=$initial_cwd_/$path_dir_;;
+ esac
+ case $abs_path_dir_ in
+ *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
+ esac
+ PATH="$abs_path_dir_:$PATH"
+
+ # Create an alias, FOO, for each FOO.exe in this directory.
+ create_exe_shims_ "$abs_path_dir_" \
+ || fail_ "something failed (above): $abs_path_dir_"
+ shift
+ done
+ export PATH
+}
+
+setup_ ()
+{
+ if test "$VERBOSE" = yes; then
+ # Test whether set -x may cause the selected shell to corrupt an
+ # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh
+ # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5.
+ # If enabling verbose output this way would cause trouble, simply
+ # issue a warning and refrain.
+ if $gl_set_x_corrupts_stderr_; then
+ warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr"
+ else
+ set -x
+ fi
+ fi
+
+ initial_cwd_=$PWD
+
+ pfx_=`testdir_prefix_`
+ test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
+ || fail_ "failed to create temporary directory in $initial_cwd_"
+ cd "$test_dir_" || fail_ "failed to cd to temporary directory"
+
+ # As autoconf-generated configure scripts do, ensure that IFS
+ # is defined initially, so that saving and restoring $IFS works.
+ gl_init_sh_nl_='
+'
+ IFS=" "" $gl_init_sh_nl_"
+
+ # This trap statement, along with a trap on 0 below, ensure that the
+ # temporary directory, $test_dir_, is removed upon exit as well as
+ # upon receipt of any of the listed signals.
+ for sig_ in 1 2 3 13 15; do
+ eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+ done
+}
+
+# Create a temporary directory, much like mktemp -d does.
+# Written by Jim Meyering.
+#
+# Usage: mktempd_ /tmp phoey.XXXXXXXXXX
+#
+# First, try to use the mktemp program.
+# Failing that, we'll roll our own mktemp-like function:
+# - try to get random bytes from /dev/urandom
+# - failing that, generate output from a combination of quickly-varying
+# sources and gzip. Ignore non-varying gzip header, and extract
+# "random" bits from there.
+# - given those bits, map to file-name bytes using tr, and try to create
+# the desired directory.
+# - make only $MAX_TRIES_ attempts
+
+# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9.
+rand_bytes_ ()
+{
+ n_=$1
+
+ # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first?
+ # But if they have openssl, they probably have mktemp, too.
+
+ chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+ dev_rand_=/dev/urandom
+ if test -r "$dev_rand_"; then
+ # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
+ dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
+ | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+ return
+ fi
+
+ n_plus_50_=`expr $n_ + 50`
+ cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
+ data_=` (eval "$cmds_") 2>&1 | gzip `
+
+ # Ensure that $data_ has length at least 50+$n_
+ while :; do
+ len_=`echo "$data_"|wc -c`
+ test $n_plus_50_ -le $len_ && break;
+ data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip `
+ done
+
+ echo "$data_" \
+ | dd bs=1 skip=50 count=$n_ 2>/dev/null \
+ | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+}
+
+mktempd_ ()
+{
+ case $# in
+ 2);;
+ *) fail_ "Usage: mktempd_ DIR TEMPLATE";;
+ esac
+
+ destdir_=$1
+ template_=$2
+
+ MAX_TRIES_=4
+
+ # Disallow any trailing slash on specified destdir:
+ # it would subvert the post-mktemp "case"-based destdir test.
+ case $destdir_ in
+ / | //) destdir_slash_=$destdir;;
+ */) fail_ "invalid destination dir: remove trailing slash(es)";;
+ *) destdir_slash_=$destdir_/;;
+ esac
+
+ case $template_ in
+ *XXXX) ;;
+ *) fail_ \
+ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+ esac
+
+ # First, try to use mktemp.
+ d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
+
+ # The resulting name must be in the specified directory.
+ case $d in "$destdir_slash_"*) :;; *) false;; esac &&
+
+ # It must have created the directory.
+ test -d "$d" &&
+
+ # It must have 0700 permissions. Handle sticky "S" bits.
+ perms=`ls -dgo "$d" 2>/dev/null` &&
+ case $perms in drwx--[-S]---*) :;; *) false;; esac && {
+ echo "$d"
+ return
+ }
+
+ # If we reach this point, we'll have to create a directory manually.
+
+ # Get a copy of the template without its suffix of X's.
+ base_template_=`echo "$template_"|sed 's/XX*$//'`
+
+ # Calculate how many X's we've just removed.
+ template_length_=`echo "$template_" | wc -c`
+ nx_=`echo "$base_template_" | wc -c`
+ nx_=`expr $template_length_ - $nx_`
+
+ err_=
+ i_=1
+ while :; do
+ X_=`rand_bytes_ $nx_`
+ candidate_dir_="$destdir_slash_$base_template_$X_"
+ err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
+ && { echo "$candidate_dir_"; return; }
+ test $MAX_TRIES_ -le $i_ && break;
+ i_=`expr $i_ + 1`
+ done
+ fail_ "$err_"
+}
+
+# If you want to override the testdir_prefix_ function,
+# or to add more utility functions, use this file.
+test -f "$srcdir/init.cfg" \
+ && . "$srcdir/init.cfg"
+
+setup_ "$@"
+# This trap is here, rather than in the setup_ function, because some
+# shells run the exit trap at shell function exit, rather than script exit.
+trap remove_tmp_ 0
diff --git a/tests/label-vs-func b/tests/label-vs-func
new file mode 100755
index 0000000..2de61f7
--- /dev/null
+++ b/tests/label-vs-func
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Show how diff's -p option can mistakenly match a label: in column 1.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+cat <<EOF > exp || fail=1
+@@ -4 +4 @@ label:
+-1;
++2;
+EOF
+
+cat <<EOF > a || fail=1
+func ()
+{
+label:
+1;
+}
+EOF
+
+sed s/1/2/ a > b || fail=1
+diff -p -u0 a b > out 2> err; test $? = 1 || fail=1
+
+tail -3 out > k && mv k out || fail=1
+
+compare exp out || fail=1
+
+# expect empty stderr
+compare /dev/null err || fail=1
+
+Exit $fail
diff --git a/tests/new-file b/tests/new-file
new file mode 100755
index 0000000..af7cc4c
--- /dev/null
+++ b/tests/new-file
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Test --new-file (-N) and --unidirectional-new-file.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+echo a > a || fail=1
+
+echo '0a1
+> a' > exp || fail=1
+
+diff -N - a <&- > out; test $? = 1 || fail=1
+compare exp out || fail=1
+
+diff --unidirectional-new-file - a <&- > out; test $? = 1 || fail=1
+compare exp out || fail=1
+
+diff -N b - < a > out; test $? = 1 || fail=1
+compare exp out || fail=1
+
+diff --unidirectional-new-file b - < a > out; test $? = 1 || fail=1
+compare exp out || fail=1
+
+echo '1d0
+< a' > exp || fail=1
+
+diff -N a - <&- > out; test $? = 1 || fail=1
+compare exp out || fail=1
+
+diff --unidirectional-new-file a - <&- > out; test $? = 2 || fail=1
+
+diff -N - b < a > out; test $? = 1 || fail=1
+compare exp out || fail=1
+
+diff --unidirectional-new-file - b < a > out; test $? = 2 || fail=1
+
+Exit $fail
diff --git a/tests/no-dereference b/tests/no-dereference
new file mode 100644
index 0000000..1426beb
--- /dev/null
+++ b/tests/no-dereference
@@ -0,0 +1,169 @@
+#!/bin/sh
+# Test the --no-dereference option.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+echo 'Simple contents' > regular1
+echo 'Sample contents' > regular2
+echo 'Sample contents' > regular3
+ln -s regular1 symlink1
+ln -s regular1 symlink1bis
+ln -s regular2 symlink2
+ln -s regular3 symlink3
+
+# Non-recursive comparisons.
+
+# Test case 3: Compare regular file with regular file.
+diff --no-dereference regular1 regular2 > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+1c1
+< Simple contents
+---
+> Sample contents
+EOF
+compare expected out || fail=1
+
+# Test case 4: Compare regular file with symbolic link.
+diff --no-dereference regular1 symlink1 > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+File regular1 is a regular file while file symlink1 is a symbolic link
+EOF
+compare expected out || fail=1
+
+# Test case 5: Compare symbolic link with regular file.
+diff --no-dereference symlink1 regular1 > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+File symlink1 is a symbolic link while file regular1 is a regular file
+EOF
+compare expected out || fail=1
+
+# Test case 6: Compare symbolic links with same value.
+diff --no-dereference symlink1 symlink1bis > out
+test $? = 0 || fail=1
+compare /dev/null out || fail=1
+
+# Test case 7: Compare symbolic links with different value and different target
+# contents.
+diff --no-dereference symlink1 symlink2 > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+Symbolic links symlink1 and symlink2 differ
+EOF
+compare expected out || fail=1
+
+# Test case 8: Compare symbolic links with different value and same target
+# contents.
+diff --no-dereference symlink2 symlink3 > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+Symbolic links symlink2 and symlink3 differ
+EOF
+compare expected out || fail=1
+
+# Recursive comparisons.
+
+# Test case 1: Compare symbolic link with nonexistent file.
+mkdir subdir1a
+mkdir subdir1b
+ln -s nonexistent subdir1a/foo
+ln -s ../regular1 subdir1a/bar
+diff -r --no-dereference subdir1a subdir1b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+Only in subdir1a: bar
+Only in subdir1a: foo
+EOF
+compare expected out || fail=1
+
+# Test case 1: Compare nonexistent file with symbolic link.
+mkdir subdir2a
+mkdir subdir2b
+ln -s nonexistent subdir2b/foo
+ln -s ../regular1 subdir2b/bar
+diff -r --no-dereference subdir2a subdir2b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+Only in subdir2b: bar
+Only in subdir2b: foo
+EOF
+compare expected out || fail=1
+
+# Test case 3: Compare regular file with regular file.
+mkdir subdir3a
+mkdir subdir3b
+cp regular1 subdir3a/foo
+cp regular2 subdir3b/foo
+diff -r --no-dereference subdir3a subdir3b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+diff -r --no-dereference subdir3a/foo subdir3b/foo
+1c1
+< Simple contents
+---
+> Sample contents
+EOF
+compare expected out || fail=1
+
+# Test case 4: Compare regular file with symbolic link.
+mkdir subdir4a
+mkdir subdir4b
+cp regular1 subdir4a/foo
+ln -s ../regular1 subdir4b/foo
+diff -r --no-dereference subdir4a subdir4b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+File subdir4a/foo is a regular file while file subdir4b/foo is a symbolic link
+EOF
+compare expected out || fail=1
+
+# Test case 5: Compare symbolic link with regular file.
+mkdir subdir5a
+mkdir subdir5b
+ln -s ../regular1 subdir5a/foo
+cp regular1 subdir5b/foo
+diff -r --no-dereference subdir5a subdir5b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+File subdir5a/foo is a symbolic link while file subdir5b/foo is a regular file
+EOF
+compare expected out || fail=1
+
+# Test case 6: Compare symbolic links with same value.
+mkdir subdir6a
+mkdir subdir6b
+ln -s ../regular1 subdir6a/foo
+ln -s ../regular1 subdir6b/foo
+diff -r --no-dereference subdir6a subdir6b > out
+test $? = 0 || fail=1
+compare /dev/null out || fail=1
+
+# Test case 7: Compare symbolic links with different value and different target
+# contents.
+mkdir subdir7a
+mkdir subdir7b
+ln -s ../regular1 subdir7a/foo
+ln -s ../regular2 subdir7b/foo
+diff -r --no-dereference subdir7a subdir7b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+Symbolic links subdir7a/foo and subdir7b/foo differ
+EOF
+compare expected out || fail=1
+
+# Test case 8: Compare symbolic links with different value and same target
+# contents.
+mkdir subdir8a
+mkdir subdir8b
+ln -s ../regular2 subdir8a/foo
+ln -s ../regular3 subdir8b/foo
+diff -r --no-dereference subdir8a subdir8b > out
+test $? = 1 || fail=1
+cat <<EOF > expected || framework_failure_
+Symbolic links subdir8a/foo and subdir8b/foo differ
+EOF
+compare expected out || fail=1
+
+Exit $fail
diff --git a/tests/no-newline-at-eof b/tests/no-newline-at-eof
new file mode 100755
index 0000000..f503718
--- /dev/null
+++ b/tests/no-newline-at-eof
@@ -0,0 +1,59 @@
+#!/bin/sh
+# exercise the no-newline-at-EOF bug
+# Before the April 2010 fix, the "\ No newline at end of file"
+# line would not be printed.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+printf '\n1' > a || framework_failure_
+printf '\n0\n\n1' > b || framework_failure_
+cat <<EOF > exp || framework_failure_
+@@ -1,2 +1,4 @@
+
++0
++
+ 1
+\ No newline at end of file
+EOF
+
+cat <<EOF > exp2 || framework_failure_
+@@ -1,2 +1,4 @@
+
+-1
++0
++
++1
+\ No newline at end of file
+EOF
+
+fail=0
+
+# So we don't have to record trailing blanks in expected output above.
+opt=--suppress-blank-empty
+
+diff $opt -U1 a b > out 2> err
+test $? = 1 || fail=1
+
+sed -n '/^@@/,$p' out > k && mv k out || fail=1
+compare exp out || fail=1
+# expect empty stderr
+compare /dev/null err || fail=1
+
+# Repeat, but with a newline at the end of "a".
+echo >> a
+
+diff $opt -U1 a b > out 2> err
+test $? = 1 || fail=1
+
+sed -n '/^@@/,$p' out > k && mv k out || fail=1
+compare exp2 out || fail=1
+# expect empty stderr
+compare /dev/null err || fail=1
+
+# Test for Bug#18402.
+printf a > a
+printf b > b
+diff -B a b > out 2>err
+test $? = 1 || fail=1
+
+Exit $fail
diff --git a/tests/stdin b/tests/stdin
new file mode 100755
index 0000000..295e98d
--- /dev/null
+++ b/tests/stdin
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Ensure that "-" means "standard input".
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+cat <<EOF > exp || fail=1
+--- -
++++ b
+@@ -1 +1 @@
+-a
++b
+EOF
+
+echo a > a
+echo b > b
+
+diff -u - b < a > out 2> err; test $? = 1 || fail=1
+# Remove date and time.
+sed -e 's/^\([-+*][-+*][-+*] [^ ]*\) .*/\1/' out > k; mv k out
+compare exp out || fail=1
+
+Exit $fail
diff --git a/tests/strcoll-0-names b/tests/strcoll-0-names
new file mode 100755
index 0000000..33c4a3c
--- /dev/null
+++ b/tests/strcoll-0-names
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Check that diff responds well with two different file names
+# that compare equal with strcoll. See:
+# http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+# These two names compare equal in the en_US.UTF-8 locale
+# in current (2013) versions of glibc.
+# On systems where the names do not compare equal,
+# this diff test should still do the right thing.
+LC_ALL=en_US.UTF-8
+export LC_ALL
+name1='エンドカード1'
+name2='ブックレット1'
+
+mkdir d1 d2 || fail=1
+echo x >d1/"$name1" || fail=1
+echo x >d2/"$name2" || fail=1
+
+# This should report a difference, but on the affected systems
+# diffutils 3.3 does not.
+diff d1 d2 && fail=1
+
+Exit $fail
diff --git a/tests/t-local.sh b/tests/t-local.sh
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-local.sh